On 2014-08-01 22:18, H Hartley Sweeten wrote:
The drivers that use this module with memory mapped io all have the
ioremap'ed base address stored in the comedi_device 'mmio' member.

Modify subdev_8255_io() to handle the memory mapped io. This allows
removing the private callbacks from some of the drivers.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>

What if a driver sets both dev->mmio and dev->iobase, but has the 8255 in the dev->iobase region? Is it reasonable for the driver to "know" that dev->mmio would be used by the 8255 subdevice driver and so it would need to implement a callback for an 8255 in the dev->iobase region?

I think the 8255 code needs to be explicitly told whether to use dev->iobase or dev->mmio if it handles both. That could be done either by adding a parameter to subdev_8255_init() (and subdev_8255_init_irq(), though that could be removed as interrupt support is incomplete and nothing has ever used it), or by exporting a separate init function (e.g. subdev_8255_mm_init()) to mark it as using dev->mmio.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to