gta02-s3cmci-power-control.patch
authorWerner Almesberger <werner@openmoko.org>
Sat, 22 Nov 2008 08:55:12 +0000 (08:55 +0000)
committerAndy Green <agreen@pads.home.warmcat.com>
Sat, 22 Nov 2008 08:55:12 +0000 (08:55 +0000)
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@openmoko.org>

arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h [new file with mode: 0644]
arch/arm/mach-s3c2440/mach-gta02.c
arch/arm/plat-s3c24xx/gta02_pm_wlan.c

diff --git a/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h b/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h
new file mode 100644 (file)
index 0000000..8e4ccf2
--- /dev/null
@@ -0,0 +1 @@
+void gta02_wlan_power(int on);
index ac2e5b6..5d0cd96 100644 (file)
@@ -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 @@ static struct s3c2410_platform_nand gta02_nand_info = {
        .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 @@ static void __init gta02_machine_init(void)
 
        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 6b00c07..3a0d240 100644 (file)
@@ -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 @@ static void __gta02_wlan_power(int on)
        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 */