From fdd71d8b2a4961540263fa3341a439475aea7fd4 Mon Sep 17 00:00:00 2001 From: Krishna Konda Date: Mon, 8 Jul 2013 16:30:16 -0700 Subject: [PATCH] board: 8226: add gpiomux configuration for SDC3 slot GPIOs This patch adds the gpiomux configuration for GPIOs of SDC3 slot. SDCC functionality for these GPIOs are muxed with other functionalities so before enabling the relevant config options for SDC3, make sure that current functionality for those GPIOs are disabled. CRs-Fixed: 490761 Change-Id: I04dd442399fdad912c79f3b912cae46651e2a4ae Signed-off-by: Asutosh Das Signed-off-by: Krishna Konda --- arch/arm/mach-msm/board-8226-gpiomux.c | 87 ++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/arch/arm/mach-msm/board-8226-gpiomux.c b/arch/arm/mach-msm/board-8226-gpiomux.c index a32031d3639..fd831fc56b7 100644 --- a/arch/arm/mach-msm/board-8226-gpiomux.c +++ b/arch/arm/mach-msm/board-8226-gpiomux.c @@ -468,6 +468,91 @@ static struct msm_gpiomux_config usb_otg_sw_configs[] __initdata = { }, }; +#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; @@ -500,4 +585,6 @@ void __init msm8226_init_gpiomux(void) 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(); }