diff options
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 967c766f53ba..418988ab6edf 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -42,6 +42,18 @@ module_param_string(o2_speedup, o2_speedup, sizeof(o2_speedup), 0444); | |||
42 | MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' " | 42 | MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' " |
43 | "or 'default' (uses recommended behaviour for the detected bridge)"); | 43 | "or 'default' (uses recommended behaviour for the detected bridge)"); |
44 | 44 | ||
45 | /* | ||
46 | * Only probe "regular" interrupts, don't | ||
47 | * touch dangerous spots like the mouse irq, | ||
48 | * because there are mice that apparently | ||
49 | * get really confused if they get fondled | ||
50 | * too intimately. | ||
51 | * | ||
52 | * Default to 11, 10, 9, 7, 6, 5, 4, 3. | ||
53 | */ | ||
54 | static u32 isa_interrupts = 0x0ef8; | ||
55 | |||
56 | |||
45 | #define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args) | 57 | #define debug(x, s, args...) dev_dbg(&s->dev->dev, x, ##args) |
46 | 58 | ||
47 | /* Don't ask.. */ | 59 | /* Don't ask.. */ |
@@ -54,6 +66,8 @@ MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' " | |||
54 | */ | 66 | */ |
55 | #ifdef CONFIG_YENTA_TI | 67 | #ifdef CONFIG_YENTA_TI |
56 | static int yenta_probe_cb_irq(struct yenta_socket *socket); | 68 | static int yenta_probe_cb_irq(struct yenta_socket *socket); |
69 | static unsigned int yenta_probe_irq(struct yenta_socket *socket, | ||
70 | u32 isa_irq_mask); | ||
57 | #endif | 71 | #endif |
58 | 72 | ||
59 | 73 | ||
@@ -329,8 +343,8 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) | |||
329 | /* ISA interrupt control? */ | 343 | /* ISA interrupt control? */ |
330 | intr = exca_readb(socket, I365_INTCTL); | 344 | intr = exca_readb(socket, I365_INTCTL); |
331 | intr = (intr & ~0xf); | 345 | intr = (intr & ~0xf); |
332 | if (!socket->cb_irq) { | 346 | if (!socket->dev->irq) { |
333 | intr |= state->io_irq; | 347 | intr |= socket->cb_irq ? socket->cb_irq : state->io_irq; |
334 | bridge |= CB_BRIDGE_INTR; | 348 | bridge |= CB_BRIDGE_INTR; |
335 | } | 349 | } |
336 | exca_writeb(socket, I365_INTCTL, intr); | 350 | exca_writeb(socket, I365_INTCTL, intr); |
@@ -340,7 +354,7 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) | |||
340 | reg = exca_readb(socket, I365_INTCTL) & (I365_RING_ENA | I365_INTR_ENA); | 354 | reg = exca_readb(socket, I365_INTCTL) & (I365_RING_ENA | I365_INTR_ENA); |
341 | reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET; | 355 | reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET; |
342 | reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0; | 356 | reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0; |
343 | if (state->io_irq != socket->cb_irq) { | 357 | if (state->io_irq != socket->dev->irq) { |
344 | reg |= state->io_irq; | 358 | reg |= state->io_irq; |
345 | bridge |= CB_BRIDGE_INTR; | 359 | bridge |= CB_BRIDGE_INTR; |
346 | } | 360 | } |
@@ -356,7 +370,9 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) | |||
356 | exca_writeb(socket, I365_POWER, reg); | 370 | exca_writeb(socket, I365_POWER, reg); |
357 | 371 | ||
358 | /* CSC interrupt: no ISA irq for CSC */ | 372 | /* CSC interrupt: no ISA irq for CSC */ |
359 | reg = I365_CSC_DETECT; | 373 | reg = exca_readb(socket, I365_CSCINT); |
374 | reg &= I365_CSC_IRQ_MASK; | ||
375 | reg |= I365_CSC_DETECT; | ||
360 | if (state->flags & SS_IOCARD) { | 376 | if (state->flags & SS_IOCARD) { |
361 | if (state->csc_mask & SS_STSCHG) | 377 | if (state->csc_mask & SS_STSCHG) |
362 | reg |= I365_CSC_STSCHG; | 378 | reg |= I365_CSC_STSCHG; |
@@ -896,22 +912,12 @@ static struct cardbus_type cardbus_type[] = { | |||
896 | }; | 912 | }; |
897 | 913 | ||
898 | 914 | ||
899 | /* | ||
900 | * Only probe "regular" interrupts, don't | ||
901 | * touch dangerous spots like the mouse irq, | ||
902 | * because there are mice that apparently | ||
903 | * get really confused if they get fondled | ||
904 | * too intimately. | ||
905 | * | ||
906 | * Default to 11, 10, 9, 7, 6, 5, 4, 3. | ||
907 | */ | ||
908 | static u32 isa_interrupts = 0x0ef8; | ||
909 | |||
910 | static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask) | 915 | static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mask) |
911 | { | 916 | { |
912 | int i; | 917 | int i; |
913 | unsigned long val; | 918 | unsigned long val; |
914 | u32 mask; | 919 | u32 mask; |
920 | u8 reg; | ||
915 | 921 | ||
916 | /* | 922 | /* |
917 | * Probe for usable interrupts using the force | 923 | * Probe for usable interrupts using the force |
@@ -919,6 +925,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas | |||
919 | */ | 925 | */ |
920 | cb_writel(socket, CB_SOCKET_EVENT, -1); | 926 | cb_writel(socket, CB_SOCKET_EVENT, -1); |
921 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); | 927 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); |
928 | reg = exca_readb(socket, I365_CSCINT); | ||
922 | exca_writeb(socket, I365_CSCINT, 0); | 929 | exca_writeb(socket, I365_CSCINT, 0); |
923 | val = probe_irq_on() & isa_irq_mask; | 930 | val = probe_irq_on() & isa_irq_mask; |
924 | for (i = 1; i < 16; i++) { | 931 | for (i = 1; i < 16; i++) { |
@@ -930,7 +937,7 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas | |||
930 | cb_writel(socket, CB_SOCKET_EVENT, -1); | 937 | cb_writel(socket, CB_SOCKET_EVENT, -1); |
931 | } | 938 | } |
932 | cb_writel(socket, CB_SOCKET_MASK, 0); | 939 | cb_writel(socket, CB_SOCKET_MASK, 0); |
933 | exca_writeb(socket, I365_CSCINT, 0); | 940 | exca_writeb(socket, I365_CSCINT, reg); |
934 | 941 | ||
935 | mask = probe_irq_mask(val) & 0xffff; | 942 | mask = probe_irq_mask(val) & 0xffff; |
936 | 943 | ||
@@ -967,6 +974,8 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id) | |||
967 | /* probes the PCI interrupt, use only on override functions */ | 974 | /* probes the PCI interrupt, use only on override functions */ |
968 | static int yenta_probe_cb_irq(struct yenta_socket *socket) | 975 | static int yenta_probe_cb_irq(struct yenta_socket *socket) |
969 | { | 976 | { |
977 | u8 reg; | ||
978 | |||
970 | if (!socket->cb_irq) | 979 | if (!socket->cb_irq) |
971 | return -1; | 980 | return -1; |
972 | 981 | ||
@@ -979,7 +988,8 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) | |||
979 | } | 988 | } |
980 | 989 | ||
981 | /* generate interrupt, wait */ | 990 | /* generate interrupt, wait */ |
982 | exca_writeb(socket, I365_CSCINT, I365_CSC_STSCHG); | 991 | reg = exca_readb(socket, I365_CSCINT); |
992 | exca_writeb(socket, I365_CSCINT, reg | I365_CSC_STSCHG); | ||
983 | cb_writel(socket, CB_SOCKET_EVENT, -1); | 993 | cb_writel(socket, CB_SOCKET_EVENT, -1); |
984 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); | 994 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); |
985 | cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS); | 995 | cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS); |
@@ -988,7 +998,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) | |||
988 | 998 | ||
989 | /* disable interrupts */ | 999 | /* disable interrupts */ |
990 | cb_writel(socket, CB_SOCKET_MASK, 0); | 1000 | cb_writel(socket, CB_SOCKET_MASK, 0); |
991 | exca_writeb(socket, I365_CSCINT, 0); | 1001 | exca_writeb(socket, I365_CSCINT, reg); |
992 | cb_writel(socket, CB_SOCKET_EVENT, -1); | 1002 | cb_writel(socket, CB_SOCKET_EVENT, -1); |
993 | exca_readb(socket, I365_CSC); | 1003 | exca_readb(socket, I365_CSC); |
994 | 1004 | ||