Re: [PATCH 13/15] staging: comedi: 8255: make default (*io) function handle memory mapped io

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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: <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




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux