0001 /*
0002 * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
0003 *
0004 * This file is dual-licensed: you can use it either under the terms
0005 * of the GPL or the X11 license, at your option. Note that this dual
0006 * licensing only applies to this file, and not this project as a
0007 * whole.
0008 *
0009 * a) This file is free software; you can redistribute it and/or
0010 * modify it under the terms of the GNU General Public License as
0011 * published by the Free Software Foundation; either version 2 of the
0012 * License, or (at your option) any later version.
0013 *
0014 * This file is distributed in the hope that it will be useful,
0015 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017 * GNU General Public License for more details.
0018 *
0019 * Or, alternatively,
0020 *
0021 * b) Permission is hereby granted, free of charge, to any person
0022 * obtaining a copy of this software and associated documentation
0023 * files (the "Software"), to deal in the Software without
0024 * restriction, including without limitation the rights to use,
0025 * copy, modify, merge, publish, distribute, sublicense, and/or
0026 * sell copies of the Software, and to permit persons to whom the
0027 * Software is furnished to do so, subject to the following
0028 * conditions:
0029 *
0030 * The above copyright notice and this permission notice shall be
0031 * included in all copies or substantial portions of the Software.
0032 *
0033 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0034 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0035 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0036 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0037 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0038 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0039 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0040 * OTHER DEALINGS IN THE SOFTWARE.
0041 */
0042
0043 /dts-v1/;
0044 #include "sun4i-a10.dtsi"
0045 #include "sunxi-common-regulators.dtsi"
0046 #include <dt-bindings/gpio/gpio.h>
0047 #include <dt-bindings/input/input.h>
0048 #include <dt-bindings/interrupt-controller/irq.h>
0049
0050 / {
0051 model = "iNet-9F Rev 03";
0052 compatible = "inet-tek,inet9f-rev03", "allwinner,sun4i-a10";
0053
0054 aliases {
0055 serial0 = &uart0;
0056 };
0057
0058 chosen {
0059 stdout-path = "serial0:115200n8";
0060 };
0061
0062 gpio-keys {
0063 compatible = "gpio-keys-polled";
0064 poll-interval = <20>;
0065
0066 event-left-joystick-left {
0067 label = "Left Joystick Left";
0068 linux,code = <ABS_X>;
0069 linux,input-type = <EV_ABS>;
0070 linux,input-value = <0xffffffff>; /* -1 */
0071 gpios = <&pio 0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA6 */
0072 };
0073
0074 event-left-joystick-right {
0075 label = "Left Joystick Right";
0076 linux,code = <ABS_X>;
0077 linux,input-type = <EV_ABS>;
0078 linux,input-value = <1>;
0079 gpios = <&pio 0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA5 */
0080 };
0081
0082 event-left-joystick-up {
0083 label = "Left Joystick Up";
0084 linux,code = <ABS_Y>;
0085 linux,input-type = <EV_ABS>;
0086 linux,input-value = <0xffffffff>; /* -1 */
0087 gpios = <&pio 0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA8 */
0088 };
0089
0090 event-left-joystick-down {
0091 label = "Left Joystick Down";
0092 linux,code = <ABS_Y>;
0093 linux,input-type = <EV_ABS>;
0094 linux,input-value = <1>;
0095 gpios = <&pio 0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA9 */
0096 };
0097
0098 event-right-joystick-left {
0099 label = "Right Joystick Left";
0100 linux,code = <ABS_Z>;
0101 linux,input-type = <EV_ABS>;
0102 linux,input-value = <0xffffffff>; /* -1 */
0103 gpios = <&pio 0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA1 */
0104 };
0105
0106 event-right-joystick-right {
0107 label = "Right Joystick Right";
0108 linux,code = <ABS_Z>;
0109 linux,input-type = <EV_ABS>;
0110 linux,input-value = <1>;
0111 gpios = <&pio 0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA0 */
0112 };
0113
0114 event-right-joystick-up {
0115 label = "Right Joystick Up";
0116 linux,code = <ABS_RZ>;
0117 linux,input-type = <EV_ABS>;
0118 linux,input-value = <0xffffffff>; /* -1 */
0119 gpios = <&pio 0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA3 */
0120 };
0121
0122 event-right-joystick-down {
0123 label = "Right Joystick Down";
0124 linux,code = <ABS_RZ>;
0125 linux,input-type = <EV_ABS>;
0126 linux,input-value = <1>;
0127 gpios = <&pio 0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA4 */
0128 };
0129
0130 event-dpad-left {
0131 label = "DPad Left";
0132 linux,code = <ABS_HAT0X>;
0133 linux,input-type = <EV_ABS>;
0134 linux,input-value = <0xffffffff>; /* -1 */
0135 gpios = <&pio 7 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH23 */
0136 };
0137
0138 event-dpad-right {
0139 label = "DPad Right";
0140 linux,code = <ABS_HAT0X>;
0141 linux,input-type = <EV_ABS>;
0142 linux,input-value = <1>;
0143 gpios = <&pio 7 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH24 */
0144 };
0145
0146 event-dpad-up {
0147 label = "DPad Up";
0148 linux,code = <ABS_HAT0Y>;
0149 linux,input-type = <EV_ABS>;
0150 linux,input-value = <0xffffffff>; /* -1 */
0151 gpios = <&pio 7 25 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH25 */
0152 };
0153
0154 event-dpad-down {
0155 label = "DPad Down";
0156 linux,code = <ABS_HAT0Y>;
0157 linux,input-type = <EV_ABS>;
0158 linux,input-value = <1>;
0159 gpios = <&pio 7 26 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH26 */
0160 };
0161
0162 event-x {
0163 label = "Button X";
0164 linux,code = <BTN_X>;
0165 gpios = <&pio 0 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA16 */
0166 };
0167
0168 event-y {
0169 label = "Button Y";
0170 linux,code = <BTN_Y>;
0171 gpios = <&pio 0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA14 */
0172 };
0173
0174 event-a {
0175 label = "Button A";
0176 linux,code = <BTN_A>;
0177 gpios = <&pio 0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA17 */
0178 };
0179
0180 event-b {
0181 label = "Button B";
0182 linux,code = <BTN_B>;
0183 gpios = <&pio 0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA15 */
0184 };
0185
0186 event-select {
0187 label = "Select Button";
0188 linux,code = <BTN_SELECT>;
0189 gpios = <&pio 0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA11 */
0190 };
0191
0192 event-start {
0193 label = "Start Button";
0194 linux,code = <BTN_START>;
0195 gpios = <&pio 0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA12 */
0196 };
0197
0198 event-top-left {
0199 label = "Top Left Button";
0200 linux,code = <BTN_TL>;
0201 gpios = <&pio 7 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH22 */
0202 };
0203
0204 event-top-right {
0205 label = "Top Right Button";
0206 linux,code = <BTN_TR>;
0207 gpios = <&pio 0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA13 */
0208 };
0209 };
0210 };
0211
0212 &cpu0 {
0213 cpu-supply = <®_dcdc2>;
0214 };
0215
0216 &ehci1 {
0217 status = "okay";
0218 };
0219
0220 &i2c0 {
0221 status = "okay";
0222
0223 axp209: pmic@34 {
0224 reg = <0x34>;
0225 interrupts = <0>;
0226 };
0227 };
0228
0229 #include "axp209.dtsi"
0230
0231 &i2c1 {
0232 status = "okay";
0233
0234 /* Accelerometer */
0235 bma250@18 {
0236 compatible = "bosch,bma250";
0237 reg = <0x18>;
0238 interrupt-parent = <&pio>;
0239 interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
0240 };
0241 };
0242
0243 &i2c2 {
0244 status = "okay";
0245
0246 ft5406ee8: touchscreen@38 {
0247 compatible = "edt,edt-ft5406";
0248 reg = <0x38>;
0249 interrupt-parent = <&pio>;
0250 interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
0251 touchscreen-size-x = <800>;
0252 touchscreen-size-y = <480>;
0253 };
0254 };
0255
0256 &lradc {
0257 vref-supply = <®_ldo2>;
0258 status = "okay";
0259
0260 button-200 {
0261 label = "Menu";
0262 linux,code = <KEY_MENU>;
0263 channel = <0>;
0264 voltage = <200000>;
0265 };
0266
0267 button-600 {
0268 label = "Volume Up";
0269 linux,code = <KEY_VOLUMEUP>;
0270 channel = <0>;
0271 voltage = <600000>;
0272 };
0273
0274 button-800 {
0275 label = "Volume Down";
0276 linux,code = <KEY_VOLUMEDOWN>;
0277 channel = <0>;
0278 voltage = <800000>;
0279 };
0280
0281 button-1000 {
0282 label = "Home";
0283 linux,code = <KEY_HOMEPAGE>;
0284 channel = <0>;
0285 voltage = <1000000>;
0286 };
0287
0288 button-1200 {
0289 label = "Esc";
0290 linux,code = <KEY_ESC>;
0291 channel = <0>;
0292 voltage = <1200000>;
0293 };
0294 };
0295
0296 &mmc0 {
0297 vmmc-supply = <®_vcc3v3>;
0298 bus-width = <4>;
0299 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
0300 status = "okay";
0301 };
0302
0303 &otg_sram {
0304 status = "okay";
0305 };
0306
0307 ®_dcdc2 {
0308 regulator-always-on;
0309 regulator-min-microvolt = <1000000>;
0310 regulator-max-microvolt = <1400000>;
0311 regulator-name = "vdd-cpu";
0312 };
0313
0314 ®_dcdc3 {
0315 regulator-always-on;
0316 regulator-min-microvolt = <1250000>;
0317 regulator-max-microvolt = <1250000>;
0318 regulator-name = "vdd-int-dll";
0319 };
0320
0321 ®_ldo1 {
0322 regulator-name = "vdd-rtc";
0323 };
0324
0325 ®_ldo2 {
0326 regulator-always-on;
0327 regulator-min-microvolt = <3000000>;
0328 regulator-max-microvolt = <3000000>;
0329 regulator-name = "avcc";
0330 };
0331
0332 ®_usb0_vbus {
0333 status = "okay";
0334 };
0335
0336 ®_usb2_vbus {
0337 status = "okay";
0338 };
0339
0340 &uart0 {
0341 pinctrl-names = "default";
0342 pinctrl-0 = <&uart0_pb_pins>;
0343 status = "okay";
0344 };
0345
0346 &usb_otg {
0347 dr_mode = "otg";
0348 status = "okay";
0349 };
0350
0351 &usbphy {
0352 usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
0353 usb0_vbus_det-gpios = <&pio 7 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PH5 */
0354 usb0_vbus-supply = <®_usb0_vbus>;
0355 usb2_vbus-supply = <®_usb2_vbus>;
0356 status = "okay";
0357 };