1. 28 Aug, 2019 2 commits
  2. 07 Jun, 2019 1 commit
    • H. Nikolaus Schaller's avatar
      gpio: pca953x: hack to fix 24 bit gpio expanders · 3b00691c
      H. Nikolaus Schaller authored
      24 bit expanders use REG_ADDR_AI in combination with register addressing. This
      conflicts with regmap which takes this bit as part of the register number,
      i.e. a second cache entry is defined for accessed with REG_ADDR_AI being
      set although on the chip it is the same register as with REG_ADDR_AI being
      The problem was introduced by
      	commit b32cecb4 ("gpio: pca953x: Extract the register address mangling to single function")
      but only became visible by
      	commit 8b9f9d4d
       ("regmap: verify if register is writeable before writing operations")
      because before, the regmap size was effectively ignored and
      pca953x_writeable_register() did know to ignore REG_ADDR_AI. Still, there
      were two separate cache entries created.
      Since the use of REG_ADDR_AI seems to be static we can work around this
      issue by simply increasing the size of the regmap to cover the "virtual"
      registers with REG_ADDR_AI being set. This only means that half of the
      regmap buffer will be unused.
      Reported-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Suggested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
  3. 05 Jun, 2019 1 commit
  4. 02 Jun, 2019 1 commit
  5. 11 Apr, 2019 2 commits
  6. 08 Apr, 2019 1 commit
  7. 22 Mar, 2019 1 commit
  8. 08 Mar, 2019 1 commit
  9. 01 Mar, 2019 1 commit
    • Mark Walton's avatar
      gpio: pca953x: Fix dereference of irq data in shutdown · c378b3aa
      Mark Walton authored
      If a PCA953x gpio was used as an interrupt and then released,
      the shutdown function was trying to extract the pca953x_chip
      pointer directly from the irq_data, but in reality was getting
      the gpio_chip structure.
      The net effect was that the subsequent writes to the data
      structure corrupted data in the gpio_chip structure, which wasn't
      immediately obvious until attempting to use the GPIO again in the
      future, at which point the kernel panics.
      This fix correctly extracts the pca953x_chip structure via the
      gpio_chip structure, as is correctly done in the other irq
      Fixes: 0a70fe00
       ("gpio: pca953x: Clear irq trigger type on irq shutdown")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMark Walton <mark.walton@serialtek.com>
      Reviewed-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
  10. 20 Feb, 2019 1 commit
  11. 14 Feb, 2019 1 commit
  12. 13 Feb, 2019 1 commit
  13. 21 Jan, 2019 2 commits
    • Thomas Petazzoni's avatar
      gpio: pca953x: use a per instance irq_chip structure · 5c4fee63
      Thomas Petazzoni authored
      When a system has two PCA953x GPIO expanders, the kernel complains with:
      gpio gpiochip2: (0-0021): detected irqchip that is shared with multiple gpiochips: please fix the driver.
      Indeed, there is a single instance of "struct irq_chip" that gets
      re-used for both PCA953x instance. This commit moves the "struct
      irq_chip" to be part of the "struct pca953x_chip", so that we have one
      "struct irq_chip" per PCA953X instance.
      As part of this, the name of the irq_chip is also made different on a
      per-instance basis, now using the dev_name() of the I2C device. This
      changes what is visible in /proc/interrupts.
       47:          0          0   pca953x  10 Edge      e0100000.sdhci cd
       48:          0          0   pca953x   6 Edge      e0101000.sdhci cd
       47:          0          0    0-0020  10 Edge      e0100000.sdhci cd
       48:          2          0    0-0020   6 Edge      e0101000.sdhci cd
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    • Thomas Petazzoni's avatar
      gpio: pca953x: reduce indentation level in pca953x_irq_setup() · 7341fa7a
      Thomas Petazzoni authored
      The current design of pca953x_irq_setup() is:
       if (all conditions to support IRQ are met) {
         lots of code to support IRQs, which goes to a serious indentation
       return 0;
      It makes more sense to handle this like this:
       if (!all conditions to support IRQ are met)
         return 0;
       handle IRQ support
      This commit does just this change, reducing by one tab the indentation
      level of the IRQ setup code. Thanks to this reduced indentation level,
      we are less restricted by the 80-column limit, and we can have more
      function arguments on the same line.
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
  14. 11 Jan, 2019 1 commit
  15. 17 Dec, 2018 1 commit
  16. 14 Dec, 2018 14 commits
  17. 02 Jul, 2018 1 commit
  18. 24 May, 2018 1 commit
  19. 23 May, 2018 4 commits
  20. 16 May, 2018 2 commits