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 "sun5i-a13.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> 488b1ba941SHans de Goede#include <dt-bindings/interrupt-controller/irq.h> 4953ab4af3SHans de Goede#include <dt-bindings/pinctrl/sun4i-a10.h> 50*80e5f83cSHans de Goede#include <dt-bindings/pwm/pwm.h> 5153ab4af3SHans de Goede 5253ab4af3SHans de Goede/ { 5353ab4af3SHans de Goede model = "Utoo P66"; 5453ab4af3SHans de Goede compatible = "utoo,p66", "allwinner,sun5i-a13"; 5553ab4af3SHans de Goede 56*80e5f83cSHans de Goede backlight: backlight { 57*80e5f83cSHans de Goede compatible = "pwm-backlight"; 58*80e5f83cSHans de Goede pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; 59*80e5f83cSHans de Goede /* Note levels of 10 / 20% result in backlight off */ 60*80e5f83cSHans de Goede brightness-levels = <0 30 40 50 60 70 80 90 100>; 61*80e5f83cSHans de Goede default-brightness-level = <6>; 62*80e5f83cSHans de Goede /* TODO: backlight uses axp gpio1 as enable pin */ 63*80e5f83cSHans de Goede }; 64*80e5f83cSHans de Goede 6553ab4af3SHans de Goede i2c_lcd: i2c@0 { 6653ab4af3SHans de Goede /* The lcd panel i2c interface is hooked up via gpios */ 6753ab4af3SHans de Goede compatible = "i2c-gpio"; 6853ab4af3SHans de Goede pinctrl-names = "default"; 6953ab4af3SHans de Goede pinctrl-0 = <&i2c_lcd_pins>; 7053ab4af3SHans de Goede gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>, /* PG12, sda */ 7153ab4af3SHans de Goede <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10, scl */ 7253ab4af3SHans de Goede i2c-gpio,delay-us = <5>; 7353ab4af3SHans de Goede }; 7453ab4af3SHans de Goede}; 7553ab4af3SHans de Goede 76*80e5f83cSHans de Goede&codec { 77*80e5f83cSHans de Goede pinctrl-names = "default"; 78*80e5f83cSHans de Goede pinctrl-0 = <&codec_pa_pin>; 79*80e5f83cSHans de Goede allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ 80*80e5f83cSHans de Goede status = "okay"; 81*80e5f83cSHans de Goede}; 82*80e5f83cSHans de Goede 8353ab4af3SHans de Goede&cpu0 { 8453ab4af3SHans de Goede cpu-supply = <®_dcdc2>; 8553ab4af3SHans de Goede}; 8653ab4af3SHans de Goede 8753ab4af3SHans de Goede&ehci0 { 8853ab4af3SHans de Goede status = "okay"; 8953ab4af3SHans de Goede}; 9053ab4af3SHans de Goede 9153ab4af3SHans de Goede&i2c0 { 9253ab4af3SHans de Goede pinctrl-names = "default"; 9353ab4af3SHans de Goede pinctrl-0 = <&i2c0_pins_a>; 9453ab4af3SHans de Goede status = "okay"; 9553ab4af3SHans de Goede 9653ab4af3SHans de Goede axp209: pmic@34 { 9753ab4af3SHans de Goede reg = <0x34>; 9853ab4af3SHans de Goede interrupts = <0>; 9953ab4af3SHans de Goede }; 10053ab4af3SHans de Goede}; 10153ab4af3SHans de Goede 10253ab4af3SHans de Goede#include "axp209.dtsi" 10353ab4af3SHans de Goede 10453ab4af3SHans de Goede&i2c1 { 10553ab4af3SHans de Goede pinctrl-names = "default"; 10653ab4af3SHans de Goede pinctrl-0 = <&i2c1_pins_a>; 10753ab4af3SHans de Goede status = "okay"; 10853ab4af3SHans de Goede 1098b1ba941SHans de Goede icn8318: touchscreen@40 { 1108b1ba941SHans de Goede compatible = "chipone,icn8318"; 1118b1ba941SHans de Goede reg = <0x40>; 1128b1ba941SHans de Goede interrupt-parent = <&pio>; 113da52a4a3SHans de Goede interrupts = <6 9 IRQ_TYPE_EDGE_FALLING>; /* EINT9 (PG9) */ 1148b1ba941SHans de Goede pinctrl-names = "default"; 1158b1ba941SHans de Goede pinctrl-0 = <&ts_wake_pin_p66>; 1168b1ba941SHans de Goede wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */ 1178b1ba941SHans de Goede touchscreen-size-x = <800>; 1188b1ba941SHans de Goede touchscreen-size-y = <480>; 1198b1ba941SHans de Goede touchscreen-inverted-x; 1208b1ba941SHans de Goede touchscreen-swapped-x-y; 1218b1ba941SHans de Goede }; 1228b1ba941SHans de Goede 12353ab4af3SHans de Goede pcf8563: rtc@51 { 12453ab4af3SHans de Goede compatible = "nxp,pcf8563"; 12553ab4af3SHans de Goede reg = <0x51>; 12653ab4af3SHans de Goede }; 12753ab4af3SHans de Goede}; 12853ab4af3SHans de Goede 12953ab4af3SHans de Goede&lradc { 13053ab4af3SHans de Goede vref-supply = <®_ldo2>; 13153ab4af3SHans de Goede status = "okay"; 13253ab4af3SHans de Goede 13353ab4af3SHans de Goede button@200 { 13453ab4af3SHans de Goede label = "Volume Up"; 13553ab4af3SHans de Goede linux,code = <KEY_VOLUMEUP>; 13653ab4af3SHans de Goede channel = <0>; 13753ab4af3SHans de Goede voltage = <200000>; 13853ab4af3SHans de Goede }; 13953ab4af3SHans de Goede 14053ab4af3SHans de Goede button@400 { 14153ab4af3SHans de Goede label = "Volume Down"; 14253ab4af3SHans de Goede linux,code = <KEY_VOLUMEDOWN>; 14353ab4af3SHans de Goede channel = <0>; 14453ab4af3SHans de Goede voltage = <400000>; 14553ab4af3SHans de Goede }; 14653ab4af3SHans de Goede}; 14753ab4af3SHans de Goede 14853ab4af3SHans de Goede&mmc0 { 14953ab4af3SHans de Goede pinctrl-names = "default"; 15053ab4af3SHans de Goede pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_p66>; 15153ab4af3SHans de Goede vmmc-supply = <®_vcc3v3>; 15253ab4af3SHans de Goede bus-width = <4>; 15353ab4af3SHans de Goede cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ 15453ab4af3SHans de Goede cd-inverted; 15553ab4af3SHans de Goede status = "okay"; 15653ab4af3SHans de Goede}; 15753ab4af3SHans de Goede 15853ab4af3SHans de Goede&mmc2 { 15953ab4af3SHans de Goede pinctrl-names = "default"; 16053ab4af3SHans de Goede pinctrl-0 = <&mmc2_pins_a>; 16153ab4af3SHans de Goede vmmc-supply = <®_vcc3v3>; 16253ab4af3SHans de Goede bus-width = <8>; 16353ab4af3SHans de Goede non-removable; 16453ab4af3SHans de Goede status = "okay"; 16553ab4af3SHans de Goede 16653ab4af3SHans de Goede mmccard: mmccard@0 { 16753ab4af3SHans de Goede reg = <0>; 16853ab4af3SHans de Goede compatible = "mmc-card"; 16953ab4af3SHans de Goede broken-hpi; 17053ab4af3SHans de Goede }; 17153ab4af3SHans de Goede}; 17253ab4af3SHans de Goede 173da52a4a3SHans de Goede&otg_sram { 174da52a4a3SHans de Goede status = "okay"; 175da52a4a3SHans de Goede}; 176da52a4a3SHans de Goede 17753ab4af3SHans de Goede&pio { 178*80e5f83cSHans de Goede codec_pa_pin: codec_pa_pin@0 { 179*80e5f83cSHans de Goede allwinner,pins = "PG3"; 180*80e5f83cSHans de Goede allwinner,function = "gpio_out"; 181*80e5f83cSHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 182*80e5f83cSHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 183*80e5f83cSHans de Goede }; 184*80e5f83cSHans de Goede 18553ab4af3SHans de Goede mmc0_cd_pin_p66: mmc0_cd_pin@0 { 18653ab4af3SHans de Goede allwinner,pins = "PG0"; 18753ab4af3SHans de Goede allwinner,function = "gpio_in"; 18853ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 18953ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; 19053ab4af3SHans de Goede }; 19153ab4af3SHans de Goede 192da52a4a3SHans de Goede usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { 193da52a4a3SHans de Goede allwinner,pins = "PG1"; 194da52a4a3SHans de Goede allwinner,function = "gpio_in"; 195da52a4a3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 196da52a4a3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>; 197da52a4a3SHans de Goede }; 198da52a4a3SHans de Goede 199da52a4a3SHans de Goede usb0_id_detect_pin: usb0_id_detect_pin@0 { 200da52a4a3SHans de Goede allwinner,pins = "PG2"; 201da52a4a3SHans de Goede allwinner,function = "gpio_in"; 202da52a4a3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 203da52a4a3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; 204da52a4a3SHans de Goede }; 205da52a4a3SHans de Goede 20653ab4af3SHans de Goede i2c_lcd_pins: i2c_lcd_pin@0 { 20753ab4af3SHans de Goede allwinner,pins = "PG10", "PG12"; 20853ab4af3SHans de Goede allwinner,function = "gpio_out"; 20953ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 21053ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; 21153ab4af3SHans de Goede }; 21253ab4af3SHans de Goede 2138b1ba941SHans de Goede ts_wake_pin_p66: ts_wake_pin@0 { 2148b1ba941SHans de Goede allwinner,pins = "PB3"; 2158b1ba941SHans de Goede allwinner,function = "gpio_out"; 2168b1ba941SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 2178b1ba941SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 2188b1ba941SHans de Goede }; 2198b1ba941SHans de Goede 22053ab4af3SHans de Goede usb0_vbus_pin_a: usb0_vbus_pin@0 { 22153ab4af3SHans de Goede allwinner,pins = "PB4"; 22253ab4af3SHans de Goede allwinner,function = "gpio_out"; 22353ab4af3SHans de Goede allwinner,drive = <SUN4I_PINCTRL_10_MA>; 22453ab4af3SHans de Goede allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; 22553ab4af3SHans de Goede }; 22653ab4af3SHans de Goede}; 22753ab4af3SHans de Goede 228*80e5f83cSHans de Goede&pwm { 229*80e5f83cSHans de Goede pinctrl-names = "default"; 230*80e5f83cSHans de Goede pinctrl-0 = <&pwm0_pins>; 231*80e5f83cSHans de Goede status = "okay"; 232*80e5f83cSHans de Goede}; 233*80e5f83cSHans de Goede 23453ab4af3SHans de Goede®_dcdc2 { 23553ab4af3SHans de Goede regulator-always-on; 23653ab4af3SHans de Goede regulator-min-microvolt = <1000000>; 23753ab4af3SHans de Goede regulator-max-microvolt = <1500000>; 23853ab4af3SHans de Goede regulator-name = "vdd-cpu"; 23953ab4af3SHans de Goede}; 24053ab4af3SHans de Goede 24153ab4af3SHans de Goede®_dcdc3 { 24253ab4af3SHans de Goede regulator-always-on; 24353ab4af3SHans de Goede regulator-min-microvolt = <1000000>; 24453ab4af3SHans de Goede regulator-max-microvolt = <1400000>; 24553ab4af3SHans de Goede regulator-name = "vdd-int-pll"; 24653ab4af3SHans de Goede}; 24753ab4af3SHans de Goede 24853ab4af3SHans de Goede®_ldo1 { 24953ab4af3SHans de Goede regulator-name = "vdd-rtc"; 25053ab4af3SHans de Goede}; 25153ab4af3SHans de Goede 25253ab4af3SHans de Goede®_ldo2 { 25353ab4af3SHans de Goede regulator-always-on; 25453ab4af3SHans de Goede regulator-min-microvolt = <3000000>; 25553ab4af3SHans de Goede regulator-max-microvolt = <3000000>; 25653ab4af3SHans de Goede regulator-name = "avcc"; 25753ab4af3SHans de Goede}; 25853ab4af3SHans de Goede 25953ab4af3SHans de Goede®_ldo3 { 26053ab4af3SHans de Goede regulator-min-microvolt = <3300000>; 26153ab4af3SHans de Goede regulator-max-microvolt = <3300000>; 26253ab4af3SHans de Goede regulator-name = "vcc-wifi"; 26353ab4af3SHans de Goede}; 26453ab4af3SHans de Goede 26553ab4af3SHans de Goede®_usb0_vbus { 26653ab4af3SHans de Goede gpio = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ 26753ab4af3SHans de Goede status = "okay"; 26853ab4af3SHans de Goede}; 26953ab4af3SHans de Goede 270da52a4a3SHans de Goede&usb_otg { 271da52a4a3SHans de Goede dr_mode = "otg"; 272da52a4a3SHans de Goede status = "okay"; 273da52a4a3SHans de Goede}; 274da52a4a3SHans de Goede 27553ab4af3SHans de Goede&usbphy { 276da52a4a3SHans de Goede pinctrl-names = "default"; 277da52a4a3SHans de Goede pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; 278da52a4a3SHans de Goede usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ 279da52a4a3SHans de Goede usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ 28053ab4af3SHans de Goede usb0_vbus-supply = <®_usb0_vbus>; 28153ab4af3SHans de Goede usb1_vbus-supply = <®_ldo3>; 28253ab4af3SHans de Goede status = "okay"; 28353ab4af3SHans de Goede}; 284