Linus Walleij [Thu, 25 Feb 2016 13:22:10 +0000 (14:22 +0100)]
Merge branch 'devm_gpiochip' of https://github.com/ldewangan/linux-upstream into devm-gpiochip-add-data
Axel Lin [Mon, 22 Feb 2016 12:16:51 +0000 (20:16 +0800)]
gpio: pisosr: Use devm_gpiod_get_optional for gpio->load_gpio
gpio->load_gpio is optional, so use devm_gpiod_get_optional instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Andrzej Hajda [Tue, 23 Feb 2016 06:45:34 +0000 (07:45 +0100)]
gpio: xgene: fix type of variable containing error codes
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 <a.hajda@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Simon Horman [Tue, 23 Feb 2016 01:36:51 +0000 (10:36 +0900)]
gpio: rcar: Use ARCH_RENESAS
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 <horms+renesas@verge.net.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Axel Lin [Sat, 20 Feb 2016 06:22:46 +0000 (14:22 +0800)]
gpio: ts4800: Drop redundant code to set already initialized gpio_chip fields
Both chip->base and chip->label are correctly set by bgpio_init().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Julien Grossholtz <julien.grossholtz@savoirfairelinux.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Axel Lin [Sat, 20 Feb 2016 01:50:37 +0000 (09:50 +0800)]
gpio: brcmstb: Use list_for_each_entry at appropriate places
Use list_for_each_entry to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Axel Lin [Sat, 20 Feb 2016 01:48:07 +0000 (09:48 +0800)]
gpio: ath79: Check valid gpio count for both DT and non-DT cases
Move the code checking valid gpio count to cover both DT and non-DT cases.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Geert Uytterhoeven [Thu, 18 Feb 2016 16:06:30 +0000 (17:06 +0100)]
gpio: rcar: Add Runtime PM handling for interrupts
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 <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Geert Uytterhoeven [Fri, 19 Feb 2016 10:00:50 +0000 (11:00 +0100)]
gpio: Propagate all errors in devm_get_gpiod_from_child()
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 <geert+renesas@glider.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: xgene: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Tue, 23 Feb 2016 14:55:04 +0000 (20:25 +0530)]
gpio: xgene-sb: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: wm8994: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: vx855: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: viperboard: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: ucb1400: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: twl6040: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: ts5500: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: ts4800: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tps65912: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tps65910: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tps6586x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: timberdale Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tegra: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tc3589x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: tb10x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: syscon: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: sx150x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: stp-xway: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: sta2x11: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: spear-spics: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: sch: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: rdc321x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: rc5t583: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: palmas: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: pcf857x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: pca953x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: octeon: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: mxc: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: mvebu: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: moxart: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: mc9s08dz60: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: lynxpoint: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: lpc32xx: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: lp3943: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: kempld: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: janz-ttl: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: iop: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: generic: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: ge: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: f7188x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: ep93xx: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: dln2: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: da9055: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Support Opensource <support.opensource@diasemi.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: da9052: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: cs5535: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: crystalcove: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
call of gpiochip_remove() from error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: clps711x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: bcm-kona: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Ray Jui <rjui@broadcom.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: arizona: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: adp5588: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from remove callback.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: adnp: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Laxman Dewangan [Mon, 22 Feb 2016 12:13:28 +0000 (17:43 +0530)]
gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
Laxman Dewangan [Mon, 22 Feb 2016 09:34:08 +0000 (15:04 +0530)]
gpio: Add missing devm_gpio_ wrapper in devres.txt
Add following missing devm wrappers in file devrs.txt under
list of managed interfaces.
devm_gpio_request()
devm_gpio_request_one()
devm_gpio_free()
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 22 Feb 2016 09:30:08 +0000 (15:00 +0530)]
gpio: Add resource management devm_gpio_chip_{add_data,remove}
Add devm wrappers for the gpiochip_add_data() and gpiochip_remove().
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Mon, 15 Feb 2016 11:02:09 +0000 (16:32 +0530)]
gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove
Add device managed APIs devm_gpiochip_add_data() and
devm_gpiochip_remove() for the APIs gpiochip_add_data()
and gpiochip_remove().
This helps in reducing code in error path and sometimes
removal of .remove callback for driver unbind.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Laxman Dewangan [Tue, 23 Feb 2016 14:07:08 +0000 (19:37 +0530)]
Merge remote-tracking branch 'linusw-gpio/for-next' into devm_gpiochip
Base for demv_gpiochip_add_data() and devm_gpiochip_remove().
ldewangan [Tue, 23 Feb 2016 14:03:35 +0000 (19:33 +0530)]
Share upstreaming patches
Share multiple bulk changes.
Markus Pargmann [Tue, 23 Feb 2016 07:54:46 +0000 (08:54 +0100)]
tools: gpio: Small updates for output format
Use %2d for the GPIO line number. This should align the results
horziontally for most gpio chips.
The GPIO label uses quotes for real values. For GPIO names this is
currently missing. The patch adds the missing quote.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Mon, 22 Feb 2016 12:47:49 +0000 (13:47 +0100)]
Merge branch 'devel' into for-next
Linus Walleij [Mon, 22 Feb 2016 12:44:53 +0000 (13:44 +0100)]
gpio: fixup line flags for userspace ABI
This fixes the wrongly indicated lines in the userspace
ABI: test for the right BITS, do not treat bit numbers as
bitmasks.
Reported-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Sat, 20 Feb 2016 11:53:31 +0000 (12:53 +0100)]
Revert "gpio: remove broken irq_to_gpio() interface"
This reverts commit
ee2204a37957daed80418ea8ffc4f5c3146fb8e7.
Bamvor Jian Zhang [Sat, 20 Feb 2016 05:13:19 +0000 (13:13 +0800)]
gpiolib: fix crash when gpiochip removed
Commit
cb464a88e1ed ("gpio: make the gpiochip a real device") call
gpiochip_sysfs_unregister after the gpiochip is empty. It lead to the
following crash:
[ 163.503994] Unable to handle kernel NULL pointer dereference at virtual address
0000007c
[...]
[ 163.525394] [<
ffffffc0003719a0>] gpiochip_sysfs_unregister+0x44/0xa4
[ 163.525611] [<
ffffffc00036f6a0>] gpiochip_remove+0x24/0x154
[ 163.525861] [<
ffffffbffc00f0a4>] mockup_gpio_remove+0x38/0x64 [gpio_mockup]
[ 163.526101] [<
ffffffc00042b4b4>] platform_drv_remove+0x24/0x64
[ 163.526313] [<
ffffffc000429cc8>] __device_release_driver+0x7c/0xfc
[ 163.526525] [<
ffffffc000429e54>] driver_detach+0xbc/0xc0
[ 163.526700] [<
ffffffc000429014>] bus_remove_driver+0x58/0xac
[ 163.526883] [<
ffffffc00042a4cc>] driver_unregister+0x2c/0x4c
[ 163.527067] [<
ffffffc00042b5c0>] platform_driver_unregister+0x10/0x18
[ 163.527284] [<
ffffffbffc00f340>] mock_device_exit+0x10/0x38 [gpio_mockup]
[ 163.527593] [<
ffffffc00011cefc>] SyS_delete_module+0x1b8/0x1fc
[ 163.527799] [<
ffffffc000085d8c>] __sys_trace_return+0x0/0x4
[ 163.528049] Code:
940d74b4 f9019abf aa1303e0 940d7439 (
7940fac0)
[ 163.536273] ---[ end trace
3d1329be504af609 ]---
This patch fix this by changing the code back.
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Sudip Mukherjee [Fri, 19 Feb 2016 09:23:00 +0000 (14:53 +0530)]
gpio: pisosr: add missing unlock
If spi_read() fails then we just returned but we missed unlocking the
mutex.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Quan Nguyen [Wed, 17 Feb 2016 13:15:08 +0000 (20:15 +0700)]
gpio: X-Gene standby GPIO controller DTS binding
Update description for X-Gene standby GPIO controller DTS binding to
support GPIO line configuration as input, output or external IRQ pin.
Signed-off-by: Y Vo <yvo@apm.com>
Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Quan Nguyen [Wed, 17 Feb 2016 13:15:07 +0000 (20:15 +0700)]
gpio: xgene: Enable X-Gene standby GPIO as interrupt controller
Enable X-Gene standby GPIO controller as interrupt controller to provide
its own resources. This avoids ambiguity where GIC interrupt resource is
use as X-Gene standby GPIO interrupt resource in user driver.
Signed-off-by: Y Vo <yvo@apm.com>
Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:43:48 +0000 (14:43 +0100)]
MIPS: txx9: rbtx4938: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:40:40 +0000 (14:40 +0100)]
MIPS: txx9: iocled: use gpiochip data pointer
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: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:37:16 +0000 (14:37 +0100)]
MIPS: rb532: use gpiochip data pointer
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: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:33:54 +0000 (14:33 +0100)]
MIPS: txx9: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:28:45 +0000 (14:28 +0100)]
MIPS: jz4740: use gpiochip data pointer
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: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:22:32 +0000 (14:22 +0100)]
MIPS: bcm63xx: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:15:03 +0000 (14:15 +0100)]
MIPS: ar7: use gpiochip data pointer
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: linux-mips@linux-mips.org
Cc: Alban Bedel <albeu@free.fr>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:08:42 +0000 (14:08 +0100)]
MIPS: alchemy: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: linux-mips@linux-mips.org
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:03:48 +0000 (14:03 +0100)]
m68k: gpio: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 13:01:01 +0000 (14:01 +0100)]
blackfin: extgpio: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Steven Miao <realmz6@gmail.com>
Cc: adi-buildroot-devel@lists.sourceforge.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 12:54:10 +0000 (13:54 +0100)]
blackfin: gpio: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Steven Miao <realmz6@gmail.com>
Cc: adi-buildroot-devel@lists.sourceforge.net
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 12:28:31 +0000 (13:28 +0100)]
ARM: plat-orion: use gpiochip data pointer
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: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 10:24:57 +0000 (11:24 +0100)]
ARM: w90x900: use gpiochip data pointer
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: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 10:20:44 +0000 (11:20 +0100)]
ARM: simpad: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 10:16:53 +0000 (11:16 +0100)]
ARM: s3c24xx: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 10:08:52 +0000 (11:08 +0100)]
ARM: ixp4xx: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 10:03:12 +0000 (11:03 +0100)]
ARM: imx: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 09:56:49 +0000 (10:56 +0100)]
ARM: gemini: switch to gpiochip_add_data()
We're planning to remove the gpiochip_add() function to swith
to gpiochip_add_data() with NULL for data argument.
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Tue, 8 Dec 2015 09:51:43 +0000 (10:51 +0100)]
ARM: scoop: use gpiochip data pointer
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: arm@kernel.org
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Mon, 7 Dec 2015 22:48:26 +0000 (23:48 +0100)]
pinctrl: cygnus-gpio: use gpiochip data pointer
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: bcm-kernel-feedback-list@broadcom.com
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Jon Mason <jonmason@broadcom.com>
Acked-by: Ray Jui <rjui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Fri, 12 Feb 2016 21:25:22 +0000 (22:25 +0100)]
gpio: add userspace ABI for GPIO line information
This adds a GPIO line ABI for getting name, label and a few select
flags from the kernel.
This hides the kernel internals and only tells userspace what it
may need to know: the different in-kernel consumers are masked
behind the flag "kernel" and that is all userspace needs to know.
However electric characteristics like active low, open drain etc
are reflected to userspace, as this is important information.
We provide information on all lines on all chips, later on we will
likely add a flag for the chardev consumer so we can filter and
display only the lines userspace actually uses in e.g. lsgpio,
but then we first need an ABI for userspace to grab and use
(get/set/select direction) a GPIO line.
Sample output from "lsgpio" on ux500:
GPIO chip: gpiochip7, "
8011e000.gpio", 32 GPIO lines
line 0: unnamed unlabeled
line 1: unnamed unlabeled
(...)
line 25: unnamed "SFH7741 Proximity Sensor" [kernel output open-drain]
line 26: unnamed unlabeled
(...)
Tested-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Linus Walleij [Fri, 12 Feb 2016 13:48:23 +0000 (14:48 +0100)]
gpio: store reflect the label to userspace
The gpio_chip label is useful for userspace to understand what
kind of GPIO chip it is dealing with. Let's store a copy of this
label in the gpio_device, add it to the struct passed to userspace
for GPIO_GET_CHIPINFO_IOCTL and modify lsgpio to show it.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>