diff options
author | Guennadi Liakhovetski <lg@denx.de> | 2008-06-13 09:17:31 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-09 21:31:52 +0100 |
commit | e172274ccc55d20536fbdceb6131f38e288541e0 (patch) | |
tree | e3b0424d9c6d7e74608c29c91d94d94f6ab36706 /arch/arm/mach-pxa/devices.c | |
parent | cabb352a6455c3550f157909196845f533b0f374 (diff) | |
download | op-kernel-dev-e172274ccc55d20536fbdceb6131f38e288541e0.zip op-kernel-dev-e172274ccc55d20536fbdceb6131f38e288541e0.tar.gz |
[ARM] 5088/3: pxa2xx: add pxa2xx_set_spi_info to register pxa2xx-spi platform devices
Add a function to dynamically allocate and register pxa2xx-spi platform
devices, to be used by PXA2xx and PXA3xx based systems. Switch pcm027 and
lubbock to use it.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/devices.c')
-rw-r--r-- | arch/arm/mach-pxa/devices.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index a6f2390..abc161d 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -13,6 +13,7 @@ #include <asm/arch/mfp-pxa27x.h> #include <asm/arch/ohci.h> #include <asm/arch/pxa27x_keypad.h> +#include <asm/arch/pxa2xx_spi.h> #include <asm/arch/camera.h> #include <asm/arch/audio.h> @@ -831,3 +832,20 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) } #endif /* CONFIG_PXA3xx */ + +/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. + * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ +void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info) +{ + struct platform_device *pd; + + pd = platform_device_alloc("pxa2xx-spi", id); + if (pd == NULL) { + printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n", + id); + return; + } + + pd->dev.platform_data = info; + platform_device_add(pd); +} |