1. 02 5月, 2016 2 次提交
  2. 21 4月, 2016 1 次提交
  3. 05 1月, 2016 1 次提交
  4. 11 12月, 2015 1 次提交
  5. 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
  6. 28 10月, 2015 1 次提交
  7. 17 10月, 2015 1 次提交
  8. 16 9月, 2015 1 次提交
    • T
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner 提交于
      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: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
  9. 31 8月, 2015 1 次提交
    • D
      pinctrl: at91: fix null pointer dereference · 1ab36387
      David Dueck 提交于
      Not all gpio banks are necessarily enabled, in the current code this can
      lead to null pointer dereferences.
      
      [   51.130000] Unable to handle kernel NULL pointer dereference at virtual address 00000058
      [   51.130000] pgd = dee04000
      [   51.130000] [00000058] *pgd=3f66d831, *pte=00000000, *ppte=00000000
      [   51.140000] Internal error: Oops: 17 [#1] ARM
      [   51.140000] Modules linked in:
      [   51.140000] CPU: 0 PID: 1664 Comm: cat Not tainted 4.1.1+ #6
      [   51.140000] Hardware name: Atmel SAMA5
      [   51.140000] task: df6dd880 ti: dec60000 task.ti: dec60000
      [   51.140000] PC is at at91_pinconf_get+0xb4/0x200
      [   51.140000] LR is at at91_pinconf_get+0xb4/0x200
      [   51.140000] pc : [<c01e71a0>]    lr : [<c01e71a0>]    psr: 600f0013
      sp : dec61e48  ip : 600f0013  fp : df522538
      [   51.140000] r10: df52250c  r9 : 00000058  r8 : 00000068
      [   51.140000] r7 : 00000000  r6 : df53c910  r5 : 00000000  r4 : dec61e7c
      [   51.140000] r3 : 00000000  r2 : c06746d4  r1 : 00000000  r0 : 00000003
      [   51.140000] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   51.140000] Control: 10c53c7d  Table: 3ee04059  DAC: 00000015
      [   51.140000] Process cat (pid: 1664, stack limit = 0xdec60208)
      [   51.140000] Stack: (0xdec61e48 to 0xdec62000)
      [   51.140000] 1e40:                   00000358 00000000 df522500 ded15f80 c05a9d08 ded15f80
      [   51.140000] 1e60: 0000048c 00000061 df522500 ded15f80 c05a9d08 c01e7304 ded15f80 00000000
      [   51.140000] 1e80: c01e6008 00000060 0000048c c01e6034 c01e5f6c ded15f80 dec61ec0 00000000
      [   51.140000] 1ea0: 00020000 ded6f280 dec61f80 00000001 00000001 c00ae0b8 b6e80000 ded15fb0
      [   51.140000] 1ec0: 00000000 00000000 df4bc974 00000055 00000800 ded6f280 b6e80000 ded6f280
      [   51.140000] 1ee0: ded6f280 00020000 b6e80000 00000000 00020000 c0090dec c0671e1c dec61fb0
      [   51.140000] 1f00: b6f8b510 00000001 00004201 c000924c 00000000 00000003 00000003 00000000
      [   51.140000] 1f20: df4bc940 00022000 00000022 c066e188 b6e7f000 c00836f4 000b6e7f ded6f280
      [   51.140000] 1f40: ded6f280 b6e80000 dec61f80 ded6f280 00020000 c0091508 00000000 00000003
      [   51.140000] 1f60: 00022000 00000000 00000000 ded6f280 ded6f280 00020000 b6e80000 c0091d9c
      [   51.140000] 1f80: 00000000 00000000 ffffffff 00020000 00020000 b6e80000 00000003 c000f124
      [   51.140000] 1fa0: dec60000 c000efa0 00020000 00020000 00000003 b6e80000 00020000 000271c4
      [   51.140000] 1fc0: 00020000 00020000 b6e80000 00000003 7fffe000 00000000 00000000 00020000
      [   51.140000] 1fe0: 00000000 bef50b64 00013835 b6f29c76 400f0030 00000003 00000000 00000000
      [   51.140000] [<c01e71a0>] (at91_pinconf_get) from [<c01e7304>] (at91_pinconf_dbg_show+0x18/0x2c0)
      [   51.140000] [<c01e7304>] (at91_pinconf_dbg_show) from [<c01e6034>] (pinconf_pins_show+0xc8/0xf8)
      [   51.140000] [<c01e6034>] (pinconf_pins_show) from [<c00ae0b8>] (seq_read+0x1a0/0x464)
      [   51.140000] [<c00ae0b8>] (seq_read) from [<c0090dec>] (__vfs_read+0x20/0xd0)
      [   51.140000] [<c0090dec>] (__vfs_read) from [<c0091508>] (vfs_read+0x7c/0x108)
      [   51.140000] [<c0091508>] (vfs_read) from [<c0091d9c>] (SyS_read+0x40/0x94)
      [   51.140000] [<c0091d9c>] (SyS_read) from [<c000efa0>] (ret_fast_syscall+0x0/0x3c)
      [   51.140000] Code: eb010ec2 e30a0d08 e34c005a eb0ae5a7 (e5993000)
      [   51.150000] ---[ end trace fb3c370da3ea4794 ]---
      
      Fixes: a0b957f3 ("pinctrl: at91: allow to have disabled gpio bank")
      Cc: stable@vger.kernel.org # 3.18
      Signed-off-by: NDavid Dueck <davidcdueck@googlemail.com>
      Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
      Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      1ab36387
  10. 26 8月, 2015 1 次提交
  11. 18 7月, 2015 2 次提交
  12. 10 6月, 2015 1 次提交
  13. 06 5月, 2015 1 次提交
  14. 07 4月, 2015 1 次提交
  15. 27 3月, 2015 1 次提交
  16. 18 3月, 2015 1 次提交
  17. 10 3月, 2015 1 次提交
  18. 26 1月, 2015 1 次提交
  19. 03 12月, 2014 1 次提交
  20. 29 10月, 2014 2 次提交
  21. 20 10月, 2014 1 次提交
  22. 23 9月, 2014 3 次提交
  23. 05 9月, 2014 2 次提交
  24. 04 9月, 2014 1 次提交
  25. 17 8月, 2014 1 次提交
  26. 11 7月, 2014 3 次提交
    • R
      pinctrl: pinctrl-at91.c: Cleaning up values that are never used · 445d2026
      Rickard Strandqvist 提交于
      Remove variable that are never used
      
      This was found using a static code analysis program called cppcheck.
      Signed-off-by: NRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      445d2026
    • R
      pinctrl: pinctrl-at91.c: Cleaning up if unsigned is less than zero · ca7162ad
      Rickard Strandqvist 提交于
      Remove checking if a unsigned is less than zero
      
      This was found using a static code analysis program called cppcheck.
      Signed-off-by: NRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ca7162ad
    • F
      pinctrl: avoid duplicated calling enable_pinmux_setting for a pin · 2243a87d
      Fan Wu 提交于
      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: NFan Wu <fwu@marvell.com>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NPatrice Chotard <patrice.chotard@st.com>
      Acked-by: NHeiko Stuebner <heiko@sntech.de>
      Acked-by: NMaxime Coquelin <maxime.coquelin@st.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      2243a87d
  27. 27 5月, 2014 1 次提交
    • A
      pinctrl/at91: Fix lockup when IRQ on PIOC and PIOD occurs · cccb0c3e
      Alexander Stein 提交于
      With commit 80cc3732 (pinctrl/at91: convert driver to use gpiolib irqchip)
      gpiochip_set_chained_irqchip is called for PIOC, PIOD and PIOE. The
      associated GPIO chip for the IRQ chip is overwritten each time, because
      they share the same hard IRQ line.
      Thus if an IRQ occurs on PIOC or PIOD, gpio_irq_handler will only check on
      PIOE (the assigned GPIO chip) where no event occured. Thus the IRQ will
      not be cleared, retriggering the ISR.
      Fix that (like done before) by only set the PIOC GPIO chip to the IRQ chip
      and walk the list in the irq handler.
      Signed-off-by: NAlexander Stein <alexanders83@web.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      cccb0c3e
  28. 23 4月, 2014 2 次提交
    • A
      pinctrl/at91: Fix mask creation in at91_gpio_dbg_show · 47f22716
      Alexander Stein 提交于
      pin_to_mask expects a bank pin number. So do not add the chip base.
      
      Without that patch cat /sys/kernel/debug/gpio looks like that:
      GPIOs 0-31, platform/fffff200.gpio, fffff200.gpio:
      [spi32766.0] GPIOfffff200.gpio5: [gpio] set
      [ads7846_pendown] GPIOfffff200.gpio15: [gpio] set
      [ohci_vbus] GPIOfffff200.gpio21: [gpio] set
      [ohci_vbus] GPIOfffff200.gpio24: [gpio] set
      [button1] GPIOfffff200.gpio28: [gpio] clear
      [button2] GPIOfffff200.gpio29: [gpio] clear
      
      GPIOs 32-63, platform/fffff400.gpio, fffff400.gpio:
      [sda] GPIOfffff400.gpio4: [periph A]
      [scl] GPIOfffff400.gpio5: [periph A]
      [spi32766.3] GPIOfffff400.gpio11: [periph A]
      [error] GPIOfffff400.gpio22: [periph A]
      [run] GPIOfffff400.gpio23: [periph A]
      
      GPIOs 64-95, platform/fffff600.gpio, fffff600.gpio:
      [reset_pin] GPIOfffff600.gpio29: [periph A]
      
      GPIOs 96-127, platform/fffff800.gpio, fffff800.gpio:
      [led1] GPIOfffff800.gpio5: [periph A]
      [led2] GPIOfffff800.gpio6: [periph A]
      [led3] GPIOfffff800.gpio7: [periph A]
      [led4] GPIOfffff800.gpio8: [periph A]
      
      GPIOs 128-159, platform/fffffa00.gpio, fffffa00.gpio:
      [button3] GPIOfffffa00.gpio10: [periph A]
      [button4] GPIOfffffa00.gpio12: [periph A]
      
      Note that every bank despite bank 0 only shows "periph A" which are
      obviously used as GPIOs.
      Signed-off-by: NAlexander Stein <alexanders83@web.de>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      47f22716
    • A
      pinctrl/at91: convert driver to use gpiolib irqchip · 80cc3732
      Alexander Stein 提交于
      This converts the AT91 pin control driver to register its
      chained irq handler and irqchip using the helpers in the
      gpiolib core.
      Signed-off-by: NAlexander Stein <alexanders83@web.de>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      80cc3732
  29. 25 2月, 2014 1 次提交
  30. 10 2月, 2014 1 次提交
  31. 03 2月, 2014 1 次提交