1. 17 Mar, 2013 27 commits
  2. 16 Mar, 2013 5 commits
  3. 15 Mar, 2013 8 commits
    • Ian Abbott's avatar
      staging: comedi: ni_labpc: fix common detach · a1459289
      Ian Abbott authored
      `labpc_common_detach()` calls `comedi_pci_disable()` unconditionally.
      That's okay for PCI devices and harmless for ISA devices (as the
      `hw_dev` member will be NULL so `comedi_to_pci_dev()` will return NULL
      and `comedi_pci_disable()` checks for that), but it is disastrous for
      PCMCIA devices.  Those are managed by the "ni_labpc_cs" module but it
      calls this `labpc_common_detach()` and the `hw_dev` member will be
      pointing to the `struct device` embedded in a `struct pcmcia_device` in
      that case.  That's enough to confuse `comedi_pci_disable()` into
      thinking it's a valid PCI device to be disabled.
      
      Use the private board information (`thisboard`) to make sure it is a PCI
      device before calling `comedi_pci_disable()`.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1459289
    • Ian Abbott's avatar
      staging: comedi: remove unneeded settings of `dev->iobase` · 84b44d08
      Ian Abbott authored
      Some PCI drivers use the "spare" `iobase` member of `struct
      comedi_device` as a flag to indicate that the call to
      `comedi_pci_enable()` was successful.  This is no longer necessary now
      that `comedi_pci_enable()` and `comedi_pci_disable()` use the
      `ioenabled` member of `struct comedi_device` themselves to keep track of
      what needs to be done.
      
      Remove the unnecessary assignments to the `iobase` member in the
      relevant drivers.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84b44d08
    • Ian Abbott's avatar
      staging: comedi: add 'ioenabled' flag to device · 00ca6884
      Ian Abbott authored
      Add 1-bit bit-field member `ioenabled` of type `bool` to `struct
      comedi_device`.  Use this to keep track of whether a PCI device and its
      BARs have been successfully enabled by `comedi_pci_enable()`.  This
      avoids overloading the meaning of the `iobase` member which is used by
      several drivers to hold the base port I/O address of a board's "main"
      registers.  Other drivers using MMIO use `iobase` as a flag to indicate
      that the preceding call to `comedi_pci_enable()` was successful.  They
      no longer need to do that.
      
      The name `ioenabled` is intended to be PCI-agnostic so it can be used
      for similar purposes by non-PCI drivers.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      00ca6884
    • Ian Abbott's avatar
      staging: comedi: make 'in_request_module' a bool bit-field · 13f12b5a
      Ian Abbott authored
      Change the `in_request_module` member of `struct comedi_device` to a
      1-bit bit-field of type `bool` and move it into a suitable hole in the
      data type to save a few bytes.  Change the assigned values to `true` and
      `false`.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13f12b5a
    • Ian Abbott's avatar
      staging: comedi: make 'dev->attached' a bool bit-field · a7401cdd
      Ian Abbott authored
      Change the `attached` member of `struct comedi_device` to a 1-bit
      bit-field of type `bool`.  Change assigned values to `true` and `false`
      and replace or remove comparison operations with simple boolean tests.
      
      We'll put some extra bit-fields in the gap later to save space.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7401cdd
    • Ian Abbott's avatar
      staging: comedi: ni_660x: support NI PXI-6624 · 8bdfefb7
      Ian Abbott authored
      Florent Boudet reports success using a NI PXI-6624 board with a
      trivially modified version of the "ni_660x" driver (addition to the PCI
      device ID table and comedi board table).  He did this with the
      out-of-tree Comedi drivers at www.comedi.org, but it applies equally to
      the in-tree "staging" drivers.
      
      He reports the PXI-6624 is basically the same as the PXI-6602, but with
      isolated channels and external voltage source.
      
      Add support for NI PXI-6224 to the "ni_660x" driver.
      
      (Maybe the driver should be renamed to "ni_66xx"?)
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Cc: Florent Boudet <flboudet@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8bdfefb7
    • Ian Abbott's avatar
      staging: comedi: ni_660x: reformat driver description comment · 71d92fac
      Ian Abbott authored
      Convert to preferred block comment style.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71d92fac
    • Ian Abbott's avatar
      staging: comedi: adv_pci_dio: restore PCI-1753E support · 87f6991b
      Ian Abbott authored
      Back in the old days (before "staging") when Comedi only supported
      manual configuration of devices, the "adv_pci_dio" driver supported both
      PCI-1753 ("pci1753") and PCI-1753E ("pci1753e").  In actual fact,
      "pci1753e" is just a PCI-1753 connected by a ribbon cable to a PCI-1753E
      expansion card, which is plugged into a PCI slot but is not a PCI device
      itself.  Now that the "adv_pci_dio" driver only supports automatic
      configuration of devices and the main "comedi" module no longer allows
      auto-configuration to be disabled, a PCI-1753 with a PCI-1753E expansion
      card is always treated as an unexpanded PCI-1753 ("pci1753") and there
      is no way to override it.  (Recently, an undefined macro
      `USE_PCI1753E_BOARDINFO` was used to make the driver switch to
      supporting "pci1753e" instead of "pci1753", but this is less than
      ideal.)
      
      Advantech has their own Linux (non-Comedi) driver for the PCI-1753 which
      detects whether the PCI-1753E expansion card is connected to the
      PCI-1753 by fiddling with a register at offset 53 from the main
      registers base.
      
      Use Advantech's test in our "adv_pci_dio" driver.  If the board appears
      to be a PCI-1753 ("pci1753"), check if the expansion card appears to be
      present, and if so, treat the device as a PCI-1753 plus PCI-1753E
      expansion card ("pci1753e").
      
      Also, get rid of `enum dio_boardid` (`BOARD_...` enum values) which was
      added recently and just use the older `TYPE_...` enum values from `enum
      hw_cards_id` instead as the mapping is now 1-to-1.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87f6991b