1. 10 6月, 2016 1 次提交
  2. 05 5月, 2016 1 次提交
    • 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
  3. 25 4月, 2016 1 次提交
  4. 22 4月, 2016 6 次提交
  5. 01 4月, 2016 1 次提交
  6. 13 2月, 2016 1 次提交
  7. 03 9月, 2015 3 次提交
  8. 01 9月, 2015 1 次提交
  9. 24 8月, 2015 1 次提交
  10. 10 8月, 2015 2 次提交
  11. 17 6月, 2015 1 次提交
  12. 12 5月, 2015 1 次提交
  13. 04 4月, 2015 1 次提交
  14. 09 3月, 2015 1 次提交
  15. 24 1月, 2015 1 次提交
  16. 20 10月, 2014 1 次提交
  17. 02 8月, 2014 1 次提交
  18. 27 6月, 2014 1 次提交
    • L
      i2c: mux: pca954x: fix dependencies · e556756a
      Linus Walleij 提交于
      This driver causes the following randconfig build error:
      
      drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
      drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
      of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
        gpio = devm_gpiod_get(&client->dev, "reset");
        ^
      drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
      pointer from integer without a cast [enabled by default]
        gpio = devm_gpiod_get(&client->dev, "reset");
             ^
      drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
      of function ‘gpiod_direction_output’
      [-Werror=implicit-function-declaration]
         gpiod_direction_output(gpio, 0);
         ^
      cc1: some warnings being treated as errors
      make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
      
      This is because it is getting compiled without gpiolib, so
      introduce an explicit dependency.
      Reported-by: NJim Davis <jim.epost@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      e556756a
  19. 05 6月, 2014 1 次提交
    • L
      i2c: pca954x: Fix compilation without CONFIG_GPIOLIB · 642653d1
      Laurent Pinchart 提交于
      The pca954x driver recently switched to the GPIO descriptor API without
      including the correct <linux/gpio/consumer.h> header. This breaks
      compilation without CONFIG_GPIOLIB.
      
      drivers/i2c/muxes/i2c-mux-pca954x.c: In function ‘pca954x_probe’:
      drivers/i2c/muxes/i2c-mux-pca954x.c:204:2: error: implicit declaration
      of function ‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
        gpio = devm_gpiod_get(&client->dev, "reset");
        ^
      drivers/i2c/muxes/i2c-mux-pca954x.c:204:7: warning: assignment makes
      pointer from integer without a cast [enabled by default]
        gpio = devm_gpiod_get(&client->dev, "reset");
             ^
      drivers/i2c/muxes/i2c-mux-pca954x.c:206:3: error: implicit declaration
      of function ‘gpiod_direction_output’
      [-Werror=implicit-function-declaration]
         gpiod_direction_output(gpio, 0);
         ^
      cc1: some warnings being treated as errors
      make[3]: *** [drivers/i2c/muxes/i2c-mux-pca954x.o] Error 1
      
      Fix it by including the right header.
      Reported-by: NJim Davis <jim.epost@gmail.com>
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      642653d1
  20. 03 6月, 2014 1 次提交
  21. 30 1月, 2014 1 次提交
  22. 25 1月, 2014 1 次提交
  23. 04 1月, 2014 2 次提交
  24. 03 1月, 2014 1 次提交
  25. 31 10月, 2013 2 次提交
    • I
      i2c: mux: gpio: use reg value for i2c_add_mux_adapter · 8c0ec250
      Ionut Nicu 提交于
      The i2c-mux driver requires that the chan_id parameter
      passed to the i2c_add_mux_adapter() function is equal
      to the reg value for that adapter:
      
      for_each_child_of_node(mux_dev->of_node, child) {
      	ret = of_property_read_u32(child, "reg", &reg);
      	if (ret)
      		continue;
      	if (chan_id == reg) {
      		priv->adap.dev.of_node = child;
      		break;
      	}
      }
      
      The i2c-mux-gpio driver uses an internal logical index
      for chan_id when calling i2c_add_mux_adapter() instead
      of using the reg value.
      
      Because of this, there will problems in selecting the
      right adapter when the i2c-mux-gpio's index into
      mux->data.values doesn't match the reg value.
      
      An example of such a case:
      
      mux->data.values = { 1, 0 }
      
      For chan_id = 0, i2c-mux will bind the adapter to the
      of_node with reg = <0>, but when it will call the
      select() callback with chan_id set to 0, the i2c-mux-gpio
      will use it as an index into mux->data.values and it will
      actually select the bus with reg = <1>.
      Signed-off-by: NIonut Nicu <ioan.nicu.ext@nsn.com>
      Acked-by: NAlexander Sverdlin <alexander.sverdlin@nsn.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      8c0ec250
    • I
      i2c: mux: gpio: use gpio_set_value_cansleep() · 250ad590
      Ionut Nicu 提交于
      Some gpio chips may have get/set operations that
      can sleep. gpio_set_value() only works for chips
      which do not sleep, for the others we will get a
      kernel warning. Using gpio_set_value_cansleep()
      will work for both chips that do sleep and those
      who don't.
      Signed-off-by: NIonut Nicu <ioan.nicu.ext@nsn.com>
      Acked-by: NPeter Korsgaard <peter.korsgaard@barco.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      250ad590
  26. 30 10月, 2013 1 次提交
  27. 10 10月, 2013 4 次提交