sun8i-a83t-tbs-a711.dts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. /*
  2. * Copyright (C) 2017 Touchless Biometric Systems AG
  3. * Tomas Novotny <[email protected]>
  4. *
  5. * This file is dual-licensed: you can use it either under the terms
  6. * of the GPL or the X11 license, at your option. Note that this dual
  7. * licensing only applies to this file, and not this project as a
  8. * whole.
  9. *
  10. * a) This file is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This file is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * Or, alternatively,
  21. *
  22. * b) Permission is hereby granted, free of charge, to any person
  23. * obtaining a copy of this software and associated documentation
  24. * files (the "Software"), to deal in the Software without
  25. * restriction, including without limitation the rights to use,
  26. * copy, modify, merge, publish, distribute, sublicense, and/or
  27. * sell copies of the Software, and to permit persons to whom the
  28. * Software is furnished to do so, subject to the following
  29. * conditions:
  30. *
  31. * The above copyright notice and this permission notice shall be
  32. * included in all copies or substantial portions of the Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  35. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  36. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  37. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  38. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  39. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  40. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  41. * OTHER DEALINGS IN THE SOFTWARE.
  42. */
  43. /dts-v1/;
  44. #include "sun8i-a83t.dtsi"
  45. #include <dt-bindings/gpio/gpio.h>
  46. #include <dt-bindings/pwm/pwm.h>
  47. #include <dt-bindings/input/input.h>
  48. / {
  49. model = "TBS A711 Tablet";
  50. compatible = "tbs-biometrics,a711", "allwinner,sun8i-a83t";
  51. aliases {
  52. serial0 = &uart0;
  53. serial1 = &uart1;
  54. };
  55. chosen {
  56. stdout-path = "serial0:115200n8";
  57. };
  58. backlight: backlight {
  59. compatible = "pwm-backlight";
  60. pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
  61. enable-gpios = <&pio 3 29 GPIO_ACTIVE_HIGH>;
  62. power-supply = <&reg_sw>;
  63. brightness-levels = <0 1 2 4 8 16 32 64 128 255>;
  64. default-brightness-level = <9>;
  65. };
  66. panel {
  67. compatible = "tbs,a711-panel", "panel-lvds";
  68. backlight = <&backlight>;
  69. power-supply = <&reg_sw>;
  70. width-mm = <153>;
  71. height-mm = <90>;
  72. data-mapping = "vesa-24";
  73. panel-timing {
  74. /* 1024x600 @60Hz */
  75. clock-frequency = <52000000>;
  76. hactive = <1024>;
  77. vactive = <600>;
  78. hsync-len = <20>;
  79. hfront-porch = <180>;
  80. hback-porch = <160>;
  81. vfront-porch = <12>;
  82. vback-porch = <23>;
  83. vsync-len = <5>;
  84. };
  85. port {
  86. panel_input: endpoint {
  87. remote-endpoint = <&tcon0_out_lcd>;
  88. };
  89. };
  90. };
  91. reg_gps: reg-gps {
  92. compatible = "regulator-fixed";
  93. regulator-name = "gps";
  94. regulator-min-microvolt = <3000000>;
  95. regulator-max-microvolt = <3000000>;
  96. };
  97. reg_vbat: reg-vbat {
  98. compatible = "regulator-fixed";
  99. regulator-name = "vbat";
  100. regulator-min-microvolt = <3700000>;
  101. regulator-max-microvolt = <3700000>;
  102. };
  103. reg_vmain: reg-vmain {
  104. compatible = "regulator-fixed";
  105. regulator-name = "vmain";
  106. regulator-min-microvolt = <5000000>;
  107. regulator-max-microvolt = <5000000>;
  108. gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>;
  109. enable-active-high;
  110. vin-supply = <&reg_vbat>;
  111. };
  112. wifi_pwrseq: wifi_pwrseq {
  113. compatible = "mmc-pwrseq-simple";
  114. reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
  115. /*
  116. * This is actually Bluetooth's clock, but we have to
  117. * hook it up somewheere
  118. */
  119. clocks = <&ac100_rtc 1>;
  120. clock-names = "ext_clock";
  121. };
  122. };
  123. &cpu0 {
  124. cpu-supply = <&reg_dcdc2>;
  125. };
  126. &cpu100 {
  127. cpu-supply = <&reg_dcdc3>;
  128. };
  129. &de {
  130. status = "okay";
  131. };
  132. /*
  133. * An USB-2 hub is connected here, which also means we don't need to
  134. * enable the OHCI controller.
  135. */
  136. &ehci0 {
  137. status = "okay";
  138. };
  139. /*
  140. * There's a modem connected here that needs to be initialised before
  141. * being able to be enumerated.
  142. */
  143. &ehci1 {
  144. status = "okay";
  145. };
  146. &i2c0 {
  147. clock-frequency = <400000>;
  148. status = "okay";
  149. touchscreen@38 {
  150. compatible = "edt,edt-ft5206";
  151. reg = <0x38>;
  152. interrupt-parent = <&r_pio>;
  153. interrupts = <0 7 IRQ_TYPE_EDGE_FALLING>; /* PL7 */
  154. reset-gpios = <&pio 3 5 GPIO_ACTIVE_LOW>; /* PD5 */
  155. vcc-supply = <&reg_ldo_io0>;
  156. touchscreen-size-x = <1024>;
  157. touchscreen-size-y = <600>;
  158. };
  159. };
  160. &i2c1 {
  161. clock-frequency = <400000>;
  162. status = "okay";
  163. accelerometer@18 {
  164. compatible = "bosch,bma250";
  165. reg = <0x18>;
  166. interrupt-parent = <&pio>;
  167. interrupts = <7 10 IRQ_TYPE_EDGE_RISING>; /* PH10 / EINT10 */
  168. };
  169. };
  170. &mmc0 {
  171. vmmc-supply = <&reg_dcdc1>;
  172. pinctrl-names = "default";
  173. pinctrl-0 = <&mmc0_pins>;
  174. bus-width = <4>;
  175. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
  176. status = "okay";
  177. };
  178. &mmc1 {
  179. mmc-pwrseq = <&wifi_pwrseq>;
  180. bus-width = <4>;
  181. vmmc-supply = <&reg_dldo1>;
  182. vqmmc-supply = <&reg_dldo1>;
  183. non-removable;
  184. wakeup-source;
  185. keep-power-in-suspend;
  186. status = "okay";
  187. brcmf: wifi@1 {
  188. reg = <1>;
  189. compatible = "brcm,bcm4329-fmac";
  190. interrupt-parent = <&r_pio>;
  191. interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 WL_WAKE_UP */
  192. interrupt-names = "host-wake";
  193. };
  194. };
  195. &mmc2 {
  196. pinctrl-0 = <&mmc2_8bit_emmc_pins>;
  197. pinctrl-names = "default";
  198. vmmc-supply = <&reg_dcdc1>;
  199. vqmmc-supply = <&reg_dcdc1>;
  200. bus-width = <8>;
  201. non-removable;
  202. cap-mmc-hw-reset;
  203. status = "okay";
  204. };
  205. &pwm {
  206. pinctrl-names = "default";
  207. pinctrl-0 = <&pwm_pin>;
  208. status = "okay";
  209. };
  210. &r_lradc {
  211. vref-supply = <&reg_aldo2>;
  212. status = "okay";
  213. button-210 {
  214. label = "Volume Up";
  215. linux,code = <KEY_VOLUMEUP>;
  216. channel = <0>;
  217. voltage = <210000>;
  218. };
  219. button-410 {
  220. label = "Volume Down";
  221. linux,code = <KEY_VOLUMEDOWN>;
  222. channel = <0>;
  223. voltage = <410000>;
  224. };
  225. };
  226. &r_rsb {
  227. status = "okay";
  228. axp81x: pmic@3a3 {
  229. compatible = "x-powers,axp813";
  230. reg = <0x3a3>;
  231. interrupt-parent = <&r_intc>;
  232. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  233. swin-supply = <&reg_dcdc1>;
  234. x-powers,drive-vbus-en;
  235. };
  236. ac100: codec@e89 {
  237. compatible = "x-powers,ac100";
  238. reg = <0xe89>;
  239. ac100_codec: codec {
  240. compatible = "x-powers,ac100-codec";
  241. interrupt-parent = <&r_pio>;
  242. interrupts = <0 12 IRQ_TYPE_LEVEL_LOW>; /* PL12 */
  243. #clock-cells = <0>;
  244. clock-output-names = "4M_adda";
  245. };
  246. ac100_rtc: rtc {
  247. compatible = "x-powers,ac100-rtc";
  248. interrupt-parent = <&r_intc>;
  249. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  250. clocks = <&ac100_codec>;
  251. #clock-cells = <1>;
  252. clock-output-names = "cko1_rtc",
  253. "cko2_rtc",
  254. "cko3_rtc";
  255. };
  256. };
  257. };
  258. #include "axp81x.dtsi"
  259. &battery_power_supply {
  260. status = "okay";
  261. };
  262. &reg_aldo1 {
  263. regulator-min-microvolt = <1800000>;
  264. regulator-max-microvolt = <1800000>;
  265. regulator-name = "vcc-1.8";
  266. };
  267. &reg_aldo2 {
  268. regulator-min-microvolt = <1800000>;
  269. regulator-max-microvolt = <1800000>;
  270. regulator-always-on;
  271. regulator-name = "vdd-drampll";
  272. };
  273. &reg_aldo3 {
  274. regulator-min-microvolt = <3000000>;
  275. regulator-max-microvolt = <3000000>;
  276. regulator-always-on;
  277. regulator-name = "avcc";
  278. };
  279. &reg_dcdc1 {
  280. regulator-min-microvolt = <3100000>;
  281. regulator-max-microvolt = <3100000>;
  282. regulator-always-on;
  283. regulator-name = "vcc-io";
  284. };
  285. &reg_dcdc2 {
  286. regulator-min-microvolt = <700000>;
  287. regulator-max-microvolt = <1100000>;
  288. regulator-always-on;
  289. regulator-name = "vdd-cpu-A";
  290. };
  291. &reg_dcdc3 {
  292. regulator-min-microvolt = <700000>;
  293. regulator-max-microvolt = <1100000>;
  294. regulator-always-on;
  295. regulator-name = "vdd-cpu-B";
  296. };
  297. &reg_dcdc4 {
  298. regulator-min-microvolt = <700000>;
  299. regulator-max-microvolt = <1100000>;
  300. regulator-name = "vdd-gpu";
  301. };
  302. &reg_dcdc5 {
  303. regulator-min-microvolt = <1200000>;
  304. regulator-max-microvolt = <1500000>;
  305. regulator-always-on;
  306. regulator-name = "vcc-dram";
  307. };
  308. &reg_dcdc6 {
  309. regulator-min-microvolt = <900000>;
  310. regulator-max-microvolt = <900000>;
  311. regulator-always-on;
  312. regulator-name = "vdd-sys";
  313. };
  314. &reg_dldo1 {
  315. regulator-min-microvolt = <3100000>;
  316. regulator-max-microvolt = <3100000>;
  317. regulator-name = "vcc-wifi-io";
  318. };
  319. &reg_dldo2 {
  320. regulator-min-microvolt = <2800000>;
  321. regulator-max-microvolt = <4200000>;
  322. regulator-name = "vcc-mipi";
  323. };
  324. &reg_dldo3 {
  325. regulator-min-microvolt = <1800000>;
  326. regulator-max-microvolt = <1800000>;
  327. regulator-name = "vdd-csi";
  328. };
  329. &reg_dldo4 {
  330. regulator-min-microvolt = <2800000>;
  331. regulator-max-microvolt = <2800000>;
  332. regulator-name = "avdd-csi";
  333. };
  334. &reg_drivevbus {
  335. regulator-name = "usb0-vbus";
  336. status = "okay";
  337. };
  338. &reg_eldo1 {
  339. regulator-min-microvolt = <1200000>;
  340. regulator-max-microvolt = <1800000>;
  341. regulator-name = "dvdd-csi-r";
  342. };
  343. &reg_eldo2 {
  344. regulator-min-microvolt = <1800000>;
  345. regulator-max-microvolt = <1800000>;
  346. regulator-name = "vcc-dsi";
  347. };
  348. &reg_eldo3 {
  349. regulator-min-microvolt = <1200000>;
  350. regulator-max-microvolt = <1800000>;
  351. regulator-name = "dvdd-csi-f";
  352. };
  353. &reg_fldo1 {
  354. regulator-min-microvolt = <1200000>;
  355. regulator-max-microvolt = <1200000>;
  356. regulator-name = "vcc-hsic";
  357. };
  358. &reg_fldo2 {
  359. regulator-min-microvolt = <700000>;
  360. regulator-max-microvolt = <1100000>;
  361. regulator-always-on;
  362. regulator-name = "vdd-cpus";
  363. };
  364. &reg_ldo_io0 {
  365. regulator-min-microvolt = <3100000>;
  366. regulator-max-microvolt = <3100000>;
  367. regulator-name = "vcc-ctp";
  368. status = "okay";
  369. };
  370. &reg_ldo_io1 {
  371. regulator-min-microvolt = <3100000>;
  372. regulator-max-microvolt = <3100000>;
  373. regulator-name = "vcc-vb";
  374. status = "okay";
  375. };
  376. &reg_sw {
  377. regulator-min-microvolt = <3100000>;
  378. regulator-max-microvolt = <3100000>;
  379. regulator-name = "vcc-lcd";
  380. };
  381. &tcon0 {
  382. pinctrl-names = "default";
  383. pinctrl-0 = <&lcd_lvds_pins>;
  384. };
  385. &tcon0_out {
  386. tcon0_out_lcd: endpoint {
  387. remote-endpoint = <&panel_input>;
  388. };
  389. };
  390. &uart0 {
  391. pinctrl-names = "default";
  392. pinctrl-0 = <&uart0_pb_pins>;
  393. status = "okay";
  394. };
  395. /* There's the BT part of the AP6210 connected to that UART */
  396. &uart1 {
  397. pinctrl-names = "default";
  398. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  399. uart-has-rtscts;
  400. status = "okay";
  401. bluetooth {
  402. compatible = "brcm,bcm20702a1";
  403. clocks = <&ac100_rtc 1>;
  404. clock-names = "lpo";
  405. vbat-supply = <&reg_vbat>;
  406. vddio-supply = <&reg_dldo1>;
  407. device-wakeup-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
  408. host-wakeup-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
  409. shutdown-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
  410. max-speed = <1500000>;
  411. };
  412. };
  413. &uart2 {
  414. pinctrl-names = "default";
  415. pinctrl-0 = <&uart2_pb_pins>;
  416. status = "okay";
  417. gnss {
  418. compatible = "u-blox,neo-6m";
  419. v-bckp-supply = <&reg_rtc_ldo>;
  420. vcc-supply = <&reg_gps>;
  421. current-speed = <9600>;
  422. };
  423. };
  424. &usb_otg {
  425. status = "okay";
  426. };
  427. &usbphy {
  428. usb0_id_det-gpios = <&pio 7 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH11 */
  429. usb0_vbus_power-supply = <&usb_power_supply>;
  430. usb0_vbus-supply = <&reg_drivevbus>;
  431. usb1_vbus-supply = <&reg_vmain>;
  432. usb2_vbus-supply = <&reg_vmain>;
  433. status = "okay";
  434. };