Lines Matching refs:port
7 * the function pointers in port->ops); if not, they can just use these
35 size_t parport_ieee1284_write_compat (struct parport *port,
43 struct pardevice *dev = port->physport->cad;
47 if (port->irq != PARPORT_IRQ_NONE) {
48 parport_enable_irq (port);
52 port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;
53 parport_write_control (port, ctl);
54 parport_data_forward (port);
66 if (!parport_wait_peripheral (port, mask, val))
71 if ((parport_read_status (port) &
88 /* Yield the port for a while. If this is the
90 the port. This way, we find out if we have
99 parport_wait_event (port, wait);
112 pr_debug("%s: Timed out\n", port->name);
118 parport_write_data (port, byte);
122 parport_write_control (port, ctl | PARPORT_CONTROL_STROBE);
125 parport_write_control (port, ctl);
138 port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
144 size_t parport_ieee1284_read_nibble (struct parport *port,
161 (parport_read_status(port) & PARPORT_STATUS_ERROR)) {
166 parport_frob_control (port,
171 port->ieee1284.phase = IEEE1284_PH_REV_DATA;
172 if (parport_wait_peripheral (port,
176 port->name, i / 2);
177 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
183 nibble = parport_read_status (port) >> 3;
190 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
193 if (parport_wait_peripheral (port,
198 port->name);
212 if (parport_read_status (port) & PARPORT_STATUS_ERROR) {
215 port->name, i / 2);
218 parport_frob_control (port,
221 port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE;
224 port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL;
232 size_t parport_ieee1284_read_byte (struct parport *port,
246 if (parport_read_status (port) & PARPORT_STATUS_ERROR) {
251 parport_data_reverse (port);
254 parport_frob_control (port,
259 port->physport->ieee1284.phase = IEEE1284_PH_REV_DATA;
260 if (parport_wait_peripheral (port,
264 parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
266 pr_debug("%s: Byte timeout at event 9\n", port->name);
270 byte = parport_read_data (port);
274 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
277 if (parport_wait_peripheral (port,
281 pr_debug("%s: Byte timeout at event 11\n", port->name);
286 parport_frob_control (port,
292 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
297 if (parport_read_status (port) & PARPORT_STATUS_ERROR) {
300 port->name, count);
303 parport_frob_control (port,
306 port->physport->ieee1284.phase = IEEE1284_PH_REV_IDLE;
309 port->physport->ieee1284.phase = IEEE1284_PH_HBUSY_DAVAIL;
323 int ecp_forward_to_reverse (struct parport *port)
328 parport_frob_control (port,
331 parport_data_reverse (port);
335 parport_frob_control (port,
340 retval = parport_wait_peripheral (port,
344 pr_debug("%s: ECP direction: reverse\n", port->name);
345 port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
347 pr_debug("%s: ECP direction: failed to reverse\n", port->name);
348 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN;
355 int ecp_reverse_to_forward (struct parport *port)
360 parport_frob_control (port,
367 retval = parport_wait_peripheral (port,
372 parport_data_forward (port);
373 pr_debug("%s: ECP direction: forward\n", port->name);
374 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
377 port->name);
378 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN;
388 size_t parport_ieee1284_ecp_write_data (struct parport *port,
399 port = port->physport;
401 if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE)
402 if (ecp_reverse_to_forward (port))
405 port->ieee1284.phase = IEEE1284_PH_FWD_DATA;
408 parport_frob_control (port,
414 unsigned long expire = jiffies + port->cad->timeout;
419 parport_write_data (port, byte);
420 parport_frob_control (port, PARPORT_CONTROL_STROBE,
424 if (!parport_wait_peripheral (port,
429 parport_frob_control (port,
437 pr_debug("%s: ECP transfer stalled!\n", port->name);
439 parport_frob_control (port, PARPORT_CONTROL_INIT,
442 if (parport_read_status (port) & PARPORT_STATUS_PAPEROUT) {
444 parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
448 parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
450 if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT))
453 pr_debug("%s: Host transfer recovered\n", port->name);
458 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
460 if (parport_wait_peripheral (port,
467 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
474 size_t parport_ieee1284_ecp_read_data (struct parport *port,
480 struct pardevice *dev = port->cad;
487 port = port->physport;
489 if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE)
490 if (ecp_forward_to_reverse (port))
493 port->ieee1284.phase = IEEE1284_PH_REV_DATA;
496 ctl = parport_read_control (port);
499 parport_write_control (port,
508 while (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) {
520 /* Yield the port for a while. */
521 if (dev->port->irq != PARPORT_IRQ_NONE) {
528 parport_wait_event (port, msecs_to_jiffies(40));
541 command = (parport_read_status (port) &
545 byte = parport_read_data (port);
552 port->name, byte);
555 else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE)
557 port->name);
564 port->name, rle_count);
572 parport_write_control (port, ctl);
575 if (parport_wait_peripheral (port, PARPORT_STATUS_ACK,
583 port->name, byte);
589 parport_write_control (port,
603 port->name, rle_count);
612 port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
618 size_t parport_ieee1284_ecp_write_addr (struct parport *port,
629 port = port->physport;
631 if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE)
632 if (ecp_reverse_to_forward (port))
635 port->ieee1284.phase = IEEE1284_PH_FWD_DATA;
638 parport_frob_control (port,
645 unsigned long expire = jiffies + port->cad->timeout;
650 parport_write_data (port, byte);
651 parport_frob_control (port, PARPORT_CONTROL_STROBE,
655 if (!parport_wait_peripheral (port,
660 parport_frob_control (port,
668 pr_debug("%s: ECP transfer stalled!\n", port->name);
670 parport_frob_control (port, PARPORT_CONTROL_INIT,
673 if (parport_read_status (port) & PARPORT_STATUS_PAPEROUT) {
675 parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
679 parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
681 if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT))
684 pr_debug("%s: Host transfer recovered\n", port->name);
689 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
691 if (parport_wait_peripheral (port,
698 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
709 size_t parport_ieee1284_epp_write_data (struct parport *port,
717 parport_frob_control (port,
724 port->ops->data_forward (port);
727 parport_write_data (port, *bp);
728 parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
732 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, 0, 10))
736 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
739 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY,
747 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
753 size_t parport_ieee1284_epp_read_data (struct parport *port,
761 parport_frob_control (port,
767 port->ops->data_reverse (port);
770 parport_frob_control (port,
774 if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0)) {
778 *bp = parport_read_data (port);
781 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
784 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY,
791 port->ops->data_forward (port);
797 size_t parport_ieee1284_epp_write_addr (struct parport *port,
805 parport_frob_control (port,
812 port->ops->data_forward (port);
815 parport_write_data (port, *bp);
816 parport_frob_control (port, PARPORT_CONTROL_SELECT,
820 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY, 0, 10))
824 parport_frob_control (port, PARPORT_CONTROL_SELECT, 0);
827 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY,
835 parport_frob_control (port, PARPORT_CONTROL_STROBE, 0);
841 size_t parport_ieee1284_epp_read_addr (struct parport *port,
849 parport_frob_control (port,
855 port->ops->data_reverse (port);
858 parport_frob_control (port, PARPORT_CONTROL_SELECT,
862 if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0)) {
866 *bp = parport_read_data (port);
869 parport_frob_control (port, PARPORT_CONTROL_SELECT,
873 if (parport_poll_peripheral (port, PARPORT_STATUS_BUSY,
879 port->ops->data_forward (port);