diff options
author | Len Brown <len.brown@intel.com> | 2012-04-07 03:48:59 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-04-07 03:48:59 +0200 |
commit | eeaab2d8af2cf1d36d7086f22e9de42d6dd2995c (patch) | |
tree | 369b9c91a6d808944f07d2290fec6f9fe2731904 /drivers/pcmcia/sa1100_shannon.c | |
parent | cpuidle: Fix panic in CPU off-lining with no idle driver (diff) | |
parent | MAINTAINERS: Update git url for ACPI (diff) | |
download | linux-eeaab2d8af2cf1d36d7086f22e9de42d6dd2995c.tar.xz linux-eeaab2d8af2cf1d36d7086f22e9de42d6dd2995c.zip |
Merge branches 'idle-fix' and 'misc' into release
Diffstat (limited to 'drivers/pcmcia/sa1100_shannon.c')
-rw-r--r-- | drivers/pcmcia/sa1100_shannon.c | 56 |
1 files changed, 17 insertions, 39 deletions
diff --git a/drivers/pcmcia/sa1100_shannon.c b/drivers/pcmcia/sa1100_shannon.c index 7ff1b43540b8..decb34730bcf 100644 --- a/drivers/pcmcia/sa1100_shannon.c +++ b/drivers/pcmcia/sa1100_shannon.c @@ -15,40 +15,35 @@ #include <asm/irq.h> #include "sa1100_generic.h" -static struct pcmcia_irqs irqs[] = { - { 0, SHANNON_IRQ_GPIO_EJECT_0, "PCMCIA_CD_0" }, - { 1, SHANNON_IRQ_GPIO_EJECT_1, "PCMCIA_CD_1" }, -}; - static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { /* All those are inputs */ - GPDR &= ~(SHANNON_GPIO_EJECT_0 | SHANNON_GPIO_EJECT_1 | - SHANNON_GPIO_RDY_0 | SHANNON_GPIO_RDY_1); - GAFR &= ~(SHANNON_GPIO_EJECT_0 | SHANNON_GPIO_EJECT_1 | - SHANNON_GPIO_RDY_0 | SHANNON_GPIO_RDY_1); - - skt->socket.pci_irq = skt->nr ? SHANNON_IRQ_GPIO_RDY_1 : SHANNON_IRQ_GPIO_RDY_0; - - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} + GAFR &= ~(GPIO_GPIO(SHANNON_GPIO_EJECT_0) | + GPIO_GPIO(SHANNON_GPIO_EJECT_1) | + GPIO_GPIO(SHANNON_GPIO_RDY_0) | + GPIO_GPIO(SHANNON_GPIO_RDY_1)); + + if (skt->nr == 0) { + skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_0; + skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_0"; + skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_0; + skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_0"; + } else { + skt->stat[SOC_STAT_CD].gpio = SHANNON_GPIO_EJECT_1; + skt->stat[SOC_STAT_CD].name = "PCMCIA_CD_1"; + skt->stat[SOC_STAT_RDY].gpio = SHANNON_GPIO_RDY_1; + skt->stat[SOC_STAT_RDY].name = "PCMCIA_RDY_1"; + } -static void shannon_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); + return 0; } static void shannon_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - unsigned long levels = GPLR; - switch (skt->nr) { case 0: - state->detect = (levels & SHANNON_GPIO_EJECT_0) ? 0 : 1; - state->ready = (levels & SHANNON_GPIO_RDY_0) ? 1 : 0; - state->wrprot = 0; /* Not available on Shannon. */ state->bvd1 = 1; state->bvd2 = 1; state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */ @@ -56,9 +51,6 @@ shannon_pcmcia_socket_state(struct soc_pcmcia_socket *skt, break; case 1: - state->detect = (levels & SHANNON_GPIO_EJECT_1) ? 0 : 1; - state->ready = (levels & SHANNON_GPIO_RDY_1) ? 1 : 0; - state->wrprot = 0; /* Not available on Shannon. */ state->bvd1 = 1; state->bvd2 = 1; state->vs_3v = 1; /* FIXME Can only apply 3.3V on Shannon. */ @@ -92,25 +84,11 @@ shannon_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, return 0; } -static void shannon_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - -static void shannon_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - static struct pcmcia_low_level shannon_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = shannon_pcmcia_hw_init, - .hw_shutdown = shannon_pcmcia_hw_shutdown, .socket_state = shannon_pcmcia_socket_state, .configure_socket = shannon_pcmcia_configure_socket, - - .socket_init = shannon_pcmcia_socket_init, - .socket_suspend = shannon_pcmcia_socket_suspend, }; int __devinit pcmcia_shannon_init(struct device *dev) |