Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    1) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    2) PARPORT interface documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    3) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    5) :Time-stamp: <2000-02-24 13:30:20 twaugh>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    7) Described here are the following functions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300    9) Global functions::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   10)   parport_register_driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   11)   parport_unregister_driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   12)   parport_enumerate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   13)   parport_register_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   14)   parport_unregister_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   15)   parport_claim
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   16)   parport_claim_or_block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   17)   parport_release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   18)   parport_yield
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   19)   parport_yield_blocking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   20)   parport_wait_peripheral
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   21)   parport_poll_peripheral
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   22)   parport_wait_event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   23)   parport_negotiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   24)   parport_read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   25)   parport_write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   26)   parport_open
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   27)   parport_close
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   28)   parport_device_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   29)   parport_device_coords
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   30)   parport_find_class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   31)   parport_find_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   32)   parport_set_timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   34) Port functions (can be overridden by low-level drivers):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   36)   SPP::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   37)     port->ops->read_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   38)     port->ops->write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   39)     port->ops->read_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   40)     port->ops->read_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   41)     port->ops->write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   42)     port->ops->frob_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   43)     port->ops->enable_irq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   44)     port->ops->disable_irq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   45)     port->ops->data_forward
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   46)     port->ops->data_reverse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   48)   EPP::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   49)     port->ops->epp_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   50)     port->ops->epp_read_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   51)     port->ops->epp_write_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   52)     port->ops->epp_read_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   54)   ECP::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   55)     port->ops->ecp_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   56)     port->ops->ecp_read_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   57)     port->ops->ecp_write_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   59)   Other::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   60)     port->ops->nibble_read_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   61)     port->ops->byte_read_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   62)     port->ops->compat_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   64) The parport subsystem comprises ``parport`` (the core port-sharing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   65) code), and a variety of low-level drivers that actually do the port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   66) accesses.  Each low-level driver handles a particular style of port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   67) (PC, Amiga, and so on).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   69) The parport interface to the device driver author can be broken down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   70) into global functions and port functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   72) The global functions are mostly for communicating between the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   73) driver and the parport subsystem: acquiring a list of available ports,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   74) claiming a port for exclusive use, and so on.  They also include
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   75) ``generic`` functions for doing standard things that will work on any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   76) IEEE 1284-capable architecture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   78) The port functions are provided by the low-level drivers, although the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   79) core parport module provides generic ``defaults`` for some routines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   80) The port functions can be split into three groups: SPP, EPP, and ECP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   82) SPP (Standard Parallel Port) functions modify so-called ``SPP``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   83) registers: data, status, and control.  The hardware may not actually
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   84) have registers exactly like that, but the PC does and this interface is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   85) modelled after common PC implementations.  Other low-level drivers may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   86) be able to emulate most of the functionality.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   88) EPP (Enhanced Parallel Port) functions are provided for reading and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   89) writing in IEEE 1284 EPP mode, and ECP (Extended Capabilities Port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   90) functions are used for IEEE 1284 ECP mode. (What about BECP? Does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   91) anyone care?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   93) Hardware assistance for EPP and/or ECP transfers may or may not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   94) available, and if it is available it may or may not be used.  If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   95) hardware is not used, the transfer will be software-driven.  In order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   96) to cope with peripherals that only tenuously support IEEE 1284, a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   97) low-level driver specific function is provided, for altering 'fudge
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   98) factors'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  100) Global functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  101) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  103) parport_register_driver - register a device driver with parport
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  104) ---------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  106) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  107) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  109) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  111) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  113) 	struct parport_driver {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  114) 		const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  115) 		void (*attach) (struct parport *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  116) 		void (*detach) (struct parport *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  117) 		struct parport_driver *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  118) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  119) 	int parport_register_driver (struct parport_driver *driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  121) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  122) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  124) In order to be notified about parallel ports when they are detected,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  125) parport_register_driver should be called.  Your driver will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  126) immediately be notified of all ports that have already been detected,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  127) and of each new port as low-level drivers are loaded.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  129) A ``struct parport_driver`` contains the textual name of your driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  130) a pointer to a function to handle new ports, and a pointer to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  131) function to handle ports going away due to a low-level driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  132) unloading.  Ports will only be detached if they are not being used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  133) (i.e. there are no devices registered on them).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  135) The visible parts of the ``struct parport *`` argument given to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  136) attach/detach are::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  138) 	struct parport
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  139) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  140) 		struct parport *next; /* next parport in list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  141) 		const char *name;     /* port's name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  142) 		unsigned int modes;   /* bitfield of hardware modes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  143) 		struct parport_device_info probe_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  144) 				/* IEEE1284 info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  145) 		int number;           /* parport index */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  146) 		struct parport_operations *ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  147) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  148) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  150) There are other members of the structure, but they should not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  151) touched.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  153) The ``modes`` member summarises the capabilities of the underlying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  154) hardware.  It consists of flags which may be bitwise-ored together:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  156)   ============================= ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  157)   PARPORT_MODE_PCSPP		IBM PC registers are available,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  158) 				i.e. functions that act on data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  159) 				control and status registers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  160) 				probably writing directly to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  161) 				hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  162)   PARPORT_MODE_TRISTATE		The data drivers may be turned off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  163) 				This allows the data lines to be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  164) 				for reverse (peripheral to host)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  165) 				transfers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  166)   PARPORT_MODE_COMPAT		The hardware can assist with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  167) 				compatibility-mode (printer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  168) 				transfers, i.e. compat_write_block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  169)   PARPORT_MODE_EPP		The hardware can assist with EPP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  170) 				transfers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  171)   PARPORT_MODE_ECP		The hardware can assist with ECP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  172) 				transfers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  173)   PARPORT_MODE_DMA		The hardware can use DMA, so you might
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  174) 				want to pass ISA DMA-able memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  175) 				(i.e. memory allocated using the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  176) 				GFP_DMA flag with kmalloc) to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  177) 				low-level driver in order to take
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  178) 				advantage of it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  179)   ============================= ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  181) There may be other flags in ``modes`` as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  183) The contents of ``modes`` is advisory only.  For example, if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  184) hardware is capable of DMA, and PARPORT_MODE_DMA is in ``modes``, it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  185) doesn't necessarily mean that DMA will always be used when possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  186) Similarly, hardware that is capable of assisting ECP transfers won't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  187) necessarily be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  189) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  190) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  192) Zero on success, otherwise an error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  194) ERRORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  195) ^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  197) None. (Can it fail? Why return int?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  199) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  200) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  202) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  204) 	static void lp_attach (struct parport *port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  205) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  206) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  207) 		private = kmalloc (...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  208) 		dev[count++] = parport_register_device (...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  209) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  210) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  212) 	static void lp_detach (struct parport *port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  213) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  214) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  215) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  217) 	static struct parport_driver lp_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  218) 		"lp",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  219) 		lp_attach,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  220) 		lp_detach,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  221) 		NULL /* always put NULL here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  222) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  224) 	int lp_init (void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  225) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  226) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  227) 		if (parport_register_driver (&lp_driver)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  228) 			/* Failed; nothing we can do. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  229) 			return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  230) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  231) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  232) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  234) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  235) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  236) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  238) parport_unregister_driver, parport_register_device, parport_enumerate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  242) parport_unregister_driver - tell parport to forget about this driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  243) --------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  245) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  246) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  248) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  250) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  252) 	struct parport_driver {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  253) 		const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  254) 		void (*attach) (struct parport *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  255) 		void (*detach) (struct parport *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  256) 		struct parport_driver *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  257) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  258) 	void parport_unregister_driver (struct parport_driver *driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  260) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  261) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  263) This tells parport not to notify the device driver of new ports or of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  264) ports going away.  Registered devices belonging to that driver are NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  265) unregistered: parport_unregister_device must be used for each one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  267) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  268) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  270) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  272) 	void cleanup_module (void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  273) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  274) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  275) 		/* Stop notifications. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  276) 		parport_unregister_driver (&lp_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  278) 		/* Unregister devices. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  279) 		for (i = 0; i < NUM_DEVS; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  280) 			parport_unregister_device (dev[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  281) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  282) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  284) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  285) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  287) parport_register_driver, parport_enumerate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  291) parport_enumerate - retrieve a list of parallel ports (DEPRECATED)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  292) ------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  294) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  295) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  297) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  299) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  301) 	struct parport *parport_enumerate (void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  302) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  303) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  304) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  306) Retrieve the first of a list of valid parallel ports for this machine.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  307) Successive parallel ports can be found using the ``struct parport
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  308) *next`` element of the ``struct parport *`` that is returned.  If ``next``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  309) is NULL, there are no more parallel ports in the list.  The number of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  310) ports in the list will not exceed PARPORT_MAX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  312) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  313) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  315) A ``struct parport *`` describing a valid parallel port for the machine,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  316) or NULL if there are none.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  318) ERRORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  319) ^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  321) This function can return NULL to indicate that there are no parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  322) ports to use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  323) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  324) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  325) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  327) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  328) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  329) 	int detect_device (void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  330) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  331) 		struct parport *port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  333) 		for (port = parport_enumerate ();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  334) 		port != NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  335) 		port = port->next) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  336) 			/* Try to detect a device on the port... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  337) 			...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  338) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  339) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  341) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  342) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  344) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  345) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  347) parport_enumerate is deprecated; parport_register_driver should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  348) used instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  350) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  351) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  352) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  353) parport_register_driver, parport_unregister_driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  354) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  355) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  357) parport_register_device - register to use a port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  358) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  360) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  361) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  363) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  365) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  367) 	typedef int (*preempt_func) (void *handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  368) 	typedef void (*wakeup_func) (void *handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  369) 	typedef int (*irq_func) (int irq, void *handle, struct pt_regs *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  370) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  371) 	struct pardevice *parport_register_device(struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  372) 						  const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  373) 						  preempt_func preempt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  374) 						  wakeup_func wakeup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  375) 						  irq_func irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  376) 						  int flags,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  377) 						  void *handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  379) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  380) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  382) Use this function to register your device driver on a parallel port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  383) (``port``).  Once you have done that, you will be able to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  384) parport_claim and parport_release in order to use the port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  386) The (``name``) argument is the name of the device that appears in /proc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  387) filesystem. The string must be valid for the whole lifetime of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  388) device (until parport_unregister_device is called).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  390) This function will register three callbacks into your driver:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  391) ``preempt``, ``wakeup`` and ``irq``.  Each of these may be NULL in order to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  392) indicate that you do not want a callback.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  393) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  394) When the ``preempt`` function is called, it is because another driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  395) wishes to use the parallel port.  The ``preempt`` function should return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  396) non-zero if the parallel port cannot be released yet -- if zero is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  397) returned, the port is lost to another driver and the port must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  398) re-claimed before use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  399) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  400) The ``wakeup`` function is called once another driver has released the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  401) port and no other driver has yet claimed it.  You can claim the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  402) parallel port from within the ``wakeup`` function (in which case the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  403) claim is guaranteed to succeed), or choose not to if you don't need it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  404) now.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  406) If an interrupt occurs on the parallel port your driver has claimed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  407) the ``irq`` function will be called. (Write something about shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  408) interrupts here.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  410) The ``handle`` is a pointer to driver-specific data, and is passed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  411) the callback functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  412) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  413) ``flags`` may be a bitwise combination of the following flags:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  414) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  415)   ===================== =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  416)         Flag            Meaning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  417)   ===================== =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  418)   PARPORT_DEV_EXCL	The device cannot share the parallel port at all.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  419) 			Use this only when absolutely necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  420)   ===================== =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  422) The typedefs are not actually defined -- they are only shown in order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  423) to make the function prototype more readable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  424) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  425) The visible parts of the returned ``struct pardevice`` are::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  427) 	struct pardevice {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  428) 		struct parport *port;	/* Associated port */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  429) 		void *private;		/* Device driver's 'handle' */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  430) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  431) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  433) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  434) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  436) A ``struct pardevice *``: a handle to the registered parallel port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  437) device that can be used for parport_claim, parport_release, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  439) ERRORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  440) ^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  441) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  442) A return value of NULL indicates that there was a problem registering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  443) a device on that port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  445) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  446) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  448) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  449) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  450) 	static int preempt (void *handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  451) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  452) 		if (busy_right_now)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  453) 			return 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  454) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  455) 		must_reclaim_port = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  456) 		return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  457) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  459) 	static void wakeup (void *handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  460) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  461) 		struct toaster *private = handle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  462) 		struct pardevice *dev = private->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  463) 		if (!dev) return; /* avoid races */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  465) 		if (want_port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  466) 			parport_claim (dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  467) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  468) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  469) 	static int toaster_detect (struct toaster *private, struct parport *port)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  470) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  471) 		private->dev = parport_register_device (port, "toaster", preempt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  472) 							wakeup, NULL, 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  473) 							private);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  474) 		if (!private->dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  475) 			/* Couldn't register with parport. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  476) 			return -EIO;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  477) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  478) 		must_reclaim_port = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  479) 		busy_right_now = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  480) 		parport_claim_or_block (private->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  481) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  482) 		/* Don't need the port while the toaster warms up. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  483) 		busy_right_now = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  484) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  485) 		busy_right_now = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  486) 		if (must_reclaim_port) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  487) 			parport_claim_or_block (private->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  488) 			must_reclaim_port = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  489) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  490) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  491) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  493) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  494) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  495) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  496) parport_unregister_device, parport_claim
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  498) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  500) parport_unregister_device - finish using a port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  501) -----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  503) SYNPOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  505) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  506) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  507) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  508) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  509) 	void parport_unregister_device (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  510) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  511) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  512) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  513) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  514) This function is the opposite of parport_register_device.  After using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  515) parport_unregister_device, ``dev`` is no longer a valid device handle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  517) You should not unregister a device that is currently claimed, although
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  518) if you do it will be released automatically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  520) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  521) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  522) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  523) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  525) 	...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  526) 	kfree (dev->private); /* before we lose the pointer */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  527) 	parport_unregister_device (dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  528) 	...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  529) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  530) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  531) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  532) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  533) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  534) parport_unregister_driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  535) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  536) parport_claim, parport_claim_or_block - claim the parallel port for a device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  537) ----------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  538) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  539) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  540) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  541) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  542) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  543) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  544) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  545) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  546) 	int parport_claim (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  547) 	int parport_claim_or_block (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  548) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  549) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  550) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  551) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  552) These functions attempt to gain control of the parallel port on which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  553) ``dev`` is registered.  ``parport_claim`` does not block, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  554) ``parport_claim_or_block`` may do. (Put something here about blocking
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  555) interruptibly or non-interruptibly.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  556) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  557) You should not try to claim a port that you have already claimed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  558) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  559) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  560) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  561) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  562) A return value of zero indicates that the port was successfully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  563) claimed, and the caller now has possession of the parallel port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  565) If ``parport_claim_or_block`` blocks before returning successfully, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  566) return value is positive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  568) ERRORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  569) ^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  570) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  571) ========== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  572)   -EAGAIN  The port is unavailable at the moment, but another attempt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  573)            to claim it may succeed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  574) ========== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  575) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  576) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  577) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  580) parport_release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  581) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  582) parport_release - release the parallel port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  583) -------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  584) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  585) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  586) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  587) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  588) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  589) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  590) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  591) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  592) 	void parport_release (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  594) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  595) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  596) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  597) Once a parallel port device has been claimed, it can be released using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  598) ``parport_release``.  It cannot fail, but you should not release a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  599) device that you do not have possession of.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  600) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  601) EXAMPLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  602) ^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  603) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  604) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  605) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  606) 	static size_t write (struct pardevice *dev, const void *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  607) 			size_t len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  608) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  609) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  610) 		written = dev->port->ops->write_ecp_data (dev->port, buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  611) 							len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  612) 		parport_release (dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  613) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  614) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  615) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  616) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  617) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  618) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  619) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  620) change_mode, parport_claim, parport_claim_or_block, parport_yield
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  621) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  622) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  623) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  624) parport_yield, parport_yield_blocking - temporarily release a parallel port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  625) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  626) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  627) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  628) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  629) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  630) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  631) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  632) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  633) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  634) 	int parport_yield (struct pardevice *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  635) 	int parport_yield_blocking (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  636) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  637) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  638) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  639) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  640) When a driver has control of a parallel port, it may allow another
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  641) driver to temporarily ``borrow`` it.  ``parport_yield`` does not block;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  642) ``parport_yield_blocking`` may do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  643) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  644) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  645) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  646) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  647) A return value of zero indicates that the caller still owns the port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  648) and the call did not block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  649) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  650) A positive return value from ``parport_yield_blocking`` indicates that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  651) the caller still owns the port and the call blocked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  652) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  653) A return value of -EAGAIN indicates that the caller no longer owns the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  654) port, and it must be re-claimed before use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  655) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  656) ERRORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  657) ^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  658) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  659) ========= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  660)   -EAGAIN  Ownership of the parallel port was given away.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  661) ========= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  662) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  663) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  664) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  665) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  666) parport_release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  667) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  668) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  669) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  670) parport_wait_peripheral - wait for status lines, up to 35ms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  671) -----------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  672) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  673) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  674) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  675) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  676) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  677) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  678) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  679) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  680) 	int parport_wait_peripheral (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  681) 				     unsigned char mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  682) 				     unsigned char val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  683) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  684) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  685) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  686) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  687) Wait for the status lines in mask to match the values in val.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  688) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  689) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  690) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  691) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  692) ======== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  693)  -EINTR  a signal is pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  694)       0  the status lines in mask have values in val
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  695)       1  timed out while waiting (35ms elapsed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  696) ======== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  697) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  698) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  699) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  700) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  701) parport_poll_peripheral
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  702) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  703) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  704) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  705) parport_poll_peripheral - wait for status lines, in usec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  706) --------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  707) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  708) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  709) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  710) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  711) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  712) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  713) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  714) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  715) 	int parport_poll_peripheral (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  716) 				     unsigned char mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  717) 				     unsigned char val,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  718) 				     int usec);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  719) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  720) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  721) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  722) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  723) Wait for the status lines in mask to match the values in val.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  724) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  725) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  726) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  727) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  728) ======== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  729)  -EINTR  a signal is pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  730)       0  the status lines in mask have values in val
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  731)       1  timed out while waiting (usec microseconds have elapsed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  732) ======== ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  733) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  734) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  735) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  736) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  737) parport_wait_peripheral
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  738) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  739) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  740) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  741) parport_wait_event - wait for an event on a port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  742) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  743) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  744) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  745) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  746) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  747) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  748) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  749) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  750) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  751) 	int parport_wait_event (struct parport *port, signed long timeout)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  752) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  753) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  754) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  755) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  756) Wait for an event (e.g. interrupt) on a port.  The timeout is in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  757) jiffies.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  758) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  759) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  760) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  761) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  762) ======= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  763)       0  success
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  764)      <0  error (exit as soon as possible)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  765)      >0  timed out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  766) ======= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  767) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  768) parport_negotiate - perform IEEE 1284 negotiation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  769) -------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  770) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  771) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  772) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  773) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  774) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  775) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  776) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  777) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  778) 	int parport_negotiate (struct parport *, int mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  779) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  780) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  781) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  782) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  783) Perform IEEE 1284 negotiation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  784) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  785) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  786) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  787) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  788) ======= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  789)      0  handshake OK; IEEE 1284 peripheral and mode available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  790)     -1  handshake failed; peripheral not compliant (or none present)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  791)      1  handshake OK; IEEE 1284 peripheral present but mode not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  792)         available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  793) ======= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  794) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  795) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  796) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  797) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  798) parport_read, parport_write
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  799) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  800) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  801) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  802) parport_read - read data from device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  803) ------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  804) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  805) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  806) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  807) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  808) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  809) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  810) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  811) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  812) 	ssize_t parport_read (struct parport *, void *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  813) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  814) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  815) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  816) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  817) Read data from device in current IEEE 1284 transfer mode.  This only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  818) works for modes that support reverse data transfer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  819) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  820) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  821) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  822) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  823) If negative, an error code; otherwise the number of bytes transferred.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  824) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  825) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  826) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  827) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  828) parport_write, parport_negotiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  829) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  830) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  831) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  832) parport_write - write data to device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  833) ------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  834) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  835) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  836) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  837) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  838) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  839) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  840) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  841) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  842) 	ssize_t parport_write (struct parport *, const void *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  843) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  844) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  845) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  846) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  847) Write data to device in current IEEE 1284 transfer mode.  This only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  848) works for modes that support forward data transfer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  849) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  850) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  851) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  852) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  853) If negative, an error code; otherwise the number of bytes transferred.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  854) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  855) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  856) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  857) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  858) parport_read, parport_negotiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  859) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  860) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  861) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  862) parport_open - register device for particular device number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  863) -----------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  864) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  865) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  866) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  867) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  868) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  869) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  870) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  871) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  872) 	struct pardevice *parport_open (int devnum, const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  873) 				        int (*pf) (void *),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  874) 					void (*kf) (void *),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  875) 					void (*irqf) (int, void *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  876) 						      struct pt_regs *),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  877) 					int flags, void *handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  878) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  879) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  880) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  881) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  882) This is like parport_register_device but takes a device number instead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  883) of a pointer to a struct parport.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  884) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  885) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  886) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  887) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  888) See parport_register_device.  If no device is associated with devnum,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  889) NULL is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  890) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  891) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  892) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  893) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  894) parport_register_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  895) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  896) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  897) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  898) parport_close - unregister device for particular device number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  899) --------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  900) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  901) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  902) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  903) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  904) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  905) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  906) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  907) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  908) 	void parport_close (struct pardevice *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  909) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  910) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  911) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  912) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  913) This is the equivalent of parport_unregister_device for parport_open.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  914) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  915) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  916) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  917) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  918) parport_unregister_device, parport_open
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  919) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  920) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  921) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  922) parport_device_id - obtain IEEE 1284 Device ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  923) ----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  924) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  925) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  926) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  927) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  928) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  929) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  930) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  931) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  932) 	ssize_t parport_device_id (int devnum, char *buffer, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  933) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  934) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  935) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  936) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  937) Obtains the IEEE 1284 Device ID associated with a given device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  938) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  939) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  940) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  941) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  942) If negative, an error code; otherwise, the number of bytes of buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  943) that contain the device ID.  The format of the device ID is as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  944) follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  945) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  946) 	[length][ID]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  947) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  948) The first two bytes indicate the inclusive length of the entire Device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  949) ID, and are in big-endian order.  The ID is a sequence of pairs of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  950) form::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  951) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  952) 	key:value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  953) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  954) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  955) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  956) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  957) Many devices have ill-formed IEEE 1284 Device IDs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  958) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  959) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  960) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  961) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  962) parport_find_class, parport_find_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  963) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  964) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  965) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  966) parport_device_coords - convert device number to device coordinates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  967) -------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  968) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  969) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  970) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  971) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  972) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  973) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  974) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  975) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  976) 	int parport_device_coords (int devnum, int *parport, int *mux,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  977) 				   int *daisy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  978) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  979) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  980) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  981) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  982) Convert between device number (zero-based) and device coordinates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  983) (port, multiplexor, daisy chain address).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  984) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  985) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  986) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  987) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  988) Zero on success, in which case the coordinates are (``*parport``, ``*mux``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  989) ``*daisy``).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  990) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  991) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  992) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  993) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  994) parport_open, parport_device_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  995) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  996) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  997) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  998) parport_find_class - find a device by its class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  999) -----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) 	typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) 		PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) 		PARPORT_CLASS_PRINTER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) 		PARPORT_CLASS_MODEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) 		PARPORT_CLASS_NET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) 		PARPORT_CLASS_HDC,              /* Hard disk controller */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) 		PARPORT_CLASS_PCMCIA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) 		PARPORT_CLASS_MEDIA,            /* Multimedia device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) 		PARPORT_CLASS_FDC,              /* Floppy disk controller */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) 		PARPORT_CLASS_PORTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) 		PARPORT_CLASS_SCANNER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019) 		PARPORT_CLASS_DIGCAM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) 		PARPORT_CLASS_OTHER,            /* Anything else */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) 		PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) 		PARPORT_CLASS_SCSIADAPTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) 	} parport_device_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) 	int parport_find_class (parport_device_class cls, int from);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) Find a device by class.  The search starts from device number from+1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) The device number of the next device in that class, or -1 if no such
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) device exists.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) Example usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) 	int devnum = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) 	while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) 		struct pardevice *dev = parport_open (devnum, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) parport_find_device, parport_open, parport_device_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) parport_find_device - find a device by its class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) 	int parport_find_device (const char *mfg, const char *mdl, int from);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) Find a device by vendor and model.  The search starts from device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) number from+1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) The device number of the next device matching the specifications, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) -1 if no such device exists.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) Example usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) 	int devnum = -1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) 	while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) 		struct pardevice *dev = parport_open (devnum, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) parport_find_class, parport_open, parport_device_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098) parport_set_timeout - set the inactivity timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) ------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) 	long parport_set_timeout (struct pardevice *dev, long inactivity);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) Set the inactivity timeout, in jiffies, for a registered device.  The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) previous timeout is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) The previous timeout, in jiffies.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) Some of the port->ops functions for a parport may take time, owing to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) delays at the peripheral.  After the peripheral has not responded for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) ``inactivity`` jiffies, a timeout will occur and the blocking function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) will return.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) A timeout of 0 jiffies is a special case: the function must do as much
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) as it can without blocking or leaving the hardware in an unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) state.  If port operations are performed from within an interrupt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) handler, for instance, a timeout of 0 jiffies should be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) Once set for a registered device, the timeout will remain at the set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) value until set again.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) port->ops->xxx_read/write_yyy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145) PORT FUNCTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) The functions in the port->ops structure (struct parport_operations)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) are provided by the low-level driver responsible for that port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) port->ops->read_data - read the data register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) ---------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) 		unsigned char (*read_data) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) If port->modes contains the PARPORT_MODE_TRISTATE flag and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) PARPORT_CONTROL_DIRECTION bit in the control register is set, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) returns the value on the data pins.  If port->modes contains the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) PARPORT_MODE_TRISTATE flag and the PARPORT_CONTROL_DIRECTION bit is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) not set, the return value _may_ be the last value written to the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) register.  Otherwise the return value is undefined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) write_data, read_status, write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) port->ops->write_data - write the data register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) -----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) 		void (*write_data) (struct parport *port, unsigned char d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203) Writes to the data register.  May have side-effects (a STROBE pulse,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) for instance).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) read_data, read_status, write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) port->ops->read_status - read the status register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) -------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) 		unsigned char (*read_status) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) Reads from the status register.  This is a bitmask:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) - PARPORT_STATUS_ERROR (printer fault, "nFault")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) - PARPORT_STATUS_SELECT (on-line, "Select")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) - PARPORT_STATUS_PAPEROUT (no paper, "PError")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) - PARPORT_STATUS_ACK (handshake, "nAck")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) - PARPORT_STATUS_BUSY (busy, "Busy")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240) There may be other bits set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) read_data, write_data, write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249) port->ops->read_control - read the control register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) ---------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261) 		unsigned char (*read_control) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268) Returns the last value written to the control register (either from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) write_control or frob_control).  No port access is performed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) read_data, write_data, read_status, write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) port->ops->write_control - write the control register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) -----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) 		void (*write_control) (struct parport *port, unsigned char s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) Writes to the control register. This is a bitmask::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) 				  _______
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) 	- PARPORT_CONTROL_STROBE (nStrobe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) 				  _______
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) 	- PARPORT_CONTROL_AUTOFD (nAutoFd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) 				_____
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) 	- PARPORT_CONTROL_INIT (nInit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) 				  _________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) 	- PARPORT_CONTROL_SELECT (nSelectIn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) read_data, write_data, read_status, frob_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) port->ops->frob_control - write control register bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) -----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) 		unsigned char (*frob_control) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) 					unsigned char mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) 					unsigned char val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336) This is equivalent to reading from the control register, masking out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) the bits in mask, exclusive-or'ing with the bits in val, and writing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) the result to the control register.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) As some ports don't allow reads from the control port, a software copy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) of its contents is maintained, so frob_control is in fact only one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) port access.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) read_data, write_data, read_status, write_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) port->ops->enable_irq - enable interrupt generation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) ---------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) 		void (*enable_irq) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) The parallel port hardware is instructed to generate interrupts at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) appropriate moments, although those moments are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372) architecture-specific.  For the PC architecture, interrupts are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) commonly generated on the rising edge of nAck.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378) disable_irq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) port->ops->disable_irq - disable interrupt generation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383) -----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) 		void (*disable_irq) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) The parallel port hardware is instructed not to generate interrupts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402) The interrupt itself is not masked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407) enable_irq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411) port->ops->data_forward - enable data drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412) ---------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1420) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1421) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1422) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1423) 		void (*data_forward) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1424) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1425) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1427) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1428) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1429) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1430) Enables the data line drivers, for 8-bit host-to-peripheral
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1431) communications.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1432) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1433) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1434) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1436) data_reverse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1440) port->ops->data_reverse - tristate the buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1441) ---------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1442) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1443) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1444) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1446) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1448) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1449) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1450) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1451) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1452) 		void (*data_reverse) (struct parport *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1453) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1454) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1455) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1456) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1457) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1459) Places the data bus in a high impedance state, if port->modes has the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1460) PARPORT_MODE_TRISTATE bit set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1462) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1463) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1465) data_forward
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1467) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1468) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1469) port->ops->epp_write_data - write EPP data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1470) ------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1471) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1472) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1473) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1474) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1475) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1476) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1477) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1478) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1479) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1480) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1481) 		size_t (*epp_write_data) (struct parport *port, const void *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1482) 					size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1483) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1484) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1485) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1486) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1487) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1488) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1489) Writes data in EPP mode, and returns the number of bytes written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1491) The ``flags`` parameter may be one or more of the following,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1492) bitwise-or'ed together:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1493) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1494) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1495) PARPORT_EPP_FAST	Use fast transfers. Some chips provide 16-bit and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1496) 			32-bit registers.  However, if a transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1497) 			times out, the return value may be unreliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1498) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1500) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1501) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1503) epp_read_data, epp_write_addr, epp_read_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1504) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1506) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1507) port->ops->epp_read_data - read EPP data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1508) ----------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1509) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1510) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1511) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1512) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1513) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1514) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1515) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1517) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1518) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1519) 		size_t (*epp_read_data) (struct parport *port, void *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1520) 					size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1521) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1522) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1524) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1525) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1526) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1527) Reads data in EPP mode, and returns the number of bytes read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1528) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1529) The ``flags`` parameter may be one or more of the following,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1530) bitwise-or'ed together:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1531) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1532) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1533) PARPORT_EPP_FAST	Use fast transfers. Some chips provide 16-bit and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1534) 			32-bit registers.  However, if a transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1535) 			times out, the return value may be unreliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1536) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1537) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1538) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1539) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1540) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1541) epp_write_data, epp_write_addr, epp_read_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1542) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1543) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1544) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1545) port->ops->epp_write_addr - write EPP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1546) ---------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1548) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1549) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1551) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1552) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1553) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1554) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1555) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1556) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1557) 		size_t (*epp_write_addr) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1558) 					const void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1559) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1560) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1561) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1562) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1563) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1564) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1565) Writes EPP addresses (8 bits each), and returns the number written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1566) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1567) The ``flags`` parameter may be one or more of the following,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1568) bitwise-or'ed together:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1569) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1570) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1571) PARPORT_EPP_FAST	Use fast transfers. Some chips provide 16-bit and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1572) 			32-bit registers.  However, if a transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1573) 			times out, the return value may be unreliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1574) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1575) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1576) (Does PARPORT_EPP_FAST make sense for this function?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1577) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1578) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1579) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1580) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1581) epp_write_data, epp_read_data, epp_read_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1582) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1583) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1584) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1585) port->ops->epp_read_addr - read EPP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1586) -------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1587) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1588) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1589) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1590) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1591) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1592) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1593) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1594) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1595) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1596) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1597) 		size_t (*epp_read_addr) (struct parport *port, void *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1598) 					size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1599) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1600) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1601) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1602) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1603) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1604) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1605) Reads EPP addresses (8 bits each), and returns the number read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1606) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1607) The ``flags`` parameter may be one or more of the following,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1608) bitwise-or'ed together:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1609) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1610) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1611) PARPORT_EPP_FAST	Use fast transfers. Some chips provide 16-bit and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1612) 			32-bit registers.  However, if a transfer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1613) 			times out, the return value may be unreliable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1614) ======================= =================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1615) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1616) (Does PARPORT_EPP_FAST make sense for this function?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1617) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1618) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1619) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1621) epp_write_data, epp_read_data, epp_write_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1622) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1623) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1624) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1625) port->ops->ecp_write_data - write a block of ECP data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1626) -----------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1627) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1628) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1629) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1630) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1631) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1632) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1633) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1634) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1635) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1636) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1637) 		size_t (*ecp_write_data) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1638) 					const void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1639) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1640) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1641) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1642) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1643) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1644) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1645) Writes a block of ECP data.  The ``flags`` parameter is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1646) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1647) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1648) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1649) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1650) The number of bytes written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1651) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1652) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1653) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1654) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1655) ecp_read_data, ecp_write_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1656) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1657) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1658) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1659) port->ops->ecp_read_data - read a block of ECP data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1660) ---------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1661) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1662) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1663) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1664) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1665) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1666) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1667) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1668) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1669) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1670) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1671) 		size_t (*ecp_read_data) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1672) 					void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1673) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1674) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1675) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1676) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1677) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1678) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1679) Reads a block of ECP data.  The ``flags`` parameter is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1680) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1681) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1682) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1683) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1684) The number of bytes read.  NB. There may be more unread data in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1685) FIFO.  Is there a way of stunning the FIFO to prevent this?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1686) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1687) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1688) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1689) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1690) ecp_write_block, ecp_write_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1691) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1692) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1693) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1694) port->ops->ecp_write_addr - write a block of ECP addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1695) ----------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1696) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1697) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1698) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1699) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1700) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1701) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1702) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1703) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1704) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1705) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1706) 		size_t (*ecp_write_addr) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1707) 					const void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1708) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1709) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1710) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1711) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1712) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1713) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1714) Writes a block of ECP addresses.  The ``flags`` parameter is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1715) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1716) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1717) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1718) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1719) The number of bytes written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1720) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1721) NOTES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1722) ^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1723) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1724) This may use a FIFO, and if so shall not return until the FIFO is empty.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1725) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1726) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1727) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1728) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1729) ecp_read_data, ecp_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1730) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1731) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1732) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1733) port->ops->nibble_read_data - read a block of data in nibble mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1734) -----------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1735) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1736) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1737) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1738) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1739) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1740) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1741) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1742) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1743) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1744) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1745) 		size_t (*nibble_read_data) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1746) 					void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1747) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1748) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1749) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1750) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1751) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1752) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1753) Reads a block of data in nibble mode.  The ``flags`` parameter is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1754) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1755) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1756) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1757) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1758) The number of whole bytes read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1759) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1760) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1761) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1762) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1763) byte_read_data, compat_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1764) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1765) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1766) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1767) port->ops->byte_read_data - read a block of data in byte mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1768) -------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1769) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1770) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1771) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1772) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1773) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1774) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1775) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1776) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1777) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1778) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1779) 		size_t (*byte_read_data) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1780) 					void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1781) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1782) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1783) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1784) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1785) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1786) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1787) Reads a block of data in byte mode.  The ``flags`` parameter is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1788) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1789) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1790) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1791) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1792) The number of bytes read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1793) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1794) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1795) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1796) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1797) nibble_read_data, compat_write_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1798) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1799) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1800) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1801) port->ops->compat_write_data - write a block of data in compatibility mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1802) --------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1803) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1804) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1805) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1806) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1807) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1808) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1809) 	#include <linux/parport.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1810) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1811) 	struct parport_operations {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1812) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1813) 		size_t (*compat_write_data) (struct parport *port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1814) 					const void *buf, size_t len, int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1815) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1816) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1817) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1818) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1819) ^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1820) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1821) Writes a block of data in compatibility mode.  The ``flags`` parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1822) is ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1823) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1824) RETURN VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1825) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1826) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1827) The number of bytes written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1828) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1829) SEE ALSO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1830) ^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1831) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1832) nibble_read_data, byte_read_data