Re: [PATCH 00/26] staging: comedi: tidy up memory mapped I/O

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

 



On 2014-07-29 23:01, H Hartley Sweeten wrote:
Some of the comedi drivers use memory mapped I/O. Currently all of these
drivers save the ioremap'ed base address in their private data.

Add a new member, 'mmio' to the comedi_device struct so the drivers don't
need to carry it in the private data. For some drivers this allows removing
the private data completely. For many of the others it simplifies the code
a bit since the private data does not need to be accessed in many places.

A note about patch 25/26.

The ii_pci20kc driver is a bit odd. The hardware is actually a memory mapped
ISA card and the driver attaches using the comedi_config utiltiy. Currently
the driver does not ioremap the address passed by the user. The it-options[0]
value is just cast to the void __iomem *. For now the existing code has not
been changed other than using the new member in the comedi_device to hold
the void __iomem *.

Patch 26/26 depends on the following series posted by Ian Abbott:
[PATCH 0/3] staging: comedi: amplc_dio200 detach cleanups

H Hartley Sweeten (26):
   staging: comedi: add an 'mmio' member to comedi_device
   staging: comedi: 8255_pci: use the comedi_device 'mmio' member
   staging: comedi: ni_65xx: use the comedi_device 'mmio' member
   staging: comedi: gsc_hpdi: use the comedi_device 'mmio' member
   staging: comedi: me_daq: use the comedi_device 'mmio' member
   staging: comedi: mf6x4: use the comedi_device 'mmio' member
   staging: comedi: icp_multi: use the comedi_device 'mmio' member
   staging: comedi: addi_apci_3xxx: use the comedi_device 'mmio' member
   staging: comedi: daqboard2000: use the comedi_device 'mmio' member
   staging: comedi: dt3000: use the comedi_device 'mmio' member
   staging: comedi: ni_6527: use the comedi_device 'mmio' member
   staging: comedi: ni_6527: iounmap resource when detached
   staging: comedi: ni_670x: use the comedi_device 'mmio' member
   staging: comedi: cb_pcidas64: use the comedi_device 'mmio' member
   staging: comedi: rtd520: use the comedi_device 'mmio' member
   staging: comedi: s626: use the comedi_device 'mmio' member
   staging: comedi: mite: inline mite_setup()
   staging: comedi: mite: pass comedi_device to mite_setup()
   staging: comedi: mite: use the comedi_device 'mmio' member
   staging: comedi: ni_labpc: pass comedi_device to the I/O callbacks
   staging: comedi: ni_labpc: don't pass dev->iobase to labpc_counter_load()
   staging: comedi: ni_labpc: don't pass dev->iobase to labpc_counter_set_mode()
   staging: comedi: ni_labpc: refactor labpc_8255_mmio()
   staging: comedi: ni_labpc: use the comedi_device 'mmio' member
   staging: comedi: ii_pci20kc: use the comedi_device 'mmio' member
   staging: comedi: amplc_dio200: use the comedi_device 'mmio' member

  drivers/staging/comedi/comedidev.h                 |   1 +
  drivers/staging/comedi/drivers.c                   |   1 +
  drivers/staging/comedi/drivers/8255_pci.c          |  21 +-
  drivers/staging/comedi/drivers/addi_apci_3xxx.c    |  68 +++---
  drivers/staging/comedi/drivers/amplc_dio200.c      |   3 +-
  drivers/staging/comedi/drivers/amplc_dio200.h      |  13 --
  .../staging/comedi/drivers/amplc_dio200_common.c   |  30 ++-
  drivers/staging/comedi/drivers/amplc_dio200_pci.c  |  14 +-
  drivers/staging/comedi/drivers/cb_pcidas64.c       |  41 ++--
  drivers/staging/comedi/drivers/daqboard2000.c      |  76 +++----
  drivers/staging/comedi/drivers/dt3000.c            | 104 ++++-----
  drivers/staging/comedi/drivers/gsc_hpdi.c          |  44 ++--
  drivers/staging/comedi/drivers/icp_multi.c         |  80 ++++---
  drivers/staging/comedi/drivers/ii_pci20kc.c        |  42 ++--
  drivers/staging/comedi/drivers/me_daq.c            |  67 +++---
  drivers/staging/comedi/drivers/mf6x4.c             |  47 ++---
  drivers/staging/comedi/drivers/mite.c              |  27 +--
  drivers/staging/comedi/drivers/mite.h              |  11 +-
  drivers/staging/comedi/drivers/ni_6527.c           |  87 ++++----
  drivers/staging/comedi/drivers/ni_65xx.c           |  80 +++----
  drivers/staging/comedi/drivers/ni_660x.c           |  26 +--
  drivers/staging/comedi/drivers/ni_670x.c           |  28 +--
  drivers/staging/comedi/drivers/ni_labpc.c          | 197 +++++++++--------
  drivers/staging/comedi/drivers/ni_labpc.h          |   6 +-
  drivers/staging/comedi/drivers/ni_labpc_isadma.c   |   2 +-
  drivers/staging/comedi/drivers/ni_labpc_pci.c      |  11 +-
  drivers/staging/comedi/drivers/ni_mio_common.c     |  36 ++--
  drivers/staging/comedi/drivers/ni_pcidio.c         | 232 +++++++++------------
  drivers/staging/comedi/drivers/ni_pcimio.c         |   8 +-
  drivers/staging/comedi/drivers/rtd520.c            | 195 ++++++++---------
  drivers/staging/comedi/drivers/s626.c              | 194 ++++++++---------
  31 files changed, 766 insertions(+), 1026 deletions(-)


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




[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