sun4i-a10-inet9f-rev03.dts 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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. /dts-v1/;
  43. #include "sun4i-a10.dtsi"
  44. #include "sunxi-common-regulators.dtsi"
  45. #include <dt-bindings/gpio/gpio.h>
  46. #include <dt-bindings/input/input.h>
  47. #include <dt-bindings/interrupt-controller/irq.h>
  48. #include <dt-bindings/pinctrl/sun4i-a10.h>
  49. / {
  50. model = "iNet-9F Rev 03";
  51. compatible = "inet-tek,inet9f-rev03", "allwinner,sun4i-a10";
  52. aliases {
  53. serial0 = &uart0;
  54. };
  55. chosen {
  56. stdout-path = "serial0:115200n8";
  57. };
  58. gpio_keys {
  59. compatible = "gpio-keys-polled";
  60. pinctrl-names = "default";
  61. pinctrl-0 = <&key_pins_inet9f>;
  62. #address-cells = <1>;
  63. #size-cells = <0>;
  64. poll-interval = <20>;
  65. button@0 {
  66. label = "Left Joystick Left";
  67. linux,code = <ABS_X>;
  68. linux,input-type = <EV_ABS>;
  69. linux,input-value = <0xffffffff>; /* -1 */
  70. gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */
  71. };
  72. button@1 {
  73. label = "Left Joystick Right";
  74. linux,code = <ABS_X>;
  75. linux,input-type = <EV_ABS>;
  76. linux,input-value = <1>;
  77. gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */
  78. };
  79. button@2 {
  80. label = "Left Joystick Up";
  81. linux,code = <ABS_Y>;
  82. linux,input-type = <EV_ABS>;
  83. linux,input-value = <0xffffffff>; /* -1 */
  84. gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
  85. };
  86. button@3 {
  87. label = "Left Joystick Down";
  88. linux,code = <ABS_Y>;
  89. linux,input-type = <EV_ABS>;
  90. linux,input-value = <1>;
  91. gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
  92. };
  93. button@4 {
  94. label = "Right Joystick Left";
  95. linux,code = <ABS_Z>;
  96. linux,input-type = <EV_ABS>;
  97. linux,input-value = <0xffffffff>; /* -1 */
  98. gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */
  99. };
  100. button@5 {
  101. label = "Right Joystick Right";
  102. linux,code = <ABS_Z>;
  103. linux,input-type = <EV_ABS>;
  104. linux,input-value = <1>;
  105. gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */
  106. };
  107. button@6 {
  108. label = "Right Joystick Up";
  109. linux,code = <ABS_RZ>;
  110. linux,input-type = <EV_ABS>;
  111. linux,input-value = <0xffffffff>; /* -1 */
  112. gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */
  113. };
  114. button@7 {
  115. label = "Right Joystick Down";
  116. linux,code = <ABS_RZ>;
  117. linux,input-type = <EV_ABS>;
  118. linux,input-value = <1>;
  119. gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
  120. };
  121. button@8 {
  122. label = "DPad Left";
  123. linux,code = <ABS_HAT0X>;
  124. linux,input-type = <EV_ABS>;
  125. linux,input-value = <0xffffffff>; /* -1 */
  126. gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */
  127. };
  128. button@9 {
  129. label = "DPad Right";
  130. linux,code = <ABS_HAT0X>;
  131. linux,input-type = <EV_ABS>;
  132. linux,input-value = <1>;
  133. gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
  134. };
  135. button@10 {
  136. label = "DPad Up";
  137. linux,code = <ABS_HAT0Y>;
  138. linux,input-type = <EV_ABS>;
  139. linux,input-value = <0xffffffff>; /* -1 */
  140. gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
  141. };
  142. button@11 {
  143. label = "DPad Down";
  144. linux,code = <ABS_HAT0Y>;
  145. linux,input-type = <EV_ABS>;
  146. linux,input-value = <1>;
  147. gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */
  148. };
  149. button@12 {
  150. label = "Button X";
  151. linux,code = <BTN_X>;
  152. gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */
  153. };
  154. button@13 {
  155. label = "Button Y";
  156. linux,code = <BTN_Y>;
  157. gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */
  158. };
  159. button@14 {
  160. label = "Button A";
  161. linux,code = <BTN_A>;
  162. gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
  163. };
  164. button@15 {
  165. label = "Button B";
  166. linux,code = <BTN_B>;
  167. gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */
  168. };
  169. button@16 {
  170. label = "Select Button";
  171. linux,code = <BTN_SELECT>;
  172. gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */
  173. };
  174. button@17 {
  175. label = "Start Button";
  176. linux,code = <BTN_START>;
  177. gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */
  178. };
  179. button@18 {
  180. label = "Top Left Button";
  181. linux,code = <BTN_TL>;
  182. gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
  183. };
  184. button@19 {
  185. label = "Top Right Button";
  186. linux,code = <BTN_TR>;
  187. gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */
  188. };
  189. };
  190. };
  191. &cpu0 {
  192. cpu-supply = <&reg_dcdc2>;
  193. };
  194. &ehci1 {
  195. status = "okay";
  196. };
  197. &i2c0 {
  198. pinctrl-names = "default";
  199. pinctrl-0 = <&i2c0_pins_a>;
  200. status = "okay";
  201. axp209: pmic@34 {
  202. reg = <0x34>;
  203. interrupts = <0>;
  204. };
  205. };
  206. #include "axp209.dtsi"
  207. &i2c1 {
  208. pinctrl-names = "default";
  209. pinctrl-0 = <&i2c1_pins_a>;
  210. status = "okay";
  211. /* Accelerometer */
  212. bma250@18 {
  213. compatible = "bosch,bma250";
  214. reg = <0x18>;
  215. interrupt-parent = <&pio>;
  216. interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
  217. };
  218. };
  219. &i2c2 {
  220. pinctrl-names = "default";
  221. pinctrl-0 = <&i2c2_pins_a>;
  222. status = "okay";
  223. ft5406ee8: touchscreen@38 {
  224. compatible = "edt,edt-ft5406";
  225. reg = <0x38>;
  226. interrupt-parent = <&pio>;
  227. interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
  228. touchscreen-size-x = <800>;
  229. touchscreen-size-y = <480>;
  230. };
  231. };
  232. &lradc {
  233. vref-supply = <&reg_ldo2>;
  234. status = "okay";
  235. button@200 {
  236. label = "Menu";
  237. linux,code = <KEY_MENU>;
  238. channel = <0>;
  239. voltage = <200000>;
  240. };
  241. button@600 {
  242. label = "Volume Up";
  243. linux,code = <KEY_VOLUMEUP>;
  244. channel = <0>;
  245. voltage = <600000>;
  246. };
  247. button@800 {
  248. label = "Volume Down";
  249. linux,code = <KEY_VOLUMEDOWN>;
  250. channel = <0>;
  251. voltage = <800000>;
  252. };
  253. button@1000 {
  254. label = "Home";
  255. linux,code = <KEY_HOMEPAGE>;
  256. channel = <0>;
  257. voltage = <1000000>;
  258. };
  259. button@1200 {
  260. label = "Esc";
  261. linux,code = <KEY_ESC>;
  262. channel = <0>;
  263. voltage = <1200000>;
  264. };
  265. };
  266. &mmc0 {
  267. pinctrl-names = "default";
  268. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  269. vmmc-supply = <&reg_vcc3v3>;
  270. bus-width = <4>;
  271. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  272. cd-inverted;
  273. status = "okay";
  274. };
  275. &otg_sram {
  276. status = "okay";
  277. };
  278. &pio {
  279. key_pins_inet9f: key_pins@0 {
  280. allwinner,pins = "PA0", "PA1", "PA3", "PA4",
  281. "PA5", "PA6", "PA8", "PA9",
  282. "PA11", "PA12", "PA13",
  283. "PA14", "PA15", "PA16", "PA17",
  284. "PH22", "PH23", "PH24", "PH25", "PH26";
  285. allwinner,function = "gpio_in";
  286. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  287. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  288. };
  289. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  290. allwinner,pins = "PH4";
  291. allwinner,function = "gpio_in";
  292. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  293. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  294. };
  295. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  296. allwinner,pins = "PH5";
  297. allwinner,function = "gpio_in";
  298. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  299. allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
  300. };
  301. };
  302. &reg_dcdc2 {
  303. regulator-always-on;
  304. regulator-min-microvolt = <1000000>;
  305. regulator-max-microvolt = <1400000>;
  306. regulator-name = "vdd-cpu";
  307. };
  308. &reg_dcdc3 {
  309. regulator-always-on;
  310. regulator-min-microvolt = <1250000>;
  311. regulator-max-microvolt = <1250000>;
  312. regulator-name = "vdd-int-dll";
  313. };
  314. &reg_ldo1 {
  315. regulator-name = "vdd-rtc";
  316. };
  317. &reg_ldo2 {
  318. regulator-always-on;
  319. regulator-min-microvolt = <3000000>;
  320. regulator-max-microvolt = <3000000>;
  321. regulator-name = "avcc";
  322. };
  323. &reg_usb0_vbus {
  324. status = "okay";
  325. };
  326. &reg_usb2_vbus {
  327. status = "okay";
  328. };
  329. &uart0 {
  330. pinctrl-names = "default";
  331. pinctrl-0 = <&uart0_pins_a>;
  332. status = "okay";
  333. };
  334. &usb_otg {
  335. dr_mode = "otg";
  336. status = "okay";
  337. };
  338. &usbphy {
  339. pinctrl-names = "default";
  340. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  341. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  342. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  343. usb0_vbus-supply = <&reg_usb0_vbus>;
  344. usb2_vbus-supply = <&reg_usb2_vbus>;
  345. status = "okay";
  346. };