From 764d14ba5b6920acd08c43af8d1160494cde6617 Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Wed, 12 Oct 2011 16:22:25 +0200 Subject: cw1200: Integration with mach-ux500 CW1200 platform data is defined and set in arch/arm/mach-ux500. TODO: WLAN regulators are defined but not handled. Waiting for support in mach-ux500. Signed-off-by: Dmitry Tarnyagin Change-Id: If368398af1ca22366bb44c3bb8c7e3b1484cab1b Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23353 Reviewed-by: Janusz DZIEDZIC Reviewed-by: Bartosz MARKOWSKI Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/board-mop500-wlan.c | 108 ++++++++++++++++++++++++++++++++ arch/arm/mach-ux500/board-mop500-wlan.h | 17 +++++ 2 files changed, 125 insertions(+) create mode 100644 arch/arm/mach-ux500/board-mop500-wlan.c create mode 100644 arch/arm/mach-ux500/board-mop500-wlan.h (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c new file mode 100644 index 00000000000..c24069600ca --- /dev/null +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -0,0 +1,108 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * Author: Dmitry Tarnyagin + * License terms: GNU General Public License (GPL) version 2 + */ + +#include +#include +#include +#include +#include "../drivers/staging/cw1200/cw1200_plat.h" + +static void cw1200_release(struct device *dev); + +static struct resource cw1200_href_resources[] = { + { + .start = 215, + .end = 215, + .flags = IORESOURCE_IO, + .name = "cw1200_reset", + }, +#ifdef CONFIG_CW1200_USE_GPIO_IRQ + { + .start = NOMADIK_GPIO_TO_IRQ(216), + .end = NOMADIK_GPIO_TO_IRQ(216), + .flags = IORESOURCE_IRQ, + .name = "cw1200_irq", + }, +#endif /* CONFIG_CW1200_USE_GPIO_IRQ */ +}; + +static struct resource cw1200_href60_resources[] = { + { + .start = 85, + .end = 85, + .flags = IORESOURCE_IO, + .name = "cw1200_reset", + }, +#ifdef CONFIG_CW1200_USE_GPIO_IRQ + { + .start = NOMADIK_GPIO_TO_IRQ(4), + .end = NOMADIK_GPIO_TO_IRQ(4), + .flags = IORESOURCE_IRQ, + .name = "cw1200_irq", + }, +#endif /* CONFIG_CW1200_USE_GPIO_IRQ */ +}; + +static struct cw1200_platform_data cw1200_platform_data = { + .regulator_vdd = "vdd", + .regulator_vio = "vio", +}; + +static struct platform_device cw1200_device = { + .name = "cw1200", + .dev = { + .platform_data = &cw1200_platform_data, + .release = cw1200_release, + }, +}; + +const struct cw1200_platform_data *cw1200_get_platform_data(void) +{ + return &cw1200_platform_data; +} +EXPORT_SYMBOL_GPL(cw1200_get_platform_data); + +int __init mop500_wlan_init(void) +{ + if (machine_is_snowball() || + machine_is_u8500() || + machine_is_u5500() || + machine_is_nomadik()) { + cw1200_device.num_resources = + ARRAY_SIZE(cw1200_href_resources); + cw1200_device.resource = cw1200_href_resources; + } else if (machine_is_hrefv60()) { + cw1200_device.num_resources = + ARRAY_SIZE(cw1200_href60_resources); + cw1200_device.resource = cw1200_href60_resources; + } else { + dev_err(&cw1200_device.dev, + "Unsupported mach type %d " + "(check mach-types.h)\n", + __machine_arch_type); + return -ENOTSUPP; + } + + if (machine_is_snowball()) + cw1200_platform_data.mmc_id = "mmc2"; + else + cw1200_platform_data.mmc_id = "mmc3"; + + cw1200_platform_data.reset = &cw1200_device.resource[0]; +#ifdef CONFIG_CW1200_USE_GPIO_IRQ + cw1200_platform_data.irq = &cw1200_device.resource[1]; +#endif /* #ifdef CONFIG_CW1200_USE_GPIO_IRQ */ + + cw1200_device.dev.release = cw1200_release; + + return platform_device_register(&cw1200_device); +} + +static void cw1200_release(struct device *dev) +{ + /* Do nothing: release is handled by SDIO stack */ +} diff --git a/arch/arm/mach-ux500/board-mop500-wlan.h b/arch/arm/mach-ux500/board-mop500-wlan.h new file mode 100644 index 00000000000..c6788adc46f --- /dev/null +++ b/arch/arm/mach-ux500/board-mop500-wlan.h @@ -0,0 +1,17 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * License terms: GNU General Public License (GPL), version 2 + * + * U8500 board specific cw1200 (WLAN device) initialization. + * + * Author: Dmitry Tarnyagin + * + */ + +#ifndef __BOARD_MOP500_WLAN_H +#define __BOARD_MOP500_WLAN_H + +int mop500_wlan_init(void); + +#endif -- cgit v1.2.3 From 78ce7d0b22780e3ac0eb85d32fddcc450691aa45 Mon Sep 17 00:00:00 2001 From: Dmitry Tarnyagin Date: Sun, 22 May 2011 23:22:42 +0200 Subject: cw1200: Request SDIO pins at device registration. ux500 platform requires hardware pins to be explicitly requested. Change-Id: I739b6badfb5d19e6e1c49eb8232df3b8aaa958e9 Signed-off-by: Dmitry Tarnyagin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23620 Reviewed-by: Par-Gunnar HJALMDAHL Reviewed-by: Bartosz MARKOWSKI Reviewed-by: Janusz DZIEDZIC Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/board-mop500-wlan.c | 42 +++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index c24069600ca..90b17e70e23 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include "pins.h" #include "../drivers/staging/cw1200/cw1200_plat.h" static void cw1200_release(struct device *dev); @@ -66,8 +68,36 @@ const struct cw1200_platform_data *cw1200_get_platform_data(void) } EXPORT_SYMBOL_GPL(cw1200_get_platform_data); +static int cw1200_pins_enable(bool enable) +{ + struct ux500_pins *pins; + int ret = 0; + + pins = ux500_pins_get("sdi1"); + if (!pins) { + printk(KERN_ERR "cw1200: Pins are not found. " + "Check platform data.\n"); + return -ENOENT; + } + + if (enable) + ret = ux500_pins_enable(pins); + else + ret = ux500_pins_disable(pins); + + if (ret) + printk(KERN_ERR "cw1200: Pins can not be %s: %d.\n", + enable ? "enabled" : "disabled", + ret); + + ux500_pins_put(pins); + + return ret; +} + int __init mop500_wlan_init(void) { + int ret; if (machine_is_snowball() || machine_is_u8500() || machine_is_u5500() || @@ -99,10 +129,18 @@ int __init mop500_wlan_init(void) cw1200_device.dev.release = cw1200_release; - return platform_device_register(&cw1200_device); + ret = cw1200_pins_enable(true); + if (WARN_ON(ret)) + return ret; + + ret = platform_device_register(&cw1200_device); + if (ret) + cw1200_pins_enable(false); + + return ret; } static void cw1200_release(struct device *dev) { - /* Do nothing: release is handled by SDIO stack */ + cw1200_pins_enable(false); } -- cgit v1.2.3 From 831df9acc277af959b0e8b3d53a55fe8fc714060 Mon Sep 17 00:00:00 2001 From: Dmitry Tarnyagin Date: Wed, 25 May 2011 23:22:35 +0200 Subject: cw1200: Add regulator support Add regulator support needed on Snowball HW. Change-Id: I12a88e7f968e00de256c7f331f5baede2d410ab7 Signed-off-by: Dmitry Tarnyagin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25139 Reviewed-by: Robert MARKLUND Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/board-mop500-wlan.c | 44 +++++++++++++++++++++++++++++---- drivers/staging/cw1200/cw1200_plat.h | 5 ++-- drivers/staging/cw1200/cw1200_sdio.c | 29 ++++++++++++++++++---- 3 files changed, 66 insertions(+), 12 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 90b17e70e23..e73a35e7c76 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -6,7 +6,9 @@ */ #include +#include #include +#include #include #include #include @@ -14,6 +16,8 @@ #include "../drivers/staging/cw1200/cw1200_plat.h" static void cw1200_release(struct device *dev); +static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, + bool enable); static struct resource cw1200_href_resources[] = { { @@ -49,16 +53,14 @@ static struct resource cw1200_href60_resources[] = { #endif /* CONFIG_CW1200_USE_GPIO_IRQ */ }; -static struct cw1200_platform_data cw1200_platform_data = { - .regulator_vdd = "vdd", - .regulator_vio = "vio", -}; +static struct cw1200_platform_data cw1200_platform_data = { 0 }; static struct platform_device cw1200_device = { - .name = "cw1200", + .name = "cw1200_wlan", .dev = { .platform_data = &cw1200_platform_data, .release = cw1200_release, + .init_name = "cw1200_wlan", }, }; @@ -95,6 +97,36 @@ static int cw1200_pins_enable(bool enable) return ret; } +static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, + bool enable) +{ + static const char *vdd_name = "vdd"; + struct regulator *vdd; + int ret = 0; + + vdd = regulator_get(&cw1200_device.dev, vdd_name); + if (IS_ERR(vdd)) { + ret = PTR_ERR(vdd); + dev_warn(&cw1200_device.dev, + "%s: Failed to get regulator '%s': %d\n", + __func__, vdd_name, ret); + } else { + if (enable) + ret = regulator_enable(vdd); + else + ret = regulator_disable(vdd); + + if (ret) { + dev_warn(&cw1200_device.dev, + "%s: Failed to %s regulator '%s': %d\n", + __func__, enable ? "enable" : "disable", + vdd_name, ret); + } + regulator_put(vdd); + } + return ret; +} + int __init mop500_wlan_init(void) { int ret; @@ -128,6 +160,8 @@ int __init mop500_wlan_init(void) #endif /* #ifdef CONFIG_CW1200_USE_GPIO_IRQ */ cw1200_device.dev.release = cw1200_release; + if (machine_is_snowball()) + cw1200_platform_data.power_ctrl = cw1200_power_ctrl; ret = cw1200_pins_enable(true); if (WARN_ON(ret)) diff --git a/drivers/staging/cw1200/cw1200_plat.h b/drivers/staging/cw1200/cw1200_plat.h index 3b6acaff305..573bc06ac7f 100644 --- a/drivers/staging/cw1200/cw1200_plat.h +++ b/drivers/staging/cw1200/cw1200_plat.h @@ -8,11 +8,12 @@ #include struct cw1200_platform_data { - const char *regulator_vdd; - const char *regulator_vio; + struct platform_device *device; const char *mmc_id; const struct resource *irq; const struct resource *reset; + int (*power_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 2b7d0a1eaf7..235ac67cb75 100644 --- a/drivers/staging/cw1200/cw1200_sdio.c +++ b/drivers/staging/cw1200/cw1200_sdio.c @@ -28,7 +28,7 @@ MODULE_AUTHOR("Dmitry Tarnyagin "); MODULE_DESCRIPTION("mac80211 ST-Ericsson CW1200 SDIO driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("cw1200"); +MODULE_ALIAS("cw1200_wlan"); struct sbus_priv { struct sdio_func *func; @@ -259,6 +259,9 @@ static int cw1200_sdio_on(const struct cw1200_platform_data *pdata) const struct resource *reset = pdata->reset; gpio_request(reset->start, reset->name); gpio_direction_output(reset->start, 1); + msleep(100); + gpio_set_value(reset->start, 0); + msleep(100); gpio_set_value(reset->start, 1); cw1200_detect_card(pdata); return 0; @@ -267,7 +270,7 @@ static int cw1200_sdio_on(const struct cw1200_platform_data *pdata) static int cw1200_sdio_reset(struct sbus_priv *self) { cw1200_sdio_off(self->pdata); - mdelay(1000); + msleep(1000); cw1200_sdio_on(self->pdata); return 0; } @@ -350,7 +353,7 @@ static void cw1200_sdio_disconnect(struct sdio_func *func) } static struct sdio_driver sdio_driver = { - .name = "cw1200", + .name = "cw1200_wlan", .id_table = if_sdio_ids, .probe = cw1200_sdio_probe, .remove = cw1200_sdio_disconnect, @@ -359,19 +362,31 @@ static struct sdio_driver sdio_driver = { /* Init Module function -> Called by insmod */ static int __init cw1200_sdio_init(void) { + const struct cw1200_platform_data *pdata; int ret; + pdata = cw1200_get_platform_data(); + ret = sdio_register_driver(&sdio_driver); if (ret) goto err_reg; - ret = cw1200_sdio_on(cw1200_get_platform_data()); + if (pdata->power_ctrl) { + ret = pdata->power_ctrl(pdata, true); + if (ret) + goto err_power; + } + + ret = cw1200_sdio_on(pdata); if (ret) goto err_on; return 0; err_on: + if (pdata->power_ctrl) + pdata->power_ctrl(pdata, false); +err_power: sdio_unregister_driver(&sdio_driver); err_reg: return ret; @@ -380,8 +395,12 @@ err_reg: /* Called at Driver Unloading */ static void __exit cw1200_sdio_exit(void) { + const struct cw1200_platform_data *pdata; + pdata = cw1200_get_platform_data(); sdio_unregister_driver(&sdio_driver); - cw1200_sdio_off(cw1200_get_platform_data()); + cw1200_sdio_off(pdata); + if (pdata->power_ctrl) + pdata->power_ctrl(pdata, false); } -- cgit v1.2.3 From 3af28b5f37358faa59dc15cfa3e5e17fa1c6a81c Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Fri, 14 Oct 2011 14:51:51 +0200 Subject: ux500: irq: wlan: Fix multi boards support & put board common parts to mach/irqs.h Signed-off-by: Philippe Langlais --- arch/arm/mach-ux500/board-mop500-wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index e73a35e7c76..65863efc78c 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include "pins.h" #include "../drivers/staging/cw1200/cw1200_plat.h" -- cgit v1.2.3 From fa7182317ed7727c26e05339c2fe52c70e80d428 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Fri, 2 Sep 2011 15:24:25 +0200 Subject: WLAN: Add cw1200_plat.h to mach-ux500 includes ST-Ericsson ID: 355582, 352334 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: NA Signed-off-by: Bartosz Markowski Change-Id: Icbfbbb21be76d21c4f1190d586ec8458ea6aa12d Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30084 --- arch/arm/mach-ux500/include/mach/cw1200_plat.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 arch/arm/mach-ux500/include/mach/cw1200_plat.h (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/include/mach/cw1200_plat.h b/arch/arm/mach-ux500/include/mach/cw1200_plat.h new file mode 100644 index 00000000000..e79794f42a3 --- /dev/null +++ b/arch/arm/mach-ux500/include/mach/cw1200_plat.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * Author: Dmitry Tarnyagin + * License terms: GNU General Public License (GPL) version 2 + */ + +#ifndef CW1200_PLAT_H_INCLUDED +#define CW1200_PLAT_H_INCLUDED + +#include + +struct cw1200_platform_data { + const char *mmc_id; + const struct resource *irq; + const struct resource *reset; + int (*power_ctrl)(const struct cw1200_platform_data *pdata, + bool enable); +}; + +/* Declaration only. Should be implemented in arch/xxx/mach-yyy */ +const struct cw1200_platform_data *cw1200_get_platform_data(void); + +#endif /* CW1200_PLAT_H_INCLUDED */ -- cgit v1.2.3 From cff22182b933d9ba958fa9110dadf7e70f27d461 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Wed, 7 Sep 2011 08:25:23 +0200 Subject: u8500: Update board-mop500-wlan * cw1200_plat.h shall be included from mach includes ST-Ericsson ID: 352334 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I547ab94410c30cb86e8350b16b673f90faf29836 Signed-off-by: Bartosz Markowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30277 Reviewed-by: Ushit KUMAR Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-mop500-wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 65863efc78c..ed3f9488409 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -13,7 +13,7 @@ #include #include #include "pins.h" -#include "../drivers/staging/cw1200/cw1200_plat.h" +#include static void cw1200_release(struct device *dev); static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, -- cgit v1.2.3 From 2139c2a7bbc09a8b0efc9eb28dba6b62cac3acd4 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Tue, 13 Sep 2011 07:47:05 +0200 Subject: WLAN: remove GPIO_IRQ conditional checks GPIO IRQs can be used also by UMAC driver, and the .config configuration is not being set then. ST-Ericsson ID: 352334 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Bartosz Markowski Change-Id: I8f103102dd004c69725afd40453f5296ea4f20bb Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30845 Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-mop500-wlan.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index ed3f9488409..d17c2748386 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -26,14 +26,12 @@ static struct resource cw1200_href_resources[] = { .flags = IORESOURCE_IO, .name = "cw1200_reset", }, -#ifdef CONFIG_CW1200_USE_GPIO_IRQ { .start = NOMADIK_GPIO_TO_IRQ(216), .end = NOMADIK_GPIO_TO_IRQ(216), .flags = IORESOURCE_IRQ, .name = "cw1200_irq", }, -#endif /* CONFIG_CW1200_USE_GPIO_IRQ */ }; static struct resource cw1200_href60_resources[] = { @@ -43,14 +41,12 @@ static struct resource cw1200_href60_resources[] = { .flags = IORESOURCE_IO, .name = "cw1200_reset", }, -#ifdef CONFIG_CW1200_USE_GPIO_IRQ { .start = NOMADIK_GPIO_TO_IRQ(4), .end = NOMADIK_GPIO_TO_IRQ(4), .flags = IORESOURCE_IRQ, .name = "cw1200_irq", }, -#endif /* CONFIG_CW1200_USE_GPIO_IRQ */ }; static struct cw1200_platform_data cw1200_platform_data = { 0 }; @@ -155,9 +151,7 @@ int __init mop500_wlan_init(void) cw1200_platform_data.mmc_id = "mmc3"; cw1200_platform_data.reset = &cw1200_device.resource[0]; -#ifdef CONFIG_CW1200_USE_GPIO_IRQ cw1200_platform_data.irq = &cw1200_device.resource[1]; -#endif /* #ifdef CONFIG_CW1200_USE_GPIO_IRQ */ cw1200_device.dev.release = cw1200_release; if (machine_is_snowball()) -- cgit v1.2.3 From 68754d3ccb18ee1fff9c6ccad024b5cc6b534920 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Wed, 14 Sep 2011 12:24:31 +0200 Subject: WLAN: u5500: Add wlan init to u5500 board file Adds WLAN init to board-u5500 to have platform configuration in one place. ST-Ericsson ID: 352334 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Bartosz Markowski Change-Id: Ica7a1f1e588c7beaf489bafda16a763cfb4dc929 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30924 Reviewed-by: Stefan NILSSON9 Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-mop500-wlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index d17c2748386..16169d1cfcb 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -145,7 +145,8 @@ int __init mop500_wlan_init(void) return -ENOTSUPP; } - if (machine_is_snowball()) + if (machine_is_snowball() || + machine_is_u5500()) cw1200_platform_data.mmc_id = "mmc2"; else cw1200_platform_data.mmc_id = "mmc3"; -- cgit v1.2.3 From c60e43a2b31e86aee614ba7a7768b0139b9528fe Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Mon, 19 Sep 2011 15:51:26 +0200 Subject: WLAN: u5500: Add new wlan platform file for u5500 * Split board config files for u8500 and u5500 * Set sdi3 and mmc2 for u5500 WLAN ST-Ericsson ID: 352334 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Bartosz Markowski Change-Id: I9746591fe33c3c3748a50c86d01205fc0680f5d2 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/31410 Reviewed-by: Stefan NILSSON9 Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-mop500-wlan.c | 52 ++------------- arch/arm/mach-ux500/board-u5500-wlan.c | 109 ++++++++++++++++++++++++++++++++ arch/arm/mach-ux500/board-u5500-wlan.h | 18 ++++++ 3 files changed, 133 insertions(+), 46 deletions(-) create mode 100644 arch/arm/mach-ux500/board-u5500-wlan.c create mode 100644 arch/arm/mach-ux500/board-u5500-wlan.h (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 16169d1cfcb..e525d4fe8aa 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -16,8 +16,6 @@ #include static void cw1200_release(struct device *dev); -static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, - bool enable); static struct resource cw1200_href_resources[] = { { @@ -68,10 +66,11 @@ EXPORT_SYMBOL_GPL(cw1200_get_platform_data); static int cw1200_pins_enable(bool enable) { - struct ux500_pins *pins; + struct ux500_pins *pins = NULL; int ret = 0; pins = ux500_pins_get("sdi1"); + if (!pins) { printk(KERN_ERR "cw1200: Pins are not found. " "Check platform data.\n"); @@ -93,45 +92,12 @@ static int cw1200_pins_enable(bool enable) return ret; } -static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, - bool enable) -{ - static const char *vdd_name = "vdd"; - struct regulator *vdd; - int ret = 0; - - vdd = regulator_get(&cw1200_device.dev, vdd_name); - if (IS_ERR(vdd)) { - ret = PTR_ERR(vdd); - dev_warn(&cw1200_device.dev, - "%s: Failed to get regulator '%s': %d\n", - __func__, vdd_name, ret); - } else { - if (enable) - ret = regulator_enable(vdd); - else - ret = regulator_disable(vdd); - - if (ret) { - dev_warn(&cw1200_device.dev, - "%s: Failed to %s regulator '%s': %d\n", - __func__, enable ? "enable" : "disable", - vdd_name, ret); - } - regulator_put(vdd); - } - return ret; -} - int __init mop500_wlan_init(void) { int ret; - if (machine_is_snowball() || - machine_is_u8500() || - machine_is_u5500() || - machine_is_nomadik()) { - cw1200_device.num_resources = - ARRAY_SIZE(cw1200_href_resources); + + if (machine_is_u8500() || machine_is_nomadik()) { + cw1200_device.num_resources = ARRAY_SIZE(cw1200_href_resources); cw1200_device.resource = cw1200_href_resources; } else if (machine_is_hrefv60()) { cw1200_device.num_resources = @@ -145,18 +111,12 @@ int __init mop500_wlan_init(void) return -ENOTSUPP; } - if (machine_is_snowball() || - machine_is_u5500()) - cw1200_platform_data.mmc_id = "mmc2"; - else - cw1200_platform_data.mmc_id = "mmc3"; + cw1200_platform_data.mmc_id = "mmc3"; cw1200_platform_data.reset = &cw1200_device.resource[0]; cw1200_platform_data.irq = &cw1200_device.resource[1]; cw1200_device.dev.release = cw1200_release; - if (machine_is_snowball()) - cw1200_platform_data.power_ctrl = cw1200_power_ctrl; ret = cw1200_pins_enable(true); if (WARN_ON(ret)) diff --git a/arch/arm/mach-ux500/board-u5500-wlan.c b/arch/arm/mach-ux500/board-u5500-wlan.c new file mode 100644 index 00000000000..68282db06c3 --- /dev/null +++ b/arch/arm/mach-ux500/board-u5500-wlan.c @@ -0,0 +1,109 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * Author: Dmitry Tarnyagin + *Author: Bartosz Markowski for ST-Ericsson + * License terms: GNU General Public License (GPL) version 2 + */ + +#include +#include +#include +#include +#include +#include +#include +#include "pins.h" +#include + +static void cw1200_release(struct device *dev); + +static struct resource cw1200_u5500_resources[] = { + { + .start = NOMADIK_GPIO_TO_IRQ(129), + .end = NOMADIK_GPIO_TO_IRQ(129), + .flags = IORESOURCE_IRQ, + .name = "cw1200_irq", + }, +}; + +static struct cw1200_platform_data cw1200_platform_data = { 0 }; + +static struct platform_device cw1200_device = { + .name = "cw1200_wlan", + .dev = { + .platform_data = &cw1200_platform_data, + .release = cw1200_release, + .init_name = "cw1200_wlan", + }, +}; + +const struct cw1200_platform_data *cw1200_get_platform_data(void) +{ + return &cw1200_platform_data; +} +EXPORT_SYMBOL_GPL(cw1200_get_platform_data); + +static int cw1200_pins_enable(bool enable) +{ + struct ux500_pins *pins = NULL; + int ret = 0; + + pins = ux500_pins_get("sdi3"); + + if (!pins) { + printk(KERN_ERR "cw1200: Pins are not found. " + "Check platform data.\n"); + return -ENOENT; + } + + if (enable) + ret = ux500_pins_enable(pins); + else + ret = ux500_pins_disable(pins); + + if (ret) + printk(KERN_ERR "cw1200: Pins can not be %s: %d.\n", + enable ? "enabled" : "disabled", + ret); + + ux500_pins_put(pins); + + return ret; +} + +int __init u5500_wlan_init(void) +{ + int ret; + + if (machine_is_u5500()) { + cw1200_device.num_resources = ARRAY_SIZE(cw1200_u5500_resources); + cw1200_device.resource = cw1200_u5500_resources; + } else { + dev_err(&cw1200_device.dev, + "Unsupported mach type %d " + "(check mach-types.h)\n", + __machine_arch_type); + return -ENOTSUPP; + } + + cw1200_platform_data.mmc_id = "mmc2"; + cw1200_platform_data.irq = &cw1200_device.resource[0]; + + cw1200_device.dev.release = cw1200_release; + + ret = cw1200_pins_enable(true); + if (WARN_ON(ret)) + return ret; + + ret = platform_device_register(&cw1200_device); + if (ret) + cw1200_pins_enable(false); + + return ret; +} + +static void cw1200_release(struct device *dev) +{ + cw1200_pins_enable(false); +} diff --git a/arch/arm/mach-ux500/board-u5500-wlan.h b/arch/arm/mach-ux500/board-u5500-wlan.h new file mode 100644 index 00000000000..89fd41166fd --- /dev/null +++ b/arch/arm/mach-ux500/board-u5500-wlan.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) ST-Ericsson SA 2011 + * + * License terms: GNU General Public License (GPL), version 2 + * + * U5500 board specific cw1200 (WLAN device) initialization. + * + * Author: Dmitry Tarnyagin + * Author: Bartosz Markowski for ST-Ericsson + * + */ + +#ifndef __BOARD_U5500_WLAN_H +#define __BOARD_U5500_WLAN_H + +int u5500_wlan_init(void); + +#endif -- cgit v1.2.3 From e68ead5d0fb5c01fe09105e899e48f41358d3725 Mon Sep 17 00:00:00 2001 From: Robert Marklund Date: Wed, 28 Sep 2011 09:59:06 +0200 Subject: mach-ux500: wlan: Add prefix to wlan board func Change-Id: I844d5b2a3021616f082adf496f88645f534a9382 Signed-off-by: Robert Marklund --- arch/arm/mach-ux500/board-u5500-wlan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-u5500-wlan.c b/arch/arm/mach-ux500/board-u5500-wlan.c index 68282db06c3..8459ebd6aac 100644 --- a/arch/arm/mach-ux500/board-u5500-wlan.c +++ b/arch/arm/mach-ux500/board-u5500-wlan.c @@ -27,22 +27,22 @@ static struct resource cw1200_u5500_resources[] = { }, }; -static struct cw1200_platform_data cw1200_platform_data = { 0 }; +static struct cw1200_platform_data cw1200_u5500_platform_data = { 0 }; static struct platform_device cw1200_device = { .name = "cw1200_wlan", .dev = { - .platform_data = &cw1200_platform_data, + .platform_data = &cw1200_u5500_platform_data, .release = cw1200_release, .init_name = "cw1200_wlan", }, }; -const struct cw1200_platform_data *cw1200_get_platform_data(void) +const struct cw1200_platform_data *cw1200_u5500_get_platform_data(void) { - return &cw1200_platform_data; + return &cw1200_u5500_platform_data; } -EXPORT_SYMBOL_GPL(cw1200_get_platform_data); +EXPORT_SYMBOL_GPL(cw1200_u5500_get_platform_data); static int cw1200_pins_enable(bool enable) { @@ -87,8 +87,8 @@ int __init u5500_wlan_init(void) return -ENOTSUPP; } - cw1200_platform_data.mmc_id = "mmc2"; - cw1200_platform_data.irq = &cw1200_device.resource[0]; + cw1200_u5500_platform_data.mmc_id = "mmc2"; + cw1200_u5500_platform_data.irq = &cw1200_device.resource[0]; cw1200_device.dev.release = cw1200_release; -- cgit v1.2.3 From 50efd61a75f1ef58920bd268be3088acee9b3259 Mon Sep 17 00:00:00 2001 From: Dmitry Tarnyagin Date: Thu, 13 Oct 2011 18:11:22 +0200 Subject: u8500: Adding clock control callback into platform data. cw1200 device has hardware clock control. However on some platforms it is required to explicitly enable clock for the device. The patch adds a clock control callback into the platform data. Change-Id: I5fd619a34a4dbeff8f1b25d55bcca9e912020c23 Signed-off-by: Dmitry Tarnyagin Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34069 Reviewed-by: Bartosz MARKOWSKI Tested-by: Robert MARKLUND Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/include/mach/cw1200_plat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/include/mach/cw1200_plat.h b/arch/arm/mach-ux500/include/mach/cw1200_plat.h index e79794f42a3..4d30dbd3979 100644 --- a/arch/arm/mach-ux500/include/mach/cw1200_plat.h +++ b/arch/arm/mach-ux500/include/mach/cw1200_plat.h @@ -16,6 +16,8 @@ struct cw1200_platform_data { const struct resource *reset; int (*power_ctrl)(const struct cw1200_platform_data *pdata, bool enable); + int (*clk_ctrl)(const struct cw1200_platform_data *pdata, + bool enable); }; /* Declaration only. Should be implemented in arch/xxx/mach-yyy */ -- cgit v1.2.3 From b93081d5df652dcadc409e0a558bee9862eab964 Mon Sep 17 00:00:00 2001 From: Robert Marklund Date: Thu, 13 Oct 2011 12:49:14 +0200 Subject: cw1200: Re add snowball support Re add power ctrl and snowball support in the cw1200 driver Change-Id: I6a6b0279a05a419e62c0259d217361e43c855665 Signed-off-by: Robert Marklund Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34064 Reviewed-by: Bartosz MARKOWSKI Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/board-mop500-wlan.c | 47 +++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index e525d4fe8aa..ec53fca5f8d 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -16,6 +16,9 @@ #include static void cw1200_release(struct device *dev); +static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, + bool enable); + static struct resource cw1200_href_resources[] = { { @@ -92,11 +95,45 @@ static int cw1200_pins_enable(bool enable) return ret; } +static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, + bool enable) +{ + static const char *vdd_name = "vdd"; + struct regulator *vdd; + int ret = 0; + + vdd = regulator_get(&cw1200_device.dev, vdd_name); + if (IS_ERR(vdd)) { + ret = PTR_ERR(vdd); + dev_warn(&cw1200_device.dev, + "%s: Failed to get regulator '%s': %d\n", + __func__, vdd_name, ret); + } else { + if (enable) + ret = regulator_enable(vdd); + else + ret = regulator_disable(vdd); + + if (ret) { + dev_warn(&cw1200_device.dev, + "%s: Failed to %s regulator '%s': %d\n", + __func__, enable ? "enable" : "disable", + vdd_name, ret); + } + regulator_put(vdd); + } + return ret; +} + + + int __init mop500_wlan_init(void) { int ret; - if (machine_is_u8500() || machine_is_nomadik()) { + if (machine_is_u8500() || + machine_is_nomadik() || + machine_is_snowball()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href_resources); cw1200_device.resource = cw1200_href_resources; } else if (machine_is_hrefv60()) { @@ -111,13 +148,19 @@ int __init mop500_wlan_init(void) return -ENOTSUPP; } - cw1200_platform_data.mmc_id = "mmc3"; + if (machine_is_snowball()) + cw1200_platform_data.mmc_id = "mmc2"; + else + cw1200_platform_data.mmc_id = "mmc3"; cw1200_platform_data.reset = &cw1200_device.resource[0]; cw1200_platform_data.irq = &cw1200_device.resource[1]; cw1200_device.dev.release = cw1200_release; + if (machine_is_snowball()) + cw1200_platform_data.power_ctrl = cw1200_power_ctrl; + ret = cw1200_pins_enable(true); if (WARN_ON(ret)) return ret; -- cgit v1.2.3 From 9a140bee4c2705a5e4a4b9c26b276c1423e97d13 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Fri, 14 Oct 2011 08:55:48 +0200 Subject: ux500: enable WLAN clock by request Change-Id: Icd8433b49939613801c40e50138e15a4b49869d9 Signed-off-by: Dmitry Tarnyagin Signed-off-by: Bartosz Markowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34070 Tested-by: Robert MARKLUND Reviewed-by: Philippe LANGLAIS --- arch/arm/mach-ux500/board-mop500-wlan.c | 41 ++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index ec53fca5f8d..84c1b8958fa 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -12,14 +12,17 @@ #include #include #include -#include "pins.h" +#include #include +#include "pins.h" + static void cw1200_release(struct device *dev); static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, + bool enable); +static int cw1200_clk_ctrl(const struct cw1200_platform_data *pdata, bool enable); - static struct resource cw1200_href_resources[] = { { .start = 215, @@ -50,7 +53,9 @@ static struct resource cw1200_href60_resources[] = { }, }; -static struct cw1200_platform_data cw1200_platform_data = { 0 }; +static struct cw1200_platform_data cw1200_platform_data = { + .clk_ctrl = cw1200_clk_ctrl, +}; static struct platform_device cw1200_device = { .name = "cw1200_wlan", @@ -125,7 +130,37 @@ static int cw1200_power_ctrl(const struct cw1200_platform_data *pdata, return ret; } +static int cw1200_clk_ctrl(const struct cw1200_platform_data *pdata, + bool enable) +{ + static const char *clock_name = "sys_clk_out"; + struct clk *clk_dev; + int ret = 0; + + clk_dev = clk_get(&cw1200_device.dev, clock_name); + if (IS_ERR(clk_dev)) { + ret = PTR_ERR(clk_dev); + dev_warn(&cw1200_device.dev, + "%s: Failed to get clk '%s': %d\n", + __func__, clock_name, ret); + + } else { + + if (enable) + ret = clk_enable(clk_dev); + else + clk_disable(clk_dev); + + if (ret) { + dev_warn(&cw1200_device.dev, + "%s: Failed to %s clk enable: %d\n", + __func__, clock_name, ret); + } + } + + return ret; +} int __init mop500_wlan_init(void) { -- cgit v1.2.3 From ae68329dd26193218c46571d86a91fffea717da4 Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Fri, 2 Dec 2011 14:30:40 +0100 Subject: wlan: Include module.h after 3.2 update Signed-off-by: Philippe Langlais --- arch/arm/mach-ux500/board-mop500-wlan.c | 1 + drivers/staging/cw1200/debug.c | 1 + drivers/staging/cw1200/main.c | 1 + 3 files changed, 3 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 84c1b8958fa..52cd23b2852 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include diff --git a/drivers/staging/cw1200/debug.c b/drivers/staging/cw1200/debug.c index 91c690ad4e6..926f7b99faa 100644 --- a/drivers/staging/cw1200/debug.c +++ b/drivers/staging/cw1200/debug.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include "cw1200.h" diff --git a/drivers/staging/cw1200/main.c b/drivers/staging/cw1200/main.c index 3af5d1c21f2..ffc43592141 100644 --- a/drivers/staging/cw1200/main.c +++ b/drivers/staging/cw1200/main.c @@ -20,6 +20,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include -- cgit v1.2.3 From 9e3cdf2a27ebe893f839b968ff34083ab0d777b1 Mon Sep 17 00:00:00 2001 From: Rejane Durand Date: Tue, 18 Oct 2011 13:37:05 +0200 Subject: [U9500] Correct the GPIO configuration for WLAN There are two parts in this correction. Firstly, as there is much in common between a U9500 platform and a U8500 one, all the tests performed to identify a U9500 platform shall be done before the ones related to U8500. Otherwise, the platform will be considered as a U8500 one and the GPIOs will be badly configured. Secondly, the mapping of WLAN_IRQ has to be changed. On U8500, WLAN_IRQ is mapped onto GPIO04. On U9500, it is GPIO144 that shall be used. ST-Ericsson ID: 368270 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I5880f617c65f7cf4ca9eeabf22a53f7a77c20133 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34320 Reviewed-by: Rejane DURAND Tested-by: Rejane DURAND Reviewed-by: QATOOLS Reviewed-by: Baptiste CHAULOUX Tested-by: Baptiste CHAULOUX Reviewed-by: Christophe GUIBOUT Reviewed-by: Jonas ABERG --- arch/arm/mach-ux500/board-mop500-wlan.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 52cd23b2852..46037ca76ae 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -54,6 +54,21 @@ static struct resource cw1200_href60_resources[] = { }, }; +static struct resource cw1200_u9500_resources[] = { + { + .start = 85, + .end = 85, + .flags = IORESOURCE_IO, + .name = "cw1200_reset", + }, + { + .start = NOMADIK_GPIO_TO_IRQ(144), + .end = NOMADIK_GPIO_TO_IRQ(144), + .flags = IORESOURCE_IRQ, + .name = "cw1200_irq", + }, +}; + static struct cw1200_platform_data cw1200_platform_data = { .clk_ctrl = cw1200_clk_ctrl, }; @@ -167,9 +182,10 @@ int __init mop500_wlan_init(void) { int ret; - if (machine_is_u8500() || - machine_is_nomadik() || - machine_is_snowball()) { + if (pins_for_u9500()) { + cw1200_device.num_resources = ARRAY_SIZE(cw1200_u9500_resources); + cw1200_device.resource = cw1200_u9500_resources; + } else if (machine_is_u8500() || machine_is_nomadik() || machine_is_snowball()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href_resources); cw1200_device.resource = cw1200_href_resources; } else if (machine_is_hrefv60()) { -- cgit v1.2.3 From 96d472636ea3216270ec94f6a0c5c896dfcf8002 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Tue, 6 Dec 2011 12:46:29 +0100 Subject: u5500: cw1200: Remove requesting SDIO pins The SDIO pins belongs to the SDIO driver and should be handled by the SDIO driver only. The reason that it has worked up until now is that the SDIO driver has just started using pm runtime. Since both WLAN and SDIO framework enable the pins, the number of users is set to two. SDIO tries to release the pins (after 50 ms of inactivity in order to save power), the usage count does not go down to 0 and therefore the pins are not reconfigured to GPIOs, which they must be when PL18X is not driving the pins due to power down). ST-Ericsson ID: 375493 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: NA Change-Id: Ibe3dfd32cb16a9d629a8c405e5723aec787a5ae6 Signed-off-by: Bartosz Markowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/41183 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-u5500-wlan.c | 43 ++-------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-u5500-wlan.c b/arch/arm/mach-ux500/board-u5500-wlan.c index 8459ebd6aac..3683f3ad8bb 100644 --- a/arch/arm/mach-ux500/board-u5500-wlan.c +++ b/arch/arm/mach-ux500/board-u5500-wlan.c @@ -12,7 +12,6 @@ #include #include #include -#include #include "pins.h" #include @@ -44,38 +43,8 @@ const struct cw1200_platform_data *cw1200_u5500_get_platform_data(void) } EXPORT_SYMBOL_GPL(cw1200_u5500_get_platform_data); -static int cw1200_pins_enable(bool enable) -{ - struct ux500_pins *pins = NULL; - int ret = 0; - - pins = ux500_pins_get("sdi3"); - - if (!pins) { - printk(KERN_ERR "cw1200: Pins are not found. " - "Check platform data.\n"); - return -ENOENT; - } - - if (enable) - ret = ux500_pins_enable(pins); - else - ret = ux500_pins_disable(pins); - - if (ret) - printk(KERN_ERR "cw1200: Pins can not be %s: %d.\n", - enable ? "enabled" : "disabled", - ret); - - ux500_pins_put(pins); - - return ret; -} - int __init u5500_wlan_init(void) { - int ret; - if (machine_is_u5500()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_u5500_resources); cw1200_device.resource = cw1200_u5500_resources; @@ -92,18 +61,10 @@ int __init u5500_wlan_init(void) cw1200_device.dev.release = cw1200_release; - ret = cw1200_pins_enable(true); - if (WARN_ON(ret)) - return ret; - - ret = platform_device_register(&cw1200_device); - if (ret) - cw1200_pins_enable(false); - - return ret; + return platform_device_register(&cw1200_device); } static void cw1200_release(struct device *dev) { - cw1200_pins_enable(false); + } -- cgit v1.2.3 From c81d6835ff70b5f4132d1cef32329e4f0ecde220 Mon Sep 17 00:00:00 2001 From: Bartosz Markowski Date: Wed, 7 Dec 2011 11:36:21 +0100 Subject: u5500: WLAN: Adds prcmu_ctrl callback Adds prcmu_ctrl callback to u5500 WLAN platform data file. In u5500 platform cw1200 reset pin is connected to PRCMU. prcmu_resetout is used to set/unset RESOUT2_N_PIN by writing to PRCMU register (platform callback) ST-Ericsson Linux next: NA ST-Ericsson ID: 375493 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Iedfa62dcec0b0bb9bc67abb6ff8dc00b1b78f375 Signed-off-by: Bartosz Markowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/41359 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR --- arch/arm/mach-ux500/board-u5500-wlan.c | 21 ++++++++++++++++++++- arch/arm/mach-ux500/include/mach/cw1200_plat.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-u5500-wlan.c b/arch/arm/mach-ux500/board-u5500-wlan.c index 3683f3ad8bb..fd64089108a 100644 --- a/arch/arm/mach-ux500/board-u5500-wlan.c +++ b/arch/arm/mach-ux500/board-u5500-wlan.c @@ -10,12 +10,16 @@ #include #include #include +#include #include #include #include "pins.h" #include + static void cw1200_release(struct device *dev); +static int cw1200_prcmu_ctrl(const struct cw1200_platform_data *pdata, + bool enable); static struct resource cw1200_u5500_resources[] = { { @@ -26,7 +30,9 @@ static struct resource cw1200_u5500_resources[] = { }, }; -static struct cw1200_platform_data cw1200_u5500_platform_data = { 0 }; +static struct cw1200_platform_data cw1200_u5500_platform_data = { + .prcmu_ctrl = cw1200_prcmu_ctrl, +}; static struct platform_device cw1200_device = { .name = "cw1200_wlan", @@ -43,6 +49,19 @@ const struct cw1200_platform_data *cw1200_u5500_get_platform_data(void) } EXPORT_SYMBOL_GPL(cw1200_u5500_get_platform_data); +static int cw1200_prcmu_ctrl(const struct cw1200_platform_data *pdata, + bool enable) +{ + int ret; + + if (enable) + ret = prcmu_resetout(2, 1); + else + ret = prcmu_resetout(2, 0); + + return ret; +} + int __init u5500_wlan_init(void) { if (machine_is_u5500()) { diff --git a/arch/arm/mach-ux500/include/mach/cw1200_plat.h b/arch/arm/mach-ux500/include/mach/cw1200_plat.h index 4d30dbd3979..3a73183c9f8 100644 --- a/arch/arm/mach-ux500/include/mach/cw1200_plat.h +++ b/arch/arm/mach-ux500/include/mach/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 */ -- cgit v1.2.3 From 050d441e966431926e92357d1810340ddecc2290 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Tue, 10 Jan 2012 09:36:14 +0100 Subject: wlan: mach-ux500: Add support for 9540 ST-Ericsson ID: 398896 Signed-off-by: Yann Gautier --- arch/arm/mach-ux500/board-mop500-wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 46037ca76ae..6ef93e3cbf0 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -188,7 +188,7 @@ int __init mop500_wlan_init(void) } else if (machine_is_u8500() || machine_is_nomadik() || machine_is_snowball()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href_resources); cw1200_device.resource = cw1200_href_resources; - } else if (machine_is_hrefv60()) { + } else if (machine_is_hrefv60() || machine_is_u9540()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href60_resources); cw1200_device.resource = cw1200_href60_resources; -- cgit v1.2.3 From 99dc13f4e5ccbdb914f76e2fbf76e1a27c31df96 Mon Sep 17 00:00:00 2001 From: Bengt Jonsson Date: Thu, 2 Feb 2012 11:36:49 +0100 Subject: wlan: ux500: Add U8520 machine ST-Ericsson ID: 371953 Signed-off-by: Bengt Jonsson --- arch/arm/mach-ux500/board-mop500-wlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 6ef93e3cbf0..86cce36c9a9 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -188,7 +188,8 @@ int __init mop500_wlan_init(void) } else if (machine_is_u8500() || machine_is_nomadik() || machine_is_snowball()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href_resources); cw1200_device.resource = cw1200_href_resources; - } else if (machine_is_hrefv60() || machine_is_u9540()) { + } else if (machine_is_hrefv60() || machine_is_u8520() + || machine_is_u9540()) { cw1200_device.num_resources = ARRAY_SIZE(cw1200_href60_resources); cw1200_device.resource = cw1200_href60_resources; -- cgit v1.2.3 From 5c5f4d2df9e9c8eacfdab76ac8060d80c802616c Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Wed, 25 Apr 2012 16:36:08 +0200 Subject: cw1200: Manage parent device during initialization Signed-off-by: Philippe Langlais --- arch/arm/mach-ux500/board-mop500-wlan.c | 3 ++- arch/arm/mach-ux500/board-mop500-wlan.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-ux500/board-mop500-wlan.c b/arch/arm/mach-ux500/board-mop500-wlan.c index 86cce36c9a9..821baae5273 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.c +++ b/arch/arm/mach-ux500/board-mop500-wlan.c @@ -178,7 +178,7 @@ static int cw1200_clk_ctrl(const struct cw1200_platform_data *pdata, return ret; } -int __init mop500_wlan_init(void) +int __init mop500_wlan_init(struct device *parent) { int ret; @@ -218,6 +218,7 @@ int __init mop500_wlan_init(void) if (WARN_ON(ret)) return ret; + cw1200_device.dev.parent = parent; ret = platform_device_register(&cw1200_device); if (ret) cw1200_pins_enable(false); diff --git a/arch/arm/mach-ux500/board-mop500-wlan.h b/arch/arm/mach-ux500/board-mop500-wlan.h index c6788adc46f..19a12d57ded 100644 --- a/arch/arm/mach-ux500/board-mop500-wlan.h +++ b/arch/arm/mach-ux500/board-mop500-wlan.h @@ -12,6 +12,6 @@ #ifndef __BOARD_MOP500_WLAN_H #define __BOARD_MOP500_WLAN_H -int mop500_wlan_init(void); +int mop500_wlan_init(struct device *parent); #endif -- cgit v1.2.3