153ab4af3SHans de Goede/*
253ab4af3SHans de Goede * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
353ab4af3SHans de Goede *
453ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms
553ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual
653ab4af3SHans de Goede * licensing only applies to this file, and not this project as a
753ab4af3SHans de Goede * whole.
853ab4af3SHans de Goede *
953ab4af3SHans de Goede *  a) This file is free software; you can redistribute it and/or
1053ab4af3SHans de Goede *     modify it under the terms of the GNU General Public License as
1153ab4af3SHans de Goede *     published by the Free Software Foundation; either version 2 of the
1253ab4af3SHans de Goede *     License, or (at your option) any later version.
1353ab4af3SHans de Goede *
1453ab4af3SHans de Goede *     This file is distributed in the hope that it will be useful,
1553ab4af3SHans de Goede *     but WITHOUT ANY WARRANTY; without even the implied warranty of
1653ab4af3SHans de Goede *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1753ab4af3SHans de Goede *     GNU General Public License for more details.
1853ab4af3SHans de Goede *
1953ab4af3SHans de Goede * Or, alternatively,
2053ab4af3SHans de Goede *
2153ab4af3SHans de Goede *  b) Permission is hereby granted, free of charge, to any person
2253ab4af3SHans de Goede *     obtaining a copy of this software and associated documentation
2353ab4af3SHans de Goede *     files (the "Software"), to deal in the Software without
2453ab4af3SHans de Goede *     restriction, including without limitation the rights to use,
2553ab4af3SHans de Goede *     copy, modify, merge, publish, distribute, sublicense, and/or
2653ab4af3SHans de Goede *     sell copies of the Software, and to permit persons to whom the
2753ab4af3SHans de Goede *     Software is furnished to do so, subject to the following
2853ab4af3SHans de Goede *     conditions:
2953ab4af3SHans de Goede *
3053ab4af3SHans de Goede *     The above copyright notice and this permission notice shall be
3153ab4af3SHans de Goede *     included in all copies or substantial portions of the Software.
3253ab4af3SHans de Goede *
3353ab4af3SHans de Goede *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3453ab4af3SHans de Goede *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3553ab4af3SHans de Goede *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3653ab4af3SHans de Goede *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3753ab4af3SHans de Goede *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3853ab4af3SHans de Goede *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3953ab4af3SHans de Goede *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4053ab4af3SHans de Goede *     OTHER DEALINGS IN THE SOFTWARE.
4153ab4af3SHans de Goede */
4253ab4af3SHans de Goede
4353ab4af3SHans de Goede/dts-v1/;
4453ab4af3SHans de Goede#include "sun4i-a10.dtsi"
4553ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi"
4653ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h>
4753ab4af3SHans de Goede#include <dt-bindings/input/input.h>
4880e5f83cSHans de Goede#include <dt-bindings/interrupt-controller/irq.h>
4953ab4af3SHans de Goede
5053ab4af3SHans de Goede/ {
5153ab4af3SHans de Goede	model = "Chuwi V7 CW0825";
5253ab4af3SHans de Goede	compatible = "chuwi,v7-cw0825", "allwinner,sun4i-a10";
5353ab4af3SHans de Goede
5453ab4af3SHans de Goede	aliases {
5553ab4af3SHans de Goede		serial0 = &uart0;
5653ab4af3SHans de Goede	};
5753ab4af3SHans de Goede
5853ab4af3SHans de Goede	chosen {
5953ab4af3SHans de Goede		stdout-path = "serial0:115200n8";
6053ab4af3SHans de Goede	};
6153ab4af3SHans de Goede};
6253ab4af3SHans de Goede
6353ab4af3SHans de Goede&ehci1 {
6453ab4af3SHans de Goede	status = "okay";
6553ab4af3SHans de Goede};
6653ab4af3SHans de Goede
6753ab4af3SHans de Goede&i2c0 {
6853ab4af3SHans de Goede	status = "okay";
6953ab4af3SHans de Goede
7053ab4af3SHans de Goede	axp209: pmic@34 {
7153ab4af3SHans de Goede		compatible = "x-powers,axp209";
7253ab4af3SHans de Goede		reg = <0x34>;
7353ab4af3SHans de Goede		interrupts = <0>;
7453ab4af3SHans de Goede
7553ab4af3SHans de Goede		interrupt-controller;
7653ab4af3SHans de Goede		#interrupt-cells = <1>;
7753ab4af3SHans de Goede	};
7853ab4af3SHans de Goede};
7953ab4af3SHans de Goede
8080e5f83cSHans de Goede&i2c1 {
8180e5f83cSHans de Goede	status = "okay";
8280e5f83cSHans de Goede};
8380e5f83cSHans de Goede
8480e5f83cSHans de Goede&i2c2 {
8580e5f83cSHans de Goede	status = "okay";
8680e5f83cSHans de Goede
8780e5f83cSHans de Goede	ft5306de4: touchscreen@38 {
8880e5f83cSHans de Goede		compatible = "edt,edt-ft5406";
8980e5f83cSHans de Goede		reg = <0x38>;
9080e5f83cSHans de Goede		interrupt-parent = <&pio>;
9180e5f83cSHans de Goede		interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
9280e5f83cSHans de Goede		touchscreen-size-x = <1024>;
9380e5f83cSHans de Goede		touchscreen-size-y = <768>;
9480e5f83cSHans de Goede	};
9580e5f83cSHans de Goede};
9680e5f83cSHans de Goede
9753ab4af3SHans de Goede&lradc {
9853ab4af3SHans de Goede	vref-supply = <&reg_vcc3v0>;
9953ab4af3SHans de Goede	status = "okay";
10053ab4af3SHans de Goede
101*3c92cca3SJagan Teki	button-800 {
10253ab4af3SHans de Goede		label = "Volume Up";
10353ab4af3SHans de Goede		linux,code = <KEY_VOLUMEUP>;
10453ab4af3SHans de Goede		channel = <0>;
10553ab4af3SHans de Goede		voltage = <800000>;
10653ab4af3SHans de Goede	};
10753ab4af3SHans de Goede
108*3c92cca3SJagan Teki	button-1000 {
10953ab4af3SHans de Goede		label = "Volume Down";
11053ab4af3SHans de Goede		linux,code = <KEY_VOLUMEDOWN>;
11153ab4af3SHans de Goede		channel = <0>;
11253ab4af3SHans de Goede		voltage = <1000000>;
11353ab4af3SHans de Goede	};
11453ab4af3SHans de Goede
115*3c92cca3SJagan Teki	button-1200 {
11653ab4af3SHans de Goede		label = "Back";
11753ab4af3SHans de Goede		linux,code = <KEY_BACK>;
11853ab4af3SHans de Goede		channel = <0>;
11953ab4af3SHans de Goede		voltage = <1200000>;
12053ab4af3SHans de Goede	};
12153ab4af3SHans de Goede};
12253ab4af3SHans de Goede
12353ab4af3SHans de Goede&mmc0 {
12453ab4af3SHans de Goede	vmmc-supply = <&reg_vcc3v3>;
12553ab4af3SHans de Goede	bus-width = <4>;
126*3c92cca3SJagan Teki	cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
12753ab4af3SHans de Goede	status = "okay";
12853ab4af3SHans de Goede};
12953ab4af3SHans de Goede
130da52a4a3SHans de Goede&otg_sram {
131da52a4a3SHans de Goede	status = "okay";
132da52a4a3SHans de Goede};
133da52a4a3SHans de Goede
134da52a4a3SHans de Goede&pio {
135*3c92cca3SJagan Teki	usb0_id_detect_pin: usb0-id-detect-pin {
136*3c92cca3SJagan Teki		pins = "PH4";
137*3c92cca3SJagan Teki		function = "gpio_in";
138*3c92cca3SJagan Teki		bias-pull-up;
139da52a4a3SHans de Goede	};
140da52a4a3SHans de Goede
141*3c92cca3SJagan Teki	usb0_vbus_detect_pin: usb0-vbus-detect-pin {
142*3c92cca3SJagan Teki		pins = "PH5";
143*3c92cca3SJagan Teki		function = "gpio_in";
144*3c92cca3SJagan Teki		bias-pull-down;
145da52a4a3SHans de Goede	};
146da52a4a3SHans de Goede};
147da52a4a3SHans de Goede
148da52a4a3SHans de Goede&reg_usb0_vbus {
149da52a4a3SHans de Goede	status = "okay";
150da52a4a3SHans de Goede};
151da52a4a3SHans de Goede
15253ab4af3SHans de Goede&reg_usb2_vbus {
15353ab4af3SHans de Goede	status = "okay";
15453ab4af3SHans de Goede};
15553ab4af3SHans de Goede
15653ab4af3SHans de Goede&uart0 {
15753ab4af3SHans de Goede	pinctrl-names = "default";
158*3c92cca3SJagan Teki	pinctrl-0 = <&uart0_pb_pins>;
15953ab4af3SHans de Goede	status = "okay";
16053ab4af3SHans de Goede};
16153ab4af3SHans de Goede
162da52a4a3SHans de Goede&usb_otg {
163da52a4a3SHans de Goede	dr_mode = "otg";
164da52a4a3SHans de Goede	status = "okay";
165da52a4a3SHans de Goede};
166da52a4a3SHans de Goede
16753ab4af3SHans de Goede&usbphy {
168da52a4a3SHans de Goede	pinctrl-names = "default";
169da52a4a3SHans de Goede	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
170da52a4a3SHans de Goede	usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
171da52a4a3SHans de Goede	usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
172da52a4a3SHans de Goede	usb0_vbus-supply = <&reg_usb0_vbus>;
17353ab4af3SHans de Goede	usb2_vbus-supply = <&reg_usb2_vbus>;
17453ab4af3SHans de Goede	status = "okay";
17553ab4af3SHans de Goede};
176