/arch/arm/mach-msm/board-8064-gpiomux.c

https://github.com/AICP/kernel_google_msm · C · 1480 lines · 1328 code · 108 blank · 44 comment · 25 complexity · b735e5d00c4be51b57eabceac496ea8f MD5 · raw file

  1. /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include <linux/init.h>
  14. #include <linux/ioport.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/bootmem.h>
  17. #include <linux/gpio.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/mmc.h>
  20. #include <mach/msm_bus_board.h>
  21. #include <mach/board.h>
  22. #include <mach/gpiomux.h>
  23. #include <mach/socinfo.h>
  24. #include "devices.h"
  25. #include "board-8064.h"
  26. #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  27. static struct gpiomux_setting gpio_eth_config = {
  28. .pull = GPIOMUX_PULL_NONE,
  29. .drv = GPIOMUX_DRV_8MA,
  30. .func = GPIOMUX_FUNC_GPIO,
  31. };
  32. /* The SPI configurations apply to GSBI 5*/
  33. static struct gpiomux_setting gpio_spi_config = {
  34. .func = GPIOMUX_FUNC_2,
  35. .drv = GPIOMUX_DRV_12MA,
  36. .pull = GPIOMUX_PULL_NONE,
  37. };
  38. /* The SPI configurations apply to GSBI 5 chip select 2*/
  39. static struct gpiomux_setting gpio_spi_cs2_config = {
  40. .func = GPIOMUX_FUNC_3,
  41. .drv = GPIOMUX_DRV_12MA,
  42. .pull = GPIOMUX_PULL_NONE,
  43. };
  44. struct msm_gpiomux_config apq8064_ethernet_configs[] = {
  45. {
  46. .gpio = 43,
  47. .settings = {
  48. [GPIOMUX_SUSPENDED] = &gpio_eth_config,
  49. [GPIOMUX_ACTIVE] = &gpio_eth_config,
  50. }
  51. },
  52. };
  53. #endif
  54. /* Chip selects for SPI clients */
  55. static struct gpiomux_setting gpio_spi_cs_config = {
  56. .func = GPIOMUX_FUNC_GPIO,
  57. .drv = GPIOMUX_DRV_12MA,
  58. .pull = GPIOMUX_PULL_UP,
  59. };
  60. /* Chip selects for EPM SPI clients */
  61. static struct gpiomux_setting gpio_epm_spi_cs_config = {
  62. .func = GPIOMUX_FUNC_6,
  63. .drv = GPIOMUX_DRV_12MA,
  64. .pull = GPIOMUX_PULL_UP,
  65. };
  66. #ifdef CONFIG_MSM_VCAP
  67. static struct gpiomux_setting gpio_vcap_config[] = {
  68. {
  69. .func = GPIOMUX_FUNC_GPIO,
  70. .drv = GPIOMUX_DRV_2MA,
  71. .pull = GPIOMUX_PULL_DOWN,
  72. },
  73. {
  74. .func = GPIOMUX_FUNC_1,
  75. .drv = GPIOMUX_DRV_2MA,
  76. .pull = GPIOMUX_PULL_DOWN,
  77. },
  78. {
  79. .func = GPIOMUX_FUNC_2,
  80. .drv = GPIOMUX_DRV_2MA,
  81. .pull = GPIOMUX_PULL_DOWN,
  82. },
  83. {
  84. .func = GPIOMUX_FUNC_3,
  85. .drv = GPIOMUX_DRV_2MA,
  86. .pull = GPIOMUX_PULL_DOWN,
  87. },
  88. {
  89. .func = GPIOMUX_FUNC_4,
  90. .drv = GPIOMUX_DRV_2MA,
  91. .pull = GPIOMUX_PULL_DOWN,
  92. },
  93. {
  94. .func = GPIOMUX_FUNC_5,
  95. .drv = GPIOMUX_DRV_2MA,
  96. .pull = GPIOMUX_PULL_DOWN,
  97. },
  98. {
  99. .func = GPIOMUX_FUNC_6,
  100. .drv = GPIOMUX_DRV_2MA,
  101. .pull = GPIOMUX_PULL_DOWN,
  102. },
  103. {
  104. .func = GPIOMUX_FUNC_7,
  105. .drv = GPIOMUX_DRV_2MA,
  106. .pull = GPIOMUX_PULL_DOWN,
  107. },
  108. {
  109. .func = GPIOMUX_FUNC_8,
  110. .drv = GPIOMUX_DRV_2MA,
  111. .pull = GPIOMUX_PULL_DOWN,
  112. },
  113. {
  114. .func = GPIOMUX_FUNC_9,
  115. .drv = GPIOMUX_DRV_2MA,
  116. .pull = GPIOMUX_PULL_DOWN,
  117. },
  118. {
  119. .func = GPIOMUX_FUNC_A,
  120. .drv = GPIOMUX_DRV_2MA,
  121. .pull = GPIOMUX_PULL_DOWN,
  122. },
  123. };
  124. struct msm_gpiomux_config vcap_configs[] = {
  125. {
  126. .gpio = 20,
  127. .settings = {
  128. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
  129. [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
  130. }
  131. },
  132. {
  133. .gpio = 25,
  134. .settings = {
  135. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  136. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  137. }
  138. },
  139. {
  140. .gpio = 24,
  141. .settings = {
  142. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
  143. [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
  144. }
  145. },
  146. {
  147. .gpio = 23,
  148. .settings = {
  149. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  150. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  151. }
  152. },
  153. {
  154. .gpio = 19,
  155. .settings = {
  156. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[8],
  157. [GPIOMUX_ACTIVE] = &gpio_vcap_config[8],
  158. }
  159. },
  160. {
  161. .gpio = 22,
  162. .settings = {
  163. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  164. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  165. }
  166. },
  167. {
  168. .gpio = 21,
  169. .settings = {
  170. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
  171. [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
  172. }
  173. },
  174. {
  175. .gpio = 12,
  176. .settings = {
  177. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
  178. [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
  179. }
  180. },
  181. {
  182. .gpio = 18,
  183. .settings = {
  184. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
  185. [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
  186. }
  187. },
  188. {
  189. .gpio = 11,
  190. .settings = {
  191. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[10],
  192. [GPIOMUX_ACTIVE] = &gpio_vcap_config[10],
  193. }
  194. },
  195. {
  196. .gpio = 10,
  197. .settings = {
  198. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[9],
  199. [GPIOMUX_ACTIVE] = &gpio_vcap_config[9],
  200. }
  201. },
  202. {
  203. .gpio = 9,
  204. .settings = {
  205. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  206. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  207. }
  208. },
  209. {
  210. .gpio = 26,
  211. .settings = {
  212. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
  213. [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
  214. }
  215. },
  216. {
  217. .gpio = 8,
  218. .settings = {
  219. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
  220. [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
  221. }
  222. },
  223. {
  224. .gpio = 7,
  225. .settings = {
  226. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
  227. [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
  228. }
  229. },
  230. {
  231. .gpio = 6,
  232. .settings = {
  233. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[7],
  234. [GPIOMUX_ACTIVE] = &gpio_vcap_config[7],
  235. }
  236. },
  237. {
  238. .gpio = 80,
  239. .settings = {
  240. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  241. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  242. }
  243. },
  244. {
  245. .gpio = 86,
  246. .settings = {
  247. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[1],
  248. [GPIOMUX_ACTIVE] = &gpio_vcap_config[1],
  249. }
  250. },
  251. {
  252. .gpio = 85,
  253. .settings = {
  254. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
  255. [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
  256. }
  257. },
  258. {
  259. .gpio = 84,
  260. .settings = {
  261. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
  262. [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
  263. }
  264. },
  265. {
  266. .gpio = 5,
  267. .settings = {
  268. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  269. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  270. }
  271. },
  272. {
  273. .gpio = 4,
  274. .settings = {
  275. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[3],
  276. [GPIOMUX_ACTIVE] = &gpio_vcap_config[3],
  277. }
  278. },
  279. {
  280. .gpio = 3,
  281. .settings = {
  282. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
  283. [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
  284. }
  285. },
  286. {
  287. .gpio = 2,
  288. .settings = {
  289. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[5],
  290. [GPIOMUX_ACTIVE] = &gpio_vcap_config[5],
  291. }
  292. },
  293. {
  294. .gpio = 82,
  295. .settings = {
  296. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
  297. [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
  298. }
  299. },
  300. {
  301. .gpio = 83,
  302. .settings = {
  303. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[4],
  304. [GPIOMUX_ACTIVE] = &gpio_vcap_config[4],
  305. }
  306. },
  307. {
  308. .gpio = 87,
  309. .settings = {
  310. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[2],
  311. [GPIOMUX_ACTIVE] = &gpio_vcap_config[2],
  312. }
  313. },
  314. {
  315. .gpio = 13,
  316. .settings = {
  317. [GPIOMUX_SUSPENDED] = &gpio_vcap_config[6],
  318. [GPIOMUX_ACTIVE] = &gpio_vcap_config[6],
  319. }
  320. },
  321. };
  322. #endif
  323. static struct gpiomux_setting gpio_i2c_config = {
  324. .func = GPIOMUX_FUNC_1,
  325. .drv = GPIOMUX_DRV_8MA,
  326. .pull = GPIOMUX_PULL_NONE,
  327. };
  328. static struct gpiomux_setting gpio_i2c_config_sus = {
  329. .func = GPIOMUX_FUNC_1,
  330. .drv = GPIOMUX_DRV_2MA,
  331. .pull = GPIOMUX_PULL_KEEPER,
  332. };
  333. static struct gpiomux_setting mbhc_hs_detect = {
  334. .func = GPIOMUX_FUNC_1,
  335. .drv = GPIOMUX_DRV_2MA,
  336. .pull = GPIOMUX_PULL_NONE,
  337. };
  338. static struct gpiomux_setting cdc_mclk = {
  339. .func = GPIOMUX_FUNC_1,
  340. .drv = GPIOMUX_DRV_8MA,
  341. .pull = GPIOMUX_PULL_NONE,
  342. };
  343. static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
  344. .func = GPIOMUX_FUNC_GPIO,
  345. .drv = GPIOMUX_DRV_2MA,
  346. .pull = GPIOMUX_PULL_UP,
  347. };
  348. static struct gpiomux_setting wcnss_5wire_active_cfg = {
  349. .func = GPIOMUX_FUNC_1,
  350. .drv = GPIOMUX_DRV_6MA,
  351. .pull = GPIOMUX_PULL_DOWN,
  352. };
  353. static struct gpiomux_setting slimbus = {
  354. .func = GPIOMUX_FUNC_1,
  355. .drv = GPIOMUX_DRV_8MA,
  356. .pull = GPIOMUX_PULL_KEEPER,
  357. };
  358. static struct gpiomux_setting gsbi1_uart_config = {
  359. .func = GPIOMUX_FUNC_1,
  360. .drv = GPIOMUX_DRV_16MA,
  361. .pull = GPIOMUX_PULL_NONE,
  362. };
  363. static struct gpiomux_setting ext_regulator_config = {
  364. .func = GPIOMUX_FUNC_GPIO,
  365. .drv = GPIOMUX_DRV_8MA,
  366. .pull = GPIOMUX_PULL_NONE,
  367. .dir = GPIOMUX_OUT_LOW,
  368. };
  369. static struct gpiomux_setting gsbi7_func1_cfg = {
  370. .func = GPIOMUX_FUNC_1,
  371. .drv = GPIOMUX_DRV_8MA,
  372. .pull = GPIOMUX_PULL_NONE,
  373. };
  374. static struct gpiomux_setting gsbi7_func2_cfg = {
  375. .func = GPIOMUX_FUNC_2,
  376. .drv = GPIOMUX_DRV_8MA,
  377. .pull = GPIOMUX_PULL_NONE,
  378. };
  379. static struct gpiomux_setting gsbi3_suspended_cfg = {
  380. .func = GPIOMUX_FUNC_1,
  381. .drv = GPIOMUX_DRV_2MA,
  382. .pull = GPIOMUX_PULL_KEEPER,
  383. };
  384. static struct gpiomux_setting gsbi3_active_cfg = {
  385. .func = GPIOMUX_FUNC_1,
  386. .drv = GPIOMUX_DRV_8MA,
  387. .pull = GPIOMUX_PULL_NONE,
  388. };
  389. static struct gpiomux_setting hdmi_suspend_cfg = {
  390. .func = GPIOMUX_FUNC_GPIO,
  391. .drv = GPIOMUX_DRV_2MA,
  392. .pull = GPIOMUX_PULL_DOWN,
  393. };
  394. static struct gpiomux_setting hdmi_active_1_cfg = {
  395. .func = GPIOMUX_FUNC_1,
  396. .drv = GPIOMUX_DRV_2MA,
  397. .pull = GPIOMUX_PULL_UP,
  398. };
  399. static struct gpiomux_setting hdmi_active_2_cfg = {
  400. .func = GPIOMUX_FUNC_1,
  401. .drv = GPIOMUX_DRV_16MA,
  402. .pull = GPIOMUX_PULL_DOWN,
  403. };
  404. static struct gpiomux_setting gsbi5_suspended_cfg = {
  405. .func = GPIOMUX_FUNC_2,
  406. .drv = GPIOMUX_DRV_12MA,
  407. .pull = GPIOMUX_PULL_NONE,
  408. };
  409. static struct gpiomux_setting gsbi5_active_cfg = {
  410. .func = GPIOMUX_FUNC_2,
  411. .drv = GPIOMUX_DRV_12MA,
  412. .pull = GPIOMUX_PULL_NONE,
  413. };
  414. static struct gpiomux_setting sx150x_suspended_cfg = {
  415. .func = GPIOMUX_FUNC_GPIO,
  416. .drv = GPIOMUX_DRV_8MA,
  417. .pull = GPIOMUX_PULL_NONE,
  418. };
  419. static struct gpiomux_setting sx150x_active_cfg = {
  420. .func = GPIOMUX_FUNC_GPIO,
  421. .drv = GPIOMUX_DRV_8MA,
  422. .pull = GPIOMUX_PULL_NONE,
  423. };
  424. #ifdef CONFIG_USB_EHCI_MSM_HSIC
  425. static struct gpiomux_setting cyts_sleep_sus_cfg = {
  426. .func = GPIOMUX_FUNC_GPIO,
  427. .drv = GPIOMUX_DRV_6MA,
  428. .pull = GPIOMUX_PULL_DOWN,
  429. };
  430. static struct gpiomux_setting cyts_sleep_act_cfg = {
  431. .func = GPIOMUX_FUNC_GPIO,
  432. .drv = GPIOMUX_DRV_6MA,
  433. .pull = GPIOMUX_PULL_DOWN,
  434. };
  435. static struct gpiomux_setting cyts_int_act_cfg = {
  436. .func = GPIOMUX_FUNC_GPIO,
  437. .drv = GPIOMUX_DRV_8MA,
  438. .pull = GPIOMUX_PULL_UP,
  439. };
  440. static struct gpiomux_setting cyts_int_sus_cfg = {
  441. .func = GPIOMUX_FUNC_GPIO,
  442. .drv = GPIOMUX_DRV_2MA,
  443. .pull = GPIOMUX_PULL_DOWN,
  444. };
  445. static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
  446. { /* TS INTERRUPT */
  447. .gpio = 6,
  448. .settings = {
  449. [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
  450. [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
  451. },
  452. },
  453. { /* TS SLEEP */
  454. .gpio = 33,
  455. .settings = {
  456. [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
  457. [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
  458. },
  459. },
  460. };
  461. static struct msm_gpiomux_config cyts_gpio_alt_config[] __initdata = {
  462. { /* TS INTERRUPT */
  463. .gpio = 6,
  464. .settings = {
  465. [GPIOMUX_ACTIVE] = &cyts_int_act_cfg,
  466. [GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
  467. },
  468. },
  469. { /* TS SLEEP */
  470. .gpio = 12,
  471. .settings = {
  472. [GPIOMUX_ACTIVE] = &cyts_sleep_act_cfg,
  473. [GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
  474. },
  475. },
  476. };
  477. static struct gpiomux_setting hsic_act_cfg = {
  478. .func = GPIOMUX_FUNC_1,
  479. .drv = GPIOMUX_DRV_8MA,
  480. .pull = GPIOMUX_PULL_NONE,
  481. };
  482. static struct gpiomux_setting hsic_sus_cfg = {
  483. .func = GPIOMUX_FUNC_GPIO,
  484. .drv = GPIOMUX_DRV_2MA,
  485. .pull = GPIOMUX_PULL_DOWN,
  486. .dir = GPIOMUX_OUT_LOW,
  487. };
  488. static struct gpiomux_setting hsic_wakeup_act_cfg = {
  489. .func = GPIOMUX_FUNC_GPIO,
  490. .drv = GPIOMUX_DRV_8MA,
  491. .pull = GPIOMUX_PULL_DOWN,
  492. .dir = GPIOMUX_IN,
  493. };
  494. static struct gpiomux_setting hsic_wakeup_sus_cfg = {
  495. .func = GPIOMUX_FUNC_GPIO,
  496. .drv = GPIOMUX_DRV_2MA,
  497. .pull = GPIOMUX_PULL_DOWN,
  498. .dir = GPIOMUX_IN,
  499. };
  500. static struct msm_gpiomux_config apq8064_hsic_configs[] = {
  501. {
  502. .gpio = 88, /*HSIC_STROBE */
  503. .settings = {
  504. [GPIOMUX_ACTIVE] = &hsic_act_cfg,
  505. [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
  506. },
  507. },
  508. {
  509. .gpio = 89, /* HSIC_DATA */
  510. .settings = {
  511. [GPIOMUX_ACTIVE] = &hsic_act_cfg,
  512. [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
  513. },
  514. },
  515. {
  516. .gpio = 47, /* wake up */
  517. .settings = {
  518. [GPIOMUX_ACTIVE] = &hsic_wakeup_act_cfg,
  519. [GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
  520. },
  521. },
  522. };
  523. #endif
  524. static struct gpiomux_setting mxt_reset_sus_cfg = {
  525. .func = GPIOMUX_FUNC_GPIO,
  526. .drv = GPIOMUX_DRV_6MA,
  527. .pull = GPIOMUX_PULL_DOWN,
  528. };
  529. static struct gpiomux_setting mxt_reset_act_cfg = {
  530. .func = GPIOMUX_FUNC_GPIO,
  531. .drv = GPIOMUX_DRV_6MA,
  532. .pull = GPIOMUX_PULL_UP,
  533. };
  534. static struct gpiomux_setting mxt_int_sus_cfg = {
  535. .func = GPIOMUX_FUNC_GPIO,
  536. .drv = GPIOMUX_DRV_2MA,
  537. .pull = GPIOMUX_PULL_DOWN,
  538. };
  539. static struct gpiomux_setting mxt_int_act_cfg = {
  540. .func = GPIOMUX_FUNC_GPIO,
  541. .drv = GPIOMUX_DRV_8MA,
  542. .pull = GPIOMUX_PULL_UP,
  543. };
  544. static struct msm_gpiomux_config apq8064_hdmi_configs[] __initdata = {
  545. {
  546. .gpio = 69,
  547. .settings = {
  548. [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
  549. [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
  550. },
  551. },
  552. {
  553. .gpio = 70,
  554. .settings = {
  555. [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
  556. [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
  557. },
  558. },
  559. {
  560. .gpio = 71,
  561. .settings = {
  562. [GPIOMUX_ACTIVE] = &hdmi_active_1_cfg,
  563. [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
  564. },
  565. },
  566. {
  567. .gpio = 72,
  568. .settings = {
  569. [GPIOMUX_ACTIVE] = &hdmi_active_2_cfg,
  570. [GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
  571. },
  572. },
  573. };
  574. static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
  575. {
  576. .gpio = 8, /* GSBI3 I2C QUP SDA */
  577. .settings = {
  578. [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
  579. [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
  580. },
  581. },
  582. {
  583. .gpio = 9, /* GSBI3 I2C QUP SCL */
  584. .settings = {
  585. [GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
  586. [GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
  587. },
  588. },
  589. {
  590. .gpio = 18, /* GSBI1 UART TX */
  591. .settings = {
  592. [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
  593. },
  594. },
  595. {
  596. .gpio = 19, /* GSBI1 UART RX */
  597. .settings = {
  598. [GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
  599. },
  600. },
  601. #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  602. {
  603. .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
  604. .settings = {
  605. [GPIOMUX_SUSPENDED] = &gpio_spi_config,
  606. },
  607. },
  608. {
  609. .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
  610. .settings = {
  611. [GPIOMUX_SUSPENDED] = &gpio_spi_config,
  612. },
  613. },
  614. {
  615. .gpio = 53, /* Funny CS0 */
  616. .settings = {
  617. [GPIOMUX_SUSPENDED] = &gpio_spi_config,
  618. },
  619. },
  620. {
  621. .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
  622. .settings = {
  623. [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
  624. },
  625. },
  626. {
  627. .gpio = 54, /* GSBI5 QUP SPI_CLK */
  628. .settings = {
  629. [GPIOMUX_SUSPENDED] = &gpio_spi_config,
  630. },
  631. },
  632. #endif
  633. {
  634. .gpio = 30, /* FP CS */
  635. .settings = {
  636. [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
  637. },
  638. },
  639. {
  640. .gpio = 32, /* EPM CS */
  641. .settings = {
  642. [GPIOMUX_SUSPENDED] = &gpio_epm_spi_cs_config,
  643. },
  644. },
  645. {
  646. .gpio = 53, /* NOR CS */
  647. .settings = {
  648. [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
  649. },
  650. },
  651. {
  652. .gpio = 82, /* GSBI7 UART2 TX */
  653. .settings = {
  654. [GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg,
  655. },
  656. },
  657. {
  658. .gpio = 83, /* GSBI7 UART2 RX */
  659. .settings = {
  660. [GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg,
  661. },
  662. },
  663. {
  664. .gpio = 21, /* GSBI1 QUP I2C_CLK */
  665. .settings = {
  666. [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
  667. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  668. },
  669. },
  670. {
  671. .gpio = 20, /* GSBI1 QUP I2C_DATA */
  672. .settings = {
  673. [GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
  674. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  675. },
  676. },
  677. };
  678. static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
  679. {
  680. .gpio = 40, /* slimbus clk */
  681. .settings = {
  682. [GPIOMUX_SUSPENDED] = &slimbus,
  683. },
  684. },
  685. {
  686. .gpio = 41, /* slimbus data */
  687. .settings = {
  688. [GPIOMUX_SUSPENDED] = &slimbus,
  689. },
  690. },
  691. };
  692. static struct gpiomux_setting spkr_i2c = {
  693. .func = GPIOMUX_FUNC_1,
  694. .drv = GPIOMUX_DRV_8MA,
  695. .pull = GPIOMUX_PULL_KEEPER,
  696. };
  697. static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
  698. {
  699. .gpio = 47, /* spkr i2c sck */
  700. .settings = {
  701. [GPIOMUX_SUSPENDED] = &spkr_i2c,
  702. },
  703. },
  704. {
  705. .gpio = 48, /* spkr_i2s_ws */
  706. .settings = {
  707. [GPIOMUX_SUSPENDED] = &spkr_i2c,
  708. },
  709. },
  710. {
  711. .gpio = 49, /* spkr_i2s_dout */
  712. .settings = {
  713. [GPIOMUX_SUSPENDED] = &spkr_i2c,
  714. },
  715. },
  716. {
  717. .gpio = 50, /* spkr_i2s_mclk */
  718. .settings = {
  719. [GPIOMUX_SUSPENDED] = &spkr_i2c,
  720. },
  721. },
  722. };
  723. static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
  724. {
  725. .gpio = 38,
  726. .settings = {
  727. [GPIOMUX_SUSPENDED] = &mbhc_hs_detect,
  728. },
  729. },
  730. {
  731. .gpio = 39,
  732. .settings = {
  733. [GPIOMUX_SUSPENDED] = &cdc_mclk,
  734. },
  735. },
  736. };
  737. /* External 3.3 V regulator enable */
  738. static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = {
  739. {
  740. .gpio = APQ8064_EXT_3P3V_REG_EN_GPIO,
  741. .settings = {
  742. [GPIOMUX_SUSPENDED] = &ext_regulator_config,
  743. },
  744. },
  745. };
  746. static struct gpiomux_setting ap2mdm_cfg = {
  747. .func = GPIOMUX_FUNC_GPIO,
  748. .drv = GPIOMUX_DRV_8MA,
  749. .pull = GPIOMUX_PULL_DOWN,
  750. };
  751. static struct gpiomux_setting mdm2ap_status_cfg = {
  752. .func = GPIOMUX_FUNC_GPIO,
  753. .drv = GPIOMUX_DRV_8MA,
  754. .pull = GPIOMUX_PULL_DOWN,
  755. };
  756. static struct gpiomux_setting mdm2ap_errfatal_cfg = {
  757. .func = GPIOMUX_FUNC_GPIO,
  758. .drv = GPIOMUX_DRV_16MA,
  759. .pull = GPIOMUX_PULL_DOWN,
  760. };
  761. static struct gpiomux_setting mdm2ap_pblrdy = {
  762. .func = GPIOMUX_FUNC_GPIO,
  763. .drv = GPIOMUX_DRV_16MA,
  764. .pull = GPIOMUX_PULL_DOWN,
  765. };
  766. static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
  767. .func = GPIOMUX_FUNC_GPIO,
  768. .drv = GPIOMUX_DRV_8MA,
  769. .pull = GPIOMUX_PULL_DOWN,
  770. };
  771. static struct gpiomux_setting ap2mdm_wakeup = {
  772. .func = GPIOMUX_FUNC_GPIO,
  773. .drv = GPIOMUX_DRV_8MA,
  774. .pull = GPIOMUX_PULL_DOWN,
  775. };
  776. static struct msm_gpiomux_config mdm_configs[] __initdata = {
  777. /* AP2MDM_STATUS */
  778. {
  779. .gpio = 48,
  780. .settings = {
  781. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  782. }
  783. },
  784. /* MDM2AP_STATUS */
  785. {
  786. .gpio = 49,
  787. .settings = {
  788. [GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
  789. [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
  790. }
  791. },
  792. /* MDM2AP_ERRFATAL */
  793. {
  794. .gpio = 19,
  795. .settings = {
  796. [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
  797. }
  798. },
  799. /* AP2MDM_ERRFATAL */
  800. {
  801. .gpio = 18,
  802. .settings = {
  803. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  804. }
  805. },
  806. /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
  807. {
  808. .gpio = 27,
  809. .settings = {
  810. [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
  811. }
  812. },
  813. /* AP2MDM_WAKEUP */
  814. {
  815. .gpio = 35,
  816. .settings = {
  817. [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
  818. }
  819. },
  820. /* MDM2AP_PBL_READY*/
  821. {
  822. .gpio = 46,
  823. .settings = {
  824. [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
  825. }
  826. },
  827. };
  828. static struct msm_gpiomux_config amdm_configs[] __initdata = {
  829. /* AP2MDM_STATUS */
  830. {
  831. .gpio = 48,
  832. .settings = {
  833. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  834. }
  835. },
  836. /* MDM2AP_STATUS */
  837. {
  838. .gpio = 49,
  839. .settings = {
  840. [GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
  841. [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
  842. }
  843. },
  844. /* MDM2AP_ERRFATAL */
  845. {
  846. .gpio = 19,
  847. .settings = {
  848. [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
  849. }
  850. },
  851. /* AP2MDM_ERRFATAL */
  852. {
  853. .gpio = 18,
  854. .settings = {
  855. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  856. }
  857. },
  858. /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
  859. {
  860. .gpio = 27,
  861. .settings = {
  862. [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
  863. }
  864. },
  865. /* AP2MDM_WAKEUP */
  866. {
  867. .gpio = 35,
  868. .settings = {
  869. [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
  870. }
  871. },
  872. /* MDM2AP_PBL_READY*/
  873. {
  874. .gpio = 31,
  875. .settings = {
  876. [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
  877. }
  878. },
  879. };
  880. static struct msm_gpiomux_config bmdm_configs[] __initdata = {
  881. /* AP2MDM_STATUS */
  882. {
  883. .gpio = 56,
  884. .settings = {
  885. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  886. }
  887. },
  888. /* MDM2AP_STATUS */
  889. {
  890. .gpio = 32,
  891. .settings = {
  892. [GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
  893. [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
  894. }
  895. },
  896. /* MDM2AP_ERRFATAL */
  897. {
  898. .gpio = 81,
  899. .settings = {
  900. [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
  901. }
  902. },
  903. /* AP2MDM_ERRFATAL */
  904. {
  905. .gpio = 18,
  906. .settings = {
  907. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  908. }
  909. },
  910. /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
  911. {
  912. .gpio = 3,
  913. .settings = {
  914. [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
  915. }
  916. },
  917. /* AP2MDM_WAKEUP */
  918. {
  919. .gpio = 29,
  920. .settings = {
  921. [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
  922. }
  923. },
  924. };
  925. static struct msm_gpiomux_config mdm_i2s_configs[] __initdata = {
  926. /* AP2MDM_STATUS */
  927. {
  928. .gpio = 48,
  929. .settings = {
  930. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  931. }
  932. },
  933. /* MDM2AP_STATUS */
  934. {
  935. .gpio = 49,
  936. .settings = {
  937. [GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
  938. }
  939. },
  940. /* MDM2AP_ERRFATAL */
  941. {
  942. .gpio = 19,
  943. .settings = {
  944. [GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
  945. }
  946. },
  947. /* AP2MDM_ERRFATAL */
  948. {
  949. .gpio = 18,
  950. .settings = {
  951. [GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
  952. }
  953. },
  954. /* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
  955. {
  956. .gpio = 0,
  957. .settings = {
  958. [GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
  959. }
  960. },
  961. /* AP2MDM_WAKEUP */
  962. {
  963. .gpio = 44,
  964. .settings = {
  965. [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
  966. }
  967. },
  968. /* MDM2AP_PBL_READY*/
  969. {
  970. .gpio = 81,
  971. .settings = {
  972. [GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
  973. }
  974. },
  975. };
  976. static struct gpiomux_setting mi2s_act_cfg = {
  977. .func = GPIOMUX_FUNC_1,
  978. .drv = GPIOMUX_DRV_8MA,
  979. .pull = GPIOMUX_PULL_NONE,
  980. };
  981. static struct gpiomux_setting mi2s_sus_cfg = {
  982. .func = GPIOMUX_FUNC_GPIO,
  983. .drv = GPIOMUX_DRV_2MA,
  984. .pull = GPIOMUX_PULL_DOWN,
  985. };
  986. static struct msm_gpiomux_config mpq8064_mi2s_configs[] __initdata = {
  987. {
  988. .gpio = 27, /* mi2s ws */
  989. .settings = {
  990. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  991. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  992. },
  993. },
  994. {
  995. .gpio = 28, /* mi2s sclk */
  996. .settings = {
  997. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  998. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  999. },
  1000. },
  1001. {
  1002. .gpio = 29, /* mi2s dout3 */
  1003. .settings = {
  1004. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  1005. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  1006. },
  1007. },
  1008. {
  1009. .gpio = 30, /* mi2s dout2 */
  1010. .settings = {
  1011. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  1012. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  1013. },
  1014. },
  1015. {
  1016. .gpio = 31, /* mi2s dout1 */
  1017. .settings = {
  1018. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  1019. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  1020. },
  1021. },
  1022. {
  1023. .gpio = 32, /* mi2s dout0 */
  1024. .settings = {
  1025. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  1026. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  1027. },
  1028. },
  1029. {
  1030. .gpio = 33, /* mi2s mclk */
  1031. .settings = {
  1032. [GPIOMUX_ACTIVE] = &mi2s_act_cfg,
  1033. [GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
  1034. },
  1035. },
  1036. };
  1037. static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
  1038. { /* TS INTERRUPT */
  1039. .gpio = 6,
  1040. .settings = {
  1041. [GPIOMUX_ACTIVE] = &mxt_int_act_cfg,
  1042. [GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg,
  1043. },
  1044. },
  1045. { /* TS RESET */
  1046. .gpio = 33,
  1047. .settings = {
  1048. [GPIOMUX_ACTIVE] = &mxt_reset_act_cfg,
  1049. [GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg,
  1050. },
  1051. },
  1052. };
  1053. static struct msm_gpiomux_config wcnss_5wire_interface[] = {
  1054. {
  1055. .gpio = 64,
  1056. .settings = {
  1057. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  1058. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  1059. },
  1060. },
  1061. {
  1062. .gpio = 65,
  1063. .settings = {
  1064. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  1065. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  1066. },
  1067. },
  1068. {
  1069. .gpio = 66,
  1070. .settings = {
  1071. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  1072. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  1073. },
  1074. },
  1075. {
  1076. .gpio = 67,
  1077. .settings = {
  1078. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  1079. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  1080. },
  1081. },
  1082. {
  1083. .gpio = 68,
  1084. .settings = {
  1085. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  1086. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  1087. },
  1088. },
  1089. };
  1090. static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
  1091. {
  1092. .gpio = 53, /* GSBI5 I2C QUP SDA */
  1093. .settings = {
  1094. [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
  1095. [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
  1096. },
  1097. },
  1098. {
  1099. .gpio = 54, /* GSBI5 I2C QUP SCL */
  1100. .settings = {
  1101. [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
  1102. [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
  1103. },
  1104. },
  1105. };
  1106. static struct gpiomux_setting ir_suspended_cfg = {
  1107. .func = GPIOMUX_FUNC_GPIO,
  1108. .drv = GPIOMUX_DRV_2MA,
  1109. .pull = GPIOMUX_PULL_UP,
  1110. };
  1111. static struct gpiomux_setting ir_active_cfg = {
  1112. .func = GPIOMUX_FUNC_GPIO,
  1113. .drv = GPIOMUX_DRV_8MA,
  1114. .pull = GPIOMUX_PULL_UP,
  1115. };
  1116. static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
  1117. {
  1118. .gpio = 88, /* GPIO IR */
  1119. .settings = {
  1120. [GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
  1121. [GPIOMUX_ACTIVE] = &ir_active_cfg,
  1122. },
  1123. },
  1124. };
  1125. static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
  1126. {
  1127. .gpio = 81,
  1128. .settings = {
  1129. [GPIOMUX_SUSPENDED] = &sx150x_suspended_cfg,
  1130. [GPIOMUX_ACTIVE] = &sx150x_active_cfg,
  1131. },
  1132. },
  1133. };
  1134. #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
  1135. static struct gpiomux_setting sdc2_clk_active_cfg = {
  1136. .func = GPIOMUX_FUNC_2,
  1137. .drv = GPIOMUX_DRV_8MA,
  1138. .pull = GPIOMUX_PULL_NONE,
  1139. };
  1140. static struct gpiomux_setting sdc2_cmd_data_0_3_active_cfg = {
  1141. .func = GPIOMUX_FUNC_2,
  1142. .drv = GPIOMUX_DRV_8MA,
  1143. .pull = GPIOMUX_PULL_UP,
  1144. };
  1145. static struct gpiomux_setting sdc2_suspended_cfg = {
  1146. .func = GPIOMUX_FUNC_GPIO,
  1147. .drv = GPIOMUX_DRV_2MA,
  1148. .pull = GPIOMUX_PULL_DOWN,
  1149. };
  1150. static struct gpiomux_setting sdc2_data_1_suspended_cfg = {
  1151. .func = GPIOMUX_FUNC_GPIO,
  1152. .drv = GPIOMUX_DRV_2MA,
  1153. .pull = GPIOMUX_PULL_UP,
  1154. };
  1155. static struct msm_gpiomux_config apq8064_sdc2_configs[] __initdata = {
  1156. {
  1157. .gpio = 59,
  1158. .settings = {
  1159. [GPIOMUX_ACTIVE] = &sdc2_clk_active_cfg,
  1160. [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
  1161. },
  1162. },
  1163. {
  1164. .gpio = 57,
  1165. .settings = {
  1166. [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
  1167. [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
  1168. },
  1169. },
  1170. {
  1171. .gpio = 62,
  1172. .settings = {
  1173. [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
  1174. [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
  1175. },
  1176. },
  1177. {
  1178. .gpio = 61,
  1179. .settings = {
  1180. [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
  1181. [GPIOMUX_SUSPENDED] = &sdc2_data_1_suspended_cfg,
  1182. },
  1183. },
  1184. {
  1185. .gpio = 60,
  1186. .settings = {
  1187. [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
  1188. [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
  1189. },
  1190. },
  1191. {
  1192. .gpio = 58,
  1193. .settings = {
  1194. [GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
  1195. [GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
  1196. },
  1197. },
  1198. };
  1199. #endif
  1200. #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
  1201. static struct gpiomux_setting sdc4_clk_active_cfg = {
  1202. .func = GPIOMUX_FUNC_2,
  1203. .drv = GPIOMUX_DRV_8MA,
  1204. .pull = GPIOMUX_PULL_NONE,
  1205. };
  1206. static struct gpiomux_setting sdc4_cmd_data_0_3_active_cfg = {
  1207. .func = GPIOMUX_FUNC_2,
  1208. .drv = GPIOMUX_DRV_8MA,
  1209. .pull = GPIOMUX_PULL_UP,
  1210. };
  1211. static struct gpiomux_setting sdc4_suspended_cfg = {
  1212. .func = GPIOMUX_FUNC_GPIO,
  1213. .drv = GPIOMUX_DRV_2MA,
  1214. .pull = GPIOMUX_PULL_DOWN,
  1215. };
  1216. static struct gpiomux_setting sdc4_data_1_suspended_cfg = {
  1217. .func = GPIOMUX_FUNC_GPIO,
  1218. .drv = GPIOMUX_DRV_2MA,
  1219. .pull = GPIOMUX_PULL_UP,
  1220. };
  1221. static struct msm_gpiomux_config apq8064_sdc4_configs[] __initdata = {
  1222. {
  1223. .gpio = 68,
  1224. .settings = {
  1225. [GPIOMUX_ACTIVE] = &sdc4_clk_active_cfg,
  1226. [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
  1227. },
  1228. },
  1229. {
  1230. .gpio = 67,
  1231. .settings = {
  1232. [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
  1233. [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
  1234. },
  1235. },
  1236. {
  1237. .gpio = 66,
  1238. .settings = {
  1239. [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
  1240. [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
  1241. },
  1242. },
  1243. {
  1244. .gpio = 65,
  1245. .settings = {
  1246. [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
  1247. [GPIOMUX_SUSPENDED] = &sdc4_data_1_suspended_cfg,
  1248. },
  1249. },
  1250. {
  1251. .gpio = 64,
  1252. .settings = {
  1253. [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
  1254. [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
  1255. },
  1256. },
  1257. {
  1258. .gpio = 63,
  1259. .settings = {
  1260. [GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
  1261. [GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
  1262. },
  1263. },
  1264. };
  1265. #endif
  1266. static struct gpiomux_setting apq8064_sdc3_card_det_cfg = {
  1267. .func = GPIOMUX_FUNC_GPIO,
  1268. .drv = GPIOMUX_DRV_2MA,
  1269. .pull = GPIOMUX_PULL_UP,
  1270. };
  1271. static struct msm_gpiomux_config apq8064_sdc3_configs[] __initdata = {
  1272. {
  1273. .gpio = 26,
  1274. .settings = {
  1275. [GPIOMUX_SUSPENDED] = &apq8064_sdc3_card_det_cfg,
  1276. [GPIOMUX_ACTIVE] = &apq8064_sdc3_card_det_cfg,
  1277. },
  1278. },
  1279. };
  1280. void __init apq8064_init_gpiomux(void)
  1281. {
  1282. int rc;
  1283. int platform_version = socinfo_get_platform_version();
  1284. rc = msm_gpiomux_init(NR_GPIO_IRQS);
  1285. if (rc) {
  1286. pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
  1287. return;
  1288. }
  1289. msm_gpiomux_install(wcnss_5wire_interface,
  1290. ARRAY_SIZE(wcnss_5wire_interface));
  1291. if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
  1292. machine_is_mpq8064_dtv()) {
  1293. msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
  1294. ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
  1295. #ifdef CONFIG_MSM_VCAP
  1296. msm_gpiomux_install(vcap_configs,
  1297. ARRAY_SIZE(vcap_configs));
  1298. #endif
  1299. msm_gpiomux_install(sx150x_int_configs,
  1300. ARRAY_SIZE(sx150x_int_configs));
  1301. } else {
  1302. #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  1303. msm_gpiomux_install(apq8064_ethernet_configs,
  1304. ARRAY_SIZE(apq8064_ethernet_configs));
  1305. #endif
  1306. msm_gpiomux_install(apq8064_gsbi_configs,
  1307. ARRAY_SIZE(apq8064_gsbi_configs));
  1308. }
  1309. msm_gpiomux_install(apq8064_slimbus_config,
  1310. ARRAY_SIZE(apq8064_slimbus_config));
  1311. msm_gpiomux_install(apq8064_audio_codec_configs,
  1312. ARRAY_SIZE(apq8064_audio_codec_configs));
  1313. if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
  1314. machine_is_mpq8064_dtv()) {
  1315. msm_gpiomux_install(mpq8064_spkr_i2s_config,
  1316. ARRAY_SIZE(mpq8064_spkr_i2s_config));
  1317. }
  1318. pr_debug("%s(): audio-auxpcm: Include GPIO configs"
  1319. " as audio is not the primary user"
  1320. " for these GPIO Pins\n", __func__);
  1321. if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
  1322. machine_is_mpq8064_dtv())
  1323. msm_gpiomux_install(mpq8064_mi2s_configs,
  1324. ARRAY_SIZE(mpq8064_mi2s_configs));
  1325. msm_gpiomux_install(apq8064_ext_regulator_configs,
  1326. ARRAY_SIZE(apq8064_ext_regulator_configs));
  1327. if (machine_is_apq8064_mtp()) {
  1328. if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
  1329. msm_gpiomux_install(amdm_configs,
  1330. ARRAY_SIZE(amdm_configs));
  1331. msm_gpiomux_install(bmdm_configs,
  1332. ARRAY_SIZE(bmdm_configs));
  1333. } else if (SOCINFO_VERSION_MINOR(platform_version) == 1)
  1334. msm_gpiomux_install(mdm_i2s_configs,
  1335. ARRAY_SIZE(mdm_i2s_configs));
  1336. else
  1337. msm_gpiomux_install(mdm_configs,
  1338. ARRAY_SIZE(mdm_configs));
  1339. }
  1340. if (machine_is_apq8064_mtp()) {
  1341. if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
  1342. msm_gpiomux_install(cyts_gpio_alt_config,
  1343. ARRAY_SIZE(cyts_gpio_alt_config));
  1344. } else {
  1345. msm_gpiomux_install(cyts_gpio_configs,
  1346. ARRAY_SIZE(cyts_gpio_configs));
  1347. }
  1348. }
  1349. #ifdef CONFIG_USB_EHCI_MSM_HSIC
  1350. if (machine_is_apq8064_mtp())
  1351. msm_gpiomux_install(apq8064_hsic_configs,
  1352. ARRAY_SIZE(apq8064_hsic_configs));
  1353. #endif
  1354. if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
  1355. msm_gpiomux_install(apq8064_mxt_configs,
  1356. ARRAY_SIZE(apq8064_mxt_configs));
  1357. msm_gpiomux_install(apq8064_hdmi_configs,
  1358. ARRAY_SIZE(apq8064_hdmi_configs));
  1359. if (machine_is_mpq8064_cdp())
  1360. msm_gpiomux_install(mpq8064_ir_configs,
  1361. ARRAY_SIZE(mpq8064_ir_configs));
  1362. #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
  1363. msm_gpiomux_install(apq8064_sdc2_configs,
  1364. ARRAY_SIZE(apq8064_sdc2_configs));
  1365. #endif
  1366. #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
  1367. msm_gpiomux_install(apq8064_sdc4_configs,
  1368. ARRAY_SIZE(apq8064_sdc4_configs));
  1369. #endif
  1370. msm_gpiomux_install(apq8064_sdc3_configs,
  1371. ARRAY_SIZE(apq8064_sdc3_configs));
  1372. }