sun50i-a64-pinephone.dtsi 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. // Copyright (C) 2019 Icenowy Zheng <[email protected]>
  3. // Copyright (C) 2020 Martijn Braam <[email protected]>
  4. // Copyright (C) 2020 Ondrej Jirman <[email protected]>
  5. #include "sun50i-a64.dtsi"
  6. #include "sun50i-a64-cpu-opp.dtsi"
  7. #include <dt-bindings/gpio/gpio.h>
  8. #include <dt-bindings/input/input.h>
  9. #include <dt-bindings/leds/common.h>
  10. #include <dt-bindings/pwm/pwm.h>
  11. / {
  12. chassis-type = "handset";
  13. aliases {
  14. ethernet0 = &rtl8723cs;
  15. serial0 = &uart0;
  16. };
  17. backlight: backlight {
  18. compatible = "pwm-backlight";
  19. pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
  20. enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
  21. power-supply = <&reg_ps>;
  22. /* Backlight configuration differs per PinePhone revision. */
  23. };
  24. bt_sco_codec: bt-sco-codec {
  25. #sound-dai-cells = <1>;
  26. compatible = "linux,bt-sco";
  27. };
  28. chosen {
  29. stdout-path = "serial0:115200n8";
  30. };
  31. leds {
  32. compatible = "gpio-leds";
  33. led-0 {
  34. function = LED_FUNCTION_INDICATOR;
  35. color = <LED_COLOR_ID_BLUE>;
  36. gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
  37. };
  38. led-1 {
  39. function = LED_FUNCTION_INDICATOR;
  40. color = <LED_COLOR_ID_GREEN>;
  41. gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
  42. };
  43. led-2 {
  44. function = LED_FUNCTION_INDICATOR;
  45. color = <LED_COLOR_ID_RED>;
  46. gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
  47. };
  48. };
  49. reg_ps: ps-regulator {
  50. compatible = "regulator-fixed";
  51. regulator-name = "ps";
  52. regulator-min-microvolt = <5000000>;
  53. regulator-max-microvolt = <5000000>;
  54. regulator-boot-on;
  55. };
  56. reg_vbat_wifi: vbat-wifi {
  57. compatible = "regulator-fixed";
  58. regulator-min-microvolt = <3300000>;
  59. regulator-max-microvolt = <3300000>;
  60. regulator-name = "vbat-wifi";
  61. };
  62. sgm3140: led-controller {
  63. compatible = "sgmicro,sgm3140";
  64. vin-supply = <&reg_dcdc1>;
  65. sgm3140_flash: led {
  66. function = LED_FUNCTION_FLASH;
  67. color = <LED_COLOR_ID_WHITE>;
  68. flash-max-timeout-us = <250000>;
  69. };
  70. };
  71. speaker_amp: audio-amplifier {
  72. compatible = "simple-audio-amplifier";
  73. enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
  74. sound-name-prefix = "Speaker Amp";
  75. };
  76. vibrator {
  77. compatible = "gpio-vibrator";
  78. enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
  79. vcc-supply = <&reg_dcdc1>;
  80. };
  81. };
  82. &codec {
  83. pinctrl-names = "default";
  84. pinctrl-0 = <&aif3_pins>;
  85. status = "okay";
  86. };
  87. &codec_analog {
  88. cpvdd-supply = <&reg_eldo1>;
  89. status = "okay";
  90. };
  91. &cpu0 {
  92. cpu-supply = <&reg_dcdc2>;
  93. };
  94. &cpu1 {
  95. cpu-supply = <&reg_dcdc2>;
  96. };
  97. &cpu2 {
  98. cpu-supply = <&reg_dcdc2>;
  99. };
  100. &cpu3 {
  101. cpu-supply = <&reg_dcdc2>;
  102. };
  103. &dai {
  104. status = "okay";
  105. };
  106. &de {
  107. status = "okay";
  108. };
  109. &dphy {
  110. status = "okay";
  111. };
  112. &dsi {
  113. vcc-dsi-supply = <&reg_dldo1>;
  114. status = "okay";
  115. panel@0 {
  116. compatible = "xingbangda,xbd599";
  117. reg = <0>;
  118. reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
  119. iovcc-supply = <&reg_dldo2>;
  120. vcc-supply = <&reg_ldo_io0>;
  121. backlight = <&backlight>;
  122. };
  123. };
  124. &ehci0 {
  125. status = "okay";
  126. };
  127. &ehci1 {
  128. status = "okay";
  129. };
  130. &i2c0 {
  131. status = "okay";
  132. touchscreen@5d {
  133. compatible = "goodix,gt917s";
  134. reg = <0x5d>;
  135. interrupt-parent = <&pio>;
  136. interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
  137. irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
  138. reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
  139. AVDD28-supply = <&reg_ldo_io0>;
  140. VDDIO-supply = <&reg_ldo_io0>;
  141. touchscreen-size-x = <720>;
  142. touchscreen-size-y = <1440>;
  143. };
  144. };
  145. &i2c1 {
  146. status = "okay";
  147. /* Magnetometer */
  148. lis3mdl: magnetometer@1e {
  149. compatible = "st,lis3mdl-magn";
  150. reg = <0x1e>;
  151. vdd-supply = <&reg_dldo1>;
  152. vddio-supply = <&reg_dldo1>;
  153. };
  154. /* Light/proximity sensor */
  155. light-sensor@48 {
  156. compatible = "sensortek,stk3311";
  157. reg = <0x48>;
  158. interrupt-parent = <&pio>;
  159. interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
  160. };
  161. /* Accelerometer/gyroscope */
  162. accelerometer@68 {
  163. compatible = "invensense,mpu6050";
  164. reg = <0x68>;
  165. interrupt-parent = <&pio>;
  166. interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
  167. vdd-supply = <&reg_dldo1>;
  168. vddio-supply = <&reg_dldo1>;
  169. };
  170. };
  171. /* Connected to pogo pins (external spring based pinheader for user addons) */
  172. &i2c2 {
  173. status = "okay";
  174. };
  175. &lradc {
  176. vref-supply = <&reg_aldo3>;
  177. wakeup-source;
  178. status = "okay";
  179. button-200 {
  180. label = "Volume Up";
  181. linux,code = <KEY_VOLUMEUP>;
  182. channel = <0>;
  183. voltage = <200000>;
  184. };
  185. button-400 {
  186. label = "Volume Down";
  187. linux,code = <KEY_VOLUMEDOWN>;
  188. channel = <0>;
  189. voltage = <400000>;
  190. };
  191. };
  192. &mmc0 {
  193. pinctrl-names = "default";
  194. pinctrl-0 = <&mmc0_pins>;
  195. vmmc-supply = <&reg_dcdc1>;
  196. vqmmc-supply = <&reg_dcdc1>;
  197. cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
  198. disable-wp;
  199. bus-width = <4>;
  200. status = "okay";
  201. };
  202. &mmc1 {
  203. pinctrl-names = "default";
  204. pinctrl-0 = <&mmc1_pins>;
  205. vmmc-supply = <&reg_vbat_wifi>;
  206. vqmmc-supply = <&reg_dldo4>;
  207. bus-width = <4>;
  208. non-removable;
  209. status = "okay";
  210. rtl8723cs: wifi@1 {
  211. reg = <1>;
  212. };
  213. };
  214. &mmc2 {
  215. pinctrl-names = "default";
  216. pinctrl-0 = <&mmc2_pins>;
  217. vmmc-supply = <&reg_dcdc1>;
  218. vqmmc-supply = <&reg_dcdc1>;
  219. bus-width = <8>;
  220. non-removable;
  221. cap-mmc-hw-reset;
  222. status = "okay";
  223. };
  224. &ohci0 {
  225. status = "okay";
  226. };
  227. &ohci1 {
  228. status = "okay";
  229. };
  230. &pio {
  231. vcc-pb-supply = <&reg_dcdc1>;
  232. vcc-pc-supply = <&reg_dcdc1>;
  233. vcc-pd-supply = <&reg_dcdc1>;
  234. vcc-pe-supply = <&reg_aldo1>;
  235. vcc-pf-supply = <&reg_dcdc1>;
  236. vcc-pg-supply = <&reg_dldo4>;
  237. vcc-ph-supply = <&reg_dcdc1>;
  238. };
  239. &r_pio {
  240. /*
  241. * FIXME: We can't add that supply for now since it would
  242. * create a circular dependency between pinctrl, the regulator
  243. * and the RSB Bus.
  244. *
  245. * vcc-pl-supply = <&reg_aldo2>;
  246. */
  247. };
  248. &r_pwm {
  249. status = "okay";
  250. };
  251. &r_rsb {
  252. status = "okay";
  253. axp803: pmic@3a3 {
  254. compatible = "x-powers,axp803";
  255. reg = <0x3a3>;
  256. interrupt-parent = <&r_intc>;
  257. interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
  258. };
  259. };
  260. #include "axp803.dtsi"
  261. &battery_power_supply {
  262. status = "okay";
  263. };
  264. &reg_aldo1 {
  265. regulator-min-microvolt = <1800000>;
  266. regulator-max-microvolt = <1800000>;
  267. regulator-name = "dovdd-csi";
  268. };
  269. &reg_aldo2 {
  270. regulator-always-on;
  271. regulator-min-microvolt = <1800000>;
  272. regulator-max-microvolt = <1800000>;
  273. regulator-name = "vcc-pl";
  274. };
  275. &reg_aldo3 {
  276. regulator-always-on;
  277. regulator-min-microvolt = <3000000>;
  278. regulator-max-microvolt = <3000000>;
  279. regulator-name = "vcc-pll-avcc";
  280. };
  281. &reg_dcdc1 {
  282. regulator-always-on;
  283. regulator-min-microvolt = <3300000>;
  284. regulator-max-microvolt = <3300000>;
  285. regulator-name = "vcc-3v3";
  286. };
  287. &reg_dcdc2 {
  288. regulator-always-on;
  289. regulator-min-microvolt = <1000000>;
  290. regulator-max-microvolt = <1300000>;
  291. regulator-name = "vdd-cpux";
  292. };
  293. /* DCDC3 is polyphased with DCDC2 */
  294. &reg_dcdc5 {
  295. regulator-always-on;
  296. regulator-min-microvolt = <1200000>;
  297. regulator-max-microvolt = <1200000>;
  298. regulator-name = "vcc-dram";
  299. };
  300. &reg_dcdc6 {
  301. regulator-always-on;
  302. regulator-min-microvolt = <1100000>;
  303. regulator-max-microvolt = <1100000>;
  304. regulator-name = "vdd-sys";
  305. };
  306. &reg_dldo1 {
  307. regulator-min-microvolt = <3300000>;
  308. regulator-max-microvolt = <3300000>;
  309. regulator-name = "vcc-dsi-sensor";
  310. };
  311. &reg_dldo2 {
  312. regulator-min-microvolt = <1800000>;
  313. regulator-max-microvolt = <1800000>;
  314. regulator-name = "vcc-mipi-io";
  315. };
  316. &reg_dldo3 {
  317. regulator-min-microvolt = <2800000>;
  318. regulator-max-microvolt = <2800000>;
  319. regulator-name = "avdd-csi";
  320. };
  321. &reg_dldo4 {
  322. regulator-min-microvolt = <1800000>;
  323. regulator-max-microvolt = <1800000>;
  324. regulator-name = "vcc-wifi-io";
  325. };
  326. &reg_eldo1 {
  327. regulator-always-on;
  328. regulator-min-microvolt = <1800000>;
  329. regulator-max-microvolt = <1800000>;
  330. regulator-name = "vcc-lpddr";
  331. };
  332. &reg_eldo3 {
  333. regulator-min-microvolt = <1800000>;
  334. regulator-max-microvolt = <1800000>;
  335. regulator-name = "dvdd-1v8-csi";
  336. };
  337. &reg_fldo1 {
  338. regulator-min-microvolt = <1200000>;
  339. regulator-max-microvolt = <1200000>;
  340. regulator-name = "vcc-1v2-hsic";
  341. };
  342. &reg_fldo2 {
  343. regulator-always-on;
  344. regulator-min-microvolt = <1100000>;
  345. regulator-max-microvolt = <1100000>;
  346. regulator-name = "vdd-cpus";
  347. };
  348. &reg_ldo_io0 {
  349. regulator-min-microvolt = <3300000>;
  350. regulator-max-microvolt = <3300000>;
  351. regulator-name = "vcc-lcd-ctp-stk";
  352. status = "okay";
  353. };
  354. &reg_ldo_io1 {
  355. regulator-min-microvolt = <1800000>;
  356. regulator-max-microvolt = <1800000>;
  357. regulator-name = "vcc-1v8-typec";
  358. status = "okay";
  359. };
  360. &reg_rtc_ldo {
  361. regulator-name = "vcc-rtc";
  362. };
  363. &sound {
  364. status = "okay";
  365. simple-audio-card,name = "PinePhone";
  366. simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
  367. simple-audio-card,widgets = "Microphone", "Headset Microphone",
  368. "Microphone", "Internal Microphone",
  369. "Headphone", "Headphone Jack",
  370. "Speaker", "Internal Earpiece",
  371. "Speaker", "Internal Speaker";
  372. simple-audio-card,routing =
  373. "Headphone Jack", "HP",
  374. "Internal Earpiece", "EARPIECE",
  375. "Internal Speaker", "Speaker Amp OUTL",
  376. "Internal Speaker", "Speaker Amp OUTR",
  377. "Speaker Amp INL", "LINEOUT",
  378. "Speaker Amp INR", "LINEOUT",
  379. "Left DAC", "DACL",
  380. "Right DAC", "DACR",
  381. "ADCL", "Left ADC",
  382. "ADCR", "Right ADC",
  383. "Internal Microphone", "MBIAS",
  384. "MIC1", "Internal Microphone",
  385. "Headset Microphone", "HBIAS",
  386. "MIC2", "Headset Microphone";
  387. simple-audio-card,dai-link@2 {
  388. format = "dsp_a";
  389. frame-master = <&link2_codec>;
  390. bitclock-master = <&link2_codec>;
  391. bitclock-inversion;
  392. link2_cpu: cpu {
  393. sound-dai = <&bt_sco_codec 0>;
  394. };
  395. link2_codec: codec {
  396. sound-dai = <&codec 2>;
  397. dai-tdm-slot-num = <1>;
  398. dai-tdm-slot-width = <32>;
  399. };
  400. };
  401. };
  402. &uart0 {
  403. pinctrl-names = "default";
  404. pinctrl-0 = <&uart0_pb_pins>;
  405. status = "okay";
  406. };
  407. &uart1 {
  408. pinctrl-names = "default";
  409. pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
  410. status = "okay";
  411. bluetooth {
  412. compatible = "realtek,rtl8723cs-bt";
  413. device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
  414. enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
  415. host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
  416. };
  417. };
  418. /* Connected to the modem (hardware flow control can't be used) */
  419. &uart3 {
  420. pinctrl-names = "default";
  421. pinctrl-0 = <&uart3_pins>;
  422. status = "okay";
  423. };
  424. &usb_otg {
  425. dr_mode = "peripheral";
  426. status = "okay";
  427. };
  428. &usb_power_supply {
  429. status = "okay";
  430. };
  431. &usbphy {
  432. status = "okay";
  433. };