arm: tegra: cardhu: Reset Modem during init
Laxman Dewangan [Thu, 14 Jul 2011 09:08:02 +0000 (14:08 +0530)]
Resetting the modem during the kernel boot for E1291-A04.

bug 817238

Original-Change-Id: Id0862d39306b87a04a28abd205455d97dd05109e
Reviewed-on: http://git-master/r/38693
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

Rebase-Id: Rf42e80598a66f46cd0ef0e2bfacca3917eb86c45

arch/arm/mach-tegra/board-cardhu-pinmux.c
arch/arm/mach-tegra/board-cardhu.c

index 3ecb649..68a6ac3 100644 (file)
@@ -442,6 +442,10 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu_a03[] = {
        DEFAULT_PINMUX(PEX_L1_PRSNT_N,  RSVD3,           PULL_UP,   TRISTATE,   INPUT),
 };
 
+static __initdata struct tegra_pingroup_config cardhu_pinmux_e1291_a04[] = {
+       DEFAULT_PINMUX(GMI_AD15,        NAND,            PULL_DOWN,   NORMAL,   OUTPUT),
+};
+
 static __initdata struct tegra_pingroup_config cardhu_pinmux_e1198[] = {
        /* SPI2 */
        DEFAULT_PINMUX(SPI2_SCK,        SPI2,            PULL_UP,    NORMAL,     INPUT),
@@ -533,6 +537,9 @@ int __init cardhu_pinmux_init(void)
                        tegra_pinmux_config_table(cardhu_pinmux_cardhu_a03,
                                        ARRAY_SIZE(cardhu_pinmux_cardhu_a03));
                }
+               if (board_info.fab >= BOARD_FAB_A04)
+                       tegra_pinmux_config_table(cardhu_pinmux_e1291_a04,
+                                       ARRAY_SIZE(cardhu_pinmux_e1291_a04));
                break;
 
        case BOARD_PM269:
index ea8cab8..295303a 100644 (file)
@@ -739,7 +739,7 @@ static void cardhu_modem_init(void)
        tegra_get_board_info(&board_info);
        switch (board_info.board_id) {
        case BOARD_E1291:
-               if (board_info.fab < 0x3) {
+               if (board_info.fab < BOARD_FAB_A03) {
                        w_disable_gpio = TEGRA_GPIO_PH5;
                } else {
                        w_disable_gpio = TEGRA_GPIO_PDD5;
@@ -751,6 +751,18 @@ static void cardhu_modem_init(void)
                                __func__, w_disable_gpio);
                else
                        gpio_direction_input(w_disable_gpio);
+
+               /* E1291-A04: Set PERST signal to low */
+               if (board_info.fab >= BOARD_FAB_A04) {
+                       ret = gpio_request(TEGRA_GPIO_PH7, "modem_perst");
+                       if (ret < 0) {
+                               pr_err("%d(): Error in allocating gpio "
+                                       "TEGRA_GPIO_PH7\n", __func__);
+                               break;
+                       }
+                       gpio_direction_output(TEGRA_GPIO_PH7, 0);
+                       tegra_gpio_enable(TEGRA_GPIO_PH7);
+               }
                break;
        case BOARD_E1186:
                tegra_gpio_enable(