08 Apr, 2019

1 commit

  • …nux/kernel/git/brgl/linux into devel

    gpio: updates for v5.2 (part 1)

    - batch of improvements for the vf610 driver which shrink the code and
    make use of resource managed helpers
    - support for a new variant of pca953x
    - make gpio-mockup buildable on systems without IOMEM
    - make gpio-74x164 more flexible by using generic device properties
    plus minor improvements
    - new driver for Mellanox BlueField
    - fixes for wakeup GPIOs in gpio-omap
    - use devm_platform_ioremap_resource() in gpio-mxc
    - a couple improvements of kernel docs for ACPI code
    - don't WARN() in gpiod_put() on optional GPIOs

    Linus Walleij
     

05 Apr, 2019

1 commit


18 Mar, 2019

7 commits

  • The code already defines "dev" variable to help with that, so make
    sure all of the code uses it.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • Now that the driver's custom remove hook contains only a single
    action, replace it by converting the code to use
    devm_gpiochip_add_data() to simplify things.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • Clk_gpio should be disabled in all error paths in the code that
    follws, including the case when either gpiochip_add_data() or
    gpiochip_irqchip_add() fail. To simplify things fix this by using
    devm_add_action() to disable corresponding clock in case of any erros
    as well as driver/device removal.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • Clk_port should be disabled in all error paths in the code that
    follws, including the case when either gpiochip_add_data() or
    gpiochip_irqchip_add() fail. To simplify things fix this by using
    devm_add_action_or_reset() to disable corresponding clock in case of
    any erros as well as driver/device removal.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • Both branches of the if statement do exactly the same thing, just at
    different offsets. Simplify the code a bit by moving shared action
    code outside of the if statement. No functional change intended.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • The only difference between two codepaths is register offset
    used. Simplify the code a bit by replacing explicit calls with a
    single call with a variable offset. No functional change intended.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     
  • Fix the warning produced by gpiochip_set_irq_hooks() by allocating a
    dedicated IRQ chip per GPIO chip/port.

    Signed-off-by: Andrey Smirnov
    Cc: Linus Walleij
    Cc: Bartosz Golaszewski
    Cc: Chris Healy
    Cc: Andrew Lunn
    Cc: Heiner Kallweit
    Cc: Fabio Estevam
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Bartosz Golaszewski

    Andrey Smirnov
     

28 Jan, 2019

1 commit

  • On SoC reset all GPIO interrupts are disable. However, if kexec is
    used to boot into a new kernel, the SoC does not experience a
    reset. Hence GPIO interrupts can be left enabled from the previous
    kernel. It is then possible for the interrupt to fire before an
    interrupt handler is registered, resulting in the kernel complaining
    of an "unexpected IRQ trap", the interrupt is never cleared, and so
    fires again, resulting in an interrupt storm.

    Disable all GPIO interrupts before registering the GPIO IRQ chip.

    Fixes: 7f2691a19627 ("gpio: vf610: add gpiolib/IRQ chip driver for Vybrid")
    Signed-off-by: Andrew Lunn
    Acked-by: Stefan Agner
    Signed-off-by: Linus Walleij

    Andrew Lunn
     

17 Nov, 2018

1 commit

  • Some SoCs need the gpio clock to be enabled before accessing
    HW registers. This patch add the optional clock handling.

    Cc: Linus Walleij
    Cc: Stefan Agner
    Cc: Shawn Guo
    Cc: linux-gpio@vger.kernel.org
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    A.s. Dong
     

12 Sep, 2018

2 commits


16 May, 2018

1 commit


08 Nov, 2017

1 commit


14 Aug, 2017

1 commit

  • The Rapid General-Purpose Input and Output with 2 Ports (RGPIO2P)
    on MX7ULP is similar to GPIO on Vibrid. But unlike Vibrid, the
    RGPIO2P has an extra Port Data Direction Register (PDDR) used
    to configure the individual port pins for input or output.

    We introduce a bool have_paddr with fsl_gpio_soc_data data
    to distinguish this differences. And we support getting the output
    status by checking the GPIO direction in PDDR.

    Cc: Alexandre Courbot
    Cc: Shawn Guo
    Cc: Stefan Agner
    Cc: Fugang Duan
    Cc: Peter Chen
    Signed-off-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Dong Aisheng
     

24 Nov, 2016

1 commit


23 Aug, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    drivers/gpio/Kconfig:config GPIO_VF610
    drivers/gpio/Kconfig: def_bool y

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modular infrastructure use, so that
    when reading the driver there is no doubt it is builtin-only.

    We delete the MODULE_LICENSE tag etc. since all that information
    is now contained at the top of the file in the comments.

    We don't replace module.h with init.h since the file already has that.

    Cc: Alexandre Courbot
    Cc: Stefan Agner
    Cc: linux-gpio@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Linus Walleij

    Paul Gortmaker
     

05 Jan, 2016

1 commit


19 Nov, 2015

1 commit

  • 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
    Cc: Rafał Miłecki
    Cc: Richard Purdie
    Cc: Mauro Carvalho Chehab
    Cc: Alek Du
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Acked-by: Dmitry Torokhov
    Acked-by: Greg Kroah-Hartman
    Acked-by: Lee Jones
    Acked-by: Jiri Kosina
    Acked-by: Hans-Christian Egtvedt
    Acked-by: Jacek Anaszewski
    Signed-off-by: Linus Walleij

    Linus Walleij
     

17 Oct, 2015

1 commit


02 Oct, 2015

1 commit

  • The state container of the vf610 GPIO driver is sometimes
    extracted from the gpio_chip exploiting the fact that offsetof()
    the struct gpio_chip inside the struct vf610_gpio_port is 0, so
    the container_of() is in practice a noop. However if a member
    is added to struct vf610_gpio_port in front of struct gpio_chip,
    things will break. Using proper container_of() avoids this
    problem.

    Semantically this is a noop, the compiler will optimize it away,
    but syntactically it makes me happier.

    Also replace some explicit container_of() calls with the helper
    function.

    Acked-by: Stefan Agner
    Signed-off-by: Linus Walleij

    Linus Walleij
     

16 Sep, 2015

2 commits

  • 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: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Jiang Liu

    Thomas Gleixner
     
  • Use irq_set_handler_locked() as it avoids a redundant lookup of the
    irq descriptor. Search and replacement was done with coccinelle:

    Signed-off-by: Thomas Gleixner
    Cc: Julia Lawall
    Cc: Linus Walleij
    Cc: linux-gpio@vger.kernel.org

    Thomas Gleixner
     

26 Aug, 2015

1 commit

  • The GPIO IRQ controller is able to generate level triggered
    interrupts, however, these were handled by handle_simple_irq so far
    which did not take care of IRQ masking. This lead to "nobody cared
    (try booting with the "irqpoll" option)" stack traces.

    Use the generic interrupt handlers depending on the IRQ type.

    Signed-off-by: Stefan Agner
    Signed-off-by: Linus Walleij

    Stefan Agner
     

14 Jul, 2015

1 commit


06 Mar, 2015

1 commit


16 Jan, 2015

1 commit


24 Oct, 2014

1 commit