Age | Commit message (Collapse) | Author | Files | Lines |
|
The standby GPIO controller can be used as a interrupt controller.
Select GPIOLIB_IRQCHIP when compiling this driver. Otherwise we get
a compilation error:
drivers/gpio/gpio-xgene-sb.c: In function 'xgene_gpio_sb_probe':
drivers/gpio/gpio-xgene-sb.c:312:10: error: 'struct gpio_chip'
has no member named 'irqdomain'
priv->gc.irqdomain = priv->irq_domain;
^
scripts/Makefile.build:295: recipe for target
'drivers/gpio/gpio-xgene-sb.o' failed
make[2]: *** [drivers/gpio/gpio-xgene-sb.o] Error 1
Fixes: 1013fc41 "gpio: xgene: Enable X-Gene standby GPIO as interrupt controller"
Signed-off-by: Matthias Brugger <[email protected]>
Acked-by: Quan Nguyen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Add support for the TPS65086 PMIC GPOs.
TPS65086 has four configurable GPOs that can be used for several
purposes. These are output only.
Signed-off-by: Andrew F. Davis <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
|
|
I screwed up while merging the immutable branch for TPS65912,
so fixing it unbroken again.
Cc: Lee Jones <[email protected]>
Cc: Andrew F. Davis <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This reverts commit 3fab91ea284a3b795327dda915a3c150a49e4be2.
|
|
GPIO chip structure already has "parent" field which is used for the
same purpose as "dev" field in gpio_bank structure - store pointer on
GPIO device.
Hence, drop duplicated "dev" field from gpio_bank structure.
Signed-off-by: Grygorii Strashko <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel
|
|
Setting gc->direction_output to gc->direction_output looks strange.
I think this change makes the intention more clear.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
*read_reg and *write_reg can be removed because at all the places to call
them, we can just use gc->read_reg/gc->write_reg instead.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
For devtype with specific gpio_dir_out implementation, current code is
wrong because below code sets both gc->direction_output and
mpc8xxx_gc->direction_output to the same function.
gc->direction_output = devtype->gpio_dir_out ?: gc->direction_output;
mpc8xxx_gc->direction_output = gc->direction_output;
Set mpc8xxx_gc->direction_output = gc->direction_output first to fix it.
This way mpc8xxx_gc->direction_output actually calls the standard
bgpio_dir_out() to update register.
Fixes: commit 42178e2a1e42 ("drivers/gpio: Switch gpio-mpc8xxx to use gpio-generic")
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch adds support for the mcp23s18 which is very similar to
the mcp23s17. A couple of control bits are not the same.
Notable IOCON_HAEN (s17 only) & IOCON_INTCC. Which can be ignored.
Patch changes the following:
- Add mcp23s18 types.
- Always set mirror bit if the dts defines mcp23s18. regardless of type.
Mirror bit is ignored on 8 bit devices anyway.
- In mcp23s08_probe use chip.ngpio instead of logic based on type
to determine number of gpio lins to increment by. This is set
appropiately by the call to mcp23s08_probe_one.
- Add mcp23s18 to device tree documentation.
- Remove statement that irqs don't work for spi. They do.
Tested with mcp23s18.
Signed-off-by: Phil Reid <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The 16Z127 is a 32bit GPIO controller on a MCB FPGA.
Every single line can be configured as input and output.
Push pull and open drain are supported as well as setting
a debounce value for the input lines.
Signed-off-by: Andreas Werner <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The implementation of lp3943_gpio_request/lp3943_gpio_free test pin_used
for tracing the pin usage. However, gpiolib already checks FLAG_REQUESTED
flag for the same purpose. So remove the redundant implementation.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Replace calls to devm_request_mem_region and devm_ioremap with a
direct call to devm_ioremap_resource instead and modify error
handling.
Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more
clear.
A simplified version of the Coccinelle semantic patch that is used to
make this change is as follows:
//<smpl>
@nm@
expression myname;
identifier i;
@@
struct platform_driver i = { .driver = { .name = myname } };
@@
expression dev,res,size,e1,e;
expression nm.myname;
@@
-if (!devm_request_mem_region(dev, res->start, size,
- \(res->name\|dev_name(dev)\|myname\)))
{
- ...
- return ...;
-}
... when != res->start = e1
e =
-devm_ioremap(dev,res->start,size);
+devm_ioremap_resource(dev,res);
if
-(e == NULL)
+(IS_ERR(e))
{
...
-return ...;
+return PTR_ERR(e);
}
//</smpl>
Further, updated error handling by hand as devm_ioremap_resource
gives appropriate error messages, so remove unnecessary error
messages.
Signed-off-by: Amitoj Kaur Chawla <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The TS-4800 is an i.MX515 board. Its GPIO driver should only be compiled
for this CPU or for test builds.
Signed-off-by: Julien Grossholtz <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
|
|
The original code of gpiodev_add_to_list is not very clear which
lead to bugs or compiling warning, reference the following patches:
Bugs:
1. Commit ef7c7553039b ("gpiolib: improve overlap check of range of
gpio").
2. Commit 96098df125c0 ("gpiolib: fix chip order in gpio list")
Warning:
1. Commit e28ecca6eac4 ("gpio: fix warning about iterator").
of gpio").
There is a off-list discussion about how to improve it consequently.
This commit try to follow this by rewriting the whole functions.
Tested pass with my gpio mockup driver and test scripts[1].
[1] http://www.spinics.net/lists/linux-gpio/msg09598.html
Suggested-by: Arnd Bergmann <[email protected]>
Signed-off-by: Bamvor Jian Zhang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
These fields are initialized by bgpio_init() with exactly the same settings
so remove the redundant code.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
I named the field representing the current user of GPIO line as
"label" but this is too vague and ambiguous. Before anyone gets
confused, rename it to "consumer" and indicate clearly in the
documentation that this is a string set by the user of the line.
Also clean up leftovers in the documentation.
Signed-off-by: Linus Walleij <[email protected]>
|
|
We started to assign the gpio_device as parent for the sysfs
but this changes the expected layout of sysfs. Restore the
previous behaviour.
Signed-off-by: Bamvor Jian Zhang <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This driver has .can_sleep flag set.
So the pisosr_gpio_get() can be called from contexts that can sleep.
Thus use the cansleep() variant in pisosr_gpio_refresh().
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
gpio->load_gpio is optional, so use devm_gpiod_get_optional instead.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Andrew F. Davis <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
ret variable can contain error values and is compared with zero.
Its type must be signed.
The problem has been detected using coccinelle script
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: Andrzej Hajda <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.
Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Both chip->base and chip->label are correctly set by bgpio_init().
Signed-off-by: Axel Lin <[email protected]>
Tested-by: Julien Grossholtz <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use list_for_each_entry to simplify the code a bit.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Gregory Fong <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Move the code checking valid gpio count to cover both DT and non-DT cases.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Alban Bedel <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
into devm-gpiochip-add-data
|
|
gpio->load_gpio is optional, so use devm_gpiod_get_optional instead.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Andrew F. Davis <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
ret variable can contain error values and is compared with zero.
Its type must be signed.
The problem has been detected using coccinelle script
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: Andrzej Hajda <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.
This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.
Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Both chip->base and chip->label are correctly set by bgpio_init().
Signed-off-by: Axel Lin <[email protected]>
Tested-by: Julien Grossholtz <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use list_for_each_entry to simplify the code a bit.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Gregory Fong <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Move the code checking valid gpio count to cover both DT and non-DT cases.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Alban Bedel <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The R-Car GPIO driver handles Runtime PM for requested GPIOs only.
When using a GPIO purely as an interrupt source, no Runtime PM handling
is done, and the GPIO module's clock may not be enabled.
To fix this:
- Add .irq_request_resources() and .irq_release_resources() callbacks
to handle Runtime PM when an interrupt is requested,
- Add irq_bus_lock() and sync_unlock() callbacks to handle Runtime PM
when e.g. disabling/enabling an interrupt, or configuring the
interrupt type.
Fixes: d5c3d84657db57bd "net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTS"
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
devm_get_gpiod_from_child() tries several property suffixes to find a
GPIO descriptor. If all suffixes fail and no probe deferral has been
detected, it returns the error of the last try.
However, if any but the last try fails with a real error (e.g. -EBUSY),
this error is not propagated, and -ENOENT will be returned.
This confuses drivers that e.g. want to detect if a GPIO is already in
use.
To fix this, change the loop logic to continue on -ENOENT, which
indicates the property was not found and the next suffix should be
tried, and propagate all other detected errors.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
Cc: [email protected]
Acked-by: Charles Keepax <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
Cc: [email protected]
Acked-by: Charles Keepax <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
Cc: [email protected]
Acked-by: Charles Keepax <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|
|
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <[email protected]>
|