diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-16 06:32:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 07:30:11 -0400 |
commit | ea8c00ac18198763bceb7ca53d26df4aa8d3c414 (patch) | |
tree | 0313ef4b1f2cb52adc1d01b8dfbff657297f83f7 /drivers/pcmcia/sa1111_generic.c | |
parent | 4f8d9cae15b5b5c89ec17c8168215aa06a5c9b2c (diff) |
ARM: sa1111: move PCMCIA interface register definitions to sa1111_generic.c
Move the PCMCIA interface register definitions into the driver, rather
than keeping them in a common place.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia/sa1111_generic.c')
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 0735c3e6a8b0..33568e18998b 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -22,6 +22,40 @@ | |||
22 | 22 | ||
23 | #include "sa1111_generic.h" | 23 | #include "sa1111_generic.h" |
24 | 24 | ||
25 | /* | ||
26 | * These are offsets from the above base. | ||
27 | */ | ||
28 | #define PCCR 0x0000 | ||
29 | #define PCSSR 0x0004 | ||
30 | #define PCSR 0x0008 | ||
31 | |||
32 | #define PCSR_S0_READY (1<<0) | ||
33 | #define PCSR_S1_READY (1<<1) | ||
34 | #define PCSR_S0_DETECT (1<<2) | ||
35 | #define PCSR_S1_DETECT (1<<3) | ||
36 | #define PCSR_S0_VS1 (1<<4) | ||
37 | #define PCSR_S0_VS2 (1<<5) | ||
38 | #define PCSR_S1_VS1 (1<<6) | ||
39 | #define PCSR_S1_VS2 (1<<7) | ||
40 | #define PCSR_S0_WP (1<<8) | ||
41 | #define PCSR_S1_WP (1<<9) | ||
42 | #define PCSR_S0_BVD1 (1<<10) | ||
43 | #define PCSR_S0_BVD2 (1<<11) | ||
44 | #define PCSR_S1_BVD1 (1<<12) | ||
45 | #define PCSR_S1_BVD2 (1<<13) | ||
46 | |||
47 | #define PCCR_S0_RST (1<<0) | ||
48 | #define PCCR_S1_RST (1<<1) | ||
49 | #define PCCR_S0_FLT (1<<2) | ||
50 | #define PCCR_S1_FLT (1<<3) | ||
51 | #define PCCR_S0_PWAITEN (1<<4) | ||
52 | #define PCCR_S1_PWAITEN (1<<5) | ||
53 | #define PCCR_S0_PSE (1<<6) | ||
54 | #define PCCR_S1_PSE (1<<7) | ||
55 | |||
56 | #define PCSSR_S0_SLEEP (1<<0) | ||
57 | #define PCSSR_S1_SLEEP (1<<1) | ||
58 | |||
25 | #define IDX_IRQ_S0_READY_NINT (0) | 59 | #define IDX_IRQ_S0_READY_NINT (0) |
26 | #define IDX_IRQ_S0_CD_VALID (1) | 60 | #define IDX_IRQ_S0_CD_VALID (1) |
27 | #define IDX_IRQ_S0_BVD1_STSCHG (2) | 61 | #define IDX_IRQ_S0_BVD1_STSCHG (2) |
@@ -49,7 +83,7 @@ static void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | |||
49 | void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) | 83 | void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) |
50 | { | 84 | { |
51 | struct sa1111_pcmcia_socket *s = to_skt(skt); | 85 | struct sa1111_pcmcia_socket *s = to_skt(skt); |
52 | unsigned long status = sa1111_readl(s->dev->mapbase + SA1111_PCSR); | 86 | unsigned long status = sa1111_readl(s->dev->mapbase + PCSR); |
53 | 87 | ||
54 | switch (skt->nr) { | 88 | switch (skt->nr) { |
55 | case 0: | 89 | case 0: |
@@ -105,10 +139,10 @@ int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s | |||
105 | pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT; | 139 | pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT; |
106 | 140 | ||
107 | local_irq_save(flags); | 141 | local_irq_save(flags); |
108 | val = sa1111_readl(s->dev->mapbase + SA1111_PCCR); | 142 | val = sa1111_readl(s->dev->mapbase + PCCR); |
109 | val &= ~pccr_skt_mask; | 143 | val &= ~pccr_skt_mask; |
110 | val |= pccr_set_mask & pccr_skt_mask; | 144 | val |= pccr_set_mask & pccr_skt_mask; |
111 | sa1111_writel(val, s->dev->mapbase + SA1111_PCCR); | 145 | sa1111_writel(val, s->dev->mapbase + PCCR); |
112 | local_irq_restore(flags); | 146 | local_irq_restore(flags); |
113 | 147 | ||
114 | return 0; | 148 | return 0; |
@@ -187,8 +221,8 @@ static int pcmcia_probe(struct sa1111_dev *dev) | |||
187 | /* | 221 | /* |
188 | * Initialise the suspend state. | 222 | * Initialise the suspend state. |
189 | */ | 223 | */ |
190 | sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + SA1111_PCSSR); | 224 | sa1111_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); |
191 | sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + SA1111_PCCR); | 225 | sa1111_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); |
192 | 226 | ||
193 | #ifdef CONFIG_SA1100_BADGE4 | 227 | #ifdef CONFIG_SA1100_BADGE4 |
194 | pcmcia_badge4_init(&dev->dev); | 228 | pcmcia_badge4_init(&dev->dev); |