1. 10 10月, 2018 1 次提交
    • M
      pinctrl: mcp23s08: fix irq and irqchip setup order · f259f896
      Marco Felsch 提交于
      Since 'commit 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")' the
      irq request isn't the last devm_* allocation. Without a deeper look at
      the irq and testing this isn't a good solution. Since this driver relies
      on the devm mechanism, requesting a interrupt should be the last thing
      to avoid memory corruptions during unbinding.
      
      'Commit 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")' fixed the
      order for the interrupt-controller use case only. The
      mcp23s08_irq_setup() must be split into two to fix it for the
      interrupt-controller use case and to register the irq at last. So the
      irq will be freed first during unbind.
      
      Cc: stable@vger.kernel.org
      Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
      Cc: Dmitry Mastykin <mastichi@gmail.com>
      Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
      Fixes: 82039d24 ("pinctrl: mcp23s08: add pinconf support")
      Fixes: 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")
      Signed-off-by: NMarco Felsch <m.felsch@pengutronix.de>
      Tested-by: NPhil Reid <preid@electromag.com.au>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f259f896
  2. 18 6月, 2018 1 次提交
    • J
      pinctrl: mcp23s08: debugfs: Do not restore the INTF register · 7547b596
      Jan Kundrát 提交于
      Apart from the usual stuff, the debugfs code is currently also used for
      one non-obvious side effect. It attempts to check whether the chip's
      registers are still set to an expected value, and if not, re-initializes
      them. It seems that the driver has "always" done so.
      
      The code, however, also checks the INTF register which normally
      indicates which pins have caused the recent interrupt. That's a volatile
      register, and the datasheet says that writes are ignored in there.
      
      When I'm just cat-ing /sys/kernel/debug/gpio with no SPI traffic and no
      nosie on the GPIO lines, I'm not getting any warnings. Once I actually
      use these GPIOs and cat that file in parallel, I always seem to get a:
      
        mcp23s08 spi1.1: restoring reg 0x07 from 0x0000 to 0xffff (power-loss?)
      
      This might be a sign that I should not leave my unused inputs floating,
      but the code should not be checking a volatile register, anyway. Let's
      simply skip this last item in the iteration. I was also considering
      removing this enitre re-initialization because it's non-obvious, but the
      code survived various refactorings already and has sign-offs by people
      who know more than I do, so let's leave it as-is. For now :).
      Signed-off-by: NJan Kundrát <jan.kundrat@cesnet.cz>
      Reviewed-by: NPhil Reid <preid@electromag.com.au>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7547b596
  3. 22 2月, 2018 2 次提交
  4. 12 2月, 2018 3 次提交
    • J
      pinctrl: mcp23s08: spi: Fix duplicate pinctrl debugfs entries · 1781af56
      Jan Kundrát 提交于
      This is a bit more involved because the pinctrl core so far always
      assumed that one device (with a unique dev_name) only contains a single
      pinctrl thing. This is not true for the mcp23s08 driver for chips
      connected over SPI. They have a "logical address" which means that
      several chips can share one physical CS signal.
      
      A downside of this patch are some possibly ugly names for the debugfs
      entries, such as "spi1.1-mcp23xxx-pinctrl.2", etc.
      Signed-off-by: NJan Kundrát <jan.kundrat@cesnet.cz>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1781af56
    • J
      pinctrl: mcp23s08: spi: Add HW address to gpio_chip.label · ed231751
      Jan Kundrát 提交于
      When several devices are sharing one hardware SPI CS, there is no visual
      clue in `lsgpio` or in /sys/kernel/debug/gpio about which one is which
      one. Stuff depends on the enumeration order, and therefore lower chip
      addresses always go first, but that's just an implementation detail.
      This change includes the device-specific address in the debug output:
      
        gpiochip4: GPIOs 464-479, parent: spi/spi1.1, mcp23s17.2, can sleep:
        gpiochip3: GPIOs 480-495, parent: spi/spi1.1, mcp23s17.1, can sleep:
      Signed-off-by: NJan Kundrát <jan.kundrat@cesnet.cz>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ed231751
    • J
      pinctrl: mcp23s08: spi: Fix regmap debugfs entries · 9b3e4207
      Jan Kundrát 提交于
      The SPI version of this chip allows several devices to be present on the
      same SPI bus via a local address. If this is in action and if the kernel
      has debugfs, however, the code attempts to create duplicate entries for
      the regmap's debugfs:
      
        mcp23s08 spi1.1: Failed to create debugfs directory
      
      This patch simply assigns a local name matching the device logical
      address to the `struct regmap_config`.
      
      No changes are needed for MCP23S18 because that device does not support
      any logical addressing. Similarly, I2C devices do not need any action,
      either, because they are already different in their I2C address.
      
      A similar problem is present for the pinctrl debugfs instance, but that
      one is not addressed by this patch.
      Signed-off-by: NJan Kundrát <jan.kundrat@cesnet.cz>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9b3e4207
  5. 30 1月, 2018 1 次提交
  6. 09 1月, 2018 1 次提交
  7. 29 11月, 2017 1 次提交
  8. 08 11月, 2017 1 次提交
  9. 19 10月, 2017 2 次提交
  10. 11 10月, 2017 1 次提交
  11. 23 5月, 2017 12 次提交
  12. 17 3月, 2017 1 次提交
  13. 30 1月, 2017 1 次提交
  14. 25 11月, 2016 1 次提交
    • L
      gpio: simplify adding threaded interrupts · d245b3f9
      Linus Walleij 提交于
      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: NLinus Walleij <linus.walleij@linaro.org>
      d245b3f9
  15. 08 9月, 2016 1 次提交
  16. 31 3月, 2016 1 次提交
  17. 30 3月, 2016 2 次提交
  18. 16 3月, 2016 1 次提交
  19. 09 3月, 2016 1 次提交
    • P
      gpio: mcp23s08: Add support for mcp23s18 · 28c5a41e
      Phil Reid 提交于
      This patch adds support for the mcp23s18 which is very similar to
      the mcp23s17. A couple of control bits are not the same.
      Notable IOCON_HAEN (s17 only) & IOCON_INTCC. Which can be ignored.
      
      Patch changes the following:
      - Add mcp23s18 types.
      - Always set mirror bit if the dts defines mcp23s18. regardless of type.
        Mirror bit is ignored on 8 bit devices anyway.
      - In mcp23s08_probe use chip.ngpio instead of logic based on type
        to determine number of gpio lins to increment by. This is set
        appropiately by the call to mcp23s08_probe_one.
      - Add mcp23s18 to device tree documentation.
      - Remove statement that irqs don't work for spi. They do.
        Tested with mcp23s18.
      Signed-off-by: NPhil Reid <preid@electromag.com.au>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      28c5a41e
  20. 16 2月, 2016 1 次提交
  21. 05 1月, 2016 1 次提交
  22. 19 11月, 2015 1 次提交
    • L
      gpio: change member .dev to .parent · 58383c78
      Linus Walleij 提交于
      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: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: NJacek Anaszewski <j.anaszewski@samsung.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      58383c78
  23. 28 10月, 2015 1 次提交
  24. 28 7月, 2015 1 次提交
    • R
      gpio: kill off set_irq_flags usage · 23393d49
      Rob Herring 提交于
      set_irq_flags is ARM specific with custom flags which have genirq
      equivalents. Convert drivers to use the genirq interfaces directly, so we
      can kill off set_irq_flags. The translation of flags is as follows:
      
      IRQF_VALID -> !IRQ_NOREQUEST
      IRQF_PROBE -> !IRQ_NOPROBE
      IRQF_NOAUTOEN -> IRQ_NOAUTOEN
      
      For IRQs managed by an irqdomain, the irqdomain core code handles clearing
      and setting IRQ_NOREQUEST already, so there is no need to do this in
      .map() functions and we can simply remove the set_irq_flags calls. Some
      users also modify IRQ_NOPROBE and this has been maintained although it
      is not clear that is really needed as most platforms don't use probing.
      There appears to be a great deal of blind copy and paste of this code.
      Signed-off-by: NRob Herring <robh@kernel.org>
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      23393d49