aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-s3c6410
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-12-05 22:55:08 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-05 22:55:08 +0000
commitf126210f14d79bb6429023b7b49308dc1b47ca69 (patch)
tree9a248d19b74cd98eafa6ff6270815544fb64bfa5 /arch/arm/mach-s3c6410
parent46375b1d935b1b97f06df2426632ba9b58861f0e (diff)
fix-gta03-wlan-pm-and-mmc-rescan.patch
This fixes problems with not enough signals controlled by WLAN enable and disable (it really does cycle the power) and adapts starting state for Qi change that defaults it all to off. It saves about 50mW pulling the power from it. It also provokes the SDIO stack to go look for the card after power up or down so it tracks presence by this power operation too. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/mach-s3c6410')
-rw-r--r--arch/arm/mach-s3c6410/om-gta03-features.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c6410/om-gta03-features.c b/arch/arm/mach-s3c6410/om-gta03-features.c
index b1b8db5179c..8467750d9d1 100644
--- a/arch/arm/mach-s3c6410/om-gta03-features.c
+++ b/arch/arm/mach-s3c6410/om-gta03-features.c
@@ -26,6 +26,10 @@
#include <linux/regulator/consumer.h>
#include <linux/mfd/pcf50633/core.h>
#include <linux/mfd/pcf50633/gpio.h>
+#include <linux/mmc/host.h>
+
+#include <plat/sdhci.h>
+#include <plat/devs.h>
#include <plat/gpio-cfg.h>
@@ -48,7 +52,7 @@ struct om_gta03_feature_info {
static struct om_gta03_feature_info feature_info[OM_GTA03_FEATURE_COUNT] = {
[OM_GTA03_GPS] = { "gps_power", 1, 0 },
- [OM_GTA03_WLAN_BT] = { "wlan_bt_power", 1, 1 },
+ [OM_GTA03_WLAN_BT] = { "wlan_bt_power", 1, 0 },
[OM_GTA03_GSM] = { "gsm_power", 0, 0 },
[OM_GTA03_USBHOST] = { "usbhost_power", 1, 0 },
[OM_GTA03_VIB] = { "vibrator_power", 1, 0 },
@@ -75,8 +79,14 @@ static void om_gta03_features_pwron_set_on(enum feature feature)
gpio_direction_output(GTA03_GPIO_NWLAN_POWER, 0);
s3c_gpio_setpull(GTA03_GPIO_NWLAN_POWER, S3C_GPIO_PULL_NONE);
s3c_gpio_cfgpin(GTA03_GPIO_NWLAN_POWER, S3C_GPIO_SFN(1));
- msleep(1);
+ msleep(500);
+ gpio_direction_output(GTA03_GPIO_WLAN_PWRDN, 1);
+ s3c_gpio_setpull(GTA03_GPIO_WLAN_PWRDN, S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgpin(GTA03_GPIO_WLAN_PWRDN, S3C_GPIO_SFN(1));
+ msleep(500);
gpio_direction_output(GTA03_GPIO_WLAN_RESET, 1);
+ msleep(500);
+ sdhci_s3c_force_presence_change(&s3c_device_hsmmc1);
break;
case OM_GTA03_GSM:
/* give power to GSM module */
@@ -110,10 +120,15 @@ static void om_gta03_features_pwron_set_off(enum feature feature)
regulator_disable(gps_regulator);
break;
case OM_GTA03_WLAN_BT:
+ gpio_direction_output(GTA03_GPIO_WLAN_PWRDN, 0);
+ s3c_gpio_setpull(GTA03_GPIO_WLAN_PWRDN, S3C_GPIO_PULL_NONE);
+ s3c_gpio_cfgpin(GTA03_GPIO_WLAN_PWRDN, S3C_GPIO_SFN(1));
+ msleep(500);
/* remove power from WLAN / BT module */
gpio_direction_output(GTA03_GPIO_NWLAN_POWER, 1);
s3c_gpio_setpull(GTA03_GPIO_NWLAN_POWER, S3C_GPIO_PULL_NONE);
s3c_gpio_cfgpin(GTA03_GPIO_NWLAN_POWER, S3C_GPIO_SFN(1));
+ sdhci_s3c_force_presence_change(&s3c_device_hsmmc1);
break;
case OM_GTA03_GSM:
/* remove power from WLAN / BT module */