board-matisse-gpiomux.c 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868
  1. /* Copyright (c) 2012-2013, 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. /****************************** Revision History ******************************************
  14. *CH# Product author Description Date
  15. *-----------------------------------------------------------------------------------------
  16. *01 Millet-All nc.chaudhary Added the gpiomux settings for 30-Jan-2014
  17. * variants UART for LCIA Test failure
  18. ******************************************************************************************
  19. */
  20. #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
  21. #include <linux/gpio.h>
  22. #endif
  23. #include <linux/init.h>
  24. #include <linux/ioport.h>
  25. #include <mach/board.h>
  26. #include <mach/gpio.h>
  27. #include <mach/gpiomux.h>
  28. #include <mach/socinfo.h>
  29. #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
  30. #define WLAN_CLK 44
  31. #define WLAN_SET 43
  32. #define WLAN_DATA0 42
  33. #define WLAN_DATA1 41
  34. #define WLAN_DATA2 40
  35. #endif
  36. #ifdef CONFIG_USB_EHCI_MSM_HSIC
  37. #if !defined(CONFIG_MACH_MATISSE3G_OPEN)
  38. static struct gpiomux_setting hsic_sus_cfg = {
  39. .func = GPIOMUX_FUNC_GPIO,
  40. .drv = GPIOMUX_DRV_2MA,
  41. .pull = GPIOMUX_PULL_DOWN,
  42. .dir = GPIOMUX_OUT_LOW,
  43. };
  44. static struct gpiomux_setting hsic_act_cfg = {
  45. .func = GPIOMUX_FUNC_1,
  46. .drv = GPIOMUX_DRV_16MA,
  47. .pull = GPIOMUX_PULL_NONE,
  48. };
  49. static struct msm_gpiomux_config msm_hsic_configs[] = {
  50. {
  51. .gpio = 115, /* HSIC_STROBE */
  52. .settings = {
  53. [GPIOMUX_ACTIVE] = &hsic_act_cfg,
  54. [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
  55. },
  56. },
  57. {
  58. .gpio = 116, /* HSIC_DATA */
  59. .settings = {
  60. [GPIOMUX_ACTIVE] = &hsic_act_cfg,
  61. [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
  62. },
  63. },
  64. };
  65. #endif
  66. #endif
  67. #define KS8851_IRQ_GPIO 115
  68. #if defined(CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC) || defined(CONFIG_MACH_MATISSE3G_OPEN)
  69. #define NC_GPIO_CONFIG(gpio_num) { \
  70. .gpio = gpio_num, \
  71. .settings ={[GPIOMUX_SUSPENDED] = &nc_cfg,}\
  72. }
  73. #define MAKE_NC_CONFIG_INIT_SLEEP(gpio_num) { \
  74. .gpio = gpio_num, \
  75. .settings ={\
  76. [GPIOMUX_ACTIVE] = &nc_cfg,\
  77. [GPIOMUX_SUSPENDED] = &nc_cfg,\
  78. }\
  79. }
  80. static struct gpiomux_setting nc_cfg = {
  81. .func = GPIOMUX_FUNC_GPIO,
  82. .drv = GPIOMUX_DRV_2MA,
  83. .pull = GPIOMUX_PULL_DOWN,
  84. .dir = GPIOMUX_IN,
  85. };
  86. #endif
  87. #if defined(CONFIG_MACH_MATISSEWIFI_OPEN) || defined(CONFIG_MACH_MATISSELTE_OPEN) || \
  88. defined(CONFIG_MACH_MATISSEWIFIUS_OPEN)
  89. #define MAKE_NC_CONFIG_INIT_SLEEP(gpio_num) { \
  90. .gpio = gpio_num, \
  91. .settings ={ \
  92. [GPIOMUX_ACTIVE] = &nc_cfg_gpios,\
  93. [GPIOMUX_SUSPENDED] = &nc_cfg_gpios,\
  94. }\
  95. }
  96. static struct gpiomux_setting nc_cfg_gpios = {
  97. .func = GPIOMUX_FUNC_GPIO,
  98. .drv = GPIOMUX_DRV_2MA,
  99. .pull = GPIOMUX_PULL_DOWN,
  100. .dir = GPIOMUX_IN,
  101. };
  102. #endif
  103. #if defined(CONFIG_MACH_MATISSEWIFI_OPEN)
  104. static struct msm_gpiomux_config matissewifi_open_nc_gpio_cfgs[] __initdata = {
  105. MAKE_NC_CONFIG_INIT_SLEEP(0),
  106. MAKE_NC_CONFIG_INIT_SLEEP(1),
  107. MAKE_NC_CONFIG_INIT_SLEEP(4),
  108. MAKE_NC_CONFIG_INIT_SLEEP(32),
  109. MAKE_NC_CONFIG_INIT_SLEEP(56),
  110. MAKE_NC_CONFIG_INIT_SLEEP(57),
  111. MAKE_NC_CONFIG_INIT_SLEEP(58),
  112. MAKE_NC_CONFIG_INIT_SLEEP(59),
  113. MAKE_NC_CONFIG_INIT_SLEEP(60),
  114. MAKE_NC_CONFIG_INIT_SLEEP(62),
  115. MAKE_NC_CONFIG_INIT_SLEEP(66),
  116. MAKE_NC_CONFIG_INIT_SLEEP(116),
  117. };
  118. #endif
  119. #if defined(CONFIG_MACH_MATISSEWIFIUS_OPEN)
  120. static struct msm_gpiomux_config matissewifiue_open_nc_gpio_cfgs[] __initdata = {
  121. #ifndef CONFIG_NFC_PN547
  122. MAKE_NC_CONFIG_INIT_SLEEP(0),
  123. MAKE_NC_CONFIG_INIT_SLEEP(1),
  124. #endif
  125. #ifndef CONFIG_IR_REMOCON_MC96FR116
  126. MAKE_NC_CONFIG_INIT_SLEEP(4),
  127. MAKE_NC_CONFIG_INIT_SLEEP(5),
  128. MAKE_NC_CONFIG_INIT_SLEEP(62),
  129. MAKE_NC_CONFIG_INIT_SLEEP(116),
  130. #endif
  131. MAKE_NC_CONFIG_INIT_SLEEP(32),
  132. MAKE_NC_CONFIG_INIT_SLEEP(56),
  133. MAKE_NC_CONFIG_INIT_SLEEP(57),
  134. MAKE_NC_CONFIG_INIT_SLEEP(58),
  135. MAKE_NC_CONFIG_INIT_SLEEP(59),
  136. MAKE_NC_CONFIG_INIT_SLEEP(60),
  137. MAKE_NC_CONFIG_INIT_SLEEP(66),
  138. };
  139. static struct msm_gpiomux_config matissewifiue_open_nc_gpio_rev5_cfgs[] __initdata = {
  140. MAKE_NC_CONFIG_INIT_SLEEP(53),
  141. };
  142. #if defined(CONFIG_MACH_MATISSEWIFIUS_GOOGLE)
  143. static struct msm_gpiomux_config matissewifigl_irda_irq_cfg_64[] __initdata = {
  144. MAKE_NC_CONFIG_INIT_SLEEP(64),
  145. };
  146. static struct msm_gpiomux_config matissewifigl_irda_irq_cfg_65[] __initdata = {
  147. MAKE_NC_CONFIG_INIT_SLEEP(65),
  148. };
  149. #endif
  150. #endif
  151. #if defined(CONFIG_MACH_MATISSELTE_OPEN)
  152. static struct msm_gpiomux_config matisselte_open_nc_gpio_cfgs[] __initdata = {
  153. MAKE_NC_CONFIG_INIT_SLEEP(4),
  154. };
  155. #endif
  156. #if defined(CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC)
  157. static struct msm_gpiomux_config matisseltevzw_nc_gpio_cfgs[] __initdata = {
  158. NC_GPIO_CONFIG(83),
  159. NC_GPIO_CONFIG(85),
  160. NC_GPIO_CONFIG(86),
  161. NC_GPIO_CONFIG(93),
  162. NC_GPIO_CONFIG(94),
  163. {
  164. .gpio = 115,
  165. .settings = {
  166. [GPIOMUX_ACTIVE] = &nc_cfg,
  167. [GPIOMUX_SUSPENDED] = &nc_cfg,
  168. }
  169. },
  170. {
  171. .gpio = 116,
  172. .settings = {
  173. [GPIOMUX_ACTIVE] = &nc_cfg,
  174. [GPIOMUX_SUSPENDED] = &nc_cfg,
  175. }
  176. },
  177. };
  178. #endif
  179. #if defined(CONFIG_MACH_MATISSE3G_OPEN)
  180. static struct msm_gpiomux_config matisse3g_nc_gpio_cfgs[] __initdata = {
  181. MAKE_NC_CONFIG_INIT_SLEEP(4),
  182. MAKE_NC_CONFIG_INIT_SLEEP(62),
  183. NC_GPIO_CONFIG(56),
  184. {
  185. .gpio = 116,
  186. .settings = {
  187. [GPIOMUX_ACTIVE] = &nc_cfg,
  188. [GPIOMUX_SUSPENDED] = &nc_cfg,
  189. }
  190. },
  191. };
  192. #endif
  193. #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  194. static struct gpiomux_setting gpio_eth_config = {
  195. .pull = GPIOMUX_PULL_UP,
  196. .drv = GPIOMUX_DRV_2MA,
  197. .func = GPIOMUX_FUNC_GPIO,
  198. };
  199. static struct msm_gpiomux_config msm_eth_configs[] = {
  200. {
  201. .gpio = KS8851_IRQ_GPIO,
  202. .settings = {
  203. [GPIOMUX_SUSPENDED] = &gpio_eth_config,
  204. }
  205. },
  206. };
  207. #endif
  208. #if defined (CONFIG_MACH_BERLUTI3G_EUR)
  209. static struct gpiomux_setting cypress_int_act_cfg = {
  210. .func = GPIOMUX_FUNC_GPIO,
  211. .drv = GPIOMUX_DRV_8MA,
  212. .pull = GPIOMUX_PULL_UP,
  213. };
  214. static struct gpiomux_setting cypress_int_sus_cfg = {
  215. .func = GPIOMUX_FUNC_GPIO,
  216. .drv = GPIOMUX_DRV_2MA,
  217. .pull = GPIOMUX_PULL_DOWN,
  218. };
  219. static struct gpiomux_setting gpio_i2c_tkey_active_config = {
  220. .func = GPIOMUX_FUNC_GPIO,
  221. .drv = GPIOMUX_DRV_2MA,
  222. .pull = GPIOMUX_PULL_NONE,
  223. };
  224. static struct gpiomux_setting gpio_i2c_tkey_suspend_config = {
  225. .func = GPIOMUX_FUNC_GPIO,
  226. .drv = GPIOMUX_DRV_2MA,
  227. .pull = GPIOMUX_PULL_DOWN,
  228. };
  229. #else
  230. static struct gpiomux_setting synaptics_int_act_cfg = {
  231. .func = GPIOMUX_FUNC_GPIO,
  232. .drv = GPIOMUX_DRV_8MA,
  233. .pull = GPIOMUX_PULL_UP,
  234. };
  235. static struct gpiomux_setting synaptics_int_sus_cfg = {
  236. .func = GPIOMUX_FUNC_GPIO,
  237. .drv = GPIOMUX_DRV_2MA,
  238. .pull = GPIOMUX_PULL_DOWN,
  239. };
  240. static struct gpiomux_setting synaptics_reset_act_cfg = {
  241. .func = GPIOMUX_FUNC_GPIO,
  242. .drv = GPIOMUX_DRV_6MA,
  243. .pull = GPIOMUX_PULL_DOWN,
  244. };
  245. static struct gpiomux_setting synaptics_reset_sus_cfg = {
  246. .func = GPIOMUX_FUNC_GPIO,
  247. .drv = GPIOMUX_DRV_2MA,
  248. .pull = GPIOMUX_PULL_DOWN,
  249. };
  250. #endif
  251. #if defined (CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC)
  252. static struct gpiomux_setting gpio_keys_vzw_active = {
  253. .func = GPIOMUX_FUNC_GPIO,
  254. .drv = GPIOMUX_DRV_2MA,
  255. .pull = GPIOMUX_PULL_NONE,
  256. .dir = GPIOMUX_IN,
  257. };
  258. #endif
  259. static struct gpiomux_setting gpio_keys_active = {
  260. .func = GPIOMUX_FUNC_GPIO,
  261. .drv = GPIOMUX_DRV_2MA,
  262. .pull = GPIOMUX_PULL_UP,
  263. .dir = GPIOMUX_IN,
  264. };
  265. static struct gpiomux_setting gpio_keys_suspend = {
  266. .func = GPIOMUX_FUNC_GPIO,
  267. .drv = GPIOMUX_DRV_2MA,
  268. .pull = GPIOMUX_PULL_NONE,
  269. };
  270. static struct gpiomux_setting hall_active_cfg = {
  271. .func = GPIOMUX_FUNC_GPIO,
  272. .drv = GPIOMUX_DRV_2MA,
  273. .pull = GPIOMUX_PULL_NONE,
  274. .dir = GPIOMUX_IN,
  275. };
  276. static struct gpiomux_setting hall_suspend_cfg = {
  277. .func = GPIOMUX_FUNC_GPIO,
  278. .drv = GPIOMUX_DRV_2MA,
  279. .pull = GPIOMUX_PULL_NONE,
  280. .dir = GPIOMUX_IN,
  281. };
  282. static struct msm_gpiomux_config msm_hall_configs[] __initdata = {
  283. {
  284. .gpio = 110,
  285. .settings = {
  286. [GPIOMUX_ACTIVE] = &hall_active_cfg,
  287. [GPIOMUX_SUSPENDED] = &hall_suspend_cfg,
  288. },
  289. },
  290. };
  291. #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
  292. static struct gpiomux_setting gpio_spi_act_config = {
  293. .func = GPIOMUX_FUNC_1,
  294. .drv = GPIOMUX_DRV_8MA,
  295. .pull = GPIOMUX_PULL_NONE,
  296. };
  297. static struct gpiomux_setting gpio_spi_cs_act_config = {
  298. .func = GPIOMUX_FUNC_1,
  299. .drv = GPIOMUX_DRV_6MA,
  300. .pull = GPIOMUX_PULL_DOWN,
  301. };
  302. static struct gpiomux_setting gpio_spi_susp_config = {
  303. .func = GPIOMUX_FUNC_GPIO,
  304. .drv = GPIOMUX_DRV_2MA,
  305. .pull = GPIOMUX_PULL_DOWN,
  306. };
  307. #endif
  308. #ifndef CONFIG_SND_SOC_MAX98504
  309. #if !defined (CONFIG_MACH_BERLUTI3G_EUR) && !defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  310. static struct gpiomux_setting gpio_spi_cs_eth_config = {
  311. .func = GPIOMUX_FUNC_4,
  312. .drv = GPIOMUX_DRV_6MA,
  313. .pull = GPIOMUX_PULL_DOWN,
  314. };
  315. #endif
  316. #endif
  317. static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
  318. .func = GPIOMUX_FUNC_GPIO,
  319. .drv = GPIOMUX_DRV_2MA,
  320. .pull = GPIOMUX_PULL_UP,
  321. };
  322. static struct gpiomux_setting wcnss_5wire_active_cfg = {
  323. .func = GPIOMUX_FUNC_1,
  324. .drv = GPIOMUX_DRV_6MA,
  325. .pull = GPIOMUX_PULL_DOWN,
  326. };
  327. #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
  328. static struct gpiomux_setting wcnss_5gpio_suspend_cfg = {
  329. .func = GPIOMUX_FUNC_GPIO,
  330. .drv = GPIOMUX_DRV_2MA,
  331. .pull = GPIOMUX_PULL_UP,
  332. };
  333. static struct gpiomux_setting wcnss_5gpio_active_cfg = {
  334. .func = GPIOMUX_FUNC_GPIO,
  335. .drv = GPIOMUX_DRV_6MA,
  336. .pull = GPIOMUX_PULL_DOWN,
  337. };
  338. #endif
  339. static struct gpiomux_setting gpio_i2c_config = {
  340. .func = GPIOMUX_FUNC_3,
  341. .drv = GPIOMUX_DRV_2MA,
  342. .pull = GPIOMUX_PULL_NONE,
  343. };
  344. static struct gpiomux_setting tsp_vendor_config = {
  345. .func = GPIOMUX_FUNC_GPIO,
  346. .drv = GPIOMUX_DRV_2MA,
  347. .pull = GPIOMUX_PULL_NONE,
  348. .dir = GPIOMUX_IN,
  349. };
  350. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  351. static struct gpiomux_setting accel_irq_config = {
  352. .func = GPIOMUX_FUNC_GPIO,
  353. .drv = GPIOMUX_DRV_2MA,
  354. .pull = GPIOMUX_PULL_DOWN,
  355. .dir = GPIOMUX_IN,
  356. };
  357. static struct gpiomux_setting grip_irq_config = {
  358. .func = GPIOMUX_FUNC_GPIO,
  359. .drv = GPIOMUX_DRV_2MA,
  360. .pull = GPIOMUX_PULL_NONE,
  361. .dir = GPIOMUX_IN,
  362. };
  363. #endif
  364. #if defined (CONFIG_MACH_BERLUTI3G_EUR)
  365. static struct gpiomux_setting gpio_uart_active_config = {
  366. .func = GPIOMUX_FUNC_2,
  367. .drv = GPIOMUX_DRV_8MA,
  368. .pull = GPIOMUX_PULL_DOWN,
  369. };
  370. static struct gpiomux_setting gpio_uart_sleep_config = {
  371. .func = GPIOMUX_FUNC_2,
  372. .drv = GPIOMUX_DRV_8MA,
  373. .pull = GPIOMUX_PULL_NONE,
  374. };
  375. static struct gpiomux_setting gpio_uart_rx_sleep_config = {
  376. .func = GPIOMUX_FUNC_2,
  377. .drv = GPIOMUX_DRV_8MA,
  378. .pull = GPIOMUX_PULL_DOWN,
  379. };
  380. static struct gpiomux_setting gpio_i2c_tsp_active_config = {
  381. .func = GPIOMUX_FUNC_GPIO,
  382. .drv = GPIOMUX_DRV_2MA,
  383. .pull = GPIOMUX_PULL_NONE,
  384. };
  385. static struct gpiomux_setting gpio_i2c_tsp_suspend_config = {
  386. .func = GPIOMUX_FUNC_GPIO,
  387. .drv = GPIOMUX_DRV_2MA,
  388. .pull = GPIOMUX_PULL_NONE,
  389. };
  390. #endif
  391. static struct msm_gpiomux_config msm_keypad_configs[] __initdata = {
  392. {
  393. .gpio = 106,
  394. .settings = {
  395. [GPIOMUX_ACTIVE] = &gpio_keys_active,
  396. [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
  397. },
  398. },
  399. {
  400. .gpio = 107,
  401. .settings = {
  402. [GPIOMUX_ACTIVE] = &gpio_keys_active,
  403. [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
  404. },
  405. },
  406. {
  407. .gpio = 108,
  408. .settings = {
  409. #if defined (CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC)
  410. [GPIOMUX_ACTIVE] = &gpio_keys_vzw_active,
  411. #else
  412. [GPIOMUX_ACTIVE] = &gpio_keys_active,
  413. #endif
  414. [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
  415. },
  416. },
  417. };
  418. static struct gpiomux_setting lcd_rst_act_cfg = {
  419. .func = GPIOMUX_FUNC_GPIO,
  420. .drv = GPIOMUX_DRV_2MA,
  421. .pull = GPIOMUX_PULL_NONE,
  422. .dir = GPIOMUX_OUT_HIGH,
  423. };
  424. static struct gpiomux_setting lcd_rst_sus_cfg = {
  425. .func = GPIOMUX_FUNC_GPIO,
  426. .drv = GPIOMUX_DRV_2MA,
  427. .pull = GPIOMUX_PULL_DOWN,
  428. .dir = GPIOMUX_OUT_LOW,
  429. };
  430. static struct gpiomux_setting lcd_in_gpio_cfg = {
  431. .func = GPIOMUX_FUNC_GPIO,
  432. .drv = GPIOMUX_DRV_2MA,
  433. .pull = GPIOMUX_PULL_NONE,
  434. .dir = GPIOMUX_IN,
  435. };
  436. static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
  437. {
  438. .gpio = 25, /* LVDS Ldo EN */
  439. .settings = {
  440. [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
  441. [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
  442. },
  443. },
  444. {
  445. .gpio = 53, /* LCD LDI INT */
  446. .settings = {
  447. [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
  448. [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
  449. },
  450. },
  451. {
  452. .gpio = 20, /* Backlight SDA */
  453. .settings = {
  454. [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
  455. [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
  456. },
  457. },
  458. {
  459. .gpio = 21, /* Backlight SCL */
  460. .settings = {
  461. [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
  462. [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
  463. },
  464. },
  465. #if defined(CONFIG_SEC_MATISSELTE_COMMON)
  466. {
  467. .gpio =56, /* Backlight Reset */
  468. .settings = {
  469. [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
  470. [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
  471. },
  472. },
  473. #else
  474. {
  475. .gpio = 74, /* Backlight Reset */
  476. .settings = {
  477. [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
  478. [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
  479. },
  480. },
  481. #endif
  482. {
  483. .gpio = 51, /*LVDS Reset*/
  484. .settings = {
  485. [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
  486. [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
  487. },
  488. },
  489. {
  490. .gpio = 33, /* Backlight PWM AP */
  491. .settings = {
  492. [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
  493. [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
  494. },
  495. },
  496. };
  497. static struct gpiomux_setting gpio_uart_config = {
  498. .func = GPIOMUX_FUNC_2,
  499. .drv = GPIOMUX_DRV_8MA,
  500. .pull = GPIOMUX_PULL_NONE, /*should be pulled None for UART */
  501. .dir = GPIOMUX_OUT_HIGH,
  502. };
  503. static struct gpiomux_setting rx_gpio_uart_config = {
  504. .func = GPIOMUX_FUNC_2,
  505. .drv = GPIOMUX_DRV_8MA,
  506. .pull = GPIOMUX_PULL_DOWN, /*LCIA Test failure*/
  507. .dir = GPIOMUX_OUT_HIGH,
  508. };
  509. static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
  510. {
  511. .gpio = 8, /* UART TX */
  512. .settings = {
  513. [GPIOMUX_SUSPENDED] = &gpio_uart_config,
  514. },
  515. },
  516. {
  517. .gpio = 9, /* UART RX */
  518. .settings = {
  519. [GPIOMUX_SUSPENDED] = &rx_gpio_uart_config,
  520. },
  521. },
  522. #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
  523. {
  524. .gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */
  525. .settings = {
  526. [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
  527. [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
  528. },
  529. },
  530. {
  531. .gpio = 1, /* BLSP1 QUP1 SPI_DATA_MISO */
  532. .settings = {
  533. [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
  534. [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
  535. },
  536. },
  537. {
  538. .gpio = 2, /* BLSP1 QUP1 SPI_CS1 */
  539. .settings = {
  540. [GPIOMUX_ACTIVE] = &gpio_spi_cs_act_config,
  541. [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
  542. },
  543. },
  544. {
  545. .gpio = 3, /* BLSP1 QUP1 SPI_CLK */
  546. .settings = {
  547. [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
  548. [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
  549. },
  550. },
  551. #endif
  552. #if !defined(CONFIG_SEC_MILLET_PROJECT) || !defined(CONFIG_SEC_MATISSE_PROJECT)
  553. {
  554. .gpio = 14, /* BLSP1 QUP4 I2C_SDA */
  555. .settings = {
  556. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  557. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  558. },
  559. },
  560. {
  561. .gpio = 15, /* BLSP1 QUP4 I2C_SCL */
  562. .settings = {
  563. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  564. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  565. },
  566. },
  567. #endif
  568. #ifdef CONFIG_MACH_BERLUTI3G_EUR
  569. {
  570. .gpio = 8, /* BLSP1 UART2 TX */
  571. .settings = {
  572. [GPIOMUX_ACTIVE] = &gpio_uart_active_config,
  573. [GPIOMUX_SUSPENDED] = &gpio_uart_sleep_config,
  574. },
  575. },
  576. {
  577. .gpio = 9, /* BLSP1 UART2 RX */
  578. .settings = {
  579. [GPIOMUX_ACTIVE] = &gpio_uart_active_config,
  580. [GPIOMUX_SUSPENDED] = &gpio_uart_rx_sleep_config,
  581. },
  582. },
  583. {
  584. .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
  585. .settings = {
  586. [GPIOMUX_ACTIVE] = &gpio_i2c_tsp_active_config,
  587. [GPIOMUX_SUSPENDED] = &gpio_i2c_tsp_suspend_config,
  588. },
  589. },
  590. {
  591. .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
  592. .settings = {
  593. [GPIOMUX_ACTIVE] = &gpio_i2c_tsp_active_config,
  594. [GPIOMUX_SUSPENDED] = &gpio_i2c_tsp_suspend_config,
  595. },
  596. },
  597. #else
  598. {
  599. .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
  600. .settings = {
  601. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  602. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  603. },
  604. },
  605. {
  606. .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
  607. .settings = {
  608. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  609. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  610. },
  611. },
  612. #endif
  613. {
  614. .gpio = 55, /* BLSP1 QUP5 I2C_SCL */
  615. .settings = {
  616. [GPIOMUX_ACTIVE] = &tsp_vendor_config,
  617. [GPIOMUX_SUSPENDED] = &tsp_vendor_config,
  618. },
  619. },
  620. #ifndef CONFIG_SND_SOC_MAX98504
  621. #if !defined (CONFIG_MACH_BERLUTI3G_EUR) && !defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  622. {
  623. .gpio = 22, /* BLSP1 QUP1 SPI_CS_ETH */
  624. .settings = {
  625. [GPIOMUX_SUSPENDED] = &gpio_spi_cs_eth_config,
  626. },
  627. },
  628. #endif
  629. #endif
  630. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  631. {
  632. .gpio = 2, /* BLSP1 QUP2 I2C_SDA */
  633. .settings = {
  634. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  635. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  636. },
  637. },
  638. {
  639. .gpio = 3, /* BLSP1 QUP2 I2C_SDA */
  640. .settings = {
  641. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  642. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  643. },
  644. },
  645. {
  646. .gpio = 6, /* BLSP1 QUP2 I2C_SDA */
  647. .settings = {
  648. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  649. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  650. },
  651. },
  652. {
  653. .gpio = 7, /* BLSP1 QUP2 I2C_SCL */
  654. .settings = {
  655. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  656. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  657. },
  658. },
  659. #endif
  660. };
  661. #if defined (CONFIG_MACH_BERLUTI3G_EUR)
  662. static struct msm_gpiomux_config msm_cypress_configs[] __initdata = {
  663. {
  664. .gpio = 17,
  665. .settings = {
  666. [GPIOMUX_ACTIVE] = &cypress_int_act_cfg,
  667. [GPIOMUX_SUSPENDED] = &cypress_int_sus_cfg,
  668. },
  669. },
  670. };
  671. static struct msm_gpiomux_config msm_keyboad_cypress_configs[] __initdata = {
  672. {
  673. .gpio = 49, /* 2_TOUCH_INT */
  674. .settings = {
  675. [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
  676. [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
  677. },
  678. },
  679. {
  680. .gpio = 23, /* 2_TOUCH_I2C_SCL */
  681. .settings = {
  682. [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
  683. [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
  684. },
  685. },
  686. {
  687. .gpio = 22, /* 2_TOUCH_I2C_SDA */
  688. .settings = {
  689. [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
  690. [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
  691. },
  692. },
  693. };
  694. #else
  695. static struct msm_gpiomux_config msm_synaptics_configs[] __initdata = {
  696. {
  697. .gpio = 16,
  698. .settings = {
  699. [GPIOMUX_ACTIVE] = &synaptics_reset_act_cfg,
  700. [GPIOMUX_SUSPENDED] = &synaptics_reset_sus_cfg,
  701. },
  702. },
  703. {
  704. .gpio = 17,
  705. .settings = {
  706. [GPIOMUX_ACTIVE] = &synaptics_int_act_cfg,
  707. [GPIOMUX_SUSPENDED] = &synaptics_int_sus_cfg,
  708. },
  709. },
  710. };
  711. #endif
  712. static struct gpiomux_setting gpio_nc_cfg = {
  713. .func = GPIOMUX_FUNC_GPIO,
  714. .drv = GPIOMUX_DRV_2MA,
  715. .pull = GPIOMUX_PULL_NONE,
  716. };
  717. static struct gpiomux_setting goodix_ldo_en_act_cfg = {
  718. .func = GPIOMUX_FUNC_GPIO,
  719. .drv = GPIOMUX_DRV_6MA,
  720. .pull = GPIOMUX_PULL_UP,
  721. };
  722. static struct gpiomux_setting goodix_ldo_en_sus_cfg = {
  723. .func = GPIOMUX_FUNC_GPIO,
  724. .drv = GPIOMUX_DRV_2MA,
  725. .pull = GPIOMUX_PULL_DOWN,
  726. };
  727. static struct gpiomux_setting goodix_int_act_cfg = {
  728. .func = GPIOMUX_FUNC_GPIO,
  729. .drv = GPIOMUX_DRV_6MA,
  730. .pull = GPIOMUX_PULL_UP,
  731. };
  732. static struct gpiomux_setting goodix_int_sus_cfg = {
  733. .func = GPIOMUX_FUNC_GPIO,
  734. .drv = GPIOMUX_DRV_2MA,
  735. .pull = GPIOMUX_PULL_DOWN,
  736. };
  737. static struct gpiomux_setting goodix_reset_act_cfg = {
  738. .func = GPIOMUX_FUNC_GPIO,
  739. .drv = GPIOMUX_DRV_6MA,
  740. .pull = GPIOMUX_PULL_UP,
  741. };
  742. static struct gpiomux_setting goodix_reset_sus_cfg = {
  743. .func = GPIOMUX_FUNC_GPIO,
  744. .drv = GPIOMUX_DRV_2MA,
  745. .pull = GPIOMUX_PULL_DOWN,
  746. };
  747. static struct msm_gpiomux_config msm_skuf_blsp_configs[] __initdata = {
  748. {
  749. .gpio = 2, /* NC */
  750. .settings = {
  751. [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
  752. },
  753. },
  754. {
  755. .gpio = 3, /* NC */
  756. .settings = {
  757. [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
  758. },
  759. },
  760. {
  761. .gpio = 4, /* NC */
  762. .settings = {
  763. [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
  764. },
  765. },
  766. {
  767. .gpio = 14, /* NC */
  768. .settings = {
  769. [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
  770. },
  771. },
  772. };
  773. static struct msm_gpiomux_config msm_skuf_goodix_configs[] __initdata = {
  774. {
  775. .gpio = 15, /* LDO EN */
  776. .settings = {
  777. [GPIOMUX_ACTIVE] = &goodix_ldo_en_act_cfg,
  778. [GPIOMUX_SUSPENDED] = &goodix_ldo_en_sus_cfg,
  779. },
  780. },
  781. {
  782. .gpio = 16, /* RESET */
  783. .settings = {
  784. [GPIOMUX_ACTIVE] = &goodix_reset_act_cfg,
  785. [GPIOMUX_SUSPENDED] = &goodix_reset_sus_cfg,
  786. },
  787. },
  788. {
  789. .gpio = 17, /* INT */
  790. .settings = {
  791. [GPIOMUX_ACTIVE] = &goodix_int_act_cfg,
  792. [GPIOMUX_SUSPENDED] = &goodix_int_sus_cfg,
  793. },
  794. },
  795. {
  796. .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
  797. .settings = {
  798. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  799. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  800. },
  801. },
  802. {
  803. .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
  804. .settings = {
  805. [GPIOMUX_ACTIVE] = &gpio_i2c_config,
  806. [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
  807. },
  808. },
  809. };
  810. #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
  811. static struct gpiomux_setting nfc_ldo_act_cfg = {
  812. .func = GPIOMUX_FUNC_GPIO,
  813. .drv = GPIOMUX_DRV_6MA,
  814. .pull = GPIOMUX_PULL_UP,
  815. };
  816. static struct gpiomux_setting nfc_ldo_sus_cfg = {
  817. .func = GPIOMUX_FUNC_GPIO,
  818. .drv = GPIOMUX_DRV_6MA,
  819. .pull = GPIOMUX_PULL_UP,
  820. };
  821. static struct gpiomux_setting nfc_regc_act_cfg = {
  822. .func = GPIOMUX_FUNC_GPIO,
  823. .drv = GPIOMUX_DRV_6MA,
  824. .pull = GPIOMUX_PULL_UP,
  825. };
  826. static struct gpiomux_setting nfc_regc_sus_cfg = {
  827. .func = GPIOMUX_FUNC_GPIO,
  828. .drv = GPIOMUX_DRV_2MA,
  829. .pull = GPIOMUX_PULL_NONE,
  830. .dir = GPIOMUX_OUT_LOW,
  831. };
  832. #endif
  833. static struct gpiomux_setting nfc_wake_act_cfg = {
  834. .func = GPIOMUX_FUNC_GPIO,
  835. .drv = GPIOMUX_DRV_6MA,
  836. .pull = GPIOMUX_PULL_UP,
  837. };
  838. static struct gpiomux_setting nfc_wake_sus_cfg = {
  839. .func = GPIOMUX_FUNC_GPIO,
  840. .drv = GPIOMUX_DRV_2MA,
  841. .pull = GPIOMUX_PULL_NONE,
  842. .dir = GPIOMUX_OUT_LOW,
  843. };
  844. static struct msm_gpiomux_config msm_skuf_nfc_configs[] __initdata = {
  845. #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
  846. { /* NFC LDO EN */
  847. .gpio = 0,
  848. .settings = {
  849. [GPIOMUX_ACTIVE] = &nfc_ldo_act_cfg,
  850. [GPIOMUX_SUSPENDED] = &nfc_ldo_sus_cfg,
  851. },
  852. },
  853. { /* NFC REGC*/
  854. .gpio = 1,
  855. .settings = {
  856. [GPIOMUX_ACTIVE] = &nfc_regc_act_cfg,
  857. [GPIOMUX_SUSPENDED] = &nfc_regc_sus_cfg,
  858. },
  859. },
  860. #endif
  861. { /* NFC WAKE */
  862. .gpio = 5,
  863. .settings = {
  864. [GPIOMUX_ACTIVE] = &nfc_wake_act_cfg,
  865. [GPIOMUX_SUSPENDED] = &nfc_wake_sus_cfg,
  866. },
  867. },
  868. };
  869. static struct gpiomux_setting sd_card_det_active_config = {
  870. .func = GPIOMUX_FUNC_GPIO,
  871. .drv = GPIOMUX_DRV_2MA,
  872. .pull = GPIOMUX_PULL_NONE,
  873. .dir = GPIOMUX_IN,
  874. };
  875. static struct gpiomux_setting sd_card_det_sleep_config = {
  876. .func = GPIOMUX_FUNC_GPIO,
  877. .drv = GPIOMUX_DRV_2MA,
  878. .pull = GPIOMUX_PULL_NONE,
  879. .dir = GPIOMUX_IN,
  880. };
  881. static struct msm_gpiomux_config sd_card_det __initdata = {
  882. .gpio = 38,
  883. .settings = {
  884. [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
  885. [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config,
  886. },
  887. };
  888. #if defined (CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
  889. static struct msm_gpiomux_config msm_nativesensors_configs[] __initdata = {
  890. #ifdef CONFIG_SENSORS_GRIP_ADJDET
  891. {
  892. .gpio = 22, /* ADJ_DET IRQ */
  893. .settings = {
  894. [GPIOMUX_ACTIVE] = &grip_irq_config,
  895. [GPIOMUX_SUSPENDED] = &grip_irq_config,
  896. },
  897. },
  898. #endif
  899. {
  900. .gpio = 66, /* GRIP IRQ */
  901. .settings = {
  902. [GPIOMUX_ACTIVE] = &grip_irq_config,
  903. [GPIOMUX_SUSPENDED] = &grip_irq_config,
  904. },
  905. },
  906. {
  907. .gpio = 54, /* ACCEL IRQ */
  908. .settings = {
  909. [GPIOMUX_ACTIVE] = &accel_irq_config,
  910. [GPIOMUX_SUSPENDED] = &accel_irq_config,
  911. },
  912. },
  913. };
  914. #endif
  915. #if defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  916. static struct gpiomux_setting nfc_enable_config = {
  917. .func = GPIOMUX_FUNC_GPIO,
  918. .drv = GPIOMUX_DRV_2MA,
  919. .pull = GPIOMUX_PULL_DOWN,
  920. };
  921. static struct gpiomux_setting nfc_irq_cfg = {
  922. .func = GPIOMUX_FUNC_GPIO,
  923. .drv = GPIOMUX_DRV_2MA,
  924. .pull = GPIOMUX_PULL_DOWN,
  925. .dir = GPIOMUX_IN,
  926. };
  927. static struct gpiomux_setting nfc_firmware_cfg = {
  928. .func = GPIOMUX_FUNC_GPIO,
  929. .drv = GPIOMUX_DRV_2MA,
  930. .pull = GPIOMUX_PULL_NONE,
  931. .dir = GPIOMUX_OUT_LOW,
  932. };
  933. static struct msm_gpiomux_config msm_nfc_configs[] __initdata = {
  934. {
  935. .gpio = 13, /* NFC IRQ */
  936. .settings = {
  937. [GPIOMUX_ACTIVE] = &nfc_irq_cfg,
  938. [GPIOMUX_SUSPENDED] = &nfc_irq_cfg,
  939. },
  940. },
  941. {
  942. .gpio = 0, /* NFC EN */
  943. .settings = {
  944. [GPIOMUX_ACTIVE] = &nfc_enable_config,
  945. [GPIOMUX_SUSPENDED] = &nfc_enable_config,
  946. },
  947. },
  948. {
  949. .gpio = 1, /* NFC FIRMWARE */
  950. .settings = {
  951. [GPIOMUX_ACTIVE] = &nfc_firmware_cfg,
  952. [GPIOMUX_SUSPENDED] = &nfc_firmware_cfg,
  953. },
  954. },
  955. };
  956. #endif
  957. static struct msm_gpiomux_config wcnss_5wire_interface[] = {
  958. {
  959. .gpio = 40,
  960. .settings = {
  961. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  962. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  963. },
  964. },
  965. {
  966. .gpio = 41,
  967. .settings = {
  968. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  969. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  970. },
  971. },
  972. {
  973. .gpio = 42,
  974. .settings = {
  975. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  976. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  977. },
  978. },
  979. {
  980. .gpio = 43,
  981. .settings = {
  982. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  983. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  984. },
  985. },
  986. {
  987. .gpio = 44,
  988. .settings = {
  989. [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
  990. [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
  991. },
  992. },
  993. };
  994. #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
  995. static struct msm_gpiomux_config wcnss_5gpio_interface[] = {
  996. {
  997. .gpio = 40,
  998. .settings = {
  999. [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
  1000. [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
  1001. },
  1002. },
  1003. {
  1004. .gpio = 41,
  1005. .settings = {
  1006. [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
  1007. [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
  1008. },
  1009. },
  1010. {
  1011. .gpio = 42,
  1012. .settings = {
  1013. [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
  1014. [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
  1015. },
  1016. },
  1017. {
  1018. .gpio = 43,
  1019. .settings = {
  1020. [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
  1021. [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
  1022. },
  1023. },
  1024. {
  1025. .gpio = 44,
  1026. .settings = {
  1027. [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
  1028. [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
  1029. },
  1030. },
  1031. };
  1032. #endif
  1033. static struct gpiomux_setting gpio_suspend_config[] = {
  1034. {
  1035. .func = GPIOMUX_FUNC_GPIO, /* IN-NP */
  1036. .drv = GPIOMUX_DRV_2MA,
  1037. .pull = GPIOMUX_PULL_NONE,
  1038. },
  1039. {
  1040. .func = GPIOMUX_FUNC_GPIO, /* O-LOW */
  1041. .drv = GPIOMUX_DRV_2MA,
  1042. .pull = GPIOMUX_PULL_NONE,
  1043. .dir = GPIOMUX_OUT_LOW,
  1044. },
  1045. };
  1046. static struct gpiomux_setting cam_settings[] = {
  1047. {
  1048. .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
  1049. .drv = GPIOMUX_DRV_2MA,
  1050. .pull = GPIOMUX_PULL_NONE,
  1051. },
  1052. {
  1053. .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
  1054. .drv = GPIOMUX_DRV_2MA,
  1055. .pull = GPIOMUX_PULL_DOWN,
  1056. },
  1057. {
  1058. .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
  1059. .drv = GPIOMUX_DRV_2MA,
  1060. .pull = GPIOMUX_PULL_KEEPER,
  1061. },
  1062. {
  1063. .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
  1064. .drv = GPIOMUX_DRV_2MA,
  1065. .pull = GPIOMUX_PULL_NONE,
  1066. },
  1067. {
  1068. .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
  1069. .drv = GPIOMUX_DRV_2MA,
  1070. .pull = GPIOMUX_PULL_DOWN,
  1071. },
  1072. {
  1073. .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 5 */
  1074. .drv = GPIOMUX_DRV_2MA,
  1075. .pull = GPIOMUX_PULL_NONE,
  1076. .dir = GPIOMUX_OUT_LOW,
  1077. },
  1078. };
  1079. static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
  1080. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  1081. {
  1082. .gpio = 16, /* VTCAM_1.8V */
  1083. .settings = {
  1084. [GPIOMUX_ACTIVE] = &cam_settings[5],
  1085. [GPIOMUX_SUSPENDED] = &cam_settings[5],
  1086. },
  1087. },
  1088. {
  1089. .gpio = 26, /* CAM_MCLK0 */
  1090. .settings = {
  1091. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1092. [GPIOMUX_SUSPENDED] = &cam_settings[1],
  1093. },
  1094. },
  1095. {
  1096. .gpio = 27, /* CAM_MCLK1 */
  1097. .settings = {
  1098. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1099. [GPIOMUX_SUSPENDED] = &cam_settings[1],
  1100. },
  1101. },
  1102. {
  1103. .gpio = 28, /* CAM2_RST_N */
  1104. .settings = {
  1105. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1106. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1107. },
  1108. },
  1109. {
  1110. .gpio = 29, /* CCI_I2C_SDA0 */
  1111. .settings = {
  1112. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1113. [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
  1114. },
  1115. },
  1116. {
  1117. .gpio = 30, /* CCI_I2C_SCL0 */
  1118. .settings = {
  1119. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1120. [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
  1121. },
  1122. },
  1123. {
  1124. .gpio = 35, /* CAM2_STANDBY_N */
  1125. .settings = {
  1126. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1127. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1128. },
  1129. },
  1130. {
  1131. .gpio = 36, /* CAM1_STANDBY_N */
  1132. .settings = {
  1133. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1134. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1135. },
  1136. },
  1137. {
  1138. .gpio = 37, /* CAM1_RST_N */
  1139. .settings = {
  1140. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1141. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1142. },
  1143. },
  1144. {
  1145. .gpio = 112, /* CAM1_ANALOG_EN */
  1146. .settings = {
  1147. [GPIOMUX_ACTIVE] = &cam_settings[5],
  1148. [GPIOMUX_SUSPENDED] = &cam_settings[5],
  1149. },
  1150. },
  1151. #else
  1152. {
  1153. .gpio = 26, /* CAM_MCLK0 */
  1154. .settings = {
  1155. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1156. [GPIOMUX_SUSPENDED] = &cam_settings[1],
  1157. },
  1158. },
  1159. {
  1160. .gpio = 27, /* CAM_MCLK1 */
  1161. .settings = {
  1162. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1163. [GPIOMUX_SUSPENDED] = &cam_settings[1],
  1164. },
  1165. },
  1166. {
  1167. .gpio = 29, /* CCI_I2C_SDA0 */
  1168. .settings = {
  1169. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1170. [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
  1171. },
  1172. },
  1173. {
  1174. .gpio = 30, /* CCI_I2C_SCL0 */
  1175. .settings = {
  1176. [GPIOMUX_ACTIVE] = &cam_settings[0],
  1177. [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
  1178. },
  1179. },
  1180. {
  1181. .gpio = 36, /* CAM1_STANDBY_N */
  1182. .settings = {
  1183. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1184. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1185. },
  1186. },
  1187. {
  1188. .gpio = 37, /* CAM1_RST_N */
  1189. .settings = {
  1190. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1191. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1192. },
  1193. },
  1194. {
  1195. .gpio = 35, /* CAM2_STANDBY_N */
  1196. .settings = {
  1197. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1198. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1199. },
  1200. },
  1201. {
  1202. .gpio = 28, /* CAM2_RST_N */
  1203. .settings = {
  1204. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1205. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1206. },
  1207. },
  1208. #endif
  1209. };
  1210. static struct msm_gpiomux_config msm_sensor_configs_skuf_plus[] __initdata = {
  1211. #if !defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  1212. {
  1213. .gpio = 22, /* CAM1_VDD */
  1214. .settings = {
  1215. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1216. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1217. },
  1218. },
  1219. #endif
  1220. {
  1221. .gpio = 34, /* CAM1 VCM_PWDN */
  1222. .settings = {
  1223. [GPIOMUX_ACTIVE] = &cam_settings[3],
  1224. [GPIOMUX_SUSPENDED] = &cam_settings[4],
  1225. },
  1226. },
  1227. };
  1228. static struct gpiomux_setting ta_nchg_cfg[] = {
  1229. {
  1230. .func = GPIOMUX_FUNC_GPIO,
  1231. .drv = GPIOMUX_DRV_2MA,
  1232. .pull = GPIOMUX_PULL_NONE,
  1233. .dir = GPIOMUX_IN,
  1234. },
  1235. };
  1236. static struct msm_gpiomux_config msm_ta_nchg_configs[] = {
  1237. {
  1238. .gpio = 52, /* TA_NCHG */
  1239. .settings = {
  1240. [GPIOMUX_ACTIVE] = &ta_nchg_cfg[0],
  1241. [GPIOMUX_SUSPENDED] = &ta_nchg_cfg[0],
  1242. },
  1243. },
  1244. };
  1245. static struct gpiomux_setting ta_int_n_cfg = {
  1246. .func = GPIOMUX_FUNC_GPIO,
  1247. .drv = GPIOMUX_DRV_2MA,
  1248. .pull = GPIOMUX_PULL_NONE,
  1249. .dir = GPIOMUX_IN,
  1250. };
  1251. static struct msm_gpiomux_config msm_ta_int_n_configs[] = {
  1252. {
  1253. #if defined (CONFIG_SEC_MATISSELTE_COMMON)
  1254. .gpio = 119, /* TA_INT_N */
  1255. #else
  1256. .gpio = 115, /* TA_INT_N */
  1257. #endif
  1258. .settings = {
  1259. [GPIOMUX_ACTIVE] = &ta_int_n_cfg,
  1260. [GPIOMUX_SUSPENDED] = &ta_int_n_cfg,
  1261. },
  1262. },
  1263. };
  1264. static struct gpiomux_setting ovp_enable_cfg = {
  1265. .func = GPIOMUX_FUNC_GPIO,
  1266. .drv = GPIOMUX_DRV_2MA,
  1267. .pull = GPIOMUX_PULL_NONE,
  1268. .dir = GPIOMUX_OUT_LOW,
  1269. };
  1270. static struct msm_gpiomux_config ovp_enable_configs[] = {
  1271. {
  1272. #if defined(CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC) || defined (CONFIG_MACH_MATISSELTE_ATT)
  1273. .gpio = 104, /* OVP enable */
  1274. #else
  1275. .gpio = 64, /* OVP enable */
  1276. #endif
  1277. .settings = {
  1278. [GPIOMUX_ACTIVE] = &ovp_enable_cfg,
  1279. [GPIOMUX_SUSPENDED] = &ovp_enable_cfg,
  1280. },
  1281. },
  1282. };
  1283. #if defined (CONFIG_SAMSUNG_JACK)
  1284. static struct gpiomux_setting earjack_gpio_active_cfg = {
  1285. .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 0 */
  1286. .drv = GPIOMUX_DRV_2MA,
  1287. #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_MACH_CRATERQ) || defined(CONFIG_SEC_MATISSE_PROJECT)
  1288. .pull = GPIOMUX_PULL_NONE,
  1289. #else
  1290. .pull = GPIOMUX_PULL_DOWN,
  1291. #endif
  1292. .dir = GPIOMUX_IN,
  1293. };
  1294. static struct gpiomux_setting earjack_gpio_suspend_cfg = {
  1295. .func = GPIOMUX_FUNC_GPIO, /*suspend*/ /* 1 */
  1296. .drv = GPIOMUX_DRV_2MA,
  1297. #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_MACH_CRATERQ) || defined(CONFIG_SEC_MATISSE_PROJECT)
  1298. .pull = GPIOMUX_PULL_NONE,
  1299. #else
  1300. .pull = GPIOMUX_PULL_DOWN,
  1301. #endif
  1302. .dir = GPIOMUX_IN,
  1303. };
  1304. static struct msm_gpiomux_config msm_earjack_gpio_configs[] __initdata = {
  1305. {
  1306. #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
  1307. .gpio = 111, /* EAR_SEND_END */
  1308. #else
  1309. .gpio = 35, /* EAR_SWITCH */
  1310. #endif
  1311. .settings = {
  1312. [GPIOMUX_ACTIVE] = &earjack_gpio_active_cfg,
  1313. [GPIOMUX_SUSPENDED] = &earjack_gpio_suspend_cfg,
  1314. },
  1315. }
  1316. };
  1317. #endif
  1318. static struct gpiomux_setting lineout_en_gpio_configs = {
  1319. .func = GPIOMUX_FUNC_GPIO,
  1320. .drv = GPIOMUX_DRV_2MA,
  1321. .dir = GPIOMUX_OUT_LOW,
  1322. .pull = GPIOMUX_PULL_DOWN,
  1323. };
  1324. static struct msm_gpiomux_config msm_lineout_en_gpio_configs[] __initdata = {
  1325. {
  1326. #if defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  1327. .gpio = 12, /* LINEOUT_EN */
  1328. #else
  1329. .gpio = 23, /* LINEOUT_EN */
  1330. #endif
  1331. .settings = {
  1332. [GPIOMUX_ACTIVE] = &lineout_en_gpio_configs,
  1333. [GPIOMUX_SUSPENDED] = &lineout_en_gpio_configs,
  1334. },
  1335. }
  1336. };
  1337. static struct gpiomux_setting spk_en_gpio_configs = {
  1338. .func = GPIOMUX_FUNC_GPIO,
  1339. .drv = GPIOMUX_DRV_2MA,
  1340. .dir = GPIOMUX_OUT_LOW,
  1341. .pull = GPIOMUX_PULL_NONE,
  1342. };
  1343. static struct msm_gpiomux_config msm_spk_en_gpio_configs[] __initdata = {
  1344. {
  1345. .gpio = 24, /* SPK_EN */
  1346. .settings = {
  1347. [GPIOMUX_ACTIVE] = &spk_en_gpio_configs,
  1348. [GPIOMUX_SUSPENDED] = &spk_en_gpio_configs,
  1349. },
  1350. }
  1351. };
  1352. static struct gpiomux_setting usb_otg_sw_cfg = {
  1353. .func = GPIOMUX_FUNC_GPIO,
  1354. .drv = GPIOMUX_DRV_2MA,
  1355. .dir = GPIOMUX_OUT_LOW,
  1356. };
  1357. static struct msm_gpiomux_config usb_otg_sw_configs[] __initdata = {
  1358. {
  1359. .gpio = 67,
  1360. .settings = {
  1361. [GPIOMUX_SUSPENDED] = &usb_otg_sw_cfg,
  1362. },
  1363. },
  1364. };
  1365. #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
  1366. static struct gpiomux_setting sdc3_clk_actv_cfg = {
  1367. .func = GPIOMUX_FUNC_2,
  1368. .drv = GPIOMUX_DRV_8MA,
  1369. .pull = GPIOMUX_PULL_NONE,
  1370. };
  1371. static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = {
  1372. .func = GPIOMUX_FUNC_2,
  1373. .drv = GPIOMUX_DRV_8MA,
  1374. .pull = GPIOMUX_PULL_UP,
  1375. };
  1376. static struct gpiomux_setting sdc3_suspend_cfg = {
  1377. .func = GPIOMUX_FUNC_GPIO,
  1378. .drv = GPIOMUX_DRV_2MA,
  1379. .pull = GPIOMUX_PULL_DOWN,
  1380. };
  1381. static struct gpiomux_setting sdc3_data_1_suspend_cfg = {
  1382. .func = GPIOMUX_FUNC_GPIO,
  1383. .drv = GPIOMUX_DRV_2MA,
  1384. .pull = GPIOMUX_PULL_UP,
  1385. };
  1386. static struct msm_gpiomux_config msm8226_sdc3_configs[] __initdata = {
  1387. {
  1388. /* DAT3 */
  1389. .gpio = 39,
  1390. .settings = {
  1391. [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
  1392. [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
  1393. },
  1394. },
  1395. {
  1396. /* DAT2 */
  1397. .gpio = 40,
  1398. .settings = {
  1399. [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
  1400. [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
  1401. },
  1402. },
  1403. {
  1404. /* DAT1 */
  1405. .gpio = 41,
  1406. .settings = {
  1407. [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
  1408. [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg,
  1409. },
  1410. },
  1411. {
  1412. /* DAT0 */
  1413. .gpio = 42,
  1414. .settings = {
  1415. [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
  1416. [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
  1417. },
  1418. },
  1419. {
  1420. /* CMD */
  1421. .gpio = 43,
  1422. .settings = {
  1423. [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
  1424. [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
  1425. },
  1426. },
  1427. {
  1428. /* CLK */
  1429. .gpio = 44,
  1430. .settings = {
  1431. [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg,
  1432. [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
  1433. },
  1434. },
  1435. };
  1436. static void msm_gpiomux_sdc3_install(void)
  1437. {
  1438. msm_gpiomux_install(msm8226_sdc3_configs,
  1439. ARRAY_SIZE(msm8226_sdc3_configs));
  1440. }
  1441. #else
  1442. static void msm_gpiomux_sdc3_install(void) {}
  1443. #endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */
  1444. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  1445. static struct gpiomux_setting gpio_10_sda_config = {
  1446. .func = GPIOMUX_FUNC_GPIO,
  1447. .drv = GPIOMUX_DRV_2MA,
  1448. .pull = GPIOMUX_PULL_NONE,
  1449. .dir = GPIOMUX_OUT_LOW,
  1450. };
  1451. static struct gpiomux_setting gpio_12_sda_config = {
  1452. .func = GPIOMUX_FUNC_GPIO,
  1453. .drv = GPIOMUX_DRV_2MA,
  1454. .pull = GPIOMUX_PULL_NONE,
  1455. };
  1456. static struct msm_gpiomux_config msm_sda_configs[] = {
  1457. {
  1458. .gpio = 10,
  1459. .settings = {
  1460. [GPIOMUX_ACTIVE] = &gpio_10_sda_config,
  1461. [GPIOMUX_SUSPENDED] = &gpio_10_sda_config,
  1462. },
  1463. },
  1464. {
  1465. .gpio = 12,
  1466. .settings = {
  1467. [GPIOMUX_ACTIVE] = &gpio_12_sda_config,
  1468. [GPIOMUX_SUSPENDED] = &gpio_12_sda_config,
  1469. },
  1470. },
  1471. };
  1472. #endif
  1473. #ifdef CONFIG_IR_REMOCON_MC96FR116
  1474. static struct gpiomux_setting irled_gpio_i2c_config = {
  1475. .func = GPIOMUX_FUNC_GPIO,
  1476. .drv = GPIOMUX_DRV_2MA,
  1477. .pull = GPIOMUX_PULL_NONE,
  1478. .dir = GPIOMUX_IN,
  1479. };
  1480. static struct msm_gpiomux_config irled_i2c_scl_config[] __initdata = {
  1481. {
  1482. .gpio = 4,
  1483. .settings = {
  1484. [GPIOMUX_ACTIVE] = &irled_gpio_i2c_config,
  1485. [GPIOMUX_SUSPENDED] = &irled_gpio_i2c_config,
  1486. },
  1487. },
  1488. #ifdef CONFIG_MACH_MATISSELTE_USC
  1489. NC_GPIO_CONFIG(5), // For IN-PD-2MA config. This PIN isn't NC
  1490. #else
  1491. {
  1492. .gpio = 5,
  1493. .settings = {
  1494. [GPIOMUX_ACTIVE] = &irled_gpio_i2c_config,
  1495. [GPIOMUX_SUSPENDED] = &irled_gpio_i2c_config,
  1496. },
  1497. },
  1498. #endif
  1499. };
  1500. #endif
  1501. extern int system_rev;
  1502. void __init msm8226_init_gpiomux(void)
  1503. {
  1504. int rc;
  1505. rc = msm_gpiomux_init_dt();
  1506. if (rc) {
  1507. pr_err("%s failed %d\n", __func__, rc);
  1508. return;
  1509. }
  1510. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  1511. msm_gpiomux_install(msm_sda_configs, ARRAY_SIZE(msm_sda_configs));
  1512. #endif
  1513. #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  1514. msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
  1515. #endif
  1516. msm_gpiomux_install(msm_keypad_configs,
  1517. ARRAY_SIZE(msm_keypad_configs));
  1518. if (of_board_is_skuf())
  1519. msm_gpiomux_install(msm_skuf_blsp_configs,
  1520. ARRAY_SIZE(msm_skuf_blsp_configs));
  1521. else
  1522. msm_gpiomux_install(msm_blsp_configs,
  1523. ARRAY_SIZE(msm_blsp_configs));
  1524. msm_gpiomux_install(wcnss_5wire_interface,
  1525. ARRAY_SIZE(wcnss_5wire_interface));
  1526. msm_gpiomux_install(&sd_card_det, 1);
  1527. if (of_board_is_skuf())
  1528. msm_gpiomux_install(msm_skuf_goodix_configs,
  1529. ARRAY_SIZE(msm_skuf_goodix_configs));
  1530. else
  1531. #if defined (CONFIG_MACH_BERLUTI3G_EUR)
  1532. msm_gpiomux_install(msm_cypress_configs,
  1533. ARRAY_SIZE(msm_cypress_configs));
  1534. msm_gpiomux_install(msm_keyboad_cypress_configs,
  1535. ARRAY_SIZE(msm_keyboad_cypress_configs));
  1536. #else
  1537. msm_gpiomux_install(msm_synaptics_configs,
  1538. ARRAY_SIZE(msm_synaptics_configs));
  1539. #endif
  1540. if (of_board_is_skuf())
  1541. msm_gpiomux_install(msm_skuf_nfc_configs,
  1542. ARRAY_SIZE(msm_skuf_nfc_configs));
  1543. msm_gpiomux_install_nowrite(msm_lcd_configs,
  1544. ARRAY_SIZE(msm_lcd_configs));
  1545. msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
  1546. if (of_board_is_skuf())
  1547. msm_gpiomux_install(msm_sensor_configs_skuf_plus,
  1548. ARRAY_SIZE(msm_sensor_configs_skuf_plus));
  1549. msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));
  1550. msm_gpiomux_install(msm_ta_int_n_configs, ARRAY_SIZE(msm_ta_int_n_configs));
  1551. if(system_rev > 1)
  1552. msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
  1553. msm_gpiomux_install(msm_hall_configs, ARRAY_SIZE(msm_hall_configs));
  1554. if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
  1555. msm_gpiomux_install(usb_otg_sw_configs,
  1556. ARRAY_SIZE(usb_otg_sw_configs));
  1557. #if defined(CONFIG_SEC_MATISSE_PROJECT)
  1558. msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
  1559. #endif
  1560. msm_gpiomux_sdc3_install();
  1561. #if defined(CONFIG_SEC_MATISSEWIFI_COMMON)
  1562. msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
  1563. #endif
  1564. /*
  1565. * HSIC STROBE gpio is also used by the ethernet. Install HSIC
  1566. * gpio mux config only when HSIC is enabled. HSIC config will
  1567. * be disabled when ethernet config is enabled.
  1568. */
  1569. #ifdef CONFIG_USB_EHCI_MSM_HSIC
  1570. #if !defined(CONFIG_MACH_MATISSE3G_OPEN)
  1571. if (machine_is_msm8926()) {
  1572. msm_hsic_configs[0].gpio = 119; /* STROBE */
  1573. msm_hsic_configs[1].gpio = 120; /* DATA */
  1574. }
  1575. msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
  1576. #endif
  1577. #endif
  1578. #if defined(CONFIG_SAMSUNG_JACK)
  1579. msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
  1580. #endif
  1581. msm_gpiomux_install(msm_lineout_en_gpio_configs, ARRAY_SIZE(msm_lineout_en_gpio_configs));
  1582. msm_gpiomux_install(msm_spk_en_gpio_configs, ARRAY_SIZE(msm_spk_en_gpio_configs));
  1583. #ifdef CONFIG_SND_SOC_MAX98504
  1584. #if defined(CONFIG_MACH_MILLETLTE_OPEN)
  1585. if ( system_rev >= 0 && system_rev < 3)
  1586. #elif defined (CONFIG_MACH_MILLET3G_EUR)
  1587. if ( system_rev >= 2 && system_rev < 4)
  1588. #elif defined(CONFIG_MACH_MILLETWIFI_OPEN)
  1589. if ( system_rev >= 0 && system_rev < 5)
  1590. #endif
  1591. {
  1592. msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
  1593. msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
  1594. }
  1595. #endif
  1596. /* Install NC Configurations */
  1597. #if defined(CONFIG_MACH_MATISSEWIFI_OPEN)
  1598. msm_gpiomux_install(matissewifi_open_nc_gpio_cfgs, ARRAY_SIZE(matissewifi_open_nc_gpio_cfgs));
  1599. #endif
  1600. #if defined(CONFIG_MACH_MATISSEWIFIUS_OPEN)
  1601. msm_gpiomux_install(matissewifiue_open_nc_gpio_cfgs, ARRAY_SIZE(matissewifiue_open_nc_gpio_cfgs));
  1602. if (system_rev >= 5)
  1603. msm_gpiomux_install(matissewifiue_open_nc_gpio_rev5_cfgs, ARRAY_SIZE(matissewifiue_open_nc_gpio_rev5_cfgs));
  1604. #if defined(CONFIG_MACH_MATISSEWIFIUS_GOOGLE)
  1605. if (system_rev < 2)
  1606. msm_gpiomux_install(matissewifigl_irda_irq_cfg_64, ARRAY_SIZE(matissewifigl_irda_irq_cfg_64));
  1607. else
  1608. msm_gpiomux_install(matissewifigl_irda_irq_cfg_65, ARRAY_SIZE(matissewifigl_irda_irq_cfg_65));
  1609. #endif
  1610. #endif
  1611. #if defined(CONFIG_MACH_MATISSELTE_OPEN)
  1612. msm_gpiomux_install(matisselte_open_nc_gpio_cfgs, ARRAY_SIZE(matisselte_open_nc_gpio_cfgs));
  1613. #endif
  1614. #if defined (CONFIG_MACH_MATISSELTE_VZW) || defined(CONFIG_MACH_MATISSELTE_USC)
  1615. msm_gpiomux_install(matisseltevzw_nc_gpio_cfgs, ARRAY_SIZE(matisseltevzw_nc_gpio_cfgs));
  1616. #endif
  1617. #if defined (CONFIG_MACH_MATISSE3G_OPEN)
  1618. msm_gpiomux_install(matisse3g_nc_gpio_cfgs, ARRAY_SIZE(matisse3g_nc_gpio_cfgs));
  1619. #endif
  1620. #ifdef CONFIG_IR_REMOCON_MC96FR116
  1621. msm_gpiomux_install(irled_i2c_scl_config, ARRAY_SIZE(irled_i2c_scl_config));
  1622. #endif
  1623. }
  1624. #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
  1625. static void wcnss_switch_to_gpio(void)
  1626. {
  1627. /* Switch MUX to GPIO */
  1628. msm_gpiomux_install(wcnss_5gpio_interface,
  1629. ARRAY_SIZE(wcnss_5gpio_interface));
  1630. /* Ensure GPIO config */
  1631. gpio_direction_input(WLAN_DATA2);
  1632. gpio_direction_input(WLAN_DATA1);
  1633. gpio_direction_input(WLAN_DATA0);
  1634. gpio_direction_output(WLAN_SET, 0);
  1635. gpio_direction_output(WLAN_CLK, 0);
  1636. }
  1637. static void wcnss_switch_to_5wire(void)
  1638. {
  1639. msm_gpiomux_install(wcnss_5wire_interface,
  1640. ARRAY_SIZE(wcnss_5wire_interface));
  1641. }
  1642. u32 wcnss_rf_read_reg(u32 rf_reg_addr)
  1643. {
  1644. int count = 0;
  1645. u32 rf_cmd_and_addr = 0;
  1646. u32 rf_data_received = 0;
  1647. u32 rf_bit = 0;
  1648. wcnss_switch_to_gpio();
  1649. /* Reset the signal if it is already being used. */
  1650. gpio_set_value(WLAN_SET, 0);
  1651. gpio_set_value(WLAN_CLK, 0);
  1652. /* We start with cmd_set high WLAN_SET = 1. */
  1653. gpio_set_value(WLAN_SET, 1);
  1654. gpio_direction_output(WLAN_DATA0, 1);
  1655. gpio_direction_output(WLAN_DATA1, 1);
  1656. gpio_direction_output(WLAN_DATA2, 1);
  1657. gpio_set_value(WLAN_DATA0, 0);
  1658. gpio_set_value(WLAN_DATA1, 0);
  1659. gpio_set_value(WLAN_DATA2, 0);
  1660. /* Prepare command and RF register address that need to sent out.
  1661. * Make sure that we send only 14 bits from LSB.
  1662. */
  1663. rf_cmd_and_addr = (((WLAN_RF_READ_REG_CMD) |
  1664. (rf_reg_addr << WLAN_RF_REG_ADDR_START_OFFSET)) &
  1665. WLAN_RF_READ_CMD_MASK);
  1666. for (count = 0; count < 5; count++) {
  1667. gpio_set_value(WLAN_CLK, 0);
  1668. rf_bit = (rf_cmd_and_addr & 0x1);
  1669. gpio_set_value(WLAN_DATA0, rf_bit ? 1 : 0);
  1670. rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
  1671. rf_bit = (rf_cmd_and_addr & 0x1);
  1672. gpio_set_value(WLAN_DATA1, rf_bit ? 1 : 0);
  1673. rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
  1674. rf_bit = (rf_cmd_and_addr & 0x1);
  1675. gpio_set_value(WLAN_DATA2, rf_bit ? 1 : 0);
  1676. rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
  1677. /* Send the data out WLAN_CLK = 1 */
  1678. gpio_set_value(WLAN_CLK, 1);
  1679. }
  1680. /* Pull down the clock signal */
  1681. gpio_set_value(WLAN_CLK, 0);
  1682. /* Configure data pins to input IO pins */
  1683. gpio_direction_input(WLAN_DATA0);
  1684. gpio_direction_input(WLAN_DATA1);
  1685. gpio_direction_input(WLAN_DATA2);
  1686. for (count = 0; count < 2; count++) {
  1687. gpio_set_value(WLAN_CLK, 1);
  1688. gpio_set_value(WLAN_CLK, 0);
  1689. }
  1690. rf_bit = 0;
  1691. for (count = 0; count < 6; count++) {
  1692. gpio_set_value(WLAN_CLK, 1);
  1693. gpio_set_value(WLAN_CLK, 0);
  1694. rf_bit = gpio_get_value(WLAN_DATA0);
  1695. rf_data_received |= (rf_bit << (count * 3 + 0));
  1696. if (count != 5) {
  1697. rf_bit = gpio_get_value(WLAN_DATA1);
  1698. rf_data_received |= (rf_bit << (count * 3 + 1));
  1699. rf_bit = gpio_get_value(WLAN_DATA2);
  1700. rf_data_received |= (rf_bit << (count * 3 + 2));
  1701. }
  1702. }
  1703. gpio_set_value(WLAN_SET, 0);
  1704. wcnss_switch_to_5wire();
  1705. return rf_data_received;
  1706. }
  1707. #endif