diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-29 01:41:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-29 01:41:54 +0000 |
commit | f969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch) | |
tree | b3530d803df59d726afaabebc6626987dee1ca05 /drivers/parport | |
parent | a10ce7ef2066b455d69187643ddf2073bfc4db24 (diff) |
Merge with 2.3.27.
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/Config.in | 8 | ||||
-rw-r--r-- | drivers/parport/ieee1284.c | 55 | ||||
-rw-r--r-- | drivers/parport/ieee1284_ops.c | 4 | ||||
-rw-r--r-- | drivers/parport/init.c | 1 | ||||
-rw-r--r-- | drivers/parport/parport_pc.c | 5 | ||||
-rw-r--r-- | drivers/parport/share.c | 2 |
6 files changed, 52 insertions, 23 deletions
diff --git a/drivers/parport/Config.in b/drivers/parport/Config.in index 812cc1a4c..0ccc8050c 100644 --- a/drivers/parport/Config.in +++ b/drivers/parport/Config.in @@ -27,18 +27,18 @@ if [ "$CONFIG_PARPORT" != "n" ]; then dep_tristate ' Multiface III parallel port' CONFIG_PARPORT_MFC3 $CONFIG_PARPORT fi else - define_bool CONFIG_PARPORT_AMIGA n - define_bool CONFIG_PARPORT_MFC3 n + define_tristate CONFIG_PARPORT_AMIGA n + define_tristate CONFIG_PARPORT_MFC3 n fi if [ "$CONFIG_ATARI" = "y" ]; then dep_tristate ' Atari hardware' CONFIG_PARPORT_ATARI $CONFIG_PARPORT else - define_bool CONFIG_PARPORT_ATARI n + define_tristate CONFIG_PARPORT_ATARI n fi if [ "$CONFIG_SBUS" = "y" ]; then dep_tristate ' Sparc hardware (EXPERIMENTAL)' CONFIG_PARPORT_SUNBPP $CONFIG_PARPORT else - define_bool CONFIG_PARPORT_SUNBPP n + define_tristate CONFIG_PARPORT_SUNBPP n fi # If exactly one hardware type is selected then parport will optimise away diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c index ba7fc1610..8db17e5c9 100644 --- a/drivers/parport/ieee1284.c +++ b/drivers/parport/ieee1284.c @@ -80,19 +80,42 @@ int parport_wait_event (struct parport *port, signed long timeout) * are able to eat the time up to 40ms. */ +int parport_poll_peripheral(struct parport *port, + unsigned char mask, + unsigned char result, + int usec) +{ + /* Zero return code is success, >0 is timeout. */ + int counter = usec / 5; + unsigned char status; + for (; counter > 0; counter--) { + status = parport_read_status (port); + if ((status & mask) == result) + return 0; + if (signal_pending (current)) + return -EINTR; + if (current->need_resched) + break; + udelay (5); + } + + return 1; +} + int parport_wait_peripheral(struct parport *port, unsigned char mask, unsigned char result) { - int counter; + int ret; + int usec; long deadline; unsigned char status; - counter = port->physport->spintime; /* usecs of fast polling */ + usec = port->physport->spintime; /* usecs of fast polling */ if (!port->physport->cad->timeout) /* A zero timeout is "special": busy wait for the entire 35ms. */ - counter = 35000; + usec = 35000; /* Fast polling. * @@ -100,16 +123,9 @@ int parport_wait_peripheral(struct parport *port, * How about making a note (in the device structure) of how long * it takes, so we know for next time? */ - for (counter /= 5; counter > 0; counter--) { - status = parport_read_status (port); - if ((status & mask) == result) - return 0; - if (signal_pending (current)) - return -EINTR; - if (current->need_resched) - break; - udelay(5); - } + ret = parport_poll_peripheral (port, mask, result, usec); + if (ret != 1) + return ret; if (!port->physport->cad->timeout) /* We may be in an interrupt handler, so we can't poll @@ -137,7 +153,7 @@ int parport_wait_peripheral(struct parport *port, /* parport_wait_event didn't time out, but the * peripheral wasn't actually ready either. * Wait for another 10ms. */ - current->state = TASK_INTERRUPTIBLE; + __set_current_state (TASK_INTERRUPTIBLE); schedule_timeout ((HZ+ 99) / 100); } } @@ -369,8 +385,17 @@ int parport_negotiate (struct parport *port, int mode) PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); + /* Event 52: nAck goes low */ + if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { + /* This peripheral is _very_ slow. */ + DPRINTK (KERN_DEBUG + "%s: Event 52 didn't happen\n", + port->name); + parport_ieee1284_terminate (port); + return 1; + } + /* Event 53: Set nStrobe high */ - udelay (5); parport_frob_control (port, PARPORT_CONTROL_STROBE, 0); diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c index 4d460a58d..3d77776b5 100644 --- a/drivers/parport/ieee1284_ops.c +++ b/drivers/parport/ieee1284_ops.c @@ -95,7 +95,7 @@ size_t parport_ieee1284_write_compat (struct parport *port, our interrupt handler called. */ if (count && no_irq) { parport_release (dev); - current->state = TASK_INTERRUPTIBLE; + set_current_state (TASK_INTERRUPTIBLE); schedule_timeout (wait); parport_claim_or_block (dev); } @@ -525,7 +525,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port, /* Yield the port for a while. */ if (count && dev->port->irq != PARPORT_IRQ_NONE) { parport_release (dev); - current->state = TASK_INTERRUPTIBLE; + set_current_state (TASK_INTERRUPTIBLE); schedule_timeout ((HZ + 24) / 25); parport_claim_or_block (dev); } diff --git a/drivers/parport/init.c b/drivers/parport/init.c index 432fede95..b2f4d4b06 100644 --- a/drivers/parport/init.c +++ b/drivers/parport/init.c @@ -181,6 +181,7 @@ EXPORT_SYMBOL(parport_write); EXPORT_SYMBOL(parport_read); EXPORT_SYMBOL(parport_ieee1284_wakeup); EXPORT_SYMBOL(parport_wait_peripheral); +EXPORT_SYMBOL(parport_poll_peripheral); EXPORT_SYMBOL(parport_wait_event); EXPORT_SYMBOL(parport_set_timeout); EXPORT_SYMBOL(parport_ieee1284_interrupt); diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index f6516d5b1..72d8dc152 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -122,7 +122,7 @@ static int change_mode(struct parport *p, int m) if (time_after_eq (jiffies, expire)) /* The FIFO is stuck. */ return -EBUSY; - current->state = TASK_INTERRUPTIBLE; + __set_current_state (TASK_INTERRUPTIBLE); schedule_timeout ((HZ + 99) / 100); if (signal_pending (current)) break; @@ -1782,6 +1782,9 @@ static int __init parport_pc_init_pci (int irq, int dma) { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DUAL_PAR_B, PCI_ANY_ID, PCI_ANY_ID, 1, { { 0, -1 }, } }, + { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_BOCA_IOPPAR, + PCI_ANY_ID, PCI_ANY_ID, + 1, { { 0, -1 }, } }, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014, 2, { { 4, -1 }, { 5, -1 }, } }, diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 7c127fd18..5a3288b9b 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -137,7 +137,7 @@ struct parport *parport_enumerate(void) request_module ("parport_lowlevel"); if (portlist) /* The user has a parport_lowlevel alias in - * conf.modules. Warn them that it won't work + * modules.conf. Warn them that it won't work * for long. */ printk (KERN_WARNING "parport: 'parport_lowlevel' is deprecated; " |