1. 26 8月, 2016 2 次提交
  2. 05 5月, 2016 2 次提交
    • P
      i2c: mux: relax locking of the top i2c adapter during mux-locked muxing · 6ef91fcc
      Peter Rosin 提交于
      With a i2c topology like the following
      
                             GPIO ---|  ------ BAT1
                              |      v /
         I2C  -----+----------+---- MUX
                   |                   \
                 EEPROM                 ------ BAT2
      
      there is a locking problem with the GPIO controller since it is a client
      on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1)
      will lock the whole i2c bus prior to attempting to switch the mux to the
      correct i2c segment. In the above case, the GPIO device is an I/O expander
      with an i2c interface, and since the GPIO subsystem knows nothing (and
      rightfully so) about the lockless needs of the i2c mux code, this results
      in a deadlock when the GPIO driver issues i2c transfers to modify the
      mux.
      
      So, observing that while it is needed to have the i2c bus locked during the
      actual MUX update in order to avoid random garbage on the slave side, it
      is not strictly a must to have it locked over the whole sequence of a full
      select-transfer-deselect mux client operation. The mux itself needs to be
      locked, so transfers to clients behind the mux are serialized, and the mux
      needs to be stable during all i2c traffic (otherwise individual mux slave
      segments might see garbage, or worse).
      
      Introduce this new locking concept as "mux-locked" muxes, and call the
      pre-existing mux locking scheme "parent-locked".
      
      Modify the i2c mux locking so that muxes that are "mux-locked" locks only
      the muxes on the parent adapter instead of the whole i2c bus when there is
      a transfer to the slave side of the mux. This lock serializes transfers to
      the slave side of the muxes on the parent adapter.
      
      Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved
      gpio/pinctrl devices have a parent that is an i2c adapter in the same
      adapter tree that is muxed, and request a "mux-locked mux" if that is the
      case.
      
      Modify the select-transfer-deselect code for "mux-locked" muxes so
      that each of the select-transfer-deselect ops locks the mux parent
      adapter individually.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      6ef91fcc
    • P
      i2c: muxes always lock the parent adapter · fa96f0cb
      Peter Rosin 提交于
      Instead of checking for i2c parent adapters for every lock/unlock, simply
      override the locking for muxes to always lock/unlock the parent adapter
      directly.
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      fa96f0cb
  3. 22 4月, 2016 2 次提交
  4. 21 2月, 2016 1 次提交
  5. 25 10月, 2015 1 次提交
    • D
      i2c: add ACPI support for I2C mux ports · 8eb5c87a
      Dustin Byford 提交于
      Although I2C mux devices are easily enumerated using ACPI (_HID/_CID or
      device property compatible string match), enumerating I2C client devices
      connected through an I2C mux needs a little extra work.
      
      This change implements a method for describing an I2C device hierarchy that
      includes mux devices by using an ACPI Device() for each mux channel along
      with an _ADR to set the channel number for the device.  See
      Documentation/acpi/i2c-muxes.txt for a simple example.
      
      To make this work the ismt, i801, and designware pci/platform devs now
      share an ACPI companion with their I2C adapter dev similar to how it's done
      in OF.  This is done on the assumption that power management functions will
      not be called directly on the I2C dev that is sharing the ACPI node.
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NDustin Byford <dustin@cumulusnetworks.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      8eb5c87a
  6. 17 6月, 2015 2 次提交
  7. 24 4月, 2015 1 次提交
  8. 18 11月, 2014 2 次提交
  9. 13 12月, 2013 1 次提交
    • E
      i2c: mux: Inherit retry count and timeout from parent for muxed bus · 2212a852
      Elie De Brauwer 提交于
      If a muxed i2c bus gets created the default retry count and
      timeout of the muxed bus is zero. Hence it it possible that you
      end up with a situation where the parent controller sets a default
      retry count and timeout which gets applied and used while the muxed
      bus (using the same controller) has a default retry count of zero
      and a default timeout of 1s (set in i2c_add_adapter()). This can be
      solved by initializing the retry count and timeout of the muxed
      bus with the values used by the the parent at creation time.
      Signed-off-by: NElie De Brauwer <eliedebrauwer@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      2212a852
  10. 23 8月, 2013 1 次提交
    • W
      i2c: move OF helpers into the core · 687b81d0
      Wolfram Sang 提交于
      I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
      that it is much cleaner to have this in the core. This also removes a
      circular dependency between the helpers and the core, and so we can
      finally register child nodes in the core instead of doing this manually
      in each driver. So, fix the drivers and documentation, too.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      687b81d0
  11. 02 4月, 2013 2 次提交
  12. 06 10月, 2012 1 次提交
    • J
      i2c-mux: Add support for device auto-detection · eee543e8
      Jean Delvare 提交于
      Let I2C bus segments behind multiplexers have a class. This allows for
      device auto-detection on these segments. As long as parent segments
      don't share the same class, it should be fine.
      
      I implemented support in drivers i2c-mux-gpio and i2c-mux-pca954x. I
      left i2c-mux-pca9541 and i2c-mux-pinctrl alone for the moment as I
      don't know if this feature makes sense for the use cases of these
      drivers.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Peter Korsgaard <peter.korsgaard@barco.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Michael Lawnick <ml.lawnick@gmx.de>
      Cc: Rodolfo Giometti <giometti@linux.it>
      eee543e8
  13. 12 5月, 2012 2 次提交
  14. 16 11月, 2010 1 次提交
  15. 12 8月, 2010 1 次提交