ste-ux500-samsung-codina.dts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Devicetree for the Samsung Galaxy Ace 2 GT-I8160 also known as Codina.
  4. *
  5. * NOTE: this is the most common variant according to the vendor tree, known
  6. * as "R0.0". There appears to be a "R0.4" variant with backlight on GPIO69,
  7. * AB8505 and other changes. There is also talk about some variants having a
  8. * Samsung S6D27A1 display, indicated by passing a different command line from
  9. * the boot loader.
  10. *
  11. * The Samsung tree further talks about GT-I8160P and GT-I8160chn (China).
  12. * The GT-I8160 plain is known as the "europe" variant.
  13. * The GT-I8160P is the CDMA version and it appears to not use the ST
  14. * Microelectronics accelerometer and reportedly has NFC mounted.
  15. * The GT-I8160chn appears to be the same as the europe variant.
  16. *
  17. * There is also the Codina-TMO, Samsung SGH-T599, which has its own device
  18. * tree.
  19. */
  20. /dts-v1/;
  21. #include "ste-db8500.dtsi"
  22. #include "ste-ab8500.dtsi"
  23. #include "ste-dbx5x0-pinctrl.dtsi"
  24. #include <dt-bindings/gpio/gpio.h>
  25. #include <dt-bindings/leds/common.h>
  26. #include <dt-bindings/input/input.h>
  27. #include <dt-bindings/interrupt-controller/irq.h>
  28. / {
  29. model = "Samsung Galaxy Ace 2 (GT-I8160)";
  30. compatible = "samsung,codina", "st-ericsson,u8500";
  31. cpus {
  32. cpu@300 {
  33. /*
  34. * This has a frequency cap at ~800 MHz in the firmware.
  35. * (Changing this number here will not overclock it.)
  36. */
  37. operating-points = <798720 0
  38. 399360 0
  39. 199680 0>;
  40. };
  41. };
  42. chosen {
  43. stdout-path = &serial2;
  44. };
  45. battery: battery {
  46. compatible = "samsung,eb425161lu";
  47. };
  48. thermal-zones {
  49. battery-thermal {
  50. /* This zone will be polled by the battery temperature code */
  51. polling-delay = <0>;
  52. polling-delay-passive = <0>;
  53. thermal-sensors = <&bat_therm>;
  54. trips {
  55. battery-crit-hi {
  56. temperature = <70000>;
  57. hysteresis = <2000>;
  58. type = "critical";
  59. };
  60. };
  61. };
  62. };
  63. bat_therm: thermistor {
  64. compatible = "samsung,1404-001221";
  65. io-channels = <&gpadc 0x02>; /* BatTemp */
  66. pullup-uv = <1800000>;
  67. pullup-ohm = <230000>;
  68. pulldown-ohm = <0>;
  69. #thermal-sensor-cells = <0>;
  70. };
  71. /* TI TXS0206 level translator for 2.9 V */
  72. sd_level_translator: regulator-gpio {
  73. compatible = "regulator-fixed";
  74. /* GPIO87 EN */
  75. gpios = <&gpio2 23 GPIO_ACTIVE_HIGH>;
  76. enable-active-high;
  77. regulator-name = "sd-level-translator";
  78. regulator-min-microvolt = <2900000>;
  79. regulator-max-microvolt = <2900000>;
  80. regulator-type = "voltage";
  81. startup-delay-us = <200>;
  82. pinctrl-names = "default";
  83. pinctrl-0 = <&sd_level_translator_default>;
  84. };
  85. /* External LDO MIC5366-3.3YMT for eMMC */
  86. ldo_3v3_reg: regulator-gpio-ldo-3v3 {
  87. compatible = "regulator-fixed";
  88. /* Supplied in turn by VBAT */
  89. regulator-name = "VMEM_3V3";
  90. regulator-min-microvolt = <3300000>;
  91. regulator-max-microvolt = <3300000>;
  92. gpios = <&gpio6 31 GPIO_ACTIVE_HIGH>;
  93. startup-delay-us = <5000>;
  94. enable-active-high;
  95. pinctrl-names = "default";
  96. pinctrl-0 = <&emmc_ldo_en_default_mode>;
  97. };
  98. /*
  99. * External Ricoh "TSP" regulator for the touchscreen.
  100. * One GPIO line controls two voltages of 3.3V and 1.8V
  101. * this line is known as "TSP_LDO_ON1" in the schematics.
  102. */
  103. ldo_tsp_3v3_reg: regulator-gpio-tsp-ldo-3v3 {
  104. compatible = "regulator-fixed";
  105. /* Supplied in turn by VBAT */
  106. regulator-name = "LDO_TSP_A3V3";
  107. regulator-min-microvolt = <3300000>;
  108. regulator-max-microvolt = <3300000>;
  109. /* GPIO94 controls this regulator */
  110. gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
  111. /* 70 ms power-on delay */
  112. startup-delay-us = <70000>;
  113. enable-active-high;
  114. pinctrl-names = "default";
  115. pinctrl-0 = <&tsp_ldo_en_default_mode>;
  116. };
  117. ldo_tsp_1v8_reg: regulator-gpio-tsp-ldo-1v8 {
  118. compatible = "regulator-fixed";
  119. /* Supplied in turn by VBAT */
  120. regulator-name = "VREG_TSP_1V8";
  121. regulator-min-microvolt = <1800000>;
  122. regulator-max-microvolt = <1800000>;
  123. /* GPIO94 controls this regulator */
  124. gpio = <&gpio2 30 GPIO_ACTIVE_HIGH>;
  125. /* 70 ms power-on delay */
  126. startup-delay-us = <70000>;
  127. enable-active-high;
  128. pinctrl-names = "default";
  129. pinctrl-0 = <&tsp_ldo_en_default_mode>;
  130. };
  131. /*
  132. * External Ricoh RP152L010B-TR LCD LDO regulator for the display.
  133. * LCD_PWR_EN controls both a 3.0V and 1.8V output.
  134. */
  135. lcd_3v0_reg: regulator-gpio-lcd-3v0 {
  136. compatible = "regulator-fixed";
  137. /* Supplied in turn by VBAT */
  138. regulator-name = "VREG_LCD_3.0V";
  139. regulator-min-microvolt = <3000000>;
  140. regulator-max-microvolt = <3000000>;
  141. /* GPIO219 controls this regulator */
  142. gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
  143. enable-active-high;
  144. pinctrl-names = "default";
  145. pinctrl-0 = <&lcd_pwr_en_default_mode>;
  146. };
  147. lcd_1v8_reg: regulator-gpio-lcd-1v8 {
  148. compatible = "regulator-fixed";
  149. /* Supplied in turn by VBAT */
  150. regulator-name = "VREG_LCD_1.8V";
  151. regulator-min-microvolt = <1800000>;
  152. regulator-max-microvolt = <1800000>;
  153. /* GPIO219 controls this regulator too */
  154. gpio = <&gpio6 27 GPIO_ACTIVE_HIGH>;
  155. enable-active-high;
  156. pinctrl-names = "default";
  157. pinctrl-0 = <&lcd_pwr_en_default_mode>;
  158. };
  159. /*
  160. * This regulator is a GPIO line that drives the Broadcom WLAN
  161. * line WL_REG_ON high and enables the internal regulators
  162. * inside the chip. Unfortunatley it is erroneously named
  163. * WLAN_RST_N on the schematic but it is not a reset line.
  164. *
  165. * The voltage specified here is only used to determine the OCR mask,
  166. * the for the SDIO connector, the chip is actually connected
  167. * directly to VBAT.
  168. */
  169. wl_reg: regulator-gpio-wlan {
  170. compatible = "regulator-fixed";
  171. regulator-name = "WL_REG_ON";
  172. regulator-min-microvolt = <3000000>;
  173. regulator-max-microvolt = <3000000>;
  174. startup-delay-us = <100000>;
  175. /* GPIO215 (WLAN_RST_N to WL_REG_ON) */
  176. gpio = <&gpio6 23 GPIO_ACTIVE_HIGH>;
  177. enable-active-high;
  178. pinctrl-names = "default";
  179. pinctrl-0 = <&wlan_ldo_en_default>;
  180. };
  181. vibrator {
  182. compatible = "gpio-vibrator";
  183. /* GPIO195 "MOT_EN" */
  184. enable-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;
  185. pinctrl-names = "default";
  186. pinctrl-0 = <&vibrator_default>;
  187. };
  188. gpio-keys {
  189. compatible = "gpio-keys";
  190. pinctrl-names = "default";
  191. pinctrl-0 = <&gpio_keys_default_mode>;
  192. button-home {
  193. linux,code = <KEY_HOME>;
  194. label = "HOME";
  195. /* GPIO91 */
  196. gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
  197. };
  198. button-volup {
  199. linux,code = <KEY_VOLUMEUP>;
  200. label = "VOL+";
  201. /* GPIO67 */
  202. gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
  203. };
  204. button-voldown {
  205. linux,code = <KEY_VOLUMEDOWN>;
  206. label = "VOL-";
  207. /* GPIO92 */
  208. gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
  209. };
  210. };
  211. gpio-leds {
  212. compatible = "gpio-leds";
  213. pinctrl-names = "default";
  214. pinctrl-0 = <&gpio_leds_default_mode>;
  215. touchkey-led {
  216. label = "touchkeys";
  217. /*
  218. * GPIO194 on R0.0, R0.4 does not use this at all, it
  219. * will instead turn LDO AUX4 on/off for key led backlighy.
  220. * (Line is pulled down on R0.4)
  221. */
  222. gpios = <&gpio6 2 GPIO_ACTIVE_HIGH>;
  223. default-state = "on";
  224. };
  225. };
  226. ktd253: backlight {
  227. compatible = "kinetic,ktd253";
  228. /*
  229. * GPIO68 is for R0.0, the board file talks about a TMO variant
  230. * (R0.4) using GPIO69.
  231. */
  232. enable-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
  233. /* Default to 13/32 brightness */
  234. default-brightness = <13>;
  235. pinctrl-names = "default";
  236. pinctrl-0 = <&ktd253_backlight_default_mode>;
  237. };
  238. /* Richtek RT8515GQW Flash LED Driver IC */
  239. flash {
  240. compatible = "richtek,rt8515";
  241. /* GPIO 140 */
  242. enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>;
  243. /* GPIO 141 */
  244. ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>;
  245. /*
  246. * RFS is 16 kOhm and RTS is 100 kOhm giving
  247. * the flash max current 343mA and torch max
  248. * current 55 mA.
  249. */
  250. richtek,rfs-ohms = <16000>;
  251. richtek,rts-ohms = <100000>;
  252. pinctrl-names = "default";
  253. pinctrl-0 = <&gpio_flash_default_mode>;
  254. led {
  255. function = LED_FUNCTION_FLASH;
  256. color = <LED_COLOR_ID_WHITE>;
  257. flash-max-timeout-us = <250000>;
  258. flash-max-microamp = <343750>;
  259. led-max-microamp = <55000>;
  260. };
  261. };
  262. /* Bit-banged I2C on GPIO143 and GPIO144 also called "SUBPMU I2C" */
  263. i2c-gpio-0 {
  264. compatible = "i2c-gpio";
  265. sda-gpios = <&gpio4 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  266. scl-gpios = <&gpio4 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  267. pinctrl-names = "default";
  268. pinctrl-0 = <&i2c_gpio_0_default>;
  269. #address-cells = <1>;
  270. #size-cells = <0>;
  271. magnetometer@c {
  272. compatible = "alps,hscdtd008a";
  273. reg = <0x0c>;
  274. clock-frequency = <400000>;
  275. avdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
  276. dvdd-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
  277. };
  278. /* TODO: this should also be used by the SM5103 Camera power management unit */
  279. };
  280. /* Bit-banged I2C on GPIO151 and GPIO152 also called "NFC I2C" */
  281. i2c-gpio-1 {
  282. compatible = "i2c-gpio";
  283. sda-gpios = <&gpio4 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  284. scl-gpios = <&gpio4 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
  285. pinctrl-names = "default";
  286. pinctrl-0 = <&i2c_gpio_1_default>;
  287. #address-cells = <1>;
  288. #size-cells = <0>;
  289. nfc@2b {
  290. /* NXP NFC circuit PN544 C1 marked NXP 44501 */
  291. compatible = "nxp,pn544-i2c";
  292. /* IF0, IF1 high, gives I2C address 0x2B */
  293. reg = <0x2b>;
  294. clock-frequency = <400000>;
  295. /* NFC IRQ on GPIO32 */
  296. interrupt-parent = <&gpio1>;
  297. interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
  298. /* GPIO 31 */
  299. firmware-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
  300. /* GPIO88 */
  301. enable-gpios = <&gpio2 24 GPIO_ACTIVE_HIGH>;
  302. pinctrl-names = "default";
  303. pinctrl-0 = <&pn544_codina_default>;
  304. };
  305. };
  306. spi-gpio-0 {
  307. compatible = "spi-gpio";
  308. /* Clock on GPIO220, pin SCL */
  309. sck-gpios = <&gpio6 28 GPIO_ACTIVE_HIGH>;
  310. /* MOSI on GPIO224, pin SDI "slave data in" */
  311. mosi-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
  312. /* MISO on GPIO225, pin SDO "slave data out" */
  313. miso-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
  314. /* Chip select on GPIO201 */
  315. cs-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>;
  316. num-chipselects = <1>;
  317. pinctrl-names = "default";
  318. pinctrl-0 = <&spi_gpio_0_default>;
  319. #address-cells = <1>;
  320. #size-cells = <0>;
  321. /*
  322. * Some Codinas (90%) have a WideChips WS2401-based LMS380KF01
  323. * display mounted and some 10% has a Samsung S6D27A1 instead.
  324. * The boot loader needs to modify this compatible to
  325. * correspond to whatever is passed from the early Samsung boot.
  326. */
  327. panel@0 {
  328. compatible = "samsung,lms380kf01";
  329. spi-max-frequency = <1200000>;
  330. /* TYPE 3: inverse clock polarity and phase */
  331. spi-cpha;
  332. spi-cpol;
  333. reg = <0>;
  334. vci-supply = <&lcd_3v0_reg>;
  335. vccio-supply = <&lcd_1v8_reg>;
  336. /* Reset on GPIO139 */
  337. reset-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
  338. /* LCD_VGH/LCD_DETECT, ESD IRQ on GPIO93 */
  339. interrupt-parent = <&gpio2>;
  340. interrupts = <29 IRQ_TYPE_EDGE_RISING>;
  341. pinctrl-names = "default";
  342. pinctrl-0 = <&panel_default_mode>;
  343. backlight = <&ktd253>;
  344. port {
  345. panel_in: endpoint {
  346. remote-endpoint = <&display_out>;
  347. };
  348. };
  349. };
  350. };
  351. soc {
  352. /* External Micro SD slot */
  353. mmc@80126000 {
  354. arm,primecell-periphid = <0x10480180>;
  355. max-frequency = <100000000>;
  356. bus-width = <4>;
  357. cap-sd-highspeed;
  358. cap-mmc-highspeed;
  359. st,sig-pin-fbclk;
  360. full-pwr-cycle;
  361. /* MMC is powered by AUX3 1.2V .. 2.91V */
  362. vmmc-supply = <&ab8500_ldo_aux3_reg>;
  363. /* 2.9 V level translator is using AUX3 at 2.9 V as well */
  364. vqmmc-supply = <&sd_level_translator>;
  365. pinctrl-names = "default", "sleep";
  366. pinctrl-0 = <&mc0_a_2_default>;
  367. pinctrl-1 = <&mc0_a_2_sleep>;
  368. cd-gpios = <&gpio6 25 GPIO_ACTIVE_LOW>; // GPIO217
  369. status = "okay";
  370. };
  371. /* WLAN SDIO channel */
  372. mmc@80118000 {
  373. arm,primecell-periphid = <0x10480180>;
  374. max-frequency = <50000000>;
  375. bus-width = <4>;
  376. non-removable;
  377. cap-sd-highspeed;
  378. pinctrl-names = "default", "sleep";
  379. pinctrl-0 = <&mc1_a_2_default>;
  380. pinctrl-1 = <&mc1_a_2_sleep>;
  381. /*
  382. * GPIO-controlled voltage enablement: this drives
  383. * the WL_REG_ON line high when we use this device.
  384. * Represented as regulator to fill OCR mask.
  385. */
  386. vmmc-supply = <&wl_reg>;
  387. #address-cells = <1>;
  388. #size-cells = <0>;
  389. status = "okay";
  390. wifi@1 {
  391. /* Actually BRCM4330 */
  392. compatible = "brcm,bcm4330-fmac", "brcm,bcm4329-fmac";
  393. reg = <1>;
  394. /* GPIO216 WL_HOST_WAKE */
  395. interrupt-parent = <&gpio6>;
  396. interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
  397. interrupt-names = "host-wake";
  398. pinctrl-names = "default";
  399. pinctrl-0 = <&wlan_default_mode>;
  400. };
  401. };
  402. /* eMMC */
  403. mmc@80005000 {
  404. arm,primecell-periphid = <0x10480180>;
  405. max-frequency = <100000000>;
  406. bus-width = <8>;
  407. non-removable;
  408. cap-mmc-highspeed;
  409. mmc-ddr-1_8v;
  410. no-sdio;
  411. no-sd;
  412. vmmc-supply = <&ldo_3v3_reg>;
  413. pinctrl-names = "default", "sleep";
  414. /*
  415. * GPIO130 will be set to input no pull-up resulting in a resistor
  416. * pulling the reset high and taking the memory out of reset.
  417. */
  418. pinctrl-0 = <&mc2_a_1_default>;
  419. pinctrl-1 = <&mc2_a_1_sleep>;
  420. status = "okay";
  421. };
  422. /* GBF (Bluetooth) UART */
  423. uart@80120000 {
  424. pinctrl-names = "default", "sleep";
  425. pinctrl-0 = <&u0_a_1_default>;
  426. pinctrl-1 = <&u0_a_1_sleep>;
  427. status = "okay";
  428. bluetooth {
  429. compatible = "brcm,bcm4330-bt";
  430. /* GPIO222 rail BT_VREG_EN to BT_REG_ON */
  431. shutdown-gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
  432. /* BT_WAKE on GPIO199 */
  433. device-wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
  434. /* BT_HOST_WAKE on GPIO97 */
  435. /* FIXME: convert to interrupt */
  436. host-wakeup-gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
  437. /* BT_RST_N on GPIO209 */
  438. reset-gpios = <&gpio6 17 GPIO_ACTIVE_LOW>;
  439. pinctrl-names = "default";
  440. pinctrl-0 = <&bluetooth_default_mode>;
  441. };
  442. };
  443. /* GPS UART */
  444. uart@80121000 {
  445. status = "okay";
  446. pinctrl-names = "default", "sleep";
  447. pinctrl-0 = <&u1rxtx_a_1_default &u1ctsrts_a_1_default>;
  448. pinctrl-1 = <&u1rxtx_a_1_sleep &u1ctsrts_a_1_sleep>;
  449. gnss {
  450. compatible = "brcm,bcm4751";
  451. /* GPS_RSTN on GPIO21 */
  452. reset-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
  453. /* GPS_ON_OFF on GPIO86 */
  454. enable-gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
  455. /* GPS_1V8 (VSMPS2) */
  456. vddio-supply = <&db8500_vsmps2_reg>;
  457. pinctrl-names = "default";
  458. pinctrl-0 = <&bcm4751_codina_default>;
  459. };
  460. };
  461. /* Debugging console UART connected to TSU6111RSVR (FSA880) */
  462. uart@80007000 {
  463. status = "okay";
  464. pinctrl-names = "default", "sleep";
  465. pinctrl-0 = <&u2rxtx_c_1_default>;
  466. pinctrl-1 = <&u2rxtx_c_1_sleep>;
  467. };
  468. prcmu@80157000 {
  469. ab8500 {
  470. phy {
  471. pinctrl-names = "default", "sleep";
  472. pinctrl-0 = <&usb_a_1_default>;
  473. pinctrl-1 = <&usb_a_1_sleep>;
  474. };
  475. ab8500_fg {
  476. line-impedance-micro-ohms = <36000>;
  477. };
  478. regulator {
  479. ab8500_ldo_aux1 {
  480. /* Used for VDD for sensors */
  481. regulator-name = "V-SENSORS-VDD";
  482. regulator-min-microvolt = <3000000>;
  483. regulator-max-microvolt = <3000000>;
  484. };
  485. ab8500_ldo_aux2 {
  486. /* Used for VIO for sensors */
  487. regulator-name = "V-SENSORS-VIO";
  488. regulator-min-microvolt = <1800000>;
  489. regulator-max-microvolt = <1800000>;
  490. };
  491. ab8500_ldo_aux3 {
  492. /* Used for voltage for external MMC/SD card */
  493. regulator-name = "V-MMC-SD";
  494. regulator-min-microvolt = <1200000>;
  495. regulator-max-microvolt = <2910000>;
  496. };
  497. };
  498. };
  499. };
  500. /* I2C0 also known as "AGC I2C" */
  501. i2c@80004000 {
  502. status = "okay";
  503. pinctrl-names = "default", "sleep";
  504. pinctrl-0 = <&i2c0_a_1_default>;
  505. pinctrl-1 = <&i2c0_a_1_sleep>;
  506. proximity@39 {
  507. /* Codina has the Amstaos TMD2672 */
  508. compatible = "amstaos,tmd2672";
  509. clock-frequency = <400000>;
  510. reg = <0x39>;
  511. /* IRQ on GPIO146 "PS_INT" */
  512. interrupt-parent = <&gpio4>;
  513. interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
  514. /* FIXME: needs a VDDIO supply that is connected to a pull-up resistor */
  515. vdd-supply = <&ab8500_ldo_aux1_reg>;
  516. pinctrl-names = "default";
  517. pinctrl-0 = <&tms2672_codina_default>;
  518. };
  519. };
  520. /* I2C1 on GPIO16 and GPIO17 also called "MUS I2C" */
  521. i2c@80122000 {
  522. status = "okay";
  523. pinctrl-names = "default","sleep";
  524. /* FIXME: If it doesn't work try what we use on Gavini */
  525. pinctrl-0 = <&i2c1_b_2_default>;
  526. pinctrl-1 = <&i2c1_b_2_sleep>;
  527. /* Texas Instruments TSU6111 micro USB switch */
  528. usb-switch@25 {
  529. compatible = "ti,tsu6111";
  530. reg = <0x25>;
  531. /* Interrupt JACK_INT_N on GPIO95 */
  532. interrupt-parent = <&gpio2>;
  533. interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
  534. pinctrl-names = "default";
  535. pinctrl-0 = <&tsu6111_codina_default>;
  536. };
  537. };
  538. /* I2C2 on GPIO10 and GPIO11 also called "SENSORS I2C" */
  539. i2c@80128000 {
  540. status = "okay";
  541. pinctrl-names = "default", "sleep";
  542. pinctrl-0 = <&i2c2_b_2_default>;
  543. pinctrl-1 = <&i2c2_b_2_sleep>;
  544. lisd3dh@19 {
  545. /* ST Microelectronics Accelerometer */
  546. compatible = "st,lis3dh-accel";
  547. st,drdy-int-pin = <1>;
  548. reg = <0x19>;
  549. vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
  550. vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
  551. mount-matrix = "0", "1", "0",
  552. "-1", "0", "0",
  553. "0", "0", "1";
  554. };
  555. };
  556. /* I2C3 */
  557. i2c@80110000 {
  558. status = "okay";
  559. pinctrl-names = "default", "sleep";
  560. pinctrl-0 = <&i2c3_c_2_default>;
  561. pinctrl-1 = <&i2c3_c_2_sleep>;
  562. /* TODO: write bindings and driver for this touchscreen */
  563. /* Zinitix BT404 ISP part */
  564. isp@50 {
  565. compatible = "zinitix,bt404-isp";
  566. reg = <0x50>;
  567. pinctrl-names = "default";
  568. pinctrl-0 = <&tsp_default>;
  569. };
  570. /* Zinitix BT404 touchscreen, also has the touchkeys for menu and back */
  571. touchscreen@20 {
  572. compatible = "zinitix,bt404";
  573. reg = <0x20>;
  574. /* GPIO218 (TSP_INT_1V8) */
  575. interrupt-parent = <&gpio6>;
  576. interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
  577. vcca-supply = <&ldo_tsp_3v3_reg>;
  578. vdd-supply = <&ldo_tsp_1v8_reg>;
  579. zinitix,mode = <2>;
  580. touchscreen-size-x = <480>;
  581. touchscreen-size-y = <800>;
  582. pinctrl-names = "default";
  583. pinctrl-0 = <&tsp_default>;
  584. };
  585. };
  586. mcde@a0350000 {
  587. status = "okay";
  588. pinctrl-names = "default";
  589. pinctrl-0 = <&dpi_default_mode>;
  590. port {
  591. display_out: endpoint {
  592. remote-endpoint = <&panel_in>;
  593. };
  594. };
  595. };
  596. };
  597. };
  598. &pinctrl {
  599. /*
  600. * This extends the MC0_A_2 default config to include
  601. * the card detect GPIO217 line.
  602. */
  603. sdi0 {
  604. mc0_a_2_default {
  605. default_cfg4 {
  606. pins = "GPIO217_AH12"; /* card detect */
  607. ste,config = <&gpio_in_pd>;
  608. };
  609. };
  610. };
  611. sdi2 {
  612. /*
  613. * This will make the resistor mounted in R0.0 pull up
  614. * the reset line and take the eMMC out of reset. On
  615. * R0.4 variants, GPIO130 should be set in GPIO mode and
  616. * pulled down. (Not connected.)
  617. */
  618. mc2_a_1_default {
  619. default_cfg2 {
  620. pins = "GPIO130_C8"; /* FBCLK */
  621. ste,config = <&in_nopull>;
  622. };
  623. };
  624. };
  625. /* GPIO that enables the 2.9V SD card level translator */
  626. sd-level-translator {
  627. sd_level_translator_default: sd_level_translator_default {
  628. /* level shifter on GPIO87 */
  629. codina_cfg1 {
  630. pins = "GPIO87_B3";
  631. ste,config = <&gpio_out_hi>;
  632. };
  633. };
  634. };
  635. /* GPIO that enables the LDO regulator for the eMMC */
  636. emmc-ldo {
  637. emmc_ldo_en_default_mode: emmc_ldo_default {
  638. /* LDO enable on GPIO223 */
  639. codina_cfg1 {
  640. pins = "GPIO223_AH9";
  641. ste,config = <&gpio_out_hi>;
  642. };
  643. };
  644. };
  645. /* GPIOs for panel control */
  646. panel {
  647. panel_default_mode: panel_default {
  648. codina_cfg1 {
  649. /* Reset line */
  650. pins = "GPIO139_C9";
  651. ste,config = <&gpio_out_lo>;
  652. };
  653. codina_cfg2 {
  654. /* ESD IRQ line "LCD detect" */
  655. pins = "GPIO93_B7";
  656. ste,config = <&gpio_in_nopull>;
  657. };
  658. };
  659. };
  660. /* GPIO that enables the LDO regulator for the touchscreen */
  661. tsp-ldo {
  662. tsp_ldo_en_default_mode: tsp_ldo_default {
  663. /* LDO enable on GPIO94 */
  664. gavini_cfg1 {
  665. pins = "GPIO94_D7";
  666. ste,config = <&gpio_out_hi>;
  667. };
  668. };
  669. };
  670. /* GPIO that enables the LDO regulator for the LCD display */
  671. lcd-ldo {
  672. lcd_pwr_en_default_mode: lcd_pwr_en_default {
  673. /* LCD_PWR_EN on GPIO219 */
  674. codina_cfg1 {
  675. pins = "GPIO219_AG10";
  676. ste,config = <&gpio_out_hi>;
  677. };
  678. };
  679. };
  680. /* GPIO that enables the LDO regulator for the key LED */
  681. key-led {
  682. gpio_leds_default_mode: en_led_ldo_default {
  683. /* EN_LED_LDO on GPIO194 */
  684. codina_cfg1 {
  685. pins = "GPIO194_AF27";
  686. ste,config = <&gpio_out_hi>;
  687. };
  688. };
  689. };
  690. /* GPIO that enables the WLAN internal LDO regulators */
  691. wlan-ldo {
  692. wlan_ldo_en_default: wlan_ldo_default {
  693. /* GPIO215 named WLAN_RST_N */
  694. codina_cfg1 {
  695. pins = "GPIO215_AH13";
  696. ste,config = <&gpio_out_lo>;
  697. };
  698. };
  699. };
  700. /* Backlight GPIO */
  701. backlight {
  702. ktd253_backlight_default_mode: backlight_default {
  703. skomer_cfg1 {
  704. pins = "GPIO68_E1"; /* LCD_BL_CTRL */
  705. ste,config = <&gpio_out_lo>;
  706. };
  707. };
  708. };
  709. /* Flash and torch */
  710. flash {
  711. gpio_flash_default_mode: flash_default {
  712. codina_cfg1 {
  713. pins = "GPIO140_B11", "GPIO141_C12";
  714. ste,config = <&gpio_out_lo>;
  715. };
  716. };
  717. };
  718. /* GPIO keys */
  719. gpio-keys {
  720. gpio_keys_default_mode: gpio_keys_default {
  721. skomer_cfg1 {
  722. pins = "GPIO67_G2", /* VOL UP */
  723. "GPIO91_B6", /* HOME */
  724. "GPIO92_D6"; /* VOL DOWN */
  725. ste,config = <&gpio_in_pu>;
  726. };
  727. };
  728. };
  729. /* Interrupt line for the Zinitix BT404 touchscreen */
  730. tsp {
  731. tsp_default: tsp_default {
  732. codina_cfg1 {
  733. pins = "GPIO218_AH11"; /* TSP_INT_1V8 */
  734. ste,config = <&gpio_in_nopull>;
  735. };
  736. };
  737. };
  738. /* Interrupt line for light/proximity sensor TMS2672 */
  739. tms2672 {
  740. tms2672_codina_default: tms2672_codina {
  741. codina_cfg1 {
  742. pins = "GPIO146_D13";
  743. ste,config = <&gpio_in_nopull>;
  744. };
  745. };
  746. };
  747. /* GPIO-based I2C bus for subpmu */
  748. i2c-gpio-0 {
  749. i2c_gpio_0_default: i2c_gpio_0 {
  750. codina_cfg1 {
  751. pins = "GPIO143_D12", "GPIO144_B13";
  752. ste,config = <&gpio_in_nopull>;
  753. };
  754. };
  755. };
  756. /* GPIO-based I2C bus for the NFC */
  757. i2c-gpio-1 {
  758. i2c_gpio_1_default: i2c_gpio_1 {
  759. codina_cfg1 {
  760. pins = "GPIO151_D17", "GPIO152_D16";
  761. ste,config = <&gpio_in_nopull>;
  762. };
  763. };
  764. };
  765. /* GPIO-based SPI bus for the display */
  766. spi-gpio-0 {
  767. spi_gpio_0_default: spi_gpio_0_d {
  768. codina_cfg1 {
  769. pins = "GPIO220_AH10", "GPIO201_AF24", "GPIO224_AG9";
  770. ste,config = <&gpio_out_hi>;
  771. };
  772. codina_cfg2 {
  773. pins = "GPIO225_AG8";
  774. /* Needs pull down, no pull down resistor on board */
  775. ste,config = <&gpio_in_pd>;
  776. };
  777. };
  778. spi_gpio_0_sleep: spi_gpio_0_s {
  779. codina_cfg1 {
  780. pins = "GPIO220_AH10", "GPIO201_AF24",
  781. "GPIO224_AG9", "GPIO225_AG8";
  782. ste,config = <&gpio_out_hi>;
  783. };
  784. };
  785. };
  786. wlan {
  787. wlan_default_mode: wlan_default {
  788. /* GPIO216 for WL_HOST_WAKE */
  789. codina_cfg2 {
  790. pins = "GPIO216_AG12";
  791. ste,config = <&gpio_in_pd>;
  792. };
  793. };
  794. };
  795. bluetooth {
  796. bluetooth_default_mode: bluetooth_default {
  797. /* GPIO199 BT_WAKE and GPIO222 BT_VREG_ON */
  798. codina_cfg1 {
  799. pins = "GPIO199_AH23", "GPIO222_AJ9";
  800. ste,config = <&gpio_out_lo>;
  801. };
  802. /* GPIO97 BT_HOST_WAKE */
  803. codina_cfg2 {
  804. pins = "GPIO97_D9";
  805. ste,config = <&gpio_in_nopull>;
  806. };
  807. /* GPIO209 BT_RST_N */
  808. codina_cfg3 {
  809. pins = "GPIO209_AG15";
  810. ste,config = <&gpio_out_hi>;
  811. };
  812. };
  813. };
  814. /* Interrupt line for TI TSU6111 Micro USB switch */
  815. tsu6111 {
  816. tsu6111_codina_default: tsu6111_codina {
  817. codina_cfg1 {
  818. /* GPIO95 used for IRQ */
  819. pins = "GPIO95_E8";
  820. ste,config = <&gpio_in_nopull>;
  821. };
  822. };
  823. };
  824. nfc {
  825. pn544_codina_default: pn544_codina {
  826. /* Interrupt line */
  827. codina_cfg1 {
  828. pins = "GPIO32_V2";
  829. ste,config = <&gpio_in_nopull>;
  830. };
  831. /* Enable and firmware GPIOs */
  832. codina_cfg2 {
  833. pins = "GPIO31_V3", "GPIO88_C4";
  834. ste,config = <&gpio_out_lo>;
  835. };
  836. };
  837. };
  838. bcm4751 {
  839. bcm4751_codina_default: bcm4751_codina {
  840. /* Reset line, start out asserted */
  841. codina_cfg1 {
  842. pins = "GPIO21_AB3";
  843. ste,config = <&gpio_out_lo>;
  844. };
  845. /* GPS_ON_OFF, start out deasserted (off) */
  846. codina_cfg2 {
  847. pins = "GPIO86_C6";
  848. ste,config = <&gpio_out_lo>;
  849. };
  850. };
  851. };
  852. vibrator {
  853. vibrator_default: vibrator_default {
  854. codina_cfg1 {
  855. pins = "GPIO195_AG28"; /* MOT_EN */
  856. ste,config = <&gpio_out_lo>;
  857. };
  858. };
  859. };
  860. mcde {
  861. dpi_default_mode: dpi_default {
  862. default_mux1 {
  863. /* Mux in all the data lines */
  864. function = "lcd";
  865. groups =
  866. /* Data lines D0-D7 GPIO70..GPIO77 */
  867. "lcd_d0_d7_a_1",
  868. /* Data lines D8-D11 GPIO78..GPIO81 */
  869. "lcd_d8_d11_a_1",
  870. /* Data lines D12-D15 GPIO82..GPIO85 */
  871. "lcd_d12_d15_a_1",
  872. /* Data lines D16-D23 GPIO161..GPIO168 */
  873. "lcd_d16_d23_b_1";
  874. };
  875. default_mux2 {
  876. function = "lcda";
  877. /* Clock line on GPIO150, DE, VSO, HSO on GPIO169..GPIO171 */
  878. groups = "lcdaclk_b_1", "lcda_b_1";
  879. };
  880. /* Input, no pull-up is the default state for pins used for an alt function */
  881. default_cfg1 {
  882. pins = "GPIO150_C14", "GPIO169_D22", "GPIO170_C23", "GPIO171_D23";
  883. ste,config = <&in_nopull>;
  884. };
  885. };
  886. };
  887. };