sun4i-a10-pov-protab2-ips9.dts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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 = "Point of View Protab2-IPS9";
  52. compatible = "pov,protab2-ips9", "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_protab>;
  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. pinctrl-names = "default";
  71. pinctrl-0 = <&codec_pa_pin>;
  72. allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
  73. status = "okay";
  74. };
  75. &cpu0 {
  76. cpu-supply = <&reg_dcdc2>;
  77. };
  78. &ehci0 {
  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. pixcir_ts@5c {
  108. pinctrl-names = "default";
  109. pinctrl-0 = <&touchscreen_pins>;
  110. compatible = "pixcir,pixcir_tangoc";
  111. reg = <0x5c>;
  112. interrupt-parent = <&pio>;
  113. interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */
  114. attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
  115. enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>;
  116. wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>;
  117. touchscreen-size-x = <1024>;
  118. touchscreen-size-y = <768>;
  119. touchscreen-inverted-x;
  120. touchscreen-inverted-y;
  121. };
  122. };
  123. &lradc {
  124. vref-supply = <&reg_ldo2>;
  125. status = "okay";
  126. button@400 {
  127. label = "Volume Up";
  128. linux,code = <KEY_VOLUMEUP>;
  129. channel = <0>;
  130. voltage = <400000>;
  131. };
  132. button@800 {
  133. label = "Volume Down";
  134. linux,code = <KEY_VOLUMEDOWN>;
  135. channel = <0>;
  136. voltage = <800000>;
  137. };
  138. };
  139. &mmc0 {
  140. pinctrl-names = "default";
  141. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  142. vmmc-supply = <&reg_vcc3v3>;
  143. bus-width = <4>;
  144. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  145. cd-inverted;
  146. status = "okay";
  147. };
  148. &otg_sram {
  149. status = "okay";
  150. };
  151. &pio {
  152. bl_en_pin_protab: bl_en_pin@0 {
  153. allwinner,pins = "PH7";
  154. allwinner,function = "gpio_out";
  155. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  156. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  157. };
  158. codec_pa_pin: codec_pa_pin@0 {
  159. allwinner,pins = "PH15";
  160. allwinner,function = "gpio_out";
  161. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  162. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  163. };
  164. touchscreen_pins: touchscreen_pins@0 {
  165. allwinner,pins = "PA5", "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_ldo3 {
  210. /*
  211. * We need to always power the camera sensor, otherwhise all access
  212. * to i2c1 is blocked.
  213. */
  214. regulator-always-on;
  215. regulator-min-microvolt = <2800000>;
  216. regulator-max-microvolt = <2800000>;
  217. regulator-name = "vdd-csi";
  218. };
  219. &reg_usb0_vbus {
  220. status = "okay";
  221. };
  222. &reg_usb1_vbus {
  223. status = "okay";
  224. };
  225. &uart0 {
  226. pinctrl-names = "default";
  227. pinctrl-0 = <&uart0_pins_a>;
  228. status = "okay";
  229. };
  230. &usb_otg {
  231. dr_mode = "otg";
  232. status = "okay";
  233. };
  234. &usbphy {
  235. pinctrl-names = "default";
  236. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  237. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  238. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  239. usb0_vbus-supply = <&reg_usb0_vbus>;
  240. usb1_vbus-supply = <&reg_usb1_vbus>;
  241. status = "okay";
  242. };