sun4i-a10-inet1.dts 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. #include <dt-bindings/pwm/pwm.h>
  50. / {
  51. model = "iNet-1";
  52. compatible = "inet-tek,inet1", "allwinner,sun4i-a10";
  53. aliases {
  54. serial0 = &uart0;
  55. };
  56. backlight: backlight {
  57. compatible = "pwm-backlight";
  58. pinctrl-names = "default";
  59. pinctrl-0 = <&bl_en_pin_inet>;
  60. pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
  61. brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
  62. default-brightness-level = <8>;
  63. enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */
  64. };
  65. chosen {
  66. stdout-path = "serial0:115200n8";
  67. };
  68. };
  69. &codec {
  70. status = "okay";
  71. };
  72. &cpu0 {
  73. cpu-supply = <&reg_dcdc2>;
  74. };
  75. &ehci0 {
  76. status = "okay";
  77. };
  78. &ehci1 {
  79. status = "okay";
  80. };
  81. &i2c0 {
  82. pinctrl-names = "default";
  83. pinctrl-0 = <&i2c0_pins_a>;
  84. status = "okay";
  85. axp209: pmic@34 {
  86. reg = <0x34>;
  87. interrupts = <0>;
  88. };
  89. };
  90. #include "axp209.dtsi"
  91. &i2c1 {
  92. pinctrl-names = "default";
  93. pinctrl-0 = <&i2c1_pins_a>;
  94. status = "okay";
  95. /* Accelerometer */
  96. bma250@18 {
  97. compatible = "bosch,bma250";
  98. reg = <0x18>;
  99. interrupt-parent = <&pio>;
  100. interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
  101. };
  102. };
  103. &i2c2 {
  104. pinctrl-names = "default";
  105. pinctrl-0 = <&i2c2_pins_a>;
  106. status = "okay";
  107. ft5x: touchscreen@38 {
  108. compatible = "edt,edt-ft5406";
  109. reg = <0x38>;
  110. interrupt-parent = <&pio>;
  111. interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
  112. pinctrl-names = "default";
  113. pinctrl-0 = <&touchscreen_wake_pin>;
  114. wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */
  115. touchscreen-size-x = <600>;
  116. touchscreen-size-y = <1024>;
  117. touchscreen-swapped-x-y;
  118. };
  119. };
  120. &lradc {
  121. vref-supply = <&reg_ldo2>;
  122. status = "okay";
  123. button@200 {
  124. label = "Volume Up";
  125. linux,code = <KEY_VOLUMEUP>;
  126. channel = <0>;
  127. voltage = <200000>;
  128. };
  129. button@1000 {
  130. label = "Volume Down";
  131. linux,code = <KEY_VOLUMEDOWN>;
  132. channel = <0>;
  133. voltage = <1000000>;
  134. };
  135. button@1200 {
  136. label = "Home";
  137. linux,code = <KEY_HOMEPAGE>;
  138. channel = <0>;
  139. voltage = <1200000>;
  140. };
  141. };
  142. &mmc0 {
  143. pinctrl-names = "default";
  144. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  145. vmmc-supply = <&reg_vcc3v3>;
  146. bus-width = <4>;
  147. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  148. cd-inverted;
  149. status = "okay";
  150. };
  151. &ohci0 {
  152. status = "okay";
  153. };
  154. &otg_sram {
  155. status = "okay";
  156. };
  157. &pio {
  158. bl_en_pin_inet: bl_en_pin@0 {
  159. allwinner,pins = "PH7";
  160. allwinner,function = "gpio_out";
  161. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  162. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  163. };
  164. touchscreen_wake_pin: touchscreen_wake_pin@0 {
  165. allwinner,pins = "PB13";
  166. allwinner,function = "gpio_out";
  167. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  168. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  169. };
  170. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  171. allwinner,pins = "PH4";
  172. allwinner,function = "gpio_in";
  173. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  174. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  175. };
  176. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  177. allwinner,pins = "PH5";
  178. allwinner,function = "gpio_in";
  179. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  180. allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
  181. };
  182. };
  183. &pwm {
  184. pinctrl-names = "default";
  185. pinctrl-0 = <&pwm0_pins_a>;
  186. status = "okay";
  187. };
  188. &reg_dcdc2 {
  189. regulator-always-on;
  190. regulator-min-microvolt = <1000000>;
  191. regulator-max-microvolt = <1400000>;
  192. regulator-name = "vdd-cpu";
  193. };
  194. &reg_dcdc3 {
  195. regulator-always-on;
  196. regulator-min-microvolt = <1250000>;
  197. regulator-max-microvolt = <1250000>;
  198. regulator-name = "vdd-int-dll";
  199. };
  200. &reg_ldo1 {
  201. regulator-name = "vdd-rtc";
  202. };
  203. &reg_ldo2 {
  204. regulator-always-on;
  205. regulator-min-microvolt = <3000000>;
  206. regulator-max-microvolt = <3000000>;
  207. regulator-name = "avcc";
  208. };
  209. &reg_usb0_vbus {
  210. status = "okay";
  211. };
  212. &reg_usb1_vbus {
  213. status = "okay";
  214. };
  215. &reg_usb2_vbus {
  216. status = "okay";
  217. };
  218. &uart0 {
  219. pinctrl-names = "default";
  220. pinctrl-0 = <&uart0_pins_a>;
  221. status = "okay";
  222. };
  223. &usb_otg {
  224. dr_mode = "otg";
  225. status = "okay";
  226. };
  227. &usbphy {
  228. pinctrl-names = "default";
  229. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  230. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  231. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  232. usb0_vbus-supply = <&reg_usb0_vbus>;
  233. usb1_vbus-supply = <&reg_usb1_vbus>;
  234. usb2_vbus-supply = <&reg_usb2_vbus>;
  235. status = "okay";
  236. };