sun8i-reference-design-tablet.dtsi 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. #include "sunxi-reference-design-tablet.dtsi"
  43. #include <dt-bindings/pwm/pwm.h>
  44. / {
  45. aliases {
  46. serial0 = &r_uart;
  47. };
  48. backlight: backlight {
  49. compatible = "pwm-backlight";
  50. pinctrl-names = "default";
  51. pinctrl-0 = <&bl_en_pin>;
  52. pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
  53. brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
  54. default-brightness-level = <8>;
  55. enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
  56. };
  57. chosen {
  58. stdout-path = "serial0:115200n8";
  59. };
  60. };
  61. &i2c0 {
  62. /*
  63. * The gsl1680 is rated at 400KHz and it will not work reliable at
  64. * 100KHz, this has been confirmed on multiple different q8 tablets.
  65. * The gsl1680 is the only device on this bus.
  66. */
  67. clock-frequency = <400000>;
  68. gsl1680: touchscreen@40 {
  69. compatible = "silead,gsl1680";
  70. reg = <0x40>;
  71. interrupt-parent = <&pio>;
  72. interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5 */
  73. pinctrl-names = "default";
  74. pinctrl-0 = <&ts_power_pin>;
  75. power-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
  76. /* Most tablets use this touchscreen, but not all */
  77. status = "disabled";
  78. };
  79. };
  80. &mmc0 {
  81. pinctrl-names = "default";
  82. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
  83. vmmc-supply = <&reg_dcdc1>;
  84. bus-width = <4>;
  85. cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
  86. cd-inverted;
  87. status = "okay";
  88. };
  89. &pio {
  90. bl_en_pin: bl_en_pin@0 {
  91. allwinner,pins = "PH6";
  92. allwinner,function = "gpio_in";
  93. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  94. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  95. };
  96. mmc0_cd_pin: mmc0_cd_pin@0 {
  97. allwinner,pins = "PB4";
  98. allwinner,function = "gpio_in";
  99. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  100. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  101. };
  102. ts_power_pin: ts_power_pin@0 {
  103. allwinner,pins = "PH1";
  104. allwinner,function = "gpio_out";
  105. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  106. allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
  107. };
  108. usb0_id_detect_pin: usb0_id_detect_pin@0 {
  109. allwinner,pins = "PH8";
  110. allwinner,function = "gpio_in";
  111. allwinner,drive = <SUN4I_PINCTRL_10_MA>;
  112. allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
  113. };
  114. };
  115. &r_rsb {
  116. status = "okay";
  117. axp22x: pmic@3a3 {
  118. compatible = "x-powers,axp223";
  119. reg = <0x3a3>;
  120. interrupt-parent = <&nmi_intc>;
  121. interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
  122. eldoin-supply = <&reg_dcdc1>;
  123. drivevbus-supply = <&reg_vcc5v0>;
  124. x-powers,drive-vbus-en;
  125. };
  126. };
  127. #include "axp22x.dtsi"
  128. &reg_aldo1 {
  129. regulator-always-on;
  130. regulator-min-microvolt = <3000000>;
  131. regulator-max-microvolt = <3000000>;
  132. regulator-name = "vcc-io";
  133. };
  134. &reg_aldo2 {
  135. regulator-always-on;
  136. regulator-min-microvolt = <2350000>;
  137. regulator-max-microvolt = <2650000>;
  138. regulator-name = "vdd-dll";
  139. };
  140. &reg_aldo3 {
  141. regulator-always-on;
  142. regulator-min-microvolt = <2700000>;
  143. regulator-max-microvolt = <3300000>;
  144. regulator-name = "vcc-pll-avcc";
  145. };
  146. &reg_dc1sw {
  147. regulator-name = "vcc-lcd";
  148. };
  149. &reg_dc5ldo {
  150. regulator-always-on;
  151. regulator-min-microvolt = <900000>;
  152. regulator-max-microvolt = <1400000>;
  153. regulator-name = "vdd-cpus";
  154. };
  155. &reg_dcdc1 {
  156. regulator-always-on;
  157. regulator-min-microvolt = <3000000>;
  158. regulator-max-microvolt = <3000000>;
  159. regulator-name = "vcc-3v0";
  160. };
  161. &reg_dcdc2 {
  162. regulator-always-on;
  163. regulator-min-microvolt = <900000>;
  164. regulator-max-microvolt = <1400000>;
  165. regulator-name = "vdd-sys";
  166. };
  167. &reg_dcdc3 {
  168. regulator-always-on;
  169. regulator-min-microvolt = <900000>;
  170. regulator-max-microvolt = <1400000>;
  171. regulator-name = "vdd-cpu";
  172. };
  173. &reg_dcdc5 {
  174. regulator-always-on;
  175. regulator-min-microvolt = <1500000>;
  176. regulator-max-microvolt = <1500000>;
  177. regulator-name = "vcc-dram";
  178. };
  179. &reg_dldo1 {
  180. regulator-min-microvolt = <3300000>;
  181. regulator-max-microvolt = <3300000>;
  182. regulator-name = "vcc-wifi";
  183. };
  184. &reg_drivevbus {
  185. regulator-name = "usb0-vbus";
  186. status = "okay";
  187. };
  188. &reg_rtc_ldo {
  189. regulator-name = "vcc-rtc";
  190. };
  191. &r_uart {
  192. pinctrl-names = "default";
  193. pinctrl-0 = <&r_uart_pins_a>;
  194. status = "okay";
  195. };
  196. &simplefb_lcd {
  197. vcc-lcd-supply = <&reg_dc1sw>;
  198. };
  199. &usb_otg {
  200. dr_mode = "otg";
  201. status = "okay";
  202. };
  203. &usb_power_supply {
  204. status = "okay";
  205. };
  206. &usbphy {
  207. pinctrl-names = "default";
  208. pinctrl-0 = <&usb0_id_detect_pin>;
  209. usb0_id_det-gpio = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
  210. usb0_vbus_power-supply = <&usb_power_supply>;
  211. usb0_vbus-supply = <&reg_drivevbus>;
  212. status = "okay";
  213. };