930 lines
20 KiB
C
930 lines
20 KiB
C
/* Copyright (c) 2012-2014, 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 <soc/qcom/socinfo.h>
|
|
|
|
#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[] = {
|
|
{
|
|
.gpio = 115, /* HSIC_STROBE */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &hsic_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
|
|
},
|
|
},
|
|
{
|
|
.gpio = 116, /* HSIC_DATA */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &hsic_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
|
|
},
|
|
},
|
|
};
|
|
#endif
|
|
|
|
static struct gpiomux_setting smsc_hub_act_cfg = {
|
|
.func = GPIOMUX_FUNC_GPIO,
|
|
.drv = GPIOMUX_DRV_8MA,
|
|
.pull = GPIOMUX_PULL_NONE,
|
|
};
|
|
|
|
static struct gpiomux_setting smsc_hub_susp_cfg = {
|
|
.func = GPIOMUX_FUNC_GPIO,
|
|
.drv = GPIOMUX_DRV_2MA,
|
|
.pull = GPIOMUX_PULL_NONE,
|
|
};
|
|
|
|
static struct msm_gpiomux_config smsc_hub_configs[] = {
|
|
{
|
|
.gpio = 114, /* reset_n */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &smsc_hub_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &smsc_hub_susp_cfg,
|
|
},
|
|
},
|
|
{
|
|
.gpio = 8, /* clk_en */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &smsc_hub_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &smsc_hub_susp_cfg,
|
|
},
|
|
},
|
|
{
|
|
.gpio = 9, /* int_n */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &smsc_hub_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &smsc_hub_susp_cfg,
|
|
},
|
|
},
|
|
};
|
|
|
|
#define KS8851_IRQ_GPIO 115
|
|
|
|
#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
|
|
|
|
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,
|
|
};
|
|
|
|
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_NONE,
|
|
};
|
|
|
|
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,
|
|
};
|
|
|
|
static struct gpiomux_setting gpio_spi_cs_eth_config = {
|
|
.func = GPIOMUX_FUNC_4,
|
|
.drv = GPIOMUX_DRV_6MA,
|
|
.pull = GPIOMUX_PULL_DOWN,
|
|
};
|
|
|
|
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 gpio_i2c_config = {
|
|
.func = GPIOMUX_FUNC_3,
|
|
.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_keys_active,
|
|
[GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
};
|
|
|
|
static struct gpiomux_setting lcd_te_act_cfg = {
|
|
.func = GPIOMUX_FUNC_1,
|
|
.drv = GPIOMUX_DRV_2MA,
|
|
.pull = GPIOMUX_PULL_DOWN,
|
|
.dir = GPIOMUX_IN,
|
|
};
|
|
|
|
static struct gpiomux_setting lcd_te_sus_cfg = {
|
|
.func = GPIOMUX_FUNC_1,
|
|
.drv = GPIOMUX_DRV_2MA,
|
|
.pull = GPIOMUX_PULL_DOWN,
|
|
.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 = 109, /* LCD Enable */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &lcd_rst_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &lcd_rst_sus_cfg,
|
|
},
|
|
}
|
|
};
|
|
|
|
static struct msm_gpiomux_config msm_lcd_te_configs[] __initdata = {
|
|
{
|
|
.gpio = 24, /* Tear Enable */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &lcd_te_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &lcd_te_sus_cfg,
|
|
},
|
|
}
|
|
};
|
|
|
|
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 = 3, /* BLSP1 QUP1 SPI_CLK */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_spi_act_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
|
|
},
|
|
},
|
|
{
|
|
.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,
|
|
},
|
|
},
|
|
{
|
|
.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,
|
|
},
|
|
},
|
|
{
|
|
.gpio = 22, /* BLSP1 QUP1 SPI_CS_ETH */
|
|
.settings = {
|
|
[GPIOMUX_SUSPENDED] = &gpio_spi_cs_eth_config,
|
|
},
|
|
},
|
|
{ /* NFC */
|
|
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
|
|
},
|
|
},
|
|
{ /* NFC */
|
|
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
|
|
},
|
|
},
|
|
};
|
|
|
|
static struct msm_gpiomux_config msm_blsp_spi_cs_config[] __initdata = {
|
|
{
|
|
.gpio = 2, /* BLSP1 QUP1 SPI_CS1 */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_spi_cs_act_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_spi_susp_config,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
};
|
|
|
|
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 = {
|
|
{ /* 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,
|
|
},
|
|
},
|
|
{ /* NFC WAKE */
|
|
.gpio = 5,
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &nfc_wake_act_cfg,
|
|
[GPIOMUX_SUSPENDED] = &nfc_wake_sus_cfg,
|
|
},
|
|
},
|
|
{ /* NFC */
|
|
.gpio = 10, /* BLSP1 QUP3 I2C_DAT */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_i2c_config,
|
|
},
|
|
},
|
|
{ /* NFC */
|
|
.gpio = 11, /* BLSP1 QUP3 I2C_CLK */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &gpio_i2c_config,
|
|
[GPIOMUX_SUSPENDED] = &gpio_i2c_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,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
},
|
|
};
|
|
|
|
|
|
static struct msm_gpiomux_config msm_sensor_configs[] __initdata = {
|
|
{
|
|
.gpio = 26, /* CAM_MCLK0 */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &cam_settings[0],
|
|
[GPIOMUX_SUSPENDED] = &cam_settings[1],
|
|
},
|
|
},
|
|
{
|
|
.gpio = 27, /* CAM_MCLK1 */
|
|
.settings = {
|
|
[GPIOMUX_ACTIVE] = &cam_settings[0],
|
|
[GPIOMUX_SUSPENDED] = &cam_settings[1],
|
|
},
|
|
|
|
},
|
|
{
|
|
.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],
|
|
},
|
|
},
|
|
|
|
};
|
|
|
|
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],
|
|
},
|
|
},
|
|
};
|
|
|
|
|
|
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,
|
|
},
|
|
},
|
|
};
|
|
|
|
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,
|
|
},
|
|
},
|
|
};
|
|
|
|
#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 */
|
|
|
|
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_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));
|
|
if (machine_is_msm8226())
|
|
msm_gpiomux_install(msm_blsp_spi_cs_config,
|
|
ARRAY_SIZE(msm_blsp_spi_cs_config));
|
|
}
|
|
|
|
msm_gpiomux_install(wcnss_5wire_interface,
|
|
ARRAY_SIZE(wcnss_5wire_interface));
|
|
|
|
if (of_board_is_skuf())
|
|
msm_gpiomux_install(msm_skuf_goodix_configs,
|
|
ARRAY_SIZE(msm_skuf_goodix_configs));
|
|
else
|
|
msm_gpiomux_install(msm_synaptics_configs,
|
|
ARRAY_SIZE(msm_synaptics_configs));
|
|
|
|
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_lcd_te_configs,
|
|
ARRAY_SIZE(msm_lcd_te_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));
|
|
|
|
msm_gpiomux_install(msm_auxpcm_configs,
|
|
ARRAY_SIZE(msm_auxpcm_configs));
|
|
|
|
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));
|
|
|
|
msm_gpiomux_sdc3_install();
|
|
|
|
/*
|
|
* HSIC STROBE gpio is also used by the ethernet. Install HSIC
|
|
* gpio mux config only when HSIC is enabled. HSIC config will
|
|
* be disabled when ethernet config is enabled.
|
|
*/
|
|
#ifdef CONFIG_USB_EHCI_MSM_HSIC
|
|
if (machine_is_msm8926()) {
|
|
msm_hsic_configs[0].gpio = 119; /* STROBE */
|
|
msm_hsic_configs[1].gpio = 120; /* DATA */
|
|
}
|
|
msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
|
|
#endif
|
|
if (machine_is_msm8926() && of_board_is_mtp())
|
|
msm_gpiomux_install(smsc_hub_configs,
|
|
ARRAY_SIZE(smsc_hub_configs));
|
|
}
|