xref: /openbmc/linux/include/uapi/linux/parport.h (revision 607ca46e)
1607ca46eSDavid Howells /*
2607ca46eSDavid Howells  * Any part of this program may be used in documents licensed under
3607ca46eSDavid Howells  * the GNU Free Documentation License, Version 1.1 or any later version
4607ca46eSDavid Howells  * published by the Free Software Foundation.
5607ca46eSDavid Howells  */
6607ca46eSDavid Howells 
7607ca46eSDavid Howells #ifndef _UAPI_PARPORT_H_
8607ca46eSDavid Howells #define _UAPI_PARPORT_H_
9607ca46eSDavid Howells 
10607ca46eSDavid Howells /* Start off with user-visible constants */
11607ca46eSDavid Howells 
12607ca46eSDavid Howells /* Maximum of 16 ports per machine */
13607ca46eSDavid Howells #define PARPORT_MAX  16
14607ca46eSDavid Howells 
15607ca46eSDavid Howells /* Magic numbers */
16607ca46eSDavid Howells #define PARPORT_IRQ_NONE  -1
17607ca46eSDavid Howells #define PARPORT_DMA_NONE  -1
18607ca46eSDavid Howells #define PARPORT_IRQ_AUTO  -2
19607ca46eSDavid Howells #define PARPORT_DMA_AUTO  -2
20607ca46eSDavid Howells #define PARPORT_DMA_NOFIFO -3
21607ca46eSDavid Howells #define PARPORT_DISABLE   -2
22607ca46eSDavid Howells #define PARPORT_IRQ_PROBEONLY -3
23607ca46eSDavid Howells #define PARPORT_IOHI_AUTO -1
24607ca46eSDavid Howells 
25607ca46eSDavid Howells #define PARPORT_CONTROL_STROBE    0x1
26607ca46eSDavid Howells #define PARPORT_CONTROL_AUTOFD    0x2
27607ca46eSDavid Howells #define PARPORT_CONTROL_INIT      0x4
28607ca46eSDavid Howells #define PARPORT_CONTROL_SELECT    0x8
29607ca46eSDavid Howells 
30607ca46eSDavid Howells #define PARPORT_STATUS_ERROR      0x8
31607ca46eSDavid Howells #define PARPORT_STATUS_SELECT     0x10
32607ca46eSDavid Howells #define PARPORT_STATUS_PAPEROUT   0x20
33607ca46eSDavid Howells #define PARPORT_STATUS_ACK        0x40
34607ca46eSDavid Howells #define PARPORT_STATUS_BUSY       0x80
35607ca46eSDavid Howells 
36607ca46eSDavid Howells /* Type classes for Plug-and-Play probe.  */
37607ca46eSDavid Howells typedef enum {
38607ca46eSDavid Howells 	PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
39607ca46eSDavid Howells 	PARPORT_CLASS_PRINTER,
40607ca46eSDavid Howells 	PARPORT_CLASS_MODEM,
41607ca46eSDavid Howells 	PARPORT_CLASS_NET,
42607ca46eSDavid Howells 	PARPORT_CLASS_HDC,              /* Hard disk controller */
43607ca46eSDavid Howells 	PARPORT_CLASS_PCMCIA,
44607ca46eSDavid Howells 	PARPORT_CLASS_MEDIA,            /* Multimedia device */
45607ca46eSDavid Howells 	PARPORT_CLASS_FDC,              /* Floppy disk controller */
46607ca46eSDavid Howells 	PARPORT_CLASS_PORTS,
47607ca46eSDavid Howells 	PARPORT_CLASS_SCANNER,
48607ca46eSDavid Howells 	PARPORT_CLASS_DIGCAM,
49607ca46eSDavid Howells 	PARPORT_CLASS_OTHER,            /* Anything else */
50607ca46eSDavid Howells 	PARPORT_CLASS_UNSPEC,           /* No CLS field in ID */
51607ca46eSDavid Howells 	PARPORT_CLASS_SCSIADAPTER
52607ca46eSDavid Howells } parport_device_class;
53607ca46eSDavid Howells 
54607ca46eSDavid Howells /* The "modes" entry in parport is a bit field representing the
55607ca46eSDavid Howells    capabilities of the hardware. */
56607ca46eSDavid Howells #define PARPORT_MODE_PCSPP	(1<<0) /* IBM PC registers available. */
57607ca46eSDavid Howells #define PARPORT_MODE_TRISTATE	(1<<1) /* Can tristate. */
58607ca46eSDavid Howells #define PARPORT_MODE_EPP	(1<<2) /* Hardware EPP. */
59607ca46eSDavid Howells #define PARPORT_MODE_ECP	(1<<3) /* Hardware ECP. */
60607ca46eSDavid Howells #define PARPORT_MODE_COMPAT	(1<<4) /* Hardware 'printer protocol'. */
61607ca46eSDavid Howells #define PARPORT_MODE_DMA	(1<<5) /* Hardware can DMA. */
62607ca46eSDavid Howells #define PARPORT_MODE_SAFEININT	(1<<6) /* SPP registers accessible in IRQ. */
63607ca46eSDavid Howells 
64607ca46eSDavid Howells /* IEEE1284 modes:
65607ca46eSDavid Howells    Nibble mode, byte mode, ECP, ECPRLE and EPP are their own
66607ca46eSDavid Howells    'extensibility request' values.  Others are special.
67607ca46eSDavid Howells    'Real' ECP modes must have the IEEE1284_MODE_ECP bit set.  */
68607ca46eSDavid Howells #define IEEE1284_MODE_NIBBLE             0
69607ca46eSDavid Howells #define IEEE1284_MODE_BYTE              (1<<0)
70607ca46eSDavid Howells #define IEEE1284_MODE_COMPAT            (1<<8)
71607ca46eSDavid Howells #define IEEE1284_MODE_BECP              (1<<9) /* Bounded ECP mode */
72607ca46eSDavid Howells #define IEEE1284_MODE_ECP               (1<<4)
73607ca46eSDavid Howells #define IEEE1284_MODE_ECPRLE            (IEEE1284_MODE_ECP | (1<<5))
74607ca46eSDavid Howells #define IEEE1284_MODE_ECPSWE            (1<<10) /* Software-emulated */
75607ca46eSDavid Howells #define IEEE1284_MODE_EPP               (1<<6)
76607ca46eSDavid Howells #define IEEE1284_MODE_EPPSL             (1<<11) /* EPP 1.7 */
77607ca46eSDavid Howells #define IEEE1284_MODE_EPPSWE            (1<<12) /* Software-emulated */
78607ca46eSDavid Howells #define IEEE1284_DEVICEID               (1<<2)  /* This is a flag */
79607ca46eSDavid Howells #define IEEE1284_EXT_LINK               (1<<14) /* This flag causes the
80607ca46eSDavid Howells 						 * extensibility link to
81607ca46eSDavid Howells 						 * be requested, using
82607ca46eSDavid Howells 						 * bits 0-6. */
83607ca46eSDavid Howells 
84607ca46eSDavid Howells /* For the benefit of parport_read/write, you can use these with
85607ca46eSDavid Howells  * parport_negotiate to use address operations.  They have no effect
86607ca46eSDavid Howells  * other than to make parport_read/write use address transfers. */
87607ca46eSDavid Howells #define IEEE1284_ADDR			(1<<13)	/* This is a flag */
88607ca46eSDavid Howells #define IEEE1284_DATA			 0	/* So is this */
89607ca46eSDavid Howells 
90607ca46eSDavid Howells /* Flags for block transfer operations. */
91607ca46eSDavid Howells #define PARPORT_EPP_FAST		(1<<0) /* Unreliable counts. */
92607ca46eSDavid Howells #define PARPORT_W91284PIC		(1<<1) /* have a Warp9 w91284pic in the device */
93607ca46eSDavid Howells 
94607ca46eSDavid Howells /* The rest is for the kernel only */
95607ca46eSDavid Howells #endif /* _UAPI_PARPORT_H_ */
96