sun4i-a10-dserve-dsrv9703c.dts 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /*
  2. * Copyright 2016 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 = "Dserve DSRV9703C";
  52. compatible = "dserve,dsrv9703c", "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_dsrv9703c>;
  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. haptics {
  69. compatible = "regulator-haptic";
  70. haptic-supply = <&reg_motor>;
  71. min-microvolt = <3000000>;
  72. max-microvolt = <3000000>;
  73. };
  74. reg_motor: reg_motor {
  75. compatible = "regulator-fixed";
  76. pinctrl-names = "default";
  77. pinctrl-0 = <&motor_pins>;
  78. regulator-name = "vcc-motor";
  79. regulator-min-microvolt = <3000000>;
  80. regulator-max-microvolt = <3000000>;
  81. enable-active-high;
  82. gpio = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
  83. };
  84. };
  85. &codec {
  86. pinctrl-names = "default";
  87. pinctrl-0 = <&codec_pa_pin>;
  88. allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
  89. status = "okay";
  90. };
  91. &cpu0 {
  92. cpu-supply = <&reg_dcdc2>;
  93. };
  94. &ehci1 {
  95. status = "okay";
  96. };
  97. &i2c0 {
  98. pinctrl-names = "default";
  99. pinctrl-0 = <&i2c0_pins_a>;
  100. status = "okay";
  101. axp209: pmic@34 {
  102. reg = <0x34>;
  103. interrupts = <0>;
  104. };
  105. };
  106. #include "axp209.dtsi"
  107. &i2c1 {
  108. pinctrl-names = "default";
  109. pinctrl-0 = <&i2c1_pins_a>;
  110. /* pull-ups and devices require AXP209 LDO3 */
  111. status = "failed";
  112. };
  113. &i2c2 {
  114. pinctrl-names = "default";
  115. pinctrl-0 = <&i2c2_pins_a>;
  116. status = "okay";
  117. ft5406ee8: touchscreen@38 {
  118. compatible = "edt,edt-ft5406";
  119. reg = <0x38>;
  120. interrupt-parent = <&pio>;
  121. interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
  122. pinctrl-names = "default";
  123. pinctrl-0 = <&touchscreen_pins>;
  124. reset-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>;
  125. touchscreen-size-x = <1024>;
  126. touchscreen-size-y = <768>;
  127. };
  128. };
  129. &lradc {
  130. vref-supply = <&reg_ldo2>;
  131. status = "okay";
  132. button@400 {
  133. label = "Volume Down";
  134. linux,code = <KEY_VOLUMEDOWN>;
  135. channel = <0>;
  136. voltage = <400000>;
  137. };
  138. button@800 {
  139. label = "Volume Up";
  140. linux,code = <KEY_VOLUMEUP>;
  141. channel = <0>;
  142. voltage = <800000>;
  143. };
  144. };
  145. &mmc0 {
  146. pinctrl-names = "default";
  147. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
  148. vmmc-supply = <&reg_vcc3v3>;
  149. bus-width = <4>;
  150. cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  151. cd-inverted;
  152. status = "okay";
  153. };
  154. &otg_sram {
  155. status = "okay";
  156. };
  157. &pio {
  158. bl_en_pin_dsrv9703c: 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. codec_pa_pin: codec_pa_pin@0 {
  165. allwinner,pins = "PH15";
  166. allwinner,function = "gpio_out";
  167. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  168. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  169. };
  170. motor_pins: motor_pins@0 {
  171. allwinner,pins = "PB3";
  172. allwinner,function = "gpio_out";
  173. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  174. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  175. };
  176. touchscreen_pins: touchscreen_pins@0 {
  177. allwinner,pins = "PB13";
  178. allwinner,function = "gpio_out";
  179. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  180. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  181. };
  182. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  183. allwinner,pins = "PH4";
  184. allwinner,function = "gpio_in";
  185. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  186. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  187. };
  188. usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
  189. allwinner,pins = "PH5";
  190. allwinner,function = "gpio_in";
  191. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  192. allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
  193. };
  194. };
  195. &pwm {
  196. pinctrl-names = "default";
  197. pinctrl-0 = <&pwm0_pins_a>;
  198. status = "okay";
  199. };
  200. &reg_dcdc2 {
  201. regulator-always-on;
  202. regulator-min-microvolt = <1000000>;
  203. regulator-max-microvolt = <1400000>;
  204. regulator-name = "vdd-cpu";
  205. };
  206. &reg_dcdc3 {
  207. regulator-always-on;
  208. regulator-min-microvolt = <1250000>;
  209. regulator-max-microvolt = <1250000>;
  210. regulator-name = "vdd-int-dll";
  211. };
  212. &reg_ldo1 {
  213. regulator-name = "vdd-rtc";
  214. };
  215. &reg_ldo2 {
  216. regulator-always-on;
  217. regulator-min-microvolt = <3000000>;
  218. regulator-max-microvolt = <3000000>;
  219. regulator-name = "avcc";
  220. };
  221. &reg_usb0_vbus {
  222. status = "okay";
  223. };
  224. &reg_usb2_vbus {
  225. status = "okay";
  226. };
  227. &uart0 {
  228. pinctrl-names = "default";
  229. pinctrl-0 = <&uart0_pins_a>;
  230. status = "okay";
  231. };
  232. &usb_otg {
  233. dr_mode = "otg";
  234. status = "okay";
  235. };
  236. &usbphy {
  237. pinctrl-names = "default";
  238. pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
  239. usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  240. usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  241. usb0_vbus-supply = <&reg_usb0_vbus>;
  242. usb2_vbus-supply = <&reg_usb2_vbus>;
  243. status = "okay";
  244. };