27 #include <linux/kernel.h>
28 #include <linux/module.h>
31 #include <linux/parport.h>
32 #include <linux/i2c.h>
35 #include <linux/slab.h>
36 #include <linux/list.h>
56 static void port_write_data(
struct parport *
p,
unsigned char d)
61 static void port_write_control(
struct parport *
p,
unsigned char d)
66 static unsigned char port_read_data(
struct parport *
p)
71 static unsigned char port_read_status(
struct parport *
p)
76 static unsigned char port_read_control(
struct parport *
p)
107 static inline int line_get(
struct parport *data,
118 static void parport_setscl(
void *data,
int state)
123 static void parport_setsda(
void *data,
int state)
128 static int parport_getscl(
void *data)
133 static int parport_getsda(
void *data)
144 .setsda = parport_setsda,
145 .setscl = parport_setscl,
146 .getsda = parport_getsda,
147 .getscl = parport_getscl,
154 static void i2c_parport_irq(
void *data)
164 "SMBus alert received but no ARA client!\n");
167 static void i2c_parport_attach(
struct parport *
port)
172 if (adapter ==
NULL) {
181 if (!adapter->
pdev) {
182 printk(
KERN_ERR "i2c-parport: Unable to register with parport\n");
190 sizeof(adapter->
adapter.name));
207 parport_setsda(port, 1);
208 parport_setscl(port, 1);
246 static void i2c_parport_detach(
struct parport *port)
253 if (adapter->
pdev->port == port) {
274 .name =
"i2c-parport",
275 .attach = i2c_parport_attach,
276 .detach = i2c_parport_detach,
281 static int __init i2c_parport_init(
void)
296 static void __exit i2c_parport_exit(
void)