[PATCH 2/2] fix-gta03-wlan-pm-and-mmc-rescan.patch

Andy Green andy at openmoko.com
Sat Dec 6 00:21:41 CET 2008


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 at openmoko.com>
---

 arch/arm/mach-s3c6410/om-gta03-features.c |   19 +++++++++++++++++--
 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 b1b8db5..8467750 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 */




More information about the openmoko-kernel mailing list