1. 23 Mar, 2017 1 commit
  2. 08 Nov, 2016 2 commits
  3. 31 Oct, 2016 1 commit
  4. 15 Sep, 2016 1 commit
  5. 11 Aug, 2016 1 commit
  6. 15 Jun, 2016 1 commit
  7. 21 Apr, 2016 1 commit
  8. 27 Jan, 2016 1 commit
  9. 05 Jan, 2016 1 commit
  10. 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: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
      Acked-by: default 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
  11. 16 Oct, 2015 1 commit
  12. 16 Sep, 2015 1 commit
    • Thomas Gleixner's avatar
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner authored
      
      
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
  13. 17 Jul, 2015 1 commit
  14. 25 Jun, 2015 1 commit
    • Thomas Gleixner's avatar
      pinctrl/st: Fix race in installing chained IRQ handler · 1b11b0cb
      Thomas Gleixner authored
      
      
      Fix a race where a pending interrupt could be received and the handler
      called before the handler's data has been setup, by converting to
      irq_set_chained_handler_and_data().
      
      Search and conversion was done with coccinelle:
      
      @@
      expression E1, E2, E3;
      @@
      (
      -if (irq_set_chained_handler(E1, E3) != 0)
      -   BUG();
      |
      -irq_set_chained_handler(E1, E3);
      )
      -irq_set_handler_data(E1, E2);
      +irq_set_chained_handler_and_data(E1, E3, E2);
      
      @@
      expression E1, E2, E3;
      @@
      (
      -if (irq_set_chained_handler(E1, E3) != 0)
      -   BUG();
      ...
      |
      -irq_set_chained_handler(E1, E3);
      ...
      )
      -irq_set_handler_data(E1, E2);
      +irq_set_chained_handler_and_data(E1, E3, E2);
      
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
      Cc: Maxime Coquelin <maxime.coquelin@st.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: kernel@stlinux.com
      Cc: linux-gpio@vger.kernel.org
      1b11b0cb
  15. 10 Jun, 2015 1 commit
  16. 27 Mar, 2015 1 commit
  17. 25 Mar, 2015 5 commits
  18. 07 Jan, 2015 2 commits
  19. 21 Oct, 2014 1 commit
    • Pramod Gurav's avatar
      pinctrl: st: Fix Sparse error · 2e537276
      Pramod Gurav authored
      
      
      This change fixes below sparse error,
      drivers/pinctrl/pinctrl-st.c:1515:31: error: incompatible types for operation (>)
      drivers/pinctrl/pinctrl-st.c:1515:31:    left side has type void [noderef] <asn:2>*irqmux_base
      drivers/pinctrl/pinctrl-st.c:1515:31:    right side has type int
      
      Cc: Maxime Coquelin <maxime.coquelin@st.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      CC: Linus Walleij <linus.walleij@linaro.org>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: default avatarPramod Gurav <pramod.gurav@smartplayin.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      2e537276
  20. 20 Oct, 2014 1 commit
  21. 23 Sep, 2014 1 commit
  22. 04 Sep, 2014 1 commit
  23. 15 Jul, 2014 1 commit
    • Maxime COQUELIN's avatar
      pinctrl: st: Fix irqmux handler · 7a2deccf
      Maxime COQUELIN authored
      
      
      st_gpio_irqmux_handler() reads the status register to find out
      which banks inside the controller have pending IRQs.
      For each banks having pending IRQs, it calls the corresponding handler.
      
      Problem is that current code restricts the number of possible banks inside the
      controller to ST_GPIO_PINS_PER_BANK. This define represents the number of pins
      inside a bank, so it shouldn't be used here.
      
      On STiH407, PIO_FRONT0 controller has 10 banks, so IRQs pending in the two
      last banks (PIO18 & PIO19) aren't handled.
      
      This patch replace ST_GPIO_PINS_PER_BANK by the number of banks inside the
      controller.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: <stable@vger.kernel.org> #v3.15+
      Acked-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Signed-off-by: default avatarMaxime Coquelin <maxime.coquelin@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7a2deccf
  24. 11 Jul, 2014 4 commits
    • Rickard Strandqvist's avatar
      pinctrl: pinctrl-st.c: Cleaning up values that are never used · 1f978217
      Rickard Strandqvist authored
      
      
      Remove variable that are never used
      
      This was found using a static code analysis program called cppcheck.
      
      Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
      Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      1f978217
    • Rickard Strandqvist's avatar
      pinctrl: pinctrl-st.c: Cleaning up if unsigned is less than zero · 8b0c107c
      Rickard Strandqvist authored
      
      
      Remove checking if a unsigned is less than zero
      
      This was found using a static code analysis program called cppcheck.
      
      Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
      Acked-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: default avatarMaxime Coquelin <maxime.coquelin@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      8b0c107c
    • David PARIS's avatar
      pinctrl: st: add IRQCHIP_SKIP_SET_WAKE flag · 8708ebca
      David PARIS authored
      
      
      no .irq_set_wake API is available for pinctrl-st driver.
      Add the IRQCHIP_SKIP_SET_WAKE flag to inform irq handler
      not to call this API.
      
      Signed-off-by: default avatarDavid Paris <david.paris@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      8708ebca
    • Fan Wu's avatar
      pinctrl: avoid duplicated calling enable_pinmux_setting for a pin · 2243a87d
      Fan Wu authored
      
      
      What the patch does:
      1. Call pinmux_disable_setting ahead of pinmux_enable_setting
        each time pinctrl_select_state is called
      2. Remove the HW disable operation in pinmux_disable_setting function.
      3. Remove the disable ops in struct pinmux_ops
      4. Remove all the disable ops users in current code base.
      
      Notes:
      1. Great thanks for the suggestion from Linus, Tony Lindgren and
         Stephen Warren and Everyone that shared comments on this patch.
      2. The patch also includes comment fixes from Stephen Warren.
      
      The reason why we do this:
      1. To avoid duplicated calling of the enable_setting operation
         without disabling operation inbetween which will let the pin
         descriptor desc->mux_usecount increase monotonously.
      2. The HW pin disable operation is not useful for any of the
         existing platforms.
         And this can be used to avoid the HW glitch after using the
         item #1 modification.
      
      In the following case, the issue can be reproduced:
      1. There is a driver that need to switch pin state dynamically,
         e.g. between "sleep" and "default" state
      2. The pin setting configuration in a DTS node may be like this:
      
        component a {
      	pinctrl-names = "default", "sleep";
      	pinctrl-0 = <&a_grp_setting &c_grp_setting>;
      	pinctrl-1 = <&b_grp_setting &c_grp_setting>;
        }
      
        The "c_grp_setting" config node is totally identical, maybe like
        following one:
      
        c_grp_setting: c_grp_setting {
      	pinctrl-single,pins = <GPIO48 AF6>;
        }
      
      3. When switching the pin state in the following official pinctrl
         sequence:
      	pin = pinctrl_get();
      	state = pinctrl_lookup_state(wanted_state);
      	pinctrl_select_state(state);
      	pinctrl_put();
      
      Test Result:
      1. The switch is completed as expected, that is: the device's
         pin configuration is changed according to the description in the
         "wanted_state" group setting
      2. The "desc->mux_usecount" of the corresponding pins in "c_group"
         is increased without being decreased, because the "desc" is for
         each physical pin while the setting is for each setting node
         in the DTS.
         Thus, if the "c_grp_setting" in pinctrl-0 is not disabled ahead
         of enabling "c_grp_setting" in pinctrl-1, the desc->mux_usecount
         will keep increasing without any chance to be decreased.
      
      According to the comments in the original code, only the setting,
      in old state but not in new state, will be "disabled" (calling
      pinmux_disable_setting), which is correct logic but not intact. We
      still need consider case that the setting is in both old state
      and new state. We can do this in the following two ways:
      
      1. Avoid to "enable"(calling pinmux_enable_setting) the "same pin
         setting" repeatedly
      2. "Disable"(calling pinmux_disable_setting) the "same pin setting",
         actually two setting instances, ahead of enabling them.
      
      Analysis:
      1. The solution #2 is better because it can avoid too much
         iteration.
      2. If we disable all of the settings in the old state and one of
         the setting(s) exist in the new state, the pins mux function
         change may happen when some SoC vendors defined the
         "pinctrl-single,function-off"
         in their DTS file.
         old_setting => disabled_setting => new_setting.
      3. In the pinmux framework, when a pin state is switched, the
         setting in the old state should be marked as "disabled".
      
      Conclusion:
      1. To Remove the HW disabling operation to above the glitch mentioned
         above.
      2. Handle the issue mentioned above by disabling all of the settings
         in old state and then enable the all of the settings in new state.
      
      Signed-off-by: default avatarFan Wu <fwu@marvell.com>
      Acked-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
      Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Acked-by: default avatarMaxime Coquelin <maxime.coquelin@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      2243a87d
  25. 22 Apr, 2014 4 commits
  26. 12 Mar, 2014 3 commits