Commit b1d8a5f9 authored by Russell King's avatar Russell King

PCMCIA: sa11x0: simpad: convert to use new irq/gpio management

Convert Simpad socket driver to use the new irq/gpio management.
This is slightly more involved because we have to touch the private
platform header file to modify the GPIO bitmasks to be GPIO numbers.
Acked-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3b61436a
...@@ -39,10 +39,8 @@ ...@@ -39,10 +39,8 @@
/*--- PCMCIA ---*/ /*--- PCMCIA ---*/
#define GPIO_CF_CD GPIO_GPIO24 #define GPIO_CF_CD 24
#define GPIO_CF_IRQ GPIO_GPIO1 #define GPIO_CF_IRQ 1
#define IRQ_GPIO_CF_IRQ IRQ_GPIO1
#define IRQ_GPIO_CF_CD IRQ_GPIO24
/*--- SmartCard ---*/ /*--- SmartCard ---*/
#define GPIO_SMART_CARD GPIO_GPIO10 #define GPIO_SMART_CARD GPIO_GPIO10
......
...@@ -15,24 +15,21 @@ ...@@ -15,24 +15,21 @@
#include <mach/simpad.h> #include <mach/simpad.h>
#include "sa1100_generic.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) static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{ {
simpad_clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); 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) static void simpad_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
{ {
soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
/* Disable CF bus: */ /* Disable CF bus: */
/*simpad_set_cs3_bit(PCMCIA_BUFF_DIS);*/ /*simpad_set_cs3_bit(PCMCIA_BUFF_DIS);*/
simpad_clear_cs3_bit(PCMCIA_RESET); simpad_clear_cs3_bit(PCMCIA_RESET);
...@@ -42,11 +39,11 @@ static void ...@@ -42,11 +39,11 @@ static void
simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
struct pcmcia_state *state) struct pcmcia_state *state)
{ {
unsigned long levels = GPLR;
long cs3reg = simpad_get_cs3_ro(); long cs3reg = simpad_get_cs3_ro();
state->detect=((levels & GPIO_CF_CD)==0)?1:0; /* the detect signal is inverted - fix that up here */
state->ready=(levels & GPIO_CF_IRQ)?1:0; state->detect = !state->detect;
state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */
state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */
state->wrprot=0; /* Not available on Simpad. */ state->wrprot=0; /* Not available on Simpad. */
...@@ -99,14 +96,8 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, ...@@ -99,14 +96,8 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
return 0; 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) 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); simpad_set_cs3_bit(PCMCIA_RESET);
} }
...@@ -116,7 +107,6 @@ static struct pcmcia_low_level simpad_pcmcia_ops = { ...@@ -116,7 +107,6 @@ static struct pcmcia_low_level simpad_pcmcia_ops = {
.hw_shutdown = simpad_pcmcia_hw_shutdown, .hw_shutdown = simpad_pcmcia_hw_shutdown,
.socket_state = simpad_pcmcia_socket_state, .socket_state = simpad_pcmcia_socket_state,
.configure_socket = simpad_pcmcia_configure_socket, .configure_socket = simpad_pcmcia_configure_socket,
.socket_init = simpad_pcmcia_socket_init,
.socket_suspend = simpad_pcmcia_socket_suspend, .socket_suspend = simpad_pcmcia_socket_suspend,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment