From: Xinyu Chen Date: Tue, 15 May 2012 09:16:33 +0000 (+0800) Subject: ENGR00182786 mx6q sabresd: Add power/reset function for 3G modem X-Git-Tag: v3.0.35-fsl~1048 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3d80760ab65d04e9e95b211494f39b606be54c2d;p=karo-tx-linux.git ENGR00182786 mx6q sabresd: Add power/reset function for 3G modem Add PCIE 3V3 power up/down routing if we do not have pcie driver selected. And power up 3V3 in board init. As the reset function of the hw board cannot reset the modem power. So on kernel boot up, we must make sure the 3g modem is reset correctly by gpio reset. Signed-off-by: guoyin.chen Signed-off-by: Xinyu Chen --- diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx6/board-mx6q_sabresd.c index 47e9211bd185..a52cc4247cbb 100644 --- a/arch/arm/mach-mx6/board-mx6q_sabresd.c +++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c @@ -1364,6 +1364,31 @@ static int __init imx6q_init_audio(void) return 0; } +#ifndef CONFIG_IMX_PCIE +static void pcie_3v3_power(void) +{ + /* disable PCIE_3V3 first */ + gpio_request(SABRESD_PCIE_PWR_EN, "pcie_3v3_en"); + gpio_direction_output(SABRESD_PCIE_PWR_EN, 0); + mdelay(10); + /* enable PCIE_3V3 again */ + gpio_set_value(SABRESD_PCIE_PWR_EN, 1); + gpio_free(SABRESD_PCIE_PWR_EN); +} + +static void pcie_3v3_reset(void) +{ + /* reset miniPCIe */ + gpio_request(SABRESD_PCIE_RST_B_REVB, "pcie_reset_rebB"); + gpio_direction_output(SABRESD_PCIE_RST_B_REVB, 0); + /* The PCI Express Mini CEM specification states that PREST# is + deasserted minimum 1ms after 3.3vVaux has been applied and stable*/ + mdelay(1); + gpio_set_value(SABRESD_PCIE_RST_B_REVB, 1); + gpio_free(SABRESD_PCIE_RST_B_REVB); +} +#endif + static void gps_power_on(bool on) { /* Enable/disable aux_3v15 */ @@ -1727,6 +1752,13 @@ static void __init mx6_sabresd_board_init(void) gpio_direction_output(SABRESD_AUX_5V_EN, 1); gpio_set_value(SABRESD_AUX_5V_EN, 1); +#ifndef CONFIG_IMX_PCIE + /* enable pcie 3v3 power without pcie driver */ + pcie_3v3_power(); + mdelay(10); + pcie_3v3_reset(); +#endif + gps_power_on(true); /* Register charger chips */ platform_device_register(&sabresd_max8903_charger_1);