Age | Commit message (Collapse) | Author | Files | Lines |
|
It's hard for occasional GPIO code reader/writer to know if values 0/1
equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and
GPIO_LINE_DIRECTION_OUT to help them out.
NOTE - for gpio-amd-fch and gpio-bd9571mwv:
This commit also changes the return value for direction get to equal 1
for direction INPUT. Prior this commit these drivers might have
returned some other positive value but 1 for INPUT.
Signed-off-by: Matti Vaittinen <[email protected]>
Acked-by: Scott Branden <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
Reviewed-by: Michal Simek <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Acked-by: Kuppuswamy Sathyanarayanan <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Enrico Weigelt <[email protected]>
Reviewed-by: Kate Stewart <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This is a GPIO driver, include only <linux/gpio/driver.h>.
Signed-off-by: Linus Walleij <[email protected]>
|
|
Allow gpiolib to read back the current IO direction configuration by
implementing the .get_direction callback. This, in part, allows
debugfs to report the complete true hardware state rather than the
software state.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use IO accessors to access the SA1100 registers rather than accessing
them directly.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use sa11x0_gpio_set_wake() to set the PWER register, as provided by
Dmitry some time back.
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
ucb1x00 has used IRQ probing since it's dawn to find the GPIO interrupt
that it's connected to. However, commit 23393d49fb75 ("gpio: kill off
set_irq_flags usage") broke this by disabling IRQ probing on GPIO
interrupts. Fix this.
Fixes: 23393d49fb75 ("gpio: kill off set_irq_flags usage")
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
For completion, sweep the floor from all gpiochip_add() usage so
we can remove that function and get rid of the function wrapper
gpiochip_add().
Signed-off-by: Linus Walleij <[email protected]>
|
|
As we want gpio_chip .get() calls to be able to return negative
error codes and propagate to drivers, we need to go over all
drivers and make sure their return values are clamped to [0,1].
We do this by using the ret = !!(val) design pattern.
Cc: Russell King <[email protected]>
Cc: Dmitry Eremin-Solenikov <[email protected]>
Cc: Kristoffer Ericson <[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]>
|
|
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: Rob Herring <[email protected]>
Cc: Michael Hennerich <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: Ray Jui <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
|
|
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.
Search and update was done with coccinelle and the invaluable help of
Julia Lawall.
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Julia Lawall <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Cc: [email protected]
|
|
The irq_domain_ops are not modified by the driver and the irqdomain core
code accepts pointer to a const data.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
As a part of driver consolidation, move GPIO-related IRQ code to
drivers/gpio/gpio-sa1100.c. The code does not use GPIOLIB_IRQCHIP (yet),
because sa1100 does not have a device for gpios, which is a requirement
for GPIOLIB_IRQCHIP. This will be the next step.
Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
Low GPIO pins use an interrupt in SC interrupts space. However it's
possible to handle them as if all the GPIO interrupts are instead tied
to single GPIO handler, which later decodes GEDR register and
chain-calls next IRQ handler. So split first 11 interrupts into system
part (IRQ_GPIO0_SC - IRQ_GPIO10_SC) which work exactly like the rest of
system controller interrupts and real GPIO interrupts
(IRQ_GPIO0..IRQ_GPIO10). A single handler sa1100_gpio_handler then
decodes and calls next handler.
Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
The SA1100 was implementing its own variants of gpio_get_value()
and gpio_set_value() and only selectively falling back to
gpiolib for extended (EGPIO) handling. However the driver in
gpio/gpio-sa1100.c already handles the same functionality for
these lines, yet remain unused.
The only upside would be things like a timing-critical hotpath
on bit-banged GPIO, but that kind of things does not seem to
happen on these GPIOs, so it is not worth having the extra
complexity.
Tested with some buttons on the Compaq iPAQ H3630.
Cc: Kristoffer Ericson <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
In preparation to convert SA1100 to sparse irq, set .nr_irqs for each machine
and explicitly include mach/irqs.h as needed.
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
The existing gpio_to_irq() implementation on sa1100 only translates
validly for internal GPIOs. Since this sub-arch enables GPIOLIB
support, this results in buggy translations for non-internal GPIOs.
Get rid of the private gpio_to_irq() implementation, replacing it
with the .to_irq method in the sa1100 gpio chip instead.
Signed-off-by: Russell King <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
|
|
As per example from the other ARM boards, push the SA100
GPIO driver down to the GPIO subsystem so it can be consolidated.
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King <[email protected]>
|