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 | |
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>
-rw-r--r-- | arch/arm/include/asm/hardware/sa1111.h | 45 | ||||
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 44 |
2 files changed, 41 insertions, 48 deletions
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h index dc15bf8ff39d..29e3e5673883 100644 --- a/arch/arm/include/asm/hardware/sa1111.h +++ b/arch/arm/include/asm/hardware/sa1111.h | |||
@@ -413,50 +413,9 @@ | |||
413 | #define SA1111_KBD 0x0a00 | 413 | #define SA1111_KBD 0x0a00 |
414 | #define SA1111_MSE 0x0c00 | 414 | #define SA1111_MSE 0x0c00 |
415 | 415 | ||
416 | /* | 416 | /* PCMCIA Interface */ |
417 | * PCMCIA Interface | 417 | #define SA1111_PCMCIA 0x1600 |
418 | * | ||
419 | * Registers | ||
420 | * PCSR Status Register | ||
421 | * PCCR Control Register | ||
422 | * PCSSR Sleep State Register | ||
423 | */ | ||
424 | 418 | ||
425 | #define SA1111_PCMCIA 0x1600 | ||
426 | |||
427 | /* | ||
428 | * These are offsets from the above base. | ||
429 | */ | ||
430 | #define SA1111_PCCR 0x0000 | ||
431 | #define SA1111_PCSSR 0x0004 | ||
432 | #define SA1111_PCSR 0x0008 | ||
433 | |||
434 | #define PCSR_S0_READY (1<<0) | ||
435 | #define PCSR_S1_READY (1<<1) | ||
436 | #define PCSR_S0_DETECT (1<<2) | ||
437 | #define PCSR_S1_DETECT (1<<3) | ||
438 | #define PCSR_S0_VS1 (1<<4) | ||
439 | #define PCSR_S0_VS2 (1<<5) | ||
440 | #define PCSR_S1_VS1 (1<<6) | ||
441 | #define PCSR_S1_VS2 (1<<7) | ||
442 | #define PCSR_S0_WP (1<<8) | ||
443 | #define PCSR_S1_WP (1<<9) | ||
444 | #define PCSR_S0_BVD1 (1<<10) | ||
445 | #define PCSR_S0_BVD2 (1<<11) | ||
446 | #define PCSR_S1_BVD1 (1<<12) | ||
447 | #define PCSR_S1_BVD2 (1<<13) | ||
448 | |||
449 | #define PCCR_S0_RST (1<<0) | ||
450 | #define PCCR_S1_RST (1<<1) | ||
451 | #define PCCR_S0_FLT (1<<2) | ||
452 | #define PCCR_S1_FLT (1<<3) | ||
453 | #define PCCR_S0_PWAITEN (1<<4) | ||
454 | #define PCCR_S1_PWAITEN (1<<5) | ||
455 | #define PCCR_S0_PSE (1<<6) | ||
456 | #define PCCR_S1_PSE (1<<7) | ||
457 | |||
458 | #define PCSSR_S0_SLEEP (1<<0) | ||
459 | #define PCSSR_S1_SLEEP (1<<1) | ||
460 | 419 | ||
461 | 420 | ||
462 | 421 | ||
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); |