1. 14 Aug, 2017 1 commit
  2. 24 Apr, 2017 1 commit
  3. 23 Mar, 2017 3 commits
  4. 11 Jan, 2017 1 commit
  5. 25 Nov, 2016 1 commit
    • Linus Walleij's avatar
      gpio: simplify adding threaded interrupts · d245b3f9
      Linus Walleij authored
      This tries to simplify the use of CONFIG_GPIOLIB_IRQCHIP when
      using threaded interrupts: add a new call
      gpiochip_irqchip_add_nested() to indicate that we're dealing
      with a nested rather than a chained irqchip, then create a
      separate gpiochip_set_nested_irqchip() to mirror
      the gpiochip_set_chained_irqchip() call to connect the
      parent and child interrupts.
      
      In the nested case gpiochip_set_nested_irqchip() does nothing
      more than call irq_set_parent() on each valid child interrupt,
      which has little semantic effect in the kernel, but this is
      probably still formally correct.
      
      Update all drivers using nested interrupts to use
      gpiochip_irqchip_add_nested() so we can now see clearly
      which these users are.
      
      The DLN2 driver can drop its specific hack with
      .irq_not_threaded as we now recognize whether a chip is
      threaded or not from its use of gpiochip_irqchip_add_nested()
      signature rather than from inspecting .can_sleep.
      
      We rename the .irq_parent to .irq_chained_parent since this
      parent IRQ is only really kept around for the chained
      interrupt handlers.
      
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Cc: Octavian Purdila <octavian.purdila@intel.com>
      Cc: Daniel Baluta <daniel.baluta@intel.com>
      Cc: Bin Gao <bin.gao@linux.intel.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
      Cc: Semen Protsenko <semen.protsenko@globallogic.com>
      Cc: Alexander Stein <alexander.stein@systec-electronic.com>
      Cc: Phil Reid <preid@electromag.com.au>
      Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      d245b3f9
  6. 08 Nov, 2016 2 commits
  7. 24 Oct, 2016 1 commit
  8. 11 Oct, 2016 1 commit
  9. 24 Sep, 2016 2 commits
    • Wolfram Sang's avatar
      gpio: pca953x: variable 'id' was used twice · 6212e1d6
      Wolfram Sang authored
      sparse  rightfully said:
      
      drivers/gpio/gpio-pca953x.c:771:45: warning: symbol 'id' shadows an earlier one
      drivers/gpio/gpio-pca953x.c:742:36: originally declared here
      
      So, name them explicitly 'i2c_id' and 'acpi_id' to avoid any confusion.
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      6212e1d6
    • Bartosz Golaszewski's avatar
      gpio: pca953x: fix an incorrect lockdep warning · 559b4699
      Bartosz Golaszewski authored
      If an I2C GPIO multiplexer is driven by a GPIO provided by an expander
      when there's a second expander using the same device driver on one of
      the I2C bus segments, lockdep prints a deadlock warning when trying to
      set the direction or the value of the GPIOs provided by the second
      expander.
      
      The below diagram presents the setup:
      
                                                     - - - - -
       -------             ---------  Bus segment 1 |         |
      |       |           |         |---------------  Devices
      |       | SCL/SDA   |         |               |         |
      | Linux |-----------| I2C MUX |                - - - - -
      |       |    |      |         | Bus segment 2
      |       |    |      |         |-------------------
       -------     |       ---------                    |
                   |           |                    - - - - -
              ------------     | MUX GPIO          |         |
             |            |    |                     Devices
             |    GPIO    |    |                   |         |
             | Expander 1 |----                     - - - - -
             |            |                             |
              ------------                              | SCL/SDA
                                                        |
                                                   ------------
                                                  |            |
                                                  |    GPIO    |
                                                  | Expander 2 |
                                                  |            |
                                                   ------------
      
      The reason for lockdep warning is that we take the chip->i2c_lock in
      pca953x_gpio_set_value() or pca953x_gpio_direction_output() and then
      come right back to pca953x_gpio_set_value() when the GPIO mux kicks
      in. The locks actually protect different expanders, but for lockdep
      both are of the same class, so it says:
      
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(&chip->i2c_lock);
         lock(&chip->i2c_lock);
      
        *** DEADLOCK ***
      
        May be due to missing lock nesting notation
      
      In order to get rid of the warning, retrieve the adapter nesting depth
      and use it as lockdep subclass for chip->i2c_lock.
      Signed-off-by: Bartosz Golaszewski's avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Acked-by: Peter Rosin's avatarPeter Rosin <peda@axentia.se>
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      559b4699
  10. 13 Sep, 2016 1 commit
  11. 12 Sep, 2016 6 commits
  12. 07 Sep, 2016 1 commit
  13. 11 Aug, 2016 1 commit
  14. 15 Jun, 2016 1 commit
  15. 13 Jun, 2016 1 commit
  16. 08 Jun, 2016 1 commit
    • Andy Shevchenko's avatar
      gpio: pca953x: enfore type for i2c_smbus_write_word_data() · c4d1cbd7
      Andy Shevchenko authored
      The commit 9b8e3ec3 ("gpio: pca953x: Use correct u16 value for register
      word write") fixed regression in pca953x_write_regs(). At the same time the
      solution introduced a sparse warning:
      
      drivers/gpio/gpio-pca953x.c:168:39: warning: incorrect type in argument 3 (different base types)
      drivers/gpio/gpio-pca953x.c:168:39:    expected unsigned short [unsigned] [usertype] value
      drivers/gpio/gpio-pca953x.c:168:39:    got restricted __le16 [usertype] <noident>
      
      Fix the code by enforcing the type of i2c_smbus_write_word_data() parameter.
      
      Cc: Yong Li <sdliyong@gmail.com>
      Cc: Phil Reid <preid@electromag.com.au>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      c4d1cbd7
  17. 07 Jun, 2016 2 commits
  18. 09 Apr, 2016 1 commit
  19. 08 Apr, 2016 1 commit
  20. 16 Mar, 2016 1 commit
  21. 23 Feb, 2016 1 commit
  22. 05 Jan, 2016 1 commit
  23. 10 Dec, 2015 1 commit
  24. 09 Dec, 2015 3 commits
    • Linus Walleij's avatar
      gpio: pca953x: make inclusion of <linux/of_platform.h> unconditional · c2369d3f
      Linus Walleij authored
      After adding the DT matching in
      commit 6f29c9af
      "gpio: pca935x: fix of-only probed devices"
      compilation fails like this:
      
      CC [M]  drivers/gpio/gpio-pca953x.o
      gpio-pca953x.c: In function ‘pca953x_probe’:
      gpio-pca953x.c:693:11: error: implicit declaration of
      function ‘of_match_device’ [-Werror=implicit-function-declaration]
      match = of_match_device(pca953x_dt_ids, &client->dev);
              ^
      gpio-pca953x.c:693:9: warning: assignment makes pointer from
      integer without a cast [-Wint-conversion]
      match = of_match_device(pca953x_dt_ids, &client->dev);
              ^
      cc1: some warnings being treated as errors
      ../scripts/Makefile.build:264: recipe for target
      'drivers/gpio/gpio-pca953x.o' failed
      
      After removing the conditional inclusion guards compilation
      works fine again. Might be a module problem so that
      fix.
      
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      c2369d3f
    • Ben Dooks's avatar
      gpio: pca935x: fix of-only probed devices · 6f29c9af
      Ben Dooks authored
      If the pca953x device is probed from OF using the proper OF probing then
      the i2c-client will be NULL and the device probe will fail as id is NULL
      and it isn't an ACPI device (previous drivers would simply OOPS out).
      
      Add support for the of_device_id table having the same data as the others
      so that the correct paths will be taken when registering a device.
      
      An example of current valid of node which did not work:
      
      	gpio@38 {
      		compatible = "onsemi,pca9654", "nxp,pca9534";
      		reg = <0x38>;
      		interrupt-parent = <&gpio5>;
      		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
      	};
      Signed-off-by: Ben Dooks's avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      6f29c9af
    • Ben Dooks's avatar
      gpio: pca953x: add onsemi,pca9654 id · 9f49f6dd
      Ben Dooks authored
      Add onsemi,pca9654 which is also compatible with the nxp,pca9524 as it
      is an 8bit expander with an interrupt output.
      Signed-off-by: Ben Dooks's avatarBen Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      9f49f6dd
  25. 19 Nov, 2015 1 commit
    • Linus Walleij's avatar
      gpio: change member .dev to .parent · 58383c78
      Linus Walleij authored
      The name .dev in a struct is normally reserved for a struct device
      that is let us say a superclass to the thing described by the struct.
      struct gpio_chip stands out by confusingly using a struct device *dev
      to point to the parent device (such as a platform_device) that
      represents the hardware. As we want to give gpio_chip:s real devices,
      this is not working. We need to rename this member to parent.
      
      This was done by two coccinelle scripts, I guess it is possible to
      combine them into one, but I don't know such stuff. They look like
      this:
      
      @@
      struct gpio_chip *var;
      @@
      -var->dev
      +var->parent
      
      and:
      
      @@
      struct gpio_chip var;
      @@
      -var.dev
      +var.parent
      
      and:
      
      @@
      struct bgpio_chip *var;
      @@
      -var->gc.dev
      +var->gc.parent
      
      Plus a few instances of bgpio that I couldn't figure out how
      to teach Coccinelle to rewrite.
      
      This patch hits all over the place, but I *strongly* prefer this
      solution to any piecemal approaches that just exercise patch
      mechanics all over the place. It mainly hits drivers/gpio and
      drivers/pinctrl which is my own backyard anyway.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Rafał Miłecki <zajec5@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Alek Du <alek.du@intel.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: Lee Jones's avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
      Acked-by: Hans-Christian Noren Egtvedt's avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      58383c78
  26. 05 Oct, 2015 2 commits
  27. 02 Oct, 2015 1 commit