From b66aa08df846bbbbc41d21cd42052d4c96b84668 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 22 Nov 2008 09:05:43 +0000 Subject: --- arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h | 1 + arch/arm/mach-s3c2440/mach-gta02.c | 16 ++++++++++++++++ arch/arm/mach-s3c6410/mach-om-gta03.c | 4 +--- arch/arm/plat-s3c24xx/gta02_pm_wlan.c | 16 +++++++++++++++- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h (limited to 'arch') 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 index 00000000000..8e4ccf241fc --- /dev/null +++ b/arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h @@ -0,0 +1 @@ +void gta02_wlan_power(int on); diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index e9a32b5874b..2baf38f9f95 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -88,6 +88,7 @@ #include #include #include +#include #include @@ -955,6 +956,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); @@ -1674,6 +1689,7 @@ static void __init gta02_machine_init(void) s3c_device_usb.dev.platform_data = >a02_usb_info; s3c_device_nand.dev.platform_data = >a02_nand_info; + s3c_device_sdi.dev.platform_data = >a02_s3c_mmc_cfg; /* acc sensor chip selects */ s3c2410_gpio_setpin(S3C2410_GPD12, 1); diff --git a/arch/arm/mach-s3c6410/mach-om-gta03.c b/arch/arm/mach-s3c6410/mach-om-gta03.c index 9306236cb63..02c1c967db9 100644 --- a/arch/arm/mach-s3c6410/mach-om-gta03.c +++ b/arch/arm/mach-s3c6410/mach-om-gta03.c @@ -136,8 +136,6 @@ static void __gta03_lis302dl_bitbang(struct lis302dl_info *lis, u8 *tx, int n; u8 shifter = 0; - printk(KERN_INFO "__gta03_lis302dl_bitbang\n"); - gpio_direction_output(pdata->pin_chip_select, 1); gpio_direction_output(pdata->pin_clk, 1); gpio_direction_output(pdata->pin_chip_select, 0); @@ -225,7 +223,7 @@ void gta03_lis302dl_suspend_io(struct lis302dl_info *lis, int resume) struct lis302dl_platform_data lis302_pdata = { .name = "lis302", - .pin_chip_select= S3C64XX_GPN(15), /* NC */ + .pin_chip_select= S3C64XX_GPC(3), /* NC */ .pin_clk = GTA03_GPIO_ACCEL_CLK, .pin_mosi = GTA03_GPIO_ACCEL_MOSI, .pin_miso = GTA03_GPIO_ACCEL_MISO, diff --git a/arch/arm/plat-s3c24xx/gta02_pm_wlan.c b/arch/arm/plat-s3c24xx/gta02_pm_wlan.c index b55ba241494..3a0d24079da 100644 --- a/arch/arm/plat-s3c24xx/gta02_pm_wlan.c +++ b/arch/arm/plat-s3c24xx/gta02_pm_wlan.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -21,13 +22,14 @@ #include #include +#include #include #include #include -static void gta02_wlan_power(int on) +static void __gta02_wlan_power(int on) { if (!on) { s3c2410_gpio_setpin(GTA02_CHIP_PWD, 1); @@ -43,7 +45,19 @@ static void gta02_wlan_power(int on) s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0); msleep(100); s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 1); +} +void gta02_wlan_power(int on) +{ + static DEFINE_MUTEX(lock); + static int is_on = -1; /* initial state is unknown */ + + on = !!on; /* normalize */ + mutex_lock(&lock); + if (on != is_on) + __gta02_wlan_power(on); + is_on = on; + mutex_unlock(&lock); } static ssize_t gta02_wlan_read(struct device *dev, -- cgit v1.2.3