[PATCH 3/3] gta02-s3cmci-power-control.patch

Werner Almesberger werner at openmoko.org
Sat Nov 22 04:17:45 CET 2008


This patch gives s3cmci nominal control over power to the WLAN
module.

In face, it only gives it the ability to reset the WLAN module
after module removal/insertion or suspend/resume. Resetting the
module is necessary, because s3cmci requests a full device
initialization from the SD/MMC stack, including CMD5, and this
command is only allowed if the SDIO module has been reset.

Signed-off-by: Werner Almesberger <werner at openmoko.org>

---

Index: ktrack/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ ktrack/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h	2008-11-22 00:33:35.000000000 -0200
@@ -0,0 +1 @@
+void gta02_wlan_power(int on);
Index: ktrack/arch/arm/mach-s3c2440/mach-gta02.c
===================================================================
--- ktrack.orig/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-22 00:31:49.000000000 -0200
+++ ktrack/arch/arm/mach-s3c2440/mach-gta02.c	2008-11-22 00:33:35.000000000 -0200
@@ -79,6 +79,7 @@
 #include <plat/iic.h>
 #include <asm/plat-s3c24xx/neo1973.h>
 #include <mach/neo1973-pm-gsm.h>
+#include <mach/gta02-pm-wlan.h>
 
 #include <linux/jbt6k74.h>
 
@@ -903,6 +904,20 @@
 	.software_ecc	= 1,
 };
 
+
+static void gta02_s3c_mmc_set_power(unsigned char power_mode,
+    unsigned short vdd)
+{
+	gta02_wlan_power(
+	    power_mode == MMC_POWER_ON ||
+	    power_mode == MMC_POWER_UP);
+}
+
+
+static struct s3c24xx_mci_pdata gta02_s3c_mmc_cfg = {
+	.set_power	= gta02_s3c_mmc_set_power,
+};
+
 static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
 {
 	printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
@@ -1580,6 +1595,7 @@
 
 	s3c_device_usb.dev.platform_data = &gta02_usb_info;
 	s3c_device_nand.dev.platform_data = &gta02_nand_info;
+	s3c_device_sdi.dev.platform_data = &gta02_s3c_mmc_cfg;
 
 	/* acc sensor chip selects */
 	s3c2410_gpio_setpin(S3C2410_GPD12, 1);
Index: ktrack/arch/arm/plat-s3c24xx/gta02_pm_wlan.c
===================================================================
--- ktrack.orig/arch/arm/plat-s3c24xx/gta02_pm_wlan.c	2008-11-22 00:33:13.000000000 -0200
+++ ktrack/arch/arm/plat-s3c24xx/gta02_pm_wlan.c	2008-11-22 00:33:35.000000000 -0200
@@ -22,6 +22,7 @@
 #include <asm/plat-s3c24xx/neo1973.h>
 
 #include <mach/gta02.h>
+#include <mach/gta02-pm-wlan.h>
 #include <mach/regs-gpio.h>
 #include <mach/regs-gpioj.h>
 
@@ -46,7 +47,7 @@
 	s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 1);
 }
 
-static void gta02_wlan_power(int on)
+void gta02_wlan_power(int on)
 {
 	static DEFINE_MUTEX(lock);
 	static int is_on = -1; /* initial state is unknown */



More information about the openmoko-kernel mailing list