From 93737471b6d64faeb466e3529e9e162211076c27 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 9 Sep 2000 22:00:54 +0000 Subject: [PATCH] patch from anders re 8255 --- comedi/drivers/daqboard2000.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/comedi/drivers/daqboard2000.c b/comedi/drivers/daqboard2000.c index 8d782b48..58031871 100644 --- a/comedi/drivers/daqboard2000.c +++ b/comedi/drivers/daqboard2000.c @@ -642,6 +642,22 @@ The test command, REMOVE!!: rmmod daqboard2000 ; rmmod comedi; make install ; modprobe daqboard2000; /usr/sbin/comedi_config /dev/comedi0 daqboard/2000 ; tail -40 /var/log/messages */ +static int daqboard2000_8255_cb(int dir, int port, int data, void *arg) +{ + int result = 0; + int iobase=(int)arg; + if(dir){ + *((u16*)(iobase+port*2)) = data; + result = 0; + }else{ + result = *((u16*)(iobase+port*2)); + } +/* printk("daqboard2000_8255_cb %x %d %d %2.2x -> %2.2x\n", + arg, dir, port, data, result); +*/ + return result; +} + static int daqboard2000_attach(comedi_device *dev, comedi_devconfig *it) { int result = 0; @@ -758,7 +774,8 @@ static int daqboard2000_attach(comedi_device *dev, comedi_devconfig *it) s->range_table = &range_daqboard2000_ao; s = dev->subdevices + 2; - result = subdev_8255_init(dev,s,NULL,(void *)(dev->iobase+0x40)); + result = subdev_8255_init(dev,s,daqboard2000_8255_cb, + (void *)(dev->iobase+0x40)); } printk("\n"); -- 2.26.2