1/* 2 * Copyright 2015 Hans de Goede <hdegoede@redhat.com> 3 * 4 * This file is dual-licensed: you can use it either under the terms 5 * of the GPL or the X11 license, at your option. Note that this dual 6 * licensing only applies to this file, and not this project as a 7 * whole. 8 * 9 * a) This file is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License as 11 * published by the Free Software Foundation; either version 2 of the 12 * License, or (at your option) any later version. 13 * 14 * This file is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * Or, alternatively, 20 * 21 * b) Permission is hereby granted, free of charge, to any person 22 * obtaining a copy of this software and associated documentation 23 * files (the "Software"), to deal in the Software without 24 * restriction, including without limitation the rights to use, 25 * copy, modify, merge, publish, distribute, sublicense, and/or 26 * sell copies of the Software, and to permit persons to whom the 27 * Software is furnished to do so, subject to the following 28 * conditions: 29 * 30 * The above copyright notice and this permission notice shall be 31 * included in all copies or substantial portions of the Software. 32 * 33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 40 * OTHER DEALINGS IN THE SOFTWARE. 41 */ 42 43/dts-v1/; 44#include "sun4i-a10.dtsi" 45#include "sunxi-common-regulators.dtsi" 46#include <dt-bindings/gpio/gpio.h> 47#include <dt-bindings/input/input.h> 48#include <dt-bindings/interrupt-controller/irq.h> 49#include <dt-bindings/pwm/pwm.h> 50 51/ { 52 model = "iNet-1"; 53 compatible = "inet-tek,inet1", "allwinner,sun4i-a10"; 54 55 aliases { 56 serial0 = &uart0; 57 }; 58 59 backlight: backlight { 60 compatible = "pwm-backlight"; 61 pinctrl-names = "default"; 62 pinctrl-0 = <&bl_en_pin_inet>; 63 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; 64 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; 65 default-brightness-level = <8>; 66 enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ 67 }; 68 69 chosen { 70 stdout-path = "serial0:115200n8"; 71 }; 72}; 73 74&codec { 75 status = "okay"; 76}; 77 78&cpu0 { 79 cpu-supply = <®_dcdc2>; 80}; 81 82&ehci0 { 83 status = "okay"; 84}; 85 86&ehci1 { 87 status = "okay"; 88}; 89 90&i2c0 { 91 pinctrl-names = "default"; 92 pinctrl-0 = <&i2c0_pins_a>; 93 status = "okay"; 94 95 axp209: pmic@34 { 96 reg = <0x34>; 97 interrupts = <0>; 98 }; 99}; 100 101#include "axp209.dtsi" 102 103&i2c1 { 104 pinctrl-names = "default"; 105 pinctrl-0 = <&i2c1_pins_a>; 106 status = "okay"; 107 108 /* Accelerometer */ 109 bma250@18 { 110 compatible = "bosch,bma250"; 111 reg = <0x18>; 112 interrupt-parent = <&pio>; 113 interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ 114 }; 115}; 116 117&i2c2 { 118 pinctrl-names = "default"; 119 pinctrl-0 = <&i2c2_pins_a>; 120 status = "okay"; 121 122 ft5x: touchscreen@38 { 123 compatible = "edt,edt-ft5406"; 124 reg = <0x38>; 125 interrupt-parent = <&pio>; 126 interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; 127 pinctrl-names = "default"; 128 pinctrl-0 = <&touchscreen_wake_pin>; 129 wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ 130 touchscreen-size-x = <600>; 131 touchscreen-size-y = <1024>; 132 touchscreen-swapped-x-y; 133 }; 134}; 135 136&lradc { 137 vref-supply = <®_ldo2>; 138 status = "okay"; 139 140 button@200 { 141 label = "Volume Up"; 142 linux,code = <KEY_VOLUMEUP>; 143 channel = <0>; 144 voltage = <200000>; 145 }; 146 147 button@1000 { 148 label = "Volume Down"; 149 linux,code = <KEY_VOLUMEDOWN>; 150 channel = <0>; 151 voltage = <1000000>; 152 }; 153 154 button@1200 { 155 label = "Home"; 156 linux,code = <KEY_HOMEPAGE>; 157 channel = <0>; 158 voltage = <1200000>; 159 }; 160}; 161 162&mmc0 { 163 pinctrl-names = "default"; 164 pinctrl-0 = <&mmc0_pins_a>; 165 vmmc-supply = <®_vcc3v3>; 166 bus-width = <4>; 167 cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ 168 cd-inverted; 169 status = "okay"; 170}; 171 172&ohci0 { 173 status = "okay"; 174}; 175 176&otg_sram { 177 status = "okay"; 178}; 179 180&pio { 181 bl_en_pin_inet: bl_en_pin@0 { 182 pins = "PH7"; 183 function = "gpio_out"; 184 }; 185 186 touchscreen_wake_pin: touchscreen_wake_pin@0 { 187 pins = "PB13"; 188 function = "gpio_out"; 189 }; 190 191 usb0_id_detect_pin: usb0_id_detect_pin@0 { 192 pins = "PH4"; 193 function = "gpio_in"; 194 bias-pull-up; 195 }; 196 197 usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { 198 pins = "PH5"; 199 function = "gpio_in"; 200 bias-pull-down; 201 }; 202}; 203 204&pwm { 205 pinctrl-names = "default"; 206 pinctrl-0 = <&pwm0_pins_a>; 207 status = "okay"; 208}; 209 210®_dcdc2 { 211 regulator-always-on; 212 regulator-min-microvolt = <1000000>; 213 regulator-max-microvolt = <1400000>; 214 regulator-name = "vdd-cpu"; 215}; 216 217®_dcdc3 { 218 regulator-always-on; 219 regulator-min-microvolt = <1250000>; 220 regulator-max-microvolt = <1250000>; 221 regulator-name = "vdd-int-dll"; 222}; 223 224®_ldo1 { 225 regulator-name = "vdd-rtc"; 226}; 227 228®_ldo2 { 229 regulator-always-on; 230 regulator-min-microvolt = <3000000>; 231 regulator-max-microvolt = <3000000>; 232 regulator-name = "avcc"; 233}; 234 235®_usb0_vbus { 236 status = "okay"; 237}; 238 239®_usb1_vbus { 240 status = "okay"; 241}; 242 243®_usb2_vbus { 244 status = "okay"; 245}; 246 247&uart0 { 248 pinctrl-names = "default"; 249 pinctrl-0 = <&uart0_pins_a>; 250 status = "okay"; 251}; 252 253&usb_otg { 254 dr_mode = "otg"; 255 status = "okay"; 256}; 257 258&usbphy { 259 pinctrl-names = "default"; 260 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; 261 usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ 262 usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ 263 usb0_vbus-supply = <®_usb0_vbus>; 264 usb1_vbus-supply = <®_usb1_vbus>; 265 usb2_vbus-supply = <®_usb2_vbus>; 266 status = "okay"; 267}; 268