diff options
author | Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> | 2011-05-18 23:16:54 +0200 |
---|---|---|
committer | Philippe LANGLAIS <philippe.langlais@stericsson.com> | 2011-05-23 08:29:23 +0200 |
commit | 0119664ee6eb134c26ccd78fc0885741f0f1c036 (patch) | |
tree | e9386a0ca0cfbfe97fff610e178fa69d51a26864 /arch/arm/mach-ux500 | |
parent | 4f4ef8517117b92f596da8482a55d67a34384817 (diff) |
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 <dmitry.tarnyagin@stericsson.com>
Change-Id: If368398af1ca22366bb44c3bb8c7e3b1484cab1b
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23353
Reviewed-by: Janusz DZIEDZIC <janusz.dziedzic@tieto.com>
Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-wlan.c | 108 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-wlan.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 2 |
4 files changed, 129 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index caef1fc3fc0..e76ac44a440 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile @@ -17,7 +17,8 @@ obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \ board-mop500-uib.o board-mop500-stuib.o \ board-mop500-u8500uib.o board-mop500-pins.o \ board-mop500-mcde.o \ - board-mop500-msp.o board-mop500-bm.o + board-mop500-msp.o board-mop500-bm.o \ + board-mop500-wlan.o obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o \ board-u5500-mcde.o board-u5500-regulators.o \ board-u5500-pins.o 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 <dmitry.tarnyagin@stericsson.com> + * License terms: GNU General Public License (GPL) version 2 + */ + +#include <linux/kernel.h> +#include <linux/platform_device.h> +#include <asm/mach-types.h> +#include <mach/irqs-board-mop500.h> +#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 <dmitry.tarnyagin@stericsson.com> + * + */ + +#ifndef __BOARD_MOP500_WLAN_H +#define __BOARD_MOP500_WLAN_H + +int mop500_wlan_init(void); + +#endif diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index e4a1da9c568..780b6537a1f 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -54,6 +54,7 @@ #include "board-mop500.h" #include "board-mop500-regulators.h" #include "board-mop500-bm.h" +#include "board-mop500-wlan.h" #ifdef CONFIG_AB8500_DENC static struct ab8500_denc_platform_data ab8500_denc_pdata = { @@ -842,6 +843,7 @@ static void __init mop500_init_machine(void) mop500_msp_init(); mop500_spi_init(); mop500_uart_init(); + mop500_wlan_init(); i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); if (machine_is_hrefv60()) |