123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098 |
- /* 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.
- *
- */
- #include <linux/init.h>
- #include <linux/ioport.h>
- #include <mach/board.h>
- #include <mach/gpio.h>
- #include <mach/gpiomux.h>
- #include <mach/socinfo.h>
- /* Key gpio configurations */
- static struct gpiomux_setting gpio_keys_active = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting gpio_keys_suspend = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- };
- static struct gpiomux_setting gpio_home_keys_active = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_home_keys_suspend = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- 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_home_keys_active,
- [GPIOMUX_SUSPENDED] = &gpio_home_keys_suspend,
- },
- },
- };
- /* SPI configurations */
- static struct gpiomux_setting gpio_spi_act_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_spi_cs_act_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct gpiomux_setting gpio_spi_susp_config = {
- .func = GPIOMUX_FUNC_1,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- /* WCNSS configurations */
- 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,
- };
- 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,
- },
- };
- 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,
- },
- },
- };
- /* GPIO i2c configurations */
- static struct gpiomux_setting gpio_i2c_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- /* Sensor configurations */
- static struct gpiomux_setting sensor_gpio_i2c_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting accel_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting prox_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting mag_irq_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting rgb_sda_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_sensors_configs[] __initdata = {
- {
- .gpio = 65, /* PROXY IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &prox_irq_config,
- [GPIOMUX_SUSPENDED] = &prox_irq_config,
- },
- },
- {
- .gpio = 64, /* G_SENSOR IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &accel_irq_config,
- [GPIOMUX_SUSPENDED] = &accel_irq_config,
- },
- },
- {
- .gpio = 66, /* MAG IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &mag_irq_config,
- [GPIOMUX_SUSPENDED] = &mag_irq_config,
- },
- },
- {
- .gpio = 23, /* SVC LED */
- .settings = {
- [GPIOMUX_ACTIVE] = &rgb_sda_config,
- [GPIOMUX_SUSPENDED] = &rgb_sda_config,
- },
- },
- };
- /* NFC configurations */
- #ifdef CONFIG_SEC_NFC_I2C
- static struct gpiomux_setting nfc_gpio_i2c_config = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting nfc_ven_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct gpiomux_setting nfc_irq_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting nfc_firmware_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config msm_nfc_configs[] __initdata = {
- {
- .gpio = 20, /* NFC EN */
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_ven_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_ven_cfg,
- },
- },
- {
- .gpio = 21, /* NFC IRQ */
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_irq_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_irq_cfg,
- },
- },
- {
- .gpio = 62, /* NFC FIRMWARE */
- .settings = {
- [GPIOMUX_ACTIVE] = &nfc_firmware_cfg,
- [GPIOMUX_SUSPENDED] = &nfc_firmware_cfg,
- },
- },
- };
- #endif
- /* Hall interrupt configuration */
- static struct gpiomux_setting hall_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting hall_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_UP,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_hall_configs[] __initdata = {
- {
- .gpio = 50,
- .settings = {
- [GPIOMUX_ACTIVE] = &hall_active_cfg,
- [GPIOMUX_SUSPENDED] = &hall_suspend_cfg,
- },
- },
- };
- /* LCD configurations */
- static struct gpiomux_setting lcd_rst_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_UP,
- .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_power_act_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_OUT_HIGH,
- };
- static struct gpiomux_setting lcd_power_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config msm_lcd_configs[] __initdata = {
- {
- .gpio = 25,
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
- },
- },
- {
- .gpio = 56,
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_power_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_power_sus_cfg,
- },
- },
- {
- .gpio = 60,
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_power_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_power_sus_cfg,
- },
- },
- {
- .gpio = 63,
- .settings = {
- [GPIOMUX_ACTIVE] = &lcd_power_act_cfg,
- [GPIOMUX_SUSPENDED] = &lcd_power_sus_cfg,
- },
- }
- };
- /* UART configurations */
- 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_active_config = {
- .func = GPIOMUX_FUNC_2,
- .drv = GPIOMUX_DRV_8MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
- {
- .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,
- },
- },
- {
- .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_sleep_config,
- },
- },
- #ifdef CONFIG_SEC_NFC_I2C
- { /* NFC */
- .gpio = 10, /* BLSP1 QUP3 I2C_DAT */
- .settings = {
- [GPIOMUX_SUSPENDED] = &nfc_gpio_i2c_config,
- },
- },
- {
- .gpio = 11, /* BLSP1 QUP3 I2C_CLK */
- .settings = {
- [GPIOMUX_SUSPENDED] = &nfc_gpio_i2c_config,
- },
- },
- #endif
- {
- .gpio = 6, /* BLSP1 QUP2 I2C_SDA */
- .settings = {
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- {
- .gpio = 7, /* BLSP1 QUP2 I2C_SCL */
- .settings = {
- [GPIOMUX_SUSPENDED] = &sensor_gpio_i2c_config,
- },
- },
- {
- .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,
- },
- },
- };
- /* Camera configurations */
- 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,
- .dir = GPIOMUX_OUT_LOW,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*suspend 0*/ /* 4 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- },
- {
- .func = GPIOMUX_FUNC_1, /*active 1*/ /* 5 */
- .drv = GPIOMUX_DRV_4MA,
- .pull = GPIOMUX_PULL_NONE,
- },
- {
- .func = GPIOMUX_FUNC_1, /*suspend*/ /* 6 */
- .drv = GPIOMUX_DRV_4MA,
- .pull = GPIOMUX_PULL_DOWN,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 0 */ //7 Haarika
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- },
- {
- .func = GPIOMUX_FUNC_GPIO, /*suspend*/ /* 1 */ //8
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- },
- {
- .func = GPIOMUX_FUNC_1, /*active 1*/ /* 9 */
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_NONE,
- },
- {
- .func = GPIOMUX_FUNC_1, /*suspend*/ /* 10 */
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- },
- };
- static struct msm_gpiomux_config msm_csensor_configs[] __initdata = {
- {
- .gpio = 0, /* CIS_SPI_MOSI */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[5],
- #if defined(CONFIG_MACH_MS01_EUR_3G)
- [GPIOMUX_SUSPENDED] = &cam_settings[5],
- #else
- [GPIOMUX_SUSPENDED] = &cam_settings[8],
- #endif
- },
- },
- {
- .gpio = 1, /* CIS_SPI_MISO */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[5],
- #if defined(CONFIG_MACH_MS01_EUR_3G)
- [GPIOMUX_SUSPENDED] = &cam_settings[5],
- #else
- [GPIOMUX_SUSPENDED] = &cam_settings[8],
- #endif
- },
- },
- {
- .gpio = 3, /* CIS_SPI_SCLK */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[5],
- #if defined(CONFIG_MACH_MS01_EUR_3G)
- [GPIOMUX_SUSPENDED] = &cam_settings[5],
- #else
- [GPIOMUX_SUSPENDED] = &cam_settings[8],
- #endif
- },
- },
- {
- .gpio = 26, /* CAM_MCLK0 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[9],
- [GPIOMUX_SUSPENDED] = &cam_settings[10],
- },
- },
- #if defined(CONFIG_MACH_S3VE3G_EUR)
- {
- .gpio = 27, /* CAM_MCLK1 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[6],
- [GPIOMUX_SUSPENDED] = &cam_settings[6],
- },
- },
- #else
- {
- .gpio = 27, /* CAM_MCLK1 */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[7],
- [GPIOMUX_SUSPENDED] = &cam_settings[8],
- },
- },
- #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 = 37, /* CAM1_RST_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],
- },
- },
- {
- .gpio = 112, /* CAM_ANALOG_EN */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 114, /* CAM_IO_EN */
- .settings = {
- [GPIOMUX_ACTIVE] = &cam_settings[3],
- [GPIOMUX_SUSPENDED] = &cam_settings[4],
- },
- },
- {
- .gpio = 34, /* AF_SDA */
- .settings = {
- /*[GPIOMUX_ACTIVE] = &gpio_i2c_config,*/
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- {
- #if defined(CONFIG_MACH_MS01_EUR_3G)
- .gpio = 33, /* AF_SCL */
- #else
- .gpio = 36, /* AF_SCL */
- #endif
- .settings = {
- /*[GPIOMUX_ACTIVE] = &gpio_i2c_config,*/
- [GPIOMUX_SUSPENDED] = &gpio_suspend_config[0],
- },
- },
- };
- /* Touch */
- static struct gpiomux_setting melfas_int_act_cfg = {
- .func = GPIOMUX_FUNC_3,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting melfas_int_sus_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_i2c_tkey_act_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting gpio_i2c_tkey_sus_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm_melfas_configs[] __initdata = {
- {
- .gpio = 17,
- .settings = {
- [GPIOMUX_ACTIVE] = &melfas_int_act_cfg,
- [GPIOMUX_SUSPENDED] = &melfas_int_sus_cfg,
- },
- },
- };
- static struct msm_gpiomux_config msm_keyboad_cypress_configs[] __initdata = {
- {
- .gpio = 49, /* 2_TOUCH_INT */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_sus_config,
- },
- },
- {
- .gpio = 66, /* 2_TOUCH_I2C_SCL */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_sus_config,
- },
- },
- {
- .gpio = 114, /* 2_TOUCH_I2C_SDA */
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_i2c_tkey_act_config,
- [GPIOMUX_SUSPENDED] = &gpio_i2c_tkey_sus_config,
- },
- },
- };
- /* EarJack configurations */
- static struct gpiomux_setting earjack_gpio_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO, /*active 1*/ /* 0 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting earjack_gpio_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO, /*suspend*/ /* 1 */
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config msm_earjack_gpio_configs[] __initdata = {
- {
- .gpio = 35, /* EAR_SWITCH */
- .settings = {
- [GPIOMUX_ACTIVE] = &earjack_gpio_active_cfg,
- [GPIOMUX_SUSPENDED] = &earjack_gpio_suspend_cfg,
- },
- }
- };
- static struct gpiomux_setting codec_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_NONE,
- };
- static struct gpiomux_setting codec_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_6MA,
- .pull = GPIOMUX_PULL_DOWN,
- };
- static struct msm_gpiomux_config msm_cdc_reset_config[] __initdata = {
- {
- .gpio = 72,
- .settings = {
- [GPIOMUX_ACTIVE] = &codec_active_cfg,
- [GPIOMUX_SUSPENDED] = &codec_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 */
- /* TX_GTR_THRESH configurations */
- static struct gpiomux_setting tx_gtr_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_OUT_LOW,
- };
- static struct msm_gpiomux_config msm8226_tx_gtr_configs[] __initdata = {
- {
- /* TX_GTR_THRESH */
- .gpio = 87,
- .settings = {
- [GPIOMUX_ACTIVE] = &tx_gtr_cfg,
- [GPIOMUX_SUSPENDED] = &tx_gtr_cfg,
- },
- },
- };
- /* MUIC configurations */
- static struct gpiomux_setting gpio_muic_config = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_NONE,
- .dir = GPIOMUX_IN,
- };
- static struct msm_gpiomux_config muic_configs[] __initdata = {
- {
- .gpio = 4,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_muic_config,
- [GPIOMUX_SUSPENDED] = &gpio_muic_config,
- },
- },
- {
- .gpio = 5,
- .settings = {
- [GPIOMUX_ACTIVE] = &gpio_muic_config,
- [GPIOMUX_SUSPENDED] = &gpio_muic_config,
- },
- },
- };
- /* NC pin configurations */
- #define NC_GPIO_CONFIG(gpio_num) { \
- .gpio = gpio_num, \
- .settings = { \
- [GPIOMUX_ACTIVE] = &nc_active_cfg, \
- [GPIOMUX_SUSPENDED] = &nc_suspend_cfg, } \
- }
- static struct gpiomux_setting nc_active_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- static struct gpiomux_setting nc_suspend_cfg = {
- .func = GPIOMUX_FUNC_GPIO,
- .drv = GPIOMUX_DRV_2MA,
- .pull = GPIOMUX_PULL_DOWN,
- .dir = GPIOMUX_IN,
- };
- 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 hw_rev_configs[] __initdata = {
- {
- .gpio = 15, /* HW_REV(0) */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- {
- .gpio = 14, /* HW_REV(1) */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- {
- .gpio = 13, /* HW_REV(2) */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- {
- .gpio = 12, /* HW_REV(3) */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- {
- .gpio = 22, /* CHECK_DS_SS */
- .settings = {
- [GPIOMUX_ACTIVE] = &hw_chk_bit_gpio_cfg,
- [GPIOMUX_SUSPENDED] = &hw_chk_bit_gpio_cfg,
- },
- },
- };
- /* BERLUTI 3G NC configs */
- static struct msm_gpiomux_config berluti3g_nc_gpio_cfgs[] __initdata = {
- #if defined(CONFIG_FB_MSM_MDSS_SHARP_HD_PANEL)
- NC_GPIO_CONFIG(16), /* As we will not ESD so ESD pin should be NC */
- #endif
- NC_GPIO_CONFIG(24),
- NC_GPIO_CONFIG(53),
- NC_GPIO_CONFIG(54),
- NC_GPIO_CONFIG(55),
- #ifndef CONFIG_FB_MSM_MDSS_SHARP_HD_PANEL
- NC_GPIO_CONFIG(60),
- #endif
- NC_GPIO_CONFIG(80),
- NC_GPIO_CONFIG(88),
- NC_GPIO_CONFIG(89),
- NC_GPIO_CONFIG(90),
- NC_GPIO_CONFIG(91),
- NC_GPIO_CONFIG(92),
- NC_GPIO_CONFIG(93),
- NC_GPIO_CONFIG(94),
- NC_GPIO_CONFIG(97),
- NC_GPIO_CONFIG(98),
- NC_GPIO_CONFIG(99),
- NC_GPIO_CONFIG(100),
- NC_GPIO_CONFIG(103),
- NC_GPIO_CONFIG(104),
- NC_GPIO_CONFIG(110),
- NC_GPIO_CONFIG(113),
- NC_GPIO_CONFIG(115),
- NC_GPIO_CONFIG(116),
- };
- void __init msm8226_init_gpiomux(void)
- {
- int rc;
- rc = msm_gpiomux_init_dt();
- if (rc) {
- pr_err("%s failed %d\n", __func__, rc);
- return;
- }
- /* Keypad */
- msm_gpiomux_install(msm_keypad_configs,
- ARRAY_SIZE(msm_keypad_configs));
- /* HallSensors */
- msm_gpiomux_install(msm_hall_configs,
- ARRAY_SIZE(msm_hall_configs));
- /* BLSP */
- msm_gpiomux_install(msm_blsp_configs,
- ARRAY_SIZE(msm_blsp_configs));
- /*HW */
- msm_gpiomux_install(hw_rev_configs,
- ARRAY_SIZE(hw_rev_configs));
- /* WCNSS */
- msm_gpiomux_install(wcnss_5wire_interface,
- ARRAY_SIZE(wcnss_5wire_interface));
- /*T_FLASH_DETECT */
- msm_gpiomux_install(&sd_card_det, 1);
- /* TX_GTR */
- msm_gpiomux_install(msm8226_tx_gtr_configs,
- ARRAY_SIZE(msm8226_tx_gtr_configs));
- /* LCD */
- msm_gpiomux_install_nowrite(msm_lcd_configs,
- ARRAY_SIZE(msm_lcd_configs));
- /* Camera */
- msm_gpiomux_install(msm_csensor_configs,
- ARRAY_SIZE(msm_csensor_configs));
- /* Touch */
- msm_gpiomux_install(msm_melfas_configs,
- ARRAY_SIZE(msm_melfas_configs));
- /* Touch Key */
- msm_gpiomux_install(msm_keyboad_cypress_configs,
- ARRAY_SIZE(msm_keyboad_cypress_configs));
- #ifdef CONFIG_SEC_NFC_I2C
- /* NFC */
- msm_gpiomux_install(msm_nfc_configs,
- ARRAY_SIZE(msm_nfc_configs));
- #endif
- /* Sensors */
- msm_gpiomux_install(msm_sensors_configs,
- ARRAY_SIZE(msm_sensors_configs));
- /* SDCC3 */
- msm_gpiomux_sdc3_install();
- /* Codec */
- msm_gpiomux_install(msm_cdc_reset_config,
- ARRAY_SIZE(msm_cdc_reset_config));
- /* Earjack */
- msm_gpiomux_install(msm_earjack_gpio_configs,
- ARRAY_SIZE(msm_earjack_gpio_configs));
- /* MUIC */
- msm_gpiomux_install(muic_configs,
- ARRAY_SIZE(muic_configs));
- /* NC */
- msm_gpiomux_install(berluti3g_nc_gpio_cfgs, ARRAY_SIZE(berluti3g_nc_gpio_cfgs));
- }
|