sun4i-a10-inet9f-rev03.dts 8.4 KB

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