summaryrefslogtreecommitdiffstats
path: root/shortprint/shortprint.h
blob: 15310255dae9a001d7630f3aa231f8bfd5a587dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Useful info describing the parallel port device.
 *
 * Copyright (C) 2001 Alessandro Rubini and Jonathan Corbet
 * Copyright (C) 2001 O'Reilly & Associates
 *
 * The source code in this file can be freely used, adapted,
 * and redistributed in source or binary form, so long as an
 * acknowledgment appears in derived source files.  The citation
 * should list that the code comes from the book "Linux Device
 * Drivers" by Alessandro Rubini and Jonathan Corbet, published
 * by O'Reilly & Associates.   No warranty is attached;
 * we cannot take responsibility for errors or fitness for use.
 *
 */

/*
 * Register offsets
 */
#define SP_DATA    0x00
#define SP_STATUS  0x01
#define SP_CONTROL 0x02
#define SP_NPORTS     3

/*
 * Status register bits.
 */
#define SP_SR_BUSY 	0x80
#define SP_SR_ACK	0x40
#define SP_SR_PAPER	0x20
#define SP_SR_ONLINE	0x10
#define SP_SR_ERR	0x08

/*
 * Control register.
 */
#define SP_CR_IRQ	0x10
#define SP_CR_SELECT	0x08
#define SP_CR_INIT	0x04
#define SP_CR_AUTOLF	0x02
#define SP_CR_STROBE	0x01

/*
 * Minimum space before waking up a writer.
 */
#define SP_MIN_SPACE	PAGE_SIZE/2