diff options
author | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-22 09:05:43 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-22 09:05:43 +0000 |
commit | b66aa08df846bbbbc41d21cd42052d4c96b84668 (patch) | |
tree | 9d796b023ac4c0e6dff0e317d499faf034595a18 /arch | |
parent | c08433d1b54a2cadc7061a2bd68fbf1a4d42fcca (diff) |
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/gta02-pm-wlan.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/mach-om-gta03.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/gta02_pm_wlan.c | 16 |
4 files changed, 33 insertions, 4 deletions
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 <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> @@ -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 <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/mutex.h> #include <linux/platform_device.h> #include <mach/hardware.h> @@ -21,13 +22,14 @@ #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> #include <linux/delay.h> -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, |