12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919 |
- /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
- /****************************** Revision History ******************************************
- *CH# Product author Description Date
- *-----------------------------------------------------------------------------------------
- *01 Millet-All nc.chaudhary Added the gpiomux settings for 30-Jan-2014
- * variants UART for LCIA Test failure
- ******************************************************************************************
- */
- #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
- #include <linux/gpio.h>
- #endif
- #include <linux/init.h>
- #include <linux/ioport.h>
- #include <mach/board.h>
- #include <mach/gpio.h>
- #include <mach/gpiomux.h>
- #include <mach/socinfo.h>
- #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
- #define WLAN_CLK 44
- #define WLAN_SET 43
- #define WLAN_DATA0 42
- #define WLAN_DATA1 41
- #define WLAN_DATA2 40
- #endif
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting nc_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- #endif
- #ifdef CONFIG_USB_EHCI_MSM_HSIC
- static struct gpiomux_setting hsic_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct gpiomux_setting hsic_act_cfg = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_16MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct msm_gpiomux_config msm_hsic_configs[] = {
- {
- #if !defined(CONFIG_SEC_MILLETLTE_COMMON)
- .gpio = 115, /* HSIC_STROBE */
- #else
- .gpio = 119, /* HSIC_STROBE */
- #endif
- .settings = {
- [GPIOMUX_ACTIVE] = &hsic_act_cfg,
- [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
- },
- },
- {
- #if !defined(CONFIG_SEC_MILLETLTE_COMMON)
- .gpio = 116, /* HSIC_DATA */
- #else
- .gpio = 120, /* HSIC_DATA */
- #endif
- .settings = {
- [GPIOMUX_ACTIVE] = &hsic_act_cfg,
- [GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
- },
- },
- };
- #endif
- #define KS8851_IRQ_GPIO 115
- #if defined (CONFIG_SEC_MILLETLTE_COMMON) || \
- defined (CONFIG_SEC_MILLETWIFI_COMMON) || \
- defined (CONFIG_MACH_MILLET3G_EUR)
- #define NC_GPIO_CONFIG(gpio_num) { \
- .gpio = gpio_num, \
- .settings ={[GPIOMUX_SUSPENDED] = &nc_cfg,}\
- }
- static struct gpiomux_setting nc_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- #endif
- #if defined(CONFIG_MACH_MILLETLTE_CAN)
- #define NC_GPIO_CONFIG_CAN(gpio_num) { \
- .gpio = gpio_num, \
- .settings ={[GPIOMUX_SUSPENDED] = &nc_cfg_can,}\
- }
- static struct gpiomux_setting nc_cfg_can = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #endif
- #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
- static struct gpiomux_setting gpio_eth_config = {
- .pull = GPIOMUX_PULL_UP,
- .drv = GPIOMUX_DRV_2MA,
- .func = GPIOMUX_FUNC_GPIO,
- };
- static struct msm_gpiomux_config msm_eth_configs[] = {
- {
- .gpio = KS8851_IRQ_GPIO,
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_eth_config,
- }
- },
- };
- #endif
- #if defined (CONFIG_MACH_BERLUTI3G_EUR)
- static struct gpiomux_setting cypress_int_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting cypress_int_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_i2c_tkey_active_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_i2c_tkey_suspend_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #elif defined(CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting melfas_int_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting melfas_int_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- #else
- static struct gpiomux_setting synaptics_int_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting synaptics_int_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting synaptics_reset_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting synaptics_reset_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #endif
- static struct gpiomux_setting gpio_keys_active = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_keys_suspend = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
- static struct gpiomux_setting gpio_spi_act_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_spi_cs_act_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_spi_susp_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #endif
- #ifndef CONFIG_SND_SOC_MAX98504
- #if !defined (CONFIG_MACH_BERLUTI3G_EUR)
- static struct gpiomux_setting gpio_spi_cs_eth_config = {
- .func = GPIOMUX_FUNC_4,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #endif
- #endif
- static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting wcnss_5wire_active_cfg = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
- static struct gpiomux_setting wcnss_5gpio_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting wcnss_5gpio_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- #endif
- static struct gpiomux_setting gpio_i2c_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- #if defined (CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
- static struct gpiomux_setting sensor_gpio_i2c_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting accel_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting irled_gpio_i2c_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- #if !defined(CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting prox_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- #endif
- static struct gpiomux_setting grip_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- #endif
- #if defined (CONFIG_MACH_BERLUTI3G_EUR)
- static struct gpiomux_setting gpio_uart_active_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_uart_sleep_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_uart_rx_sleep_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_i2c_tsp_active_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_i2c_tsp_suspend_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- #endif
- static struct msm_gpiomux_config msm_keypad_configs[] __initdata = {
- {
- .gpio = 106,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_keys_active,
- [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
- },
- },
- {
- .gpio = 107,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_keys_active,
- [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
- },
- },
- {
- .gpio = 108,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_keys_active,
- [GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
- },
- },
- };
- static struct gpiomux_setting lcd_rst_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_HIGH,
- };
- static struct gpiomux_setting lcd_rst_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct gpiomux_setting lcd_in_gpio_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
- {
- .gpio = 25, /* LCD Reset */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
- },
- },
- {
- .gpio = 53, /* LCD LDI INT */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
- },
- },
- {
- .gpio = 20, /* Backlight SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
- },
- },
- {
- .gpio = 21, /* Backlight SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_in_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_in_gpio_cfg,
- },
- },
- #if defined(CONFIG_SEC_MILLETLTE_COMMON)
- {
- .gpio =56, /* Backlight Reset */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
- },
- },
- #else
- {
- .gpio = 74, /* Backlight Reset */
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
- },
- },
- #endif
- };
- static struct gpiomux_setting gpio_uart_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE, /*should be pulled None for UART */
- .dir = GPIOMUX_OUT_HIGH,
- };
- static struct gpiomux_setting rx_gpio_uart_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN, /*LCIA Test failure*/
- .dir = GPIOMUX_OUT_HIGH,
- };
- static struct gpiomux_setting hw_chk_bit_gpio_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
- {
- .gpio = 8, /* UART TX */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_uart_config,
- },
- },
- {
- .gpio = 9, /* UART RX */
- .settings = {
- [GPIOMUX_SUSPENDED] = &rx_gpio_uart_config,
- },
- },
- {
- .gpio = 32, /* HW_CHK_BIT 1 */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- {
- .gpio = 63, /* HW_CHK_BIT 0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
- {
- .gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
- },
- },
- {
- .gpio = 1, /* BLSP1 QUP1 SPI_DATA_MISO */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
- },
- },
- {
- .gpio = 2, /* BLSP1 QUP1 SPI_CS1 */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_spi_cs_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
- },
- },
- {
- .gpio = 3, /* BLSP1 QUP1 SPI_CLK */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_spi_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
- },
- },
- #endif
- #if !defined(CONFIG_SEC_MILLET_PROJECT) || !defined(CONFIG_SEC_MATISSE_PROJECT)
- {
- .gpio = 14, /* BLSP1 QUP4 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- {
- .gpio = 15, /* BLSP1 QUP4 I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- #endif
- #ifdef CONFIG_MACH_BERLUTI3G_EUR
- {
- .gpio = 8, /* BLSP1 UART2 TX */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_uart_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_uart_sleep_config,
- },
- },
- {
- .gpio = 9, /* BLSP1 UART2 RX */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_uart_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_uart_rx_sleep_config,
- },
- },
- {
- .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tsp_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tsp_suspend_config,
- },
- },
- {
- .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tsp_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tsp_suspend_config,
- },
- },
- #else
- {
- .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- {
- .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- #endif
- #ifndef CONFIG_SND_SOC_MAX98504
- #if !defined (CONFIG_MACH_BERLUTI3G_EUR)
- {
- .gpio = 22, /* BLSP1 QUP1 SPI_CS_ETH */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_spi_cs_eth_config,
- },
- },
- #endif
- #endif
- #if defined (CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
- {
- .gpio = 6, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &sensor_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- {
- .gpio = 7, /* BLSP1 QUP2 I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &sensor_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- #endif
- };
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting prox_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config light_prox_config[] __initdata = {
- {
- .gpio = 65, /* PROXY IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &prox_irq_config,
- [GPIOMUX_SUSPENDED] = &prox_irq_config,
- },
- },
- {
- .gpio = 2, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &sensor_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- {
- .gpio = 3, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &sensor_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- };
- static struct msm_gpiomux_config nc_light_prox_config[] __initdata = {
- {
- .gpio = 2, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &nc_suspend_cfg,
- [GPIOMUX_SUSPENDED] = &nc_suspend_cfg,
- },
- },
- {
- .gpio = 3, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &nc_suspend_cfg,
- [GPIOMUX_SUSPENDED] = &nc_suspend_cfg,
- },
- },
- };
- static struct msm_gpiomux_config irled_i2c_scl_config[] __initdata = {
- {
- .gpio = 4,
- .settings = {
- [GPIOMUX_ACTIVE] = &irled_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &irled_gpio_i2c_config,
- },
- },
- {
- .gpio = 5,
- .settings = {
- [GPIOMUX_ACTIVE] = &irled_gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &irled_gpio_i2c_config,
- },
- },
- };
- #endif
- #if defined (CONFIG_MACH_BERLUTI3G_EUR)
- static struct msm_gpiomux_config msm_cypress_configs[] __initdata = {
- {
- .gpio = 17,
- .settings = {
- [GPIOMUX_ACTIVE] = &cypress_int_act_cfg,
- [GPIOMUX_SUSPENDED] = &cypress_int_sus_cfg,
- },
- },
- };
- static struct msm_gpiomux_config msm_keyboad_cypress_configs[] __initdata = {
- {
- .gpio = 49, /* 2_TOUCH_INT */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
- },
- },
- {
- .gpio = 23, /* 2_TOUCH_I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
- },
- },
- {
- .gpio = 22, /* 2_TOUCH_I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_suspend_config,
- },
- },
- };
- #elif defined(CONFIG_SEC_MILLET_PROJECT)
- static struct msm_gpiomux_config msm_melfas_configs[] __initdata = {
- {
- .gpio = 17,
- .settings = {
- [GPIOMUX_ACTIVE] = &melfas_int_act_cfg,
- [GPIOMUX_SUSPENDED] = &melfas_int_sus_cfg,
- },
- },
- };
- #else
- static struct msm_gpiomux_config msm_synaptics_configs[] __initdata = {
- {
- .gpio = 16,
- .settings = {
- [GPIOMUX_ACTIVE] = &synaptics_reset_act_cfg,
- [GPIOMUX_SUSPENDED] = &synaptics_reset_sus_cfg,
- },
- },
- {
- .gpio = 17,
- .settings = {
- [GPIOMUX_ACTIVE] = &synaptics_int_act_cfg,
- [GPIOMUX_SUSPENDED] = &synaptics_int_sus_cfg,
- },
- },
- };
- #endif
- static struct gpiomux_setting gpio_nc_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting goodix_ldo_en_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting goodix_ldo_en_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting goodix_int_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting goodix_int_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting goodix_reset_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting goodix_reset_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm_skuf_blsp_configs[] __initdata = {
- {
- .gpio = 2, /* NC */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
- },
- },
- {
- .gpio = 3, /* NC */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
- },
- },
- {
- .gpio = 4, /* NC */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
- },
- },
- {
- .gpio = 14, /* NC */
- .settings = {
- [GPIOMUX_SUSPENDED] = &gpio_nc_cfg,
- },
- },
- };
- static struct msm_gpiomux_config msm_skuf_goodix_configs[] __initdata = {
- {
- .gpio = 15, /* LDO EN */
- .settings = {
- [GPIOMUX_ACTIVE] = &goodix_ldo_en_act_cfg,
- [GPIOMUX_SUSPENDED] = &goodix_ldo_en_sus_cfg,
- },
- },
- {
- .gpio = 16, /* RESET */
- .settings = {
- [GPIOMUX_ACTIVE] = &goodix_reset_act_cfg,
- [GPIOMUX_SUSPENDED] = &goodix_reset_sus_cfg,
- },
- },
- {
- .gpio = 17, /* INT */
- .settings = {
- [GPIOMUX_ACTIVE] = &goodix_int_act_cfg,
- [GPIOMUX_SUSPENDED] = &goodix_int_sus_cfg,
- },
- },
- {
- .gpio = 18, /* BLSP1 QUP5 I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- {
- .gpio = 19, /* BLSP1 QUP5 I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
- },
- },
- };
- #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
- static struct gpiomux_setting nfc_ldo_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting nfc_ldo_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting nfc_regc_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting nfc_regc_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_LOW,
- };
- #endif
- static struct gpiomux_setting nfc_wake_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting nfc_wake_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config msm_skuf_nfc_configs[] __initdata = {
- #if !defined (CONFIG_SEC_MILLET_PROJECT) && !defined(CONFIG_SEC_MATISSE_PROJECT)
- { /* NFC LDO EN */
- .gpio = 0,
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_ldo_act_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_ldo_sus_cfg,
- },
- },
- { /* NFC REGC*/
- .gpio = 1,
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_regc_act_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_regc_sus_cfg,
- },
- },
- #endif
- { /* NFC WAKE */
- .gpio = 5,
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_wake_act_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_wake_sus_cfg,
- },
- },
- };
- static struct gpiomux_setting sd_card_det_active_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting sd_card_det_sleep_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config sd_card_det __initdata = {
- .gpio = 38,
- .settings = {
- [GPIOMUX_ACTIVE] = &sd_card_det_active_config,
- [GPIOMUX_SUSPENDED] = &sd_card_det_sleep_config,
- },
- };
- #if defined (CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
- static struct msm_gpiomux_config msm_nativesensors_configs[] __initdata = {
- {
- .gpio = 66, /* GRIP IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &grip_irq_config,
- [GPIOMUX_SUSPENDED] = &grip_irq_config,
- },
- },
- {
- .gpio = 54, /* ACCEL IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &accel_irq_config,
- [GPIOMUX_SUSPENDED] = &accel_irq_config,
- },
- },
- };
- #endif
- static struct msm_gpiomux_config wcnss_5wire_interface[] = {
- {
- .gpio = 40,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
- },
- },
- {
- .gpio = 41,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
- },
- },
- {
- .gpio = 42,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
- },
- },
- {
- .gpio = 43,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
- },
- },
- {
- .gpio = 44,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5wire_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
- },
- },
- };
- #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
- static struct msm_gpiomux_config wcnss_5gpio_interface[] = {
- {
- .gpio = 40,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
- },
- },
- {
- .gpio = 41,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
- },
- },
- {
- .gpio = 42,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
- },
- },
- {
- .gpio = 43,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
- },
- },
- {
- .gpio = 44,
- .settings = {
- [GPIOMUX_ACTIVE] = &wcnss_5gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &wcnss_5gpio_suspend_cfg,
- },
- },
- };
- #endif
- static struct gpiomux_setting gpio_suspend_config[] = {
- {
- .func = GPIOMUX_FUNC_GPIO, /* IN-NP */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /* O-LOW */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_LOW,
- },
- };
- static struct gpiomux_setting cam_settings[] = {
- {
- .func = GPIOMUX_FUNC_1, /*active 1*/ /* 0 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- },
- {
- .func = GPIOMUX_FUNC_1, /*suspend*/ /* 1 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- },
- {
- .func = GPIOMUX_FUNC_1, /*i2c suspend*/ /* 2 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_KEEPER,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*active 0*/ /* 3 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 5 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_LOW,
- },
- };
- static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- {
- .gpio = 16, /* VTCAM_1.8V */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[5],
- [GPIOMUX_SUSPENDED] = &cam_settings[5],
- },
- },
- {
- .gpio = 26, /* CAM_MCLK0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &cam_settings[1],
- },
- },
- {
- .gpio = 28, /* CAM2_RST_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 29, /* CCI_I2C_SDA0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- {
- .gpio = 30, /* CCI_I2C_SCL0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- {
- .gpio = 35, /* CAM2_STANDBY_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 36, /* CAM1_STANDBY_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 110, /* CAM1_RST_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 112, /* CAM1_ANALOG_EN */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[5],
- [GPIOMUX_SUSPENDED] = &cam_settings[5],
- },
- },
- #else
- {
- .gpio = 26, /* CAM_MCLK0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &cam_settings[1],
- },
- },
- #if !defined(CONFIG_SEC_MILLET_PROJECT)
- {
- .gpio = 27, /* CAM_MCLK1 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &cam_settings[1],
- },
- },
- #endif
- {
- .gpio = 29, /* CCI_I2C_SDA0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- {
- .gpio = 30, /* CCI_I2C_SCL0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[0],
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- {
- .gpio = 36, /* CAM1_STANDBY_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 37, /* CAM1_RST_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 35, /* CAM2_STANDBY_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 28, /* CAM2_RST_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- #endif
- };
- static struct msm_gpiomux_config msm_sensor_configs_skuf_plus[] __initdata = {
- {
- .gpio = 22, /* CAM1_VDD */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 34, /* CAM1 VCM_PWDN */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- };
- #if !defined (CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting auxpcm_act_cfg = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting auxpcm_sus_cfg = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm_auxpcm_configs[] __initdata = {
- {
- .gpio = 63,
- .settings = {
- [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
- [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
- },
- },
- {
- .gpio = 64,
- .settings = {
- [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
- [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
- },
- },
- {
- .gpio = 65,
- .settings = {
- [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
- [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
- },
- },
- {
- .gpio = 66,
- .settings = {
- [GPIOMUX_SUSPENDED] = &auxpcm_sus_cfg,
- [GPIOMUX_ACTIVE] = &auxpcm_act_cfg,
- },
- },
- };
- #endif
- #if defined (CONFIG_SAMSUNG_JACK)
- static struct gpiomux_setting earjack_gpio_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 0 */
- .drv = GPIOMUX_DRV_2MA,
- #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_MACH_CRATERQ) || defined(CONFIG_SEC_MATISSE_PROJECT)
- .pull = GPIOMUX_PULL_NONE,
- #else
- .pull = GPIOMUX_PULL_DOWN,
- #endif
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting earjack_gpio_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO, /*suspend*/ /* 1 */
- .drv = GPIOMUX_DRV_2MA,
- #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_MACH_CRATERQ) || defined(CONFIG_SEC_MATISSE_PROJECT)
- .pull = GPIOMUX_PULL_NONE,
- #else
- .pull = GPIOMUX_PULL_DOWN,
- #endif
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_earjack_gpio_configs[] __initdata = {
- {
- #if defined(CONFIG_SEC_MILLET_PROJECT) || defined(CONFIG_SEC_MATISSE_PROJECT)
- .gpio = 111, /* EAR_SEND_END */
- #else
- .gpio = 35, /* EAR_SWITCH */
- #endif
- .settings = {
- [GPIOMUX_ACTIVE] = &earjack_gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &earjack_gpio_suspend_cfg,
- },
- },
- {
- .gpio = 69,
- .settings = {
- [GPIOMUX_ACTIVE] = &earjack_gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &earjack_gpio_suspend_cfg,
- },
- },
- };
- #endif
- #ifdef CONFIG_SND_SOC_MAX98504
- static struct gpiomux_setting gpio_i2c_codec_active_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .dir = GPIOMUX_IN,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_i2c_codec_suspend_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .dir = GPIOMUX_IN,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting pri_mi2s_act_cfg = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting pri_mi2s_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm8226_blsp_codec_configs[] __initdata = {
- { /* MAX_SDA */
- .gpio = 22, /* BLSP1 QUP3 I2C_DAT */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_codec_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_codec_suspend_config,
- },
- },
- { /* MAX_SCL */
- .gpio = 23, /* BLSP1 QUP3 I2C_CLK */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_codec_active_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_codec_suspend_config,
- },
- },
- };
- static struct gpiomux_setting gpio_amp_int_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .dir = GPIOMUX_IN,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct msm_gpiomux_config msm8226_amp_int_configs[] __initdata = {
- {
- .gpio = 24, /* AMP_INT_N */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_amp_int_config,
- [GPIOMUX_SUSPENDED] = &gpio_amp_int_config,
- },
- },
- };
- static struct msm_gpiomux_config msm8226_tertiary_mi2s_configs[] __initdata = {
- {
- .gpio = 49, /* qua mi2s sck */
- .settings = {
- [GPIOMUX_SUSPENDED] = &pri_mi2s_sus_cfg,
- [GPIOMUX_ACTIVE] = &pri_mi2s_act_cfg,
- },
- },
- {
- .gpio = 50,
- .settings = {
- [GPIOMUX_SUSPENDED] = &pri_mi2s_sus_cfg,
- [GPIOMUX_ACTIVE] = &pri_mi2s_act_cfg,
- },
- },
- {
- .gpio = 51,
- .settings = {
- [GPIOMUX_SUSPENDED] = &pri_mi2s_sus_cfg,
- [GPIOMUX_ACTIVE] = &pri_mi2s_act_cfg,
- },
- },
- {
- .gpio = 52,
- .settings = {
- [GPIOMUX_SUSPENDED] = &pri_mi2s_sus_cfg,
- [GPIOMUX_ACTIVE] = &pri_mi2s_act_cfg,
- },
- },
- };
- #endif /* CONFIG_SND_SOC_MAX98504 */
- static struct gpiomux_setting ta_nchg_cfg[] = {
- {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- },
- };
- static struct msm_gpiomux_config msm_ta_nchg_configs[] = {
- {
- .gpio = 27, /* TA_NCHG */
- .settings = {
- [GPIOMUX_ACTIVE] = &ta_nchg_cfg[0],
- [GPIOMUX_SUSPENDED] = &ta_nchg_cfg[0],
- },
- },
- };
- static struct gpiomux_setting ta_int_n_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_ta_int_n_configs[] = {
- {
- #if defined (CONFIG_SEC_MILLETLTE_COMMON)
- .gpio = 119, /* TA_INT_N */
- #else
- .gpio = 115, /* TA_INT_N */
- #endif
- .settings = {
- [GPIOMUX_ACTIVE] = &ta_int_n_cfg,
- [GPIOMUX_SUSPENDED] = &ta_int_n_cfg,
- },
- },
- };
- static struct gpiomux_setting ovp_enable_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config ovp_enable_configs[] = {
- {
- .gpio = 65, /* OVP enable */
- .settings = {
- [GPIOMUX_ACTIVE] = &ovp_enable_cfg,
- [GPIOMUX_SUSPENDED] = &ovp_enable_cfg,
- },
- },
- };
- static struct gpiomux_setting usb_otg_sw_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config usb_otg_sw_configs[] __initdata = {
- {
- .gpio = 67,
- .settings = {
- [GPIOMUX_SUSPENDED] = &usb_otg_sw_cfg,
- },
- },
- };
- static struct gpiomux_setting wcdcodec_reset_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .dir = GPIOMUX_OUT_HIGH,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct msm_gpiomux_config wcdcodec_reset_cfg[] __initdata = {
- {
- .gpio = 72,
- .settings = {
- [GPIOMUX_SUSPENDED] = &wcdcodec_reset_suspend_cfg,
- },
- },
- };
- #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
- static struct gpiomux_setting sdc3_clk_actv_cfg = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting sdc3_cmd_data_0_3_actv_cfg = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting sdc3_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting sdc3_data_1_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct msm_gpiomux_config msm8226_sdc3_configs[] __initdata = {
- {
- /* DAT3 */
- .gpio = 39,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
- },
- },
- {
- /* DAT2 */
- .gpio = 40,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
- },
- },
- {
- /* DAT1 */
- .gpio = 41,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_data_1_suspend_cfg,
- },
- },
- {
- /* DAT0 */
- .gpio = 42,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
- },
- },
- {
- /* CMD */
- .gpio = 43,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_cmd_data_0_3_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
- },
- },
- {
- /* CLK */
- .gpio = 44,
- .settings = {
- [GPIOMUX_ACTIVE] = &sdc3_clk_actv_cfg,
- [GPIOMUX_SUSPENDED] = &sdc3_suspend_cfg,
- },
- },
- };
- static void msm_gpiomux_sdc3_install(void)
- {
- msm_gpiomux_install(msm8226_sdc3_configs,
- ARRAY_SIZE(msm8226_sdc3_configs));
- }
- #else
- static void msm_gpiomux_sdc3_install(void) {}
- #endif /* CONFIG_MMC_MSM_SDC3_SUPPORT */
- extern int system_rev;
- #if defined (CONFIG_MACH_MILLETLTE_OPEN) || defined (CONFIG_MACH_MILLETLTE_KOR)
- static struct msm_gpiomux_config millet_nc_gpio_cfgs[] __initdata = {
- NC_GPIO_CONFIG(115),
- NC_GPIO_CONFIG(116),
- };
- static struct msm_gpiomux_config millet_nc3_gpio_cfgs[] __initdata = {
- NC_GPIO_CONFIG(4),
- NC_GPIO_CONFIG(52),
- NC_GPIO_CONFIG(120),
- };
- #endif
- #if defined (CONFIG_SEC_MILLETWIFI_COMMON)
- static struct msm_gpiomux_config milletwifi_nc_gpio_cfgs[] __initdata = {
- NC_GPIO_CONFIG(0),
- NC_GPIO_CONFIG(1),
- #if defined(CONFIG_MACH_MILLETWIFI_OPEN)
- NC_GPIO_CONFIG(4),
- NC_GPIO_CONFIG(5),
- #endif
- NC_GPIO_CONFIG(22),
- NC_GPIO_CONFIG(52),
- NC_GPIO_CONFIG(56),
- NC_GPIO_CONFIG(57),
- NC_GPIO_CONFIG(58),
- NC_GPIO_CONFIG(59),
- NC_GPIO_CONFIG(60),
- NC_GPIO_CONFIG(66),
- NC_GPIO_CONFIG(116),
- };
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_VZW) || defined(CONFIG_MACH_MILLETLTE_ATT) || defined(CONFIG_MACH_MILLETLTE_TMO) || defined(CONFIG_MACH_MILLETLTE_CAN)
- static struct msm_gpiomux_config milletltevzw_att_nc_gpio_cfgs[] __initdata = {
- NC_GPIO_CONFIG(2),
- NC_GPIO_CONFIG(3),
- #if defined(CONFIG_MACH_MILLETLTE_CAN)
- NC_GPIO_CONFIG_CAN(22),
- #else
- NC_GPIO_CONFIG(22),
- #endif
- NC_GPIO_CONFIG(52),
- };
- #endif
- extern int poweroff_charging;
- #if defined (CONFIG_MACH_MILLET3G_EUR)
- static struct msm_gpiomux_config millet3g_nc_gpio_cfgs[] __initdata = {
- NC_GPIO_CONFIG(4),
- NC_GPIO_CONFIG(52),
- NC_GPIO_CONFIG(56),
- NC_GPIO_CONFIG(62),
- NC_GPIO_CONFIG(64),
- NC_GPIO_CONFIG(116),
- };
- #endif
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- static struct gpiomux_setting gpio_10_sda_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config milletltevzw_gpio_10[] __initdata = {
- {
- .gpio = 10,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_10_sda_config,
- [GPIOMUX_SUSPENDED] = &gpio_10_sda_config,
- },
- },
- };
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_ATT) || defined(CONFIG_MACH_MILLETLTE_TMO) || defined(CONFIG_MACH_MILLETLTE_CAN)
- static struct msm_gpiomux_config milletatt_tmo_nc_gpio_107[] __initdata = {
- NC_GPIO_CONFIG(107), // NC, revision 1 onwards
- };
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_VZW)
- static struct msm_gpiomux_config milletvzw_nc_gpio_22[] __initdata = {
- NC_GPIO_CONFIG(22),
- };
- static struct msm_gpiomux_config milletvzw_nc_gpio_107[] __initdata = {
- NC_GPIO_CONFIG(107), // NC only after revision 4
- };
- #endif
- void __init msm8226_init_gpiomux(void)
- {
- int rc;
- rc = msm_gpiomux_init_dt();
- if (rc) {
- pr_err("%s failed %d\n", __func__, rc);
- return;
- }
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- msm_gpiomux_install(milletltevzw_gpio_10, ARRAY_SIZE(milletltevzw_gpio_10));
- #endif
- #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
- msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
- #endif
- msm_gpiomux_install(msm_keypad_configs,
- ARRAY_SIZE(msm_keypad_configs));
- if (of_board_is_skuf())
- msm_gpiomux_install(msm_skuf_blsp_configs,
- ARRAY_SIZE(msm_skuf_blsp_configs));
- else
- msm_gpiomux_install(msm_blsp_configs,
- ARRAY_SIZE(msm_blsp_configs));
- msm_gpiomux_install(wcnss_5wire_interface,
- ARRAY_SIZE(wcnss_5wire_interface));
- msm_gpiomux_install(&sd_card_det, 1);
- if (of_board_is_skuf())
- msm_gpiomux_install(msm_skuf_goodix_configs,
- ARRAY_SIZE(msm_skuf_goodix_configs));
- else
- #if defined (CONFIG_MACH_BERLUTI3G_EUR)
- msm_gpiomux_install(msm_cypress_configs,
- ARRAY_SIZE(msm_cypress_configs));
- msm_gpiomux_install(msm_keyboad_cypress_configs,
- ARRAY_SIZE(msm_keyboad_cypress_configs));
- #elif defined(CONFIG_SEC_MILLET_PROJECT)
- msm_gpiomux_install(msm_melfas_configs,
- ARRAY_SIZE(msm_melfas_configs));
- #else
- msm_gpiomux_install(msm_synaptics_configs,
- ARRAY_SIZE(msm_synaptics_configs));
- #endif
- if (of_board_is_skuf())
- msm_gpiomux_install(msm_skuf_nfc_configs,
- ARRAY_SIZE(msm_skuf_nfc_configs));
- msm_gpiomux_install_nowrite(msm_lcd_configs,
- ARRAY_SIZE(msm_lcd_configs));
- msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
- if (of_board_is_skuf())
- msm_gpiomux_install(msm_sensor_configs_skuf_plus,
- ARRAY_SIZE(msm_sensor_configs_skuf_plus));
- #if !defined (CONFIG_SEC_MILLET_PROJECT)
- msm_gpiomux_install(msm_auxpcm_configs,
- ARRAY_SIZE(msm_auxpcm_configs));
- #endif
- if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
- msm_gpiomux_install(usb_otg_sw_configs,
- ARRAY_SIZE(usb_otg_sw_configs));
- #if defined (CONFIG_SEC_MILLET_PROJECT)
- msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
- if ( system_rev >= 0 && system_rev < 3) {
- msm_gpiomux_install(light_prox_config, ARRAY_SIZE(light_prox_config));
- msm_gpiomux_install(irled_i2c_scl_config,
- ARRAY_SIZE(irled_i2c_scl_config));
- } else {
- msm_gpiomux_install(nc_light_prox_config, ARRAY_SIZE(nc_light_prox_config));
- #if defined (CONFIG_MACH_MILLETLTE_VZW) || defined(CONFIG_SEC_MILLETWIFI_COMMON)
- msm_gpiomux_install(irled_i2c_scl_config,
- ARRAY_SIZE(irled_i2c_scl_config));
- #endif
- }
- #endif
- msm_gpiomux_sdc3_install();
- msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));
- msm_gpiomux_install(msm_ta_int_n_configs, ARRAY_SIZE(msm_ta_int_n_configs));
- #if defined (CONFIG_SEC_MILLETLTE_COMMON)
- if ( system_rev >= 3)
- {
- msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
- }
- #else
- msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
- #endif
- #if defined (CONFIG_SEC_MILLETWIFI_COMMON)
- msm_gpiomux_install(milletwifi_nc_gpio_cfgs, ARRAY_SIZE(milletwifi_nc_gpio_cfgs));
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_OPEN) || defined (CONFIG_MACH_MILLETLTE_KOR)
- msm_gpiomux_install(millet_nc_gpio_cfgs, ARRAY_SIZE(millet_nc_gpio_cfgs));
- if ( system_rev >= 3){
- msm_gpiomux_install(millet_nc3_gpio_cfgs, ARRAY_SIZE(millet_nc3_gpio_cfgs));
- }
- #endif
- #if defined (CONFIG_MACH_MILLET3G_EUR)
- if ( system_rev >= 2)
- msm_gpiomux_install(millet3g_nc_gpio_cfgs, ARRAY_SIZE(millet3g_nc_gpio_cfgs));
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_VZW)
- msm_gpiomux_install(milletvzw_nc_gpio_22, ARRAY_SIZE(milletvzw_nc_gpio_22));
- if ( system_rev >= 4)
- msm_gpiomux_install(milletvzw_nc_gpio_107, ARRAY_SIZE(milletvzw_nc_gpio_107));
- if ( system_rev >= 1)
- msm_gpiomux_install(milletltevzw_att_nc_gpio_cfgs, ARRAY_SIZE(milletltevzw_att_nc_gpio_cfgs));
- #endif
- #if defined (CONFIG_MACH_MILLETLTE_ATT) || defined(CONFIG_MACH_MILLETLTE_TMO) || defined(CONFIG_MACH_MILLETLTE_CAN)
- msm_gpiomux_install(milletltevzw_att_nc_gpio_cfgs, ARRAY_SIZE(milletltevzw_att_nc_gpio_cfgs));
- msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
- if (system_rev >= 1)
- msm_gpiomux_install(milletatt_tmo_nc_gpio_107, ARRAY_SIZE(milletatt_tmo_nc_gpio_107));
- #endif
- #if defined(CONFIG_SAMSUNG_JACK)
- msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
- #endif
- if(!poweroff_charging)
- msm_gpiomux_install(wcdcodec_reset_cfg, ARRAY_SIZE(wcdcodec_reset_cfg));
- #ifdef CONFIG_SND_SOC_MAX98504
- #if defined(CONFIG_MACH_MILLETLTE_OPEN) || defined (CONFIG_MACH_MILLETLTE_KOR)
- if ( system_rev >= 0 && system_rev < 3)
- #elif defined (CONFIG_MACH_MILLET3G_EUR)
- if ( system_rev >= 2 && system_rev < 4)
- #elif defined(CONFIG_MACH_MILLETWIFI_OPEN)
- if ( system_rev >= 0 && system_rev < 5)
- #endif
- {
- msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
- msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
- msm_gpiomux_install(msm8226_amp_int_configs,ARRAY_SIZE(msm8226_amp_int_configs));
- }
- #endif
- }
- #ifdef CONFIG_WCNSS_IRIS_REGISTER_DUMP
- static void wcnss_switch_to_gpio(void)
- {
- /* Switch MUX to GPIO */
- msm_gpiomux_install(wcnss_5gpio_interface,
- ARRAY_SIZE(wcnss_5gpio_interface));
- /* Ensure GPIO config */
- gpio_direction_input(WLAN_DATA2);
- gpio_direction_input(WLAN_DATA1);
- gpio_direction_input(WLAN_DATA0);
- gpio_direction_output(WLAN_SET, 0);
- gpio_direction_output(WLAN_CLK, 0);
- }
- static void wcnss_switch_to_5wire(void)
- {
- msm_gpiomux_install(wcnss_5wire_interface,
- ARRAY_SIZE(wcnss_5wire_interface));
- }
- u32 wcnss_rf_read_reg(u32 rf_reg_addr)
- {
- int count = 0;
- u32 rf_cmd_and_addr = 0;
- u32 rf_data_received = 0;
- u32 rf_bit = 0;
- wcnss_switch_to_gpio();
- /* Reset the signal if it is already being used. */
- gpio_set_value(WLAN_SET, 0);
- gpio_set_value(WLAN_CLK, 0);
- /* We start with cmd_set high WLAN_SET = 1. */
- gpio_set_value(WLAN_SET, 1);
- gpio_direction_output(WLAN_DATA0, 1);
- gpio_direction_output(WLAN_DATA1, 1);
- gpio_direction_output(WLAN_DATA2, 1);
- gpio_set_value(WLAN_DATA0, 0);
- gpio_set_value(WLAN_DATA1, 0);
- gpio_set_value(WLAN_DATA2, 0);
- /* Prepare command and RF register address that need to sent out.
- * Make sure that we send only 14 bits from LSB.
- */
- rf_cmd_and_addr = (((WLAN_RF_READ_REG_CMD) |
- (rf_reg_addr << WLAN_RF_REG_ADDR_START_OFFSET)) &
- WLAN_RF_READ_CMD_MASK);
- for (count = 0; count < 5; count++) {
- gpio_set_value(WLAN_CLK, 0);
- rf_bit = (rf_cmd_and_addr & 0x1);
- gpio_set_value(WLAN_DATA0, rf_bit ? 1 : 0);
- rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
- rf_bit = (rf_cmd_and_addr & 0x1);
- gpio_set_value(WLAN_DATA1, rf_bit ? 1 : 0);
- rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
- rf_bit = (rf_cmd_and_addr & 0x1);
- gpio_set_value(WLAN_DATA2, rf_bit ? 1 : 0);
- rf_cmd_and_addr = (rf_cmd_and_addr >> 1);
- /* Send the data out WLAN_CLK = 1 */
- gpio_set_value(WLAN_CLK, 1);
- }
- /* Pull down the clock signal */
- gpio_set_value(WLAN_CLK, 0);
- /* Configure data pins to input IO pins */
- gpio_direction_input(WLAN_DATA0);
- gpio_direction_input(WLAN_DATA1);
- gpio_direction_input(WLAN_DATA2);
- for (count = 0; count < 2; count++) {
- gpio_set_value(WLAN_CLK, 1);
- gpio_set_value(WLAN_CLK, 0);
- }
- rf_bit = 0;
- for (count = 0; count < 6; count++) {
- gpio_set_value(WLAN_CLK, 1);
- gpio_set_value(WLAN_CLK, 0);
- rf_bit = gpio_get_value(WLAN_DATA0);
- rf_data_received |= (rf_bit << (count * 3 + 0));
- if (count != 5) {
- rf_bit = gpio_get_value(WLAN_DATA1);
- rf_data_received |= (rf_bit << (count * 3 + 1));
- rf_bit = gpio_get_value(WLAN_DATA2);
- rf_data_received |= (rf_bit << (count * 3 + 2));
- }
- }
- gpio_set_value(WLAN_SET, 0);
- wcnss_switch_to_5wire();
- return rf_data_received;
- }
- #endif
|