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

Ian Abbott abbotti at mev.co.uk
Mon Aug 4 12:53:09 UTC 2014


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 at visionengravers.com>
> Cc: Ian Abbott <abbotti at mev.co.uk>
> Cc: Greg Kroah-Hartman <gregkh at 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: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the devel mailing list