31 #ifndef __DRIVERS_PARPORT_PARPORT_GSC_H
32 #define __DRIVERS_PARPORT_PARPORT_GSC_H
41 #define parport_readb gsc_readb
42 #define parport_writeb gsc_writeb
47 return gsc_readb(port);
52 gsc_writeb(value,port);
59 #define EPPDATA(p) ((p)->base + 0x4)
60 #define EPPADDR(p) ((p)->base + 0x3)
61 #define CONTROL(p) ((p)->base + 0x2)
62 #define STATUS(p) ((p)->base + 0x1)
63 #define DATA(p) ((p)->base + 0x0)
85 static inline void parport_gsc_write_data(
struct parport *
p,
unsigned char d)
93 static inline unsigned char parport_gsc_read_data(
struct parport *
p)
105 static inline unsigned char __parport_gsc_frob_control(
struct parport *p,
110 unsigned char ctr = priv->
ctr;
113 "__parport_gsc_frob_control(%02x,%02x): %02x -> %02x\n",
114 mask, val, ctr, ((ctr & ~mask) ^ val) & priv->
ctr_writable);
116 ctr = (ctr & ~mask) ^ val;
123 static inline void parport_gsc_data_reverse(
struct parport *p)
125 __parport_gsc_frob_control (p, 0x20, 0x20);
128 static inline void parport_gsc_data_forward(
struct parport *p)
130 __parport_gsc_frob_control (p, 0x20, 0x00);
133 static inline void parport_gsc_write_control(
struct parport *p,
145 parport_gsc_data_reverse (p);
148 __parport_gsc_frob_control (p, wm, d & wm);
151 static inline unsigned char parport_gsc_read_control(
struct parport *p)
158 return priv->
ctr & rm;
161 static inline unsigned char parport_gsc_frob_control(
struct parport *p,
174 (val & 0x20) ?
"reverse" :
"forward");
176 parport_gsc_data_reverse (p);
178 parport_gsc_data_forward (p);
185 return __parport_gsc_frob_control (p, mask, val);
188 static inline unsigned char parport_gsc_read_status(
struct parport *p)
193 static inline void parport_gsc_disable_irq(
struct parport *p)
195 __parport_gsc_frob_control (p, 0x10, 0x00);
198 static inline void parport_gsc_enable_irq(
struct parport *p)
200 __parport_gsc_frob_control (p, 0x10, 0x10);