Age | Commit message (Collapse) | Author | Files | Lines |
|
We need to convert all old gpio irqchips to pass the irqchip
setup along when adding the gpio_chip. For more info see
drivers/gpio/TODO.
For chained irqchips this is a pretty straight-forward
conversion.
Cc: Andrey Smirnov <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Dong Aisheng <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
|
|
Simplify error checking code by replacing multiple ERR macros with a
call to PTR_ERR_OR_ZERO. No functional change intended.
Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/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
|
|
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The code already defines "dev" variable to help with that, so make
sure all of the code uses it.
Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Fix the warning produced by gpiochip_set_irq_hooks() by allocating a
dedicated IRQ chip per GPIO chip/port.
Signed-off-by: Andrey Smirnov <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Bartosz Golaszewski <[email protected]>
Cc: Chris Healy <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
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 <[email protected]>
Acked-by: Stefan Agner <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Some SoCs need the gpio clock to be enabled before accessing
HW registers. This patch add the optional clock handling.
Cc: Linus Walleij <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: [email protected]
Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Just use the SPDX identifier for the license.
Acked-by: Stefan Agner <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This is a GPIO driver so only include <linux/gpio/driver.h>.
Acked-by: Stefan Agner <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
In order to consolidate the multiple ways to associate an IRQ chip with
a GPIO chip, move more fields into the new struct gpio_irq_chip.
Signed-off-by: Thierry Reding <[email protected]>
Acked-by: Grygorii Strashko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Fugang Duan <[email protected]>
Cc: Peter Chen <[email protected]>
Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use builtin_platform_driver() helper to simplify the code.
Signed-off-by: Geliang Tang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: [email protected]
Signed-off-by: Paul Gortmaker <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This makes the driver use the data pointer added to the gpio_chip
to store a pointer to the state container instead of relying on
container_of().
Cc: Stefan Agner <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Cc: Rafał Miłecki <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Alek Du <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Lee Jones <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Acked-by: Hans-Christian Egtvedt <[email protected]>
Acked-by: Jacek Anaszewski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Replace all trivial request/free callbacks that do nothing but call into
pinctrl code with the generic versions.
Signed-off-by: Jonas Gorski <[email protected]>
Reviewed-by: Thomas Petazzoni <[email protected]>
Acked-by: James Hogan <[email protected]>
Acked-by: Stefan Agner <[email protected]>
Acked-by: Joachim Eastwood <[email protected]>
Acked-by: Gregory CLEMENT <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: Jiang Liu <[email protected]>
|
|
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 <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: [email protected]
|
|
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.
Preparatory patch for the removal of the 'irq' argument from irq flow
handlers.
Signed-off-by: Jiang Liu <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
|
|
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This platform_driver does not need to set an owner, it will be populated by the
driver core.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add a gpiolib and IRQ chip driver for Vybrid ARM SoC using the
Vybrid's GPIO and PORT module. The driver is instanced once per
each GPIO/PORT module pair and handles 32 GPIO's.
Signed-off-by: Stefan Agner <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|