Lines Matching +full:strobe +full:- +full:polarity +full:- +full:high

1 // SPDX-License-Identifier: GPL-2.0
2 /* IEEE-1284 operations for parport.
5 * they are used by the low-level drivers. If they have a special way
7 * the function pointers in port->ops); if not, they can just use these
13 * Fixed AUTOFD polarity in ecp_forward_to_reverse(). Fred Barnes, 1999
31 * One-way data transfer functions. *
43 struct pardevice *dev = port->physport->cad; in parport_ieee1284_write_compat()
47 if (port->irq != PARPORT_IRQ_NONE) { in parport_ieee1284_write_compat()
52 port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; in parport_ieee1284_write_compat()
56 unsigned long expire = jiffies + dev->timeout; in parport_ieee1284_write_compat()
112 pr_debug("%s: Timed out\n", port->name); in parport_ieee1284_write_compat()
121 /* Pulse strobe. */ in parport_ieee1284_write_compat()
123 udelay (1); /* strobe */ in parport_ieee1284_write_compat()
138 port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE; in parport_ieee1284_write_compat()
171 port->ieee1284.phase = IEEE1284_PH_REV_DATA; in parport_ieee1284_read_nibble()
174 /* Timeout -- no more data? */ in parport_ieee1284_read_nibble()
176 port->name, i / 2); in parport_ieee1284_read_nibble()
189 /* Event 10: Set nAutoFd high. */ in parport_ieee1284_read_nibble()
192 /* Event 11: nAck goes high. */ in parport_ieee1284_read_nibble()
196 /* Timeout -- no more data? */ in parport_ieee1284_read_nibble()
198 port->name); in parport_ieee1284_read_nibble()
215 port->name, i / 2); in parport_ieee1284_read_nibble()
221 port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; in parport_ieee1284_read_nibble()
224 port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL; in parport_ieee1284_read_nibble()
250 /* Event 14: Place data bus in high impedance state. */ in parport_ieee1284_read_byte()
259 port->physport->ieee1284.phase = IEEE1284_PH_REV_DATA; in parport_ieee1284_read_byte()
263 /* Timeout -- no more data? */ in parport_ieee1284_read_byte()
266 pr_debug("%s: Byte timeout at event 9\n", port->name); in parport_ieee1284_read_byte()
273 /* Event 10: Set nAutoFd high */ in parport_ieee1284_read_byte()
276 /* Event 11: nAck goes high. */ in parport_ieee1284_read_byte()
280 /* Timeout -- no more data? */ in parport_ieee1284_read_byte()
281 pr_debug("%s: Byte timeout at event 11\n", port->name); in parport_ieee1284_read_byte()
291 /* Event 17: Set nStrobe high. */ in parport_ieee1284_read_byte()
300 port->name, count); in parport_ieee1284_read_byte()
306 port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE; in parport_ieee1284_read_byte()
309 port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL; in parport_ieee1284_read_byte()
344 pr_debug("%s: ECP direction: reverse\n", port->name); in ecp_forward_to_reverse()
345 port->ieee1284.phase = IEEE1284_PH_REV_IDLE; in ecp_forward_to_reverse()
347 pr_debug("%s: ECP direction: failed to reverse\n", port->name); in ecp_forward_to_reverse()
348 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; in ecp_forward_to_reverse()
359 /* Event 47: Set nInit high */ in ecp_reverse_to_forward()
366 /* Event 49: PError goes high */ in ecp_reverse_to_forward()
373 pr_debug("%s: ECP direction: forward\n", port->name); in ecp_reverse_to_forward()
374 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; in ecp_reverse_to_forward()
377 port->name); in ecp_reverse_to_forward()
378 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN; in ecp_reverse_to_forward()
399 port = port->physport; in parport_ieee1284_ecp_write_data()
401 if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) in parport_ieee1284_ecp_write_data()
405 port->ieee1284.phase = IEEE1284_PH_FWD_DATA; in parport_ieee1284_ecp_write_data()
407 /* HostAck high (data, not command) */ in parport_ieee1284_ecp_write_data()
414 unsigned long expire = jiffies + port->cad->timeout; in parport_ieee1284_ecp_write_data()
437 pr_debug("%s: ECP transfer stalled!\n", port->name); in parport_ieee1284_ecp_write_data()
453 pr_debug("%s: Host transfer recovered\n", port->name); in parport_ieee1284_ecp_write_data()
467 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; in parport_ieee1284_ecp_write_data()
480 struct pardevice *dev = port->cad; in parport_ieee1284_ecp_read_data()
487 port = port->physport; in parport_ieee1284_ecp_read_data()
489 if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE) in parport_ieee1284_ecp_read_data()
493 port->ieee1284.phase = IEEE1284_PH_REV_DATA; in parport_ieee1284_ecp_read_data()
502 unsigned long expire = jiffies + dev->timeout; in parport_ieee1284_ecp_read_data()
521 if (count && dev->port->irq != PARPORT_IRQ_NONE) { in parport_ieee1284_ecp_read_data()
537 /* The last byte was a run-length count, so in parport_ieee1284_ecp_read_data()
552 port->name, byte); in parport_ieee1284_ecp_read_data()
555 else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE) in parport_ieee1284_ecp_read_data()
557 port->name); in parport_ieee1284_ecp_read_data()
562 if (rle_count > (len - count)) { in parport_ieee1284_ecp_read_data()
564 port->name, rle_count); in parport_ieee1284_ecp_read_data()
571 /* Event 44: Set HostAck high, acknowledging handshake. */ in parport_ieee1284_ecp_read_data()
574 /* Event 45: The peripheral has 35ms to set nAck high. */ in parport_ieee1284_ecp_read_data()
583 port->name, byte); in parport_ieee1284_ecp_read_data()
592 /* If we just read a run-length count, fetch the data. */ in parport_ieee1284_ecp_read_data()
596 /* If this is the byte after a run-length count, decompress. */ in parport_ieee1284_ecp_read_data()
603 port->name, rle_count); in parport_ieee1284_ecp_read_data()
612 port->ieee1284.phase = IEEE1284_PH_REV_IDLE; in parport_ieee1284_ecp_read_data()
629 port = port->physport; in parport_ieee1284_ecp_write_addr()
631 if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) in parport_ieee1284_ecp_write_addr()
635 port->ieee1284.phase = IEEE1284_PH_FWD_DATA; in parport_ieee1284_ecp_write_addr()
645 unsigned long expire = jiffies + port->cad->timeout; in parport_ieee1284_ecp_write_addr()
668 pr_debug("%s: ECP transfer stalled!\n", port->name); in parport_ieee1284_ecp_write_addr()
684 pr_debug("%s: Host transfer recovered\n", port->name); in parport_ieee1284_ecp_write_addr()
698 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; in parport_ieee1284_ecp_write_addr()
716 /* set EPP idle state (just to make sure) with strobe low */ in parport_ieee1284_epp_write_data()
724 port->ops->data_forward (port); in parport_ieee1284_epp_write_data()
725 for (; len > 0; len--, bp++) { in parport_ieee1284_epp_write_data()
731 /* Event 58: wait for busy (nWait) to go high */ in parport_ieee1284_epp_write_data()
735 /* Event 63: set nAutoFd (nDStrb) high */ in parport_ieee1284_epp_write_data()
746 /* Event 61: set strobe (nWrite) high */ in parport_ieee1284_epp_write_data()
760 /* set EPP idle state (just to make sure) with strobe high */ in parport_ieee1284_epp_read_data()
767 port->ops->data_reverse (port); in parport_ieee1284_epp_read_data()
768 for (; len > 0; len--, bp++) { in parport_ieee1284_epp_read_data()
773 /* Event 58: wait for Busy to go high */ in parport_ieee1284_epp_read_data()
780 /* Event 63: set nAutoFd (nDStrb) high */ in parport_ieee1284_epp_read_data()
791 port->ops->data_forward (port); in parport_ieee1284_epp_read_data()
804 /* set EPP idle state (just to make sure) with strobe low */ in parport_ieee1284_epp_write_addr()
812 port->ops->data_forward (port); in parport_ieee1284_epp_write_addr()
813 for (; len > 0; len--, bp++) { in parport_ieee1284_epp_write_addr()
819 /* Event 58: wait for busy (nWait) to go high */ in parport_ieee1284_epp_write_addr()
823 /* Event 59: set nAStrb high */ in parport_ieee1284_epp_write_addr()
834 /* Event 61: set strobe (nWrite) high */ in parport_ieee1284_epp_write_addr()
848 /* Set EPP idle state (just to make sure) with strobe high */ in parport_ieee1284_epp_read_addr()
855 port->ops->data_reverse (port); in parport_ieee1284_epp_read_addr()
856 for (; len > 0; len--, bp++) { in parport_ieee1284_epp_read_addr()
861 /* Event 58: wait for Busy to go high */ in parport_ieee1284_epp_read_addr()
868 /* Event 59: set nSelectIn (nAStrb) high */ in parport_ieee1284_epp_read_addr()
879 port->ops->data_forward (port); in parport_ieee1284_epp_read_addr()