[Originally posted 2013-06-19. Reposting to new driverdev-devel list.] On 2013-06-18 21:20, H Hartley Sweeten wrote:
Clean up and simplify this legacy driver. The async command support (interrupts) still needs a bit of work. The command support is a bit goofy and does not really follow the comedi API. This will be addressed.
Command support for reading DIO subdevices is a bit goofy. All of them pack the single-bit channels somehow. Some drivers just return the data from all the channels, where bit 'n' corresponds to the data from channel 'n'. Other drivers (like this one) set bit 'n' to the data read from channel 'chanlist[n]'. That's probably closer to the spirit of the handling of the scan data for AI subdevices in that the samples are in the order specified by the chanlist.
H Hartley Sweeten (21): staging: comedi: pcmuio: remove unused {lock,unlock}_port() staging: comedi: pcmuio: tidy up the register map defines staging: comedi: pcmuio: tidy up switch_page() staging: comedi: pcmuio: introduce pcmuio_write() staging: comedi: pcmuio: remove unused private data variables staging: comedi: pcmuio: remove 'first_chan' staging: comedi: pcmuio: remove 'num_asic_chans' staging: comedi: pcmuio: remove 'asic_chan' staging: comedi: pcmuio: kzalloc'ed data does not need cleared staging: comedi: pcmuio: remove unused boardinfo staging: comedi: pcmuio: simplify 'n_subdevs' and 's->n_chan' staging: comedi: pcmuio: remove 'iobase' from private data staging: comedi: pcmuio: remove 'iobases' from subdevice private data staging: comedi: pcmuio: simplify interrupt subdevice init staging: comedi: pcmuio: introduce pcmuio_read() staging: comedi: pcmuio: cleanup DIO subdevice (*insn_{bits,config}) staging: comedi: pcmuio: cleanup remaining #define's staging: comedi: pcmuio: use preferred form for passing the size of a struct staging: comedi: pcmuio: remove dev_dbg() noise during attach staging: comedi: pcmuio: return 0 for successful attach staging: comedi: pcmuio: fix namespace for all private functions drivers/staging/comedi/drivers/pcmuio.c | 536 +++++++++----------------------- 1 file changed, 154 insertions(+), 382 deletions(-)
I managed to understand it all eventually! Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx> -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel