diff options
author | Marc Zyngier <maz@misterjones.org> | 2009-11-14 15:39:13 +0300 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-12-13 16:42:58 +0300 |
commit | c2de1c382933fd9ef0a3db13b6747115e1e32c56 (patch) | |
tree | d9e0fa251d376fb7d5f9906952bf02f2f31570e0 /arch/arm/mach-pxa/zeus.c | |
parent | e491a11c77a4ed93ec14cc052b1f048bddc9e99a (diff) | |
download | linux-c2de1c382933fd9ef0a3db13b6747115e1e32c56.tar.xz |
[ARM] pxa/zeus: make Viper pcmcia support more generic to support Zeus
The Arcom Zeus CF slot requires the same kind of support as the Viper.
To avoid code duplication, introduce a platform device that abstracts
the differences.
This also allows for the removal of the ugly export of viper_cf_rst().
Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/zeus.c')
-rw-r--r-- | arch/arm/mach-pxa/zeus.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index ae1c3d2f6d5b..5b986a8bd9e6 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c @@ -43,6 +43,7 @@ #include <mach/mfp-pxa27x.h> #include <mach/pm.h> #include <mach/audio.h> +#include <mach/arcom-pcmcia.h> #include <mach/zeus.h> #include "generic.h" @@ -428,6 +429,33 @@ static struct platform_device zeus_leds_device = { }, }; +static void zeus_cf_reset(int state) +{ + u16 cpld_state = __raw_readw(ZEUS_CPLD_CONTROL); + + if (state) + cpld_state |= ZEUS_CPLD_CONTROL_CF_RST; + else + cpld_state &= ~ZEUS_CPLD_CONTROL_CF_RST; + + __raw_writew(cpld_state, ZEUS_CPLD_CONTROL); +} + +static struct arcom_pcmcia_pdata zeus_pcmcia_info = { + .cd_gpio = ZEUS_CF_CD_GPIO, + .rdy_gpio = ZEUS_CF_RDY_GPIO, + .pwr_gpio = ZEUS_CF_PWEN_GPIO, + .reset = zeus_cf_reset, +}; + +static struct platform_device zeus_pcmcia_device = { + .name = "zeus-pcmcia", + .id = -1, + .dev = { + .platform_data = &zeus_pcmcia_info, + }, +}; + static struct platform_device *zeus_devices[] __initdata = { &zeus_serial_device, &zeus_mtd_devices[0], @@ -436,6 +464,7 @@ static struct platform_device *zeus_devices[] __initdata = { &zeus_sram_device, &pxa2xx_spi_ssp3_device, &zeus_leds_device, + &zeus_pcmcia_device, }; /* AC'97 */ |