summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Marklund <robert.marklund@stericsson.com>2011-10-13 12:49:14 +0200
committerPhilippe LANGLAIS <philippe.langlais@stericsson.com>2011-10-14 14:34:18 +0200
commit8ed99a25a39742faa83232015db71e55ce8bf38e (patch)
tree6af3f7fcbf45b864cb1e26a362ab693db9f86102
parentb42de34211d0e8b89c0b251dd6905e620f8b9d68 (diff)
cw1200: Re add snowball support
Re add power ctrl and snowball support in the cw1200 driver Change-Id: I6a6b0279a05a419e62c0259d217361e43c855665 Signed-off-by: Robert Marklund <robert.marklund@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/34064 Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/board-mop500-wlan.c47
1 files changed, 45 insertions, 2 deletions
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 <mach/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[] = {
{
@@ -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;