Hans de Goede | c3ed8c1 | 2016-06-11 15:19:38 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 "sun8i-a23.dtsi" |
| 45 | #include "sunxi-common-regulators.dtsi" |
| 46 | |
| 47 | #include <dt-bindings/gpio/gpio.h> |
| 48 | #include <dt-bindings/input/input.h> |
| 49 | #include <dt-bindings/pinctrl/sun4i-a10.h> |
| 50 | #include <dt-bindings/pwm/pwm.h> |
| 51 | |
| 52 | / { |
| 53 | model = "Polaroid MID2407PXE03 tablet"; |
| 54 | compatible = "polaroid,mid2407pxe03", "allwinner,sun8i-a23"; |
| 55 | |
| 56 | aliases { |
| 57 | serial0 = &r_uart; |
| 58 | }; |
| 59 | |
| 60 | backlight: backlight { |
| 61 | compatible = "pwm-backlight"; |
| 62 | pinctrl-names = "default"; |
| 63 | pinctrl-0 = <&bl_en_pin_mid2407>; |
| 64 | pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; |
| 65 | brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; |
| 66 | default-brightness-level = <8>; |
| 67 | enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ |
| 68 | }; |
| 69 | |
| 70 | chosen { |
| 71 | stdout-path = "serial0:115200n8"; |
| 72 | }; |
| 73 | }; |
| 74 | |
| 75 | &i2c0 { |
| 76 | pinctrl-names = "default"; |
| 77 | pinctrl-0 = <&i2c0_pins_a>; |
| 78 | status = "okay"; |
| 79 | /* |
| 80 | * The gsl1680 is rated at 400KHz and it will not work reliable at |
| 81 | * 100KHz, this has been confirmed on multiple different tablets. |
| 82 | * The gsl1680 is the only device on this bus. |
| 83 | */ |
| 84 | clock-frequency = <400000>; |
| 85 | |
| 86 | gsl1680: touchscreen@40 { |
| 87 | compatible = "silead,gsl1680"; |
| 88 | reg = <0x40>; |
| 89 | interrupt-parent = <&pio>; |
| 90 | interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5 */ |
| 91 | pinctrl-names = "default"; |
| 92 | pinctrl-0 = <&ts_power_pin_mid2407>; |
| 93 | power-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ |
| 94 | touchscreen-size-x = <960>; |
| 95 | touchscreen-size-y = <640>; |
| 96 | touchscreen-inverted-x; |
| 97 | touchscreen-inverted-y; |
| 98 | touchscreen-max-fingers = <5>; |
| 99 | touchscreen-fw-name = "silead/gsl1680-polaroid-mid2407pxe03.fw"; |
| 100 | }; |
| 101 | }; |
| 102 | |
| 103 | &i2c1 { |
| 104 | pinctrl-names = "default"; |
| 105 | pinctrl-0 = <&i2c1_pins_a>; |
| 106 | status = "okay"; |
| 107 | }; |
| 108 | |
| 109 | &lradc { |
| 110 | vref-supply = <®_vcc3v0>; |
| 111 | status = "okay"; |
| 112 | |
| 113 | button@200 { |
| 114 | label = "Volume Up"; |
| 115 | linux,code = <KEY_VOLUMEUP>; |
| 116 | channel = <0>; |
| 117 | voltage = <200000>; |
| 118 | }; |
| 119 | |
| 120 | button@400 { |
| 121 | label = "Volume Down"; |
| 122 | linux,code = <KEY_VOLUMEDOWN>; |
| 123 | channel = <0>; |
| 124 | voltage = <400000>; |
| 125 | }; |
| 126 | }; |
| 127 | |
| 128 | &mmc0 { |
| 129 | pinctrl-names = "default"; |
| 130 | pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_mid2407>; |
| 131 | vmmc-supply = <®_dcdc1>; |
| 132 | bus-width = <4>; |
| 133 | cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ |
| 134 | cd-inverted; |
| 135 | status = "okay"; |
| 136 | }; |
| 137 | |
| 138 | &pio { |
| 139 | bl_en_pin_mid2407: bl_en_pin@0 { |
| 140 | allwinner,pins = "PH6"; |
| 141 | allwinner,function = "gpio_in"; |
| 142 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; |
| 143 | allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; |
| 144 | }; |
| 145 | |
| 146 | mmc0_cd_pin_mid2407: mmc0_cd_pin@0 { |
| 147 | allwinner,pins = "PB4"; |
| 148 | allwinner,function = "gpio_in"; |
| 149 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; |
| 150 | allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; |
| 151 | }; |
| 152 | |
| 153 | ts_power_pin_mid2407: ts_power_pin@0 { |
| 154 | allwinner,pins = "PH1"; |
| 155 | allwinner,function = "gpio_out"; |
| 156 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; |
| 157 | allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; |
| 158 | }; |
| 159 | |
| 160 | usb0_id_detect_pin: usb0_id_detect_pin@0 { |
| 161 | allwinner,pins = "PH8"; |
| 162 | allwinner,function = "gpio_in"; |
| 163 | allwinner,drive = <SUN4I_PINCTRL_10_MA>; |
| 164 | allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; |
| 165 | }; |
| 166 | }; |
| 167 | |
| 168 | &pwm { |
| 169 | pinctrl-names = "default"; |
| 170 | pinctrl-0 = <&pwm0_pins>; |
| 171 | status = "okay"; |
| 172 | }; |
| 173 | |
| 174 | &r_rsb { |
| 175 | status = "okay"; |
| 176 | |
| 177 | axp22x: pmic@3a3 { |
| 178 | compatible = "x-powers,axp223"; |
| 179 | reg = <0x3a3>; |
| 180 | interrupt-parent = <&nmi_intc>; |
| 181 | interrupts = <0 IRQ_TYPE_LEVEL_LOW>; |
| 182 | eldoin-supply = <®_dcdc1>; |
| 183 | x-powers,drive-vbus-en; |
| 184 | }; |
| 185 | }; |
| 186 | |
| 187 | &r_uart { |
| 188 | pinctrl-names = "default"; |
| 189 | pinctrl-0 = <&r_uart_pins_a>; |
| 190 | status = "okay"; |
| 191 | }; |
| 192 | |
| 193 | #include "axp22x.dtsi" |
| 194 | |
| 195 | ®_aldo1 { |
| 196 | regulator-always-on; |
| 197 | regulator-min-microvolt = <3000000>; |
| 198 | regulator-max-microvolt = <3000000>; |
| 199 | regulator-name = "vcc-io"; |
| 200 | }; |
| 201 | |
| 202 | ®_aldo2 { |
| 203 | regulator-always-on; |
| 204 | regulator-min-microvolt = <2350000>; |
| 205 | regulator-max-microvolt = <2650000>; |
| 206 | regulator-name = "vdd-dll"; |
| 207 | }; |
| 208 | |
| 209 | ®_aldo3 { |
| 210 | regulator-always-on; |
| 211 | regulator-min-microvolt = <2700000>; |
| 212 | regulator-max-microvolt = <3300000>; |
| 213 | regulator-name = "vcc-pll-avcc"; |
| 214 | }; |
| 215 | |
| 216 | ®_dc1sw { |
| 217 | regulator-name = "vcc-lcd"; |
| 218 | }; |
| 219 | |
| 220 | ®_dc5ldo { |
| 221 | regulator-always-on; |
| 222 | regulator-min-microvolt = <900000>; |
| 223 | regulator-max-microvolt = <1400000>; |
| 224 | regulator-name = "vdd-cpus"; |
| 225 | }; |
| 226 | |
| 227 | ®_dcdc1 { |
| 228 | regulator-always-on; |
| 229 | regulator-min-microvolt = <3000000>; |
| 230 | regulator-max-microvolt = <3000000>; |
| 231 | regulator-name = "vcc-3v0"; |
| 232 | }; |
| 233 | |
| 234 | ®_dcdc2 { |
| 235 | regulator-always-on; |
| 236 | regulator-min-microvolt = <900000>; |
| 237 | regulator-max-microvolt = <1400000>; |
| 238 | regulator-name = "vdd-sys"; |
| 239 | }; |
| 240 | |
| 241 | ®_dcdc3 { |
| 242 | regulator-always-on; |
| 243 | regulator-min-microvolt = <900000>; |
| 244 | regulator-max-microvolt = <1400000>; |
| 245 | regulator-name = "vdd-cpu"; |
| 246 | }; |
| 247 | |
| 248 | ®_dcdc5 { |
| 249 | regulator-always-on; |
| 250 | regulator-min-microvolt = <1500000>; |
| 251 | regulator-max-microvolt = <1500000>; |
| 252 | regulator-name = "vcc-dram"; |
| 253 | }; |
| 254 | |
| 255 | ®_drivevbus { |
| 256 | regulator-name = "usb0-vbus"; |
| 257 | status = "okay"; |
| 258 | }; |
| 259 | |
| 260 | ®_ldo_io1 { |
| 261 | regulator-always-on; |
| 262 | regulator-min-microvolt = <3300000>; |
| 263 | regulator-max-microvolt = <3300000>; |
| 264 | regulator-name = "vcc-touchscreen"; |
| 265 | status = "okay"; |
| 266 | }; |
| 267 | |
| 268 | ®_rtc_ldo { |
| 269 | regulator-name = "vcc-rtc"; |
| 270 | }; |
| 271 | |
| 272 | &simplefb_lcd { |
| 273 | vcc-lcd-supply = <®_dc1sw>; |
| 274 | }; |
| 275 | |
| 276 | &usb_otg { |
| 277 | dr_mode = "otg"; |
| 278 | status = "okay"; |
| 279 | }; |
| 280 | |
| 281 | &usb_power_supply { |
| 282 | status = "okay"; |
| 283 | }; |
| 284 | |
| 285 | &usbphy { |
| 286 | pinctrl-names = "default"; |
| 287 | pinctrl-0 = <&usb0_id_detect_pin>; |
| 288 | usb0_id_det-gpio = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ |
| 289 | usb0_vbus_power-supply = <&usb_power_supply>; |
| 290 | usb0_vbus-supply = <®_drivevbus>; |
| 291 | status = "okay"; |
| 292 | }; |