Commit 20052f47 authored by Russell King's avatar Russell King

[SERIAL] 8250_cs update - incorporate pcmcia-cs 3.1.34 serial_cs fixes

- add buggy_uart parameter
- use detected Vcc values, not CIS Vcc values
- handle OxSemi OXCF950 ports
parent a1e52b44
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
A driver for PCMCIA serial devices A driver for PCMCIA serial devices
serial_cs.c 1.123 2000/08/24 18:46:38 serial_cs.c 1.134 2002/05/04 05:48:53
The contents of this file are subject to the Mozilla Public The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file License Version 1.1 (the "License"); you may not use this file
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
static int pc_debug = PCMCIA_DEBUG; static int pc_debug = PCMCIA_DEBUG;
MODULE_PARM(pc_debug, "i"); MODULE_PARM(pc_debug, "i");
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
static char *version = "serial_cs.c 1.123 2000/08/24 18:46:38 (David Hinds)"; static char *version = "serial_cs.c 1.134 2002/05/04 05:48:53 (David Hinds)";
#else #else
#define DEBUG(n, args...) #define DEBUG(n, args...)
#endif #endif
...@@ -73,10 +73,13 @@ static int irq_list[4] = { -1 }; ...@@ -73,10 +73,13 @@ static int irq_list[4] = { -1 };
/* Enable the speaker? */ /* Enable the speaker? */
static int do_sound = 1; static int do_sound = 1;
/* Skip strict UART tests? */
static int buggy_uart;
MODULE_PARM(irq_mask, "i"); MODULE_PARM(irq_mask, "i");
MODULE_PARM(irq_list, "1-4i"); MODULE_PARM(irq_list, "1-4i");
MODULE_PARM(do_sound, "i"); MODULE_PARM(do_sound, "i");
MODULE_PARM(buggy_uart, "i");
/*====================================================================*/ /*====================================================================*/
...@@ -190,7 +193,6 @@ static dev_link_t *serial_attach(void) ...@@ -190,7 +193,6 @@ static dev_link_t *serial_attach(void)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
link->irq.IRQInfo2 |= 1 << irq_list[i]; link->irq.IRQInfo2 |= 1 << irq_list[i];
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
if (do_sound) { if (do_sound) {
link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA; link->conf.Status = CCSR_AUDIO_ENA;
...@@ -275,11 +277,13 @@ static int setup_serial(struct serial_info * info, ioaddr_t port, int irq) ...@@ -275,11 +277,13 @@ static int setup_serial(struct serial_info * info, ioaddr_t port, int irq)
serial.port = port; serial.port = port;
serial.irq = irq; serial.irq = irq;
serial.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ; serial.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ;
if (buggy_uart)
serial.flags |= UPF_BUGGY_UART;
line = register_serial(&serial); line = register_serial(&serial);
if (line < 0) { if (line < 0) {
printk(KERN_NOTICE "serial_cs: register_serial() at 0x%04lx," printk(KERN_NOTICE "serial_cs: register_serial() at 0x%04lx,"
" irq %d failed\n", (u_long) serial.port, serial.irq); " irq %d failed\n", (u_long) serial.port, serial.irq);
return -1; return -EINVAL;
} }
info->line[info->ndev] = line; info->line[info->ndev] = line;
...@@ -426,8 +430,16 @@ static int multi_config(dev_link_t * link) ...@@ -426,8 +430,16 @@ static int multi_config(dev_link_t * link)
u_char buf[256]; u_char buf[256];
cisparse_t parse; cisparse_t parse;
cistpl_cftable_entry_t *cf = &parse.cftable_entry; cistpl_cftable_entry_t *cf = &parse.cftable_entry;
config_info_t config;
int i, base2 = 0; int i, base2 = 0;
i = CardServices(GetConfigurationInfo, handle, &config);
if (i != CS_SUCCESS) {
cs_error(handle, GetConfiguration, i);
return -1;
}
link->conf.Vcc = config.Vcc;
tuple.TupleData = (cisdata_t *) buf; tuple.TupleData = (cisdata_t *) buf;
tuple.TupleOffset = 0; tuple.TupleOffset = 0;
tuple.TupleDataMax = 255; tuple.TupleDataMax = 255;
...@@ -500,6 +512,19 @@ static int multi_config(dev_link_t * link) ...@@ -500,6 +512,19 @@ static int multi_config(dev_link_t * link)
return -1; return -1;
} }
/* The Oxford Semiconductor OXCF950 cards are in fact single-port:
8 registers are for the UART, the others are extra registers */
if (info->manfid == MANFID_OXSEMI) {
if (cf->index == 1 || cf->index == 3) {
setup_serial(info, base2, link->irq.AssignedIRQ);
outb(12, link->io.BasePort1 + 1);
} else {
setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ);
outb(12, base2 + 1);
}
return 0;
}
setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ); setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ);
/* The Nokia cards are not really multiport cards */ /* The Nokia cards are not really multiport cards */
if (info->manfid == MANFID_NOKIA) if (info->manfid == MANFID_NOKIA)
...@@ -608,6 +633,7 @@ void serial_config(dev_link_t * link) ...@@ -608,6 +633,7 @@ void serial_config(dev_link_t * link)
cs_error(link->handle, last_fn, last_ret); cs_error(link->handle, last_fn, last_ret);
failed: failed:
serial_remove(link); serial_remove(link);
link->state &= ~DEV_CONFIG_PENDING;
} }
/*====================================================================== /*======================================================================
......
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