diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:37:40 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 17:37:40 -0700 |
commit | 24613ff927500513eae7e84bb6fc6c3ef268e452 (patch) | |
tree | ef26480a8f123a12690c0f226870cf69dc6ffb55 /drivers/pcmcia/sa1100_simpad.c | |
parent | 0d19eac12031680dc5f5402921fb0c388e42f619 (diff) | |
parent | ff80aa57cc9946d3dafe65119d576b3d11304303 (diff) |
Merge branch 'pcmcia' of git://git.linaro.org/people/rmk/linux-arm
Pull #3 ARM updates from Russell King:
"This adds gpio support to soc_common, allowing an amount of code to be
deleted from each PCMCIA socket driver for the PXA/SA11x0 SoCs."
* 'pcmcia' of git://git.linaro.org/people/rmk/linux-arm:
PCMCIA: sa1111: rename sa1111 socket drivers to have sa1111_ prefix.
PCMCIA: make lubbock socket driver part of sa1111_cs
PCMCIA: add Kconfig control for building sa11xx_base.c
PCMCIA: sa1111: jornada720: no need to disable IRQs around sa1111_set_io
PCMCIA: sa1111: pass along sa1111_pcmcia_configure_socket() failure code
PCMCIA: soc_common: remove explicit wrprot initialization in socket drivers
PCMCIA: soc_common: remove soc_pcmcia_*_irqs functions
PCMCIA: sa11x0: h3600: convert to use new irq/gpio management
PCMCIA: sa11x0: simpad: convert to use new irq/gpio management
PCMCIA: sa11x0: shannon: convert to use new irq/gpio management
PCMCIA: sa11x0: nanoengine: convert reset handling to use GPIO subsystem
PCMCIA: sa11x0: nanoengine: convert to use new irq/gpio management
PCMCIA: sa11x0: cerf: convert reset handling to use GPIO subsystem
PCMCIA: sa11x0: cerf: convert to use new irq/gpio management
PCMCIA: sa11x0: assabet: convert to use new irq/gpio management
PCMCIA: sa1111: use new per-socket irq/gpio infrastructure
PCMCIA: pxa: convert PXA socket drivers to use new irq/gpio management
PCMCIA: soc_common: add GPIO support for card status signals
PCMCIA: soc_common: move common initialization into soc_common
Diffstat (limited to 'drivers/pcmcia/sa1100_simpad.c')
-rw-r--r-- | drivers/pcmcia/sa1100_simpad.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c index 0fac9658b02..8647b17c449 100644 --- a/drivers/pcmcia/sa1100_simpad.c +++ b/drivers/pcmcia/sa1100_simpad.c @@ -15,24 +15,21 @@ #include <mach/simpad.h> #include "sa1100_generic.h" -static struct pcmcia_irqs irqs[] = { - { 1, IRQ_GPIO_CF_CD, "CF_CD" }, -}; - static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); - skt->socket.pci_irq = IRQ_GPIO_CF_IRQ; + skt->stat[SOC_STAT_CD].gpio = GPIO_CF_CD; + skt->stat[SOC_STAT_CD].name = "CF_CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_CF_IRQ; + skt->stat[SOC_STAT_RDY].name = "CF_RDY"; - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); + return 0; } static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) { - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); - /* Disable CF bus: */ /*simpad_set_cs3_bit(PCMCIA_BUFF_DIS);*/ simpad_clear_cs3_bit(PCMCIA_RESET); @@ -42,14 +39,13 @@ static void simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - unsigned long levels = GPLR; long cs3reg = simpad_get_cs3_ro(); - state->detect=((levels & GPIO_CF_CD)==0)?1:0; - state->ready=(levels & GPIO_CF_IRQ)?1:0; + /* the detect signal is inverted - fix that up here */ + state->detect = !state->detect; + state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ - state->wrprot=0; /* Not available on Simpad. */ if ((cs3reg & (PCMCIA_VS1|PCMCIA_VS2)) == (PCMCIA_VS1|PCMCIA_VS2)) { @@ -99,14 +95,8 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, return 0; } -static void simpad_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - static void simpad_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) { - soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); simpad_set_cs3_bit(PCMCIA_RESET); } @@ -116,7 +106,6 @@ static struct pcmcia_low_level simpad_pcmcia_ops = { .hw_shutdown = simpad_pcmcia_hw_shutdown, .socket_state = simpad_pcmcia_socket_state, .configure_socket = simpad_pcmcia_configure_socket, - .socket_init = simpad_pcmcia_socket_init, .socket_suspend = simpad_pcmcia_socket_suspend, }; |