From f969d69ba9f952e5bdd38278e25e26a3e4a61a70 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 29 Jan 2000 01:41:54 +0000 Subject: Merge with 2.3.27. --- drivers/pcmcia/i82365.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'drivers/pcmcia/i82365.c') diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index ed7bd3c30..685e65fe9 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -3,7 +3,7 @@ Device driver for Intel 82365 and compatible PC Card controllers, and Yenta-compatible PCI-to-CardBus controllers. - i82365.c 1.260 1999/10/21 00:56:07 + i82365.c 1.265 1999/11/10 18:36:21 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file @@ -16,7 +16,7 @@ rights and limitations under the License. The initial developer of the original code is David A. Hinds - . Portions created by David A. Hinds + . Portions created by David A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights Reserved. Alternatively, the contents of this file may be used under the @@ -76,7 +76,7 @@ static int pc_debug = PCMCIA_DEBUG; MODULE_PARM(pc_debug, "i"); #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) static const char *version = -"i82365.c 1.260 1999/10/21 00:56:07 (David Hinds)"; +"i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)"; #else #define DEBUG(n, args...) do { } while (0) #endif @@ -189,7 +189,7 @@ MODULE_PARM(cb_write_post, "i"); #ifdef CONFIG_ISA #ifdef CONFIG_PCI /* PCI card status change interrupts? */ -static int pci_csc = 1; +static int pci_csc = 0; /* PCI IO card functional interrupts? */ static int pci_int = 0; MODULE_PARM(pci_csc, "i"); @@ -903,7 +903,8 @@ static void o2micro_get_state(u_short s) { socket_info_t *t = &socket[s]; o2micro_state_t *p = &socket[s].state.o2micro; - if ((t->revision == 0x34) || (t->revision == 0x62)) { + if ((t->revision == 0x34) || (t->revision == 0x62) || + (t->type == IS_OZ6812)) { p->mode_a = i365_get(s, O2_MODE_A_2); p->mode_b = i365_get(s, O2_MODE_B_2); } else { @@ -923,7 +924,8 @@ static void o2micro_set_state(u_short s) { socket_info_t *t = &socket[s]; o2micro_state_t *p = &socket[s].state.o2micro; - if ((t->revision == 0x34) || (t->revision == 0x62)) { + if ((t->revision == 0x34) || (t->revision == 0x62) || + (t->type == IS_OZ6812)) { i365_set(s, O2_MODE_A_2, p->mode_a); i365_set(s, O2_MODE_B_2, p->mode_b); } else { @@ -1007,6 +1009,7 @@ static int topic_set_irq_mode(u_short s, int pcsc, int pint) flip(p->ccr, TOPIC97_ICR_IRQSEL, pcsc); return 0; } else { + /* no ISA card status change irq */ return !pcsc; } } @@ -1541,7 +1544,8 @@ static void __init add_pcic(int ns, int type) #ifdef CONFIG_ISA /* Poll if only two interrupts available */ if (!use_pci && !poll_interval) { - u_int tmp = (mask & (mask-1)); + u_int tmp = (mask & 0xff20); + tmp = tmp & (tmp-1); if ((tmp & (tmp-1)) == 0) poll_interval = HZ; } @@ -1627,7 +1631,7 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, u_short v, u_short d0) { socket_info_t *s = &socket[sockets]; - u_short d, ns; + u_short d, ns, i; u_char a, b, r, max; /* PCI bus enumeration is broken on some systems */ @@ -1666,7 +1670,6 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, pci_writel(bus, devfn, CB_LEGACY_MODE_BASE, 0); pci_readl(bus, devfn, PCI_BASE_ADDRESS_0, &s->cb_phys); if (s->cb_phys == 0) { - int i; pci_writew(bus, devfn, PCI_COMMAND, CMD_DFLT); for (i = 0; i < sizeof(cb_mem_base)/sizeof(u_int); i++) { s->cb_phys = cb_mem_base[i]; @@ -1710,10 +1713,21 @@ static void __init add_cb_bridge(int type, u_char bus, u_char devfn, } add_pcic(ns, type); - /* Re-do card type & voltage detection */ - cb_writel(sockets-ns, CB_SOCKET_FORCE, CB_SF_CVSTEST); - __set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + /* Re-do card voltage detection, if needed: this checks for + card presence with no voltage detect bits set */ + for (a = sockets-ns; a < sockets; a++) + if (!(cb_readl(a, CB_SOCKET_STATE) & 0x3c86)) + cb_writel(a, CB_SOCKET_FORCE, CB_SF_CVSTEST); + for (i = 0; i < 200; i++) { + for (a = sockets-ns; a < sockets; a++) + if (!(cb_readl(a, CB_SOCKET_STATE) & 0x3c86)) break; + if (a == sockets) break; + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ/20); + } + if (i == 200) + printk(KERN_NOTICE "i82365: card voltage interrogation" + " timed out!\n"); /* Set up PCI bus bridge structures if needed */ for (a = 0; a < ns; a++) { -- cgit v1.2.3