From ca8df41a15456e13b8a77cbed969ad84bcf9e9d5 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Wed, 29 Feb 2012 15:15:10 +0100 Subject: cw1200: Adds wlan on u5500 support In u5500 platform reset pin is connected to PRCMU. * Kconfig option for wlan on u5500 * Implementation to set/unset RESOUT2_N_PIN by writing to PRCMU register (platform callback). ST-Ericsson ID: 375493 ST-Ericsson FOSS-OUT ID: NA Change-Id: I319622ab083c69c628bc52322d64339726e3e9bc Signed-off-by: Bartosz Markowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/41168 Reviewed-by: QATOOLS Reviewed-by: Janusz DZIEDZIC --- drivers/staging/cw1200/Kconfig | 12 ++++++------ drivers/staging/cw1200/ap.c | 0 drivers/staging/cw1200/cw1200_plat.h | 2 ++ drivers/staging/cw1200/cw1200_sdio.c | 20 +++++++++++++++++--- 4 files changed, 25 insertions(+), 9 deletions(-) mode change 100755 => 100644 drivers/staging/cw1200/ap.c diff --git a/drivers/staging/cw1200/Kconfig b/drivers/staging/cw1200/Kconfig index dbb97adb829..3a4fc9813c6 100644 --- a/drivers/staging/cw1200/Kconfig +++ b/drivers/staging/cw1200/Kconfig @@ -42,18 +42,18 @@ config CW1200_WAPI_SUPPORT Say Y if your compat-wireless support WAPI. If unsure, say N. -config CW1200_U5500_SUPPORT - bool "Enable U5500 support" +config CW1200_DISABLE_BEACON_HINTS + bool "Disable 11d beacon hints" depends on CW1200 help - Say Y if you want to enable wlan on u5500 platform support. + Say Y if you want to disable 11d beacon hints. If unsure, say N. -config CW1200_DISABLE_BEACON_HINTS - bool "Disable 11d beacon hints" +config CW1200_U5500_SUPPORT + bool "Enable U5500 support" depends on CW1200 help - Say Y if you want to disable 11d beacon hints. + Say Y if you want to enable wlan on u5500 platform support. If unsure, say N. menu "Driver debug features" diff --git a/drivers/staging/cw1200/ap.c b/drivers/staging/cw1200/ap.c old mode 100755 new mode 100644 diff --git a/drivers/staging/cw1200/cw1200_plat.h b/drivers/staging/cw1200/cw1200_plat.h index 4d30dbd3979..3a73183c9f8 100644 --- a/drivers/staging/cw1200/cw1200_plat.h +++ b/drivers/staging/cw1200/cw1200_plat.h @@ -18,6 +18,8 @@ struct cw1200_platform_data { bool enable); int (*clk_ctrl)(const struct cw1200_platform_data *pdata, bool enable); + int (*prcmu_ctrl)(const struct cw1200_platform_data *pdata, + bool enable); }; /* Declaration only. Should be implemented in arch/xxx/mach-yyy */ diff --git a/drivers/staging/cw1200/cw1200_sdio.c b/drivers/staging/cw1200/cw1200_sdio.c index 6f3eabd3967..c5de6dbbc2a 100644 --- a/drivers/staging/cw1200/cw1200_sdio.c +++ b/drivers/staging/cw1200/cw1200_sdio.c @@ -235,15 +235,24 @@ static int cw1200_detect_card(const struct cw1200_platform_data *pdata) static int cw1200_sdio_off(const struct cw1200_platform_data *pdata) { + int ret = 0; +#ifndef CONFIG_CW1200_U5500_SUPPORT const struct resource *reset = pdata->reset; gpio_set_value(reset->start, 0); - cw1200_detect_card(pdata); gpio_free(reset->start); - return 0; +#else + if (pdata->prcmu_ctrl) + ret = pdata->prcmu_ctrl(pdata, false); + msleep(50); +#endif + cw1200_detect_card(pdata); + return ret; } static int cw1200_sdio_on(const struct cw1200_platform_data *pdata) { + int ret = 0; +#ifndef CONFIG_CW1200_U5500_SUPPORT const struct resource *reset = pdata->reset; gpio_request(reset->start, reset->name); gpio_direction_output(reset->start, 1); @@ -259,8 +268,13 @@ static int cw1200_sdio_on(const struct cw1200_platform_data *pdata) /* The host should wait 32 ms after the WRESETN release * for the on-chip LDO to stabilize */ msleep(32); +#else + if (pdata->prcmu_ctrl) + ret = pdata->prcmu_ctrl(pdata, true); + msleep(50); +#endif cw1200_detect_card(pdata); - return 0; + return ret; } static int cw1200_sdio_reset(struct sbus_priv *self) -- cgit v1.2.3