summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* gpio: omap: prepare and unprepare the debounce clockRajendra Nayak2014-05-161-5/+5
| | | | | | | | | | | | | | | Replace the clk_enable()s with a clk_prepare_enable() and the clk_disables()s with a clk_disable_unprepare() This never showed issues due to the OMAP platform code (hwmod) leaving these clocks in clk_prepare()ed state by default. Reported-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: Add helpers for optional GPIOsThierry Reding2014-05-092-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce gpiod_get_optional() and gpiod_get_index_optional() helpers that make it easier for drivers to handle optional GPIOs. Currently in order to handle optional GPIOs, a driver needs to special case error handling for -ENOENT, such as this: gpio = gpiod_get(dev, "foo"); if (IS_ERR(gpio)) { if (PTR_ERR(gpio) != -ENOENT) return PTR_ERR(gpio); gpio = NULL; } if (gpio) { /* set up GPIO */ } With these new helpers the above is reduced to: gpio = gpiod_get_optional(dev, "foo"); if (IS_ERR(gpio)) return PTR_ERR(gpio); if (gpio) { /* set up GPIO */ } While at it, device-managed variants of these functions are also provided. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: pca953x: request a shared interruptToby Smith2014-05-091-1/+2
| | | | | | | Request a shared interrupt when requesting a pca953x GPIO interrupt Signed-off-by: Toby Smith <toby@tismith.id.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: pca953x: return IRQ_NONE when appropriateToby Smith2014-05-091-2/+4
| | | | | | | | The irq handler should return IRQ_NONE or IRQ_HANDLED to report if we have handled the interrupt. Signed-off-by: Toby Smith <toby@tismith.id.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: mvebu: Remove initcall-based driver initializationEzequiel Garcia2014-05-091-6/+1Star
| | | | | | | | | | There's no reason to use an initcall to initialize this driver, and regular module_platform_driver() can be used instead. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: zevio: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: xilinx: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: tegra: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: palmas: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: mvebu: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: mcp23s08: Make of_device_id array constJingoo Han2014-05-091-2/+2
| | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: grgpio: Make of_device_id array constJingoo Han2014-05-091-1/+1
| | | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: zevio: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: tps65910: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: tps6586x: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: tegra: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: SPEAr: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: rdc321x: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: rcar: remove unnecessary OOM messagesJingoo Han2014-05-091-1/+0Star
| | | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: rc5t583: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: palmas: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: mvebu: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: moxart: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: lynxpoint: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: janz-ttl: remove unnecessary OOM messagesJingoo Han2014-05-091-1/+0Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: em: remove unnecessary OOM messagesJingoo Han2014-05-091-1/+0Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: davinci: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: adp5588: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: adp5520: remove unnecessary OOM messagesJingoo Han2014-05-091-3/+1Star
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: always enable GPIO_OMAP on ARCH_OMAPArnd Bergmann2014-05-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Commit 4df42de9d3e "gpio: omap: add a GPIO_OMAP option instead of using ARCH_OMAP" made it possible to build OMAP kernels without the GPIO driver, which at least on OMAP2 and OMAP3 causes build errors because of functions used by the platform power management code: arch/arm/mach-omap2/built-in.o: In function `omap_sram_idle': arch/arm/mach-omap2/pm24xx.c:129: undefined reference to `omap2_gpio_prepare_for_idle' arch/arm/mach-omap2/pm24xx.c:129: undefined reference to `omap2_gpio_resume_after_idle' We presumably always want the GPIO driver on OMAP, so this adds a slightly broader dependency and only allows disabling the driver only when no OMAP2PLUS platform is selected. However, it seems entirely reasonable to include the driver in build tests on other platforms, so we should also allow building it for COMPILE_TEST builds and select the required GENERIC_IRQ_CHIP that may not already be enabled on other platforms. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: pl061: use BIT() macro instead of shifting bitsJavier Martinez Canillas2014-05-031-13/+13
| | | | | | | | | Using the BIT() macro instead of shifting bits makes the code less error prone and also more readable. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: omap: use BIT() macro instead of shifting bitsJavier Martinez Canillas2014-05-031-25/+25
| | | | | | | | | Using the BIT() macro instead of shifting bits makes the code less error prone and also more readable. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: kempld: use BIT() macro instead of shifting bitsJavier Martinez Canillas2014-05-031-1/+1
| | | | | | | | | Using the BIT() macro instead of shifting bits makes the code less error prone and also more readable. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: em: use BIT() macro instead of shifting bitsJavier Martinez Canillas2014-05-031-1/+1
| | | | | | | | | Using the BIT() macro instead of shifting bits makes the code less error prone and also more readable. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: Fix gpio_get -> gpiod_get typo in kernel-docThierry Reding2014-05-031-1/+1
| | | | | | | | The function is called gpiod_get(), not gpio_get(). Fix the kernel-doc comment to match the name. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: of: Allow -gpio suffix for property namesThierry Reding2014-04-281-6/+12
| | | | | | | | | | Many bindings use the -gpio suffix in property names. Support this in addition to the -gpios suffix when requesting GPIOs using the new descriptor-based API. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: omap: implement get_directionYegor Yefremov2014-04-281-0/+17
| | | | | | | | | | | | | This patch implements gpio_chip's get_direction() routine, that lets other drivers get particular GPIOs direction using struct gpio_desc. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: of: Remove unneeded dummy functionThierry Reding2014-04-281-9/+0Star
| | | | | | | | of_find_gpio() is always called under an IS_ENABLED(CONFIG_OF), so the dummy implementation provided for !OF configurations is not needed. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: do not set up hardware for IRQ_TYPE_NONELinus Walleij2014-04-281-2/+8
| | | | | | | | | | | | | | | | | | Some GPIO irqchip drivers exploit the irqdomain mapping function to set up the IRQ default type in the hardware, make sure that if we pass IRQ_TYPE_NONE, no hardware setup whatsoever takes place (this should be the norm) until later when the IRQ gets utilized. Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: linux-omap <linux-omap@vger.kernel.org> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Javier Martinez Canillas <javier@dowhile0.org> Tested-by: Nishanth Menon <nm@ti.com> Acked-by: Nishanth Menon <nm@ti.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: rdc321x: Convert to use devm_kzallocAxel Lin2014-04-281-13/+6Star
| | | | | | | | This saves a few unwind code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: rcar: Add minimal runtime PM supportGeert Uytterhoeven2014-04-281-0/+8
| | | | | | | | | | This is just enough to automatically enable the functional clock, if present. Clock management during suspend/resume is still to be added. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: linux-gpio@vger.kernel.org Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: kempld: Fix autoloading of moduleAxel Lin2014-04-281-1/+1
| | | | | | | | | Make the module alias match the platform device name, so gpio-kempld module should now autoload correctly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: sch311x: Slightly refactor sch311x_detect for better readabilityAxel Lin2014-04-281-4/+12
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: pl061/sx150x: Remove unneeded include of linux/workqueue.hAxel Lin2014-04-282-2/+0Star
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: max730x: Remove kfree(ts) in __max730x_remove()Axel Lin2014-04-281-3/+2Star
| | | | | | | | | | The memory for ts is allocated by devm_kzalloc now, so the kfree is not required. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Juergen Beisert <jbe@pengutronix.de> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: ge: Convert to platform driverAlexander Shiyan2014-04-281-121/+53Star
| | | | | | | This patch converts GE I/O FPGA GPIO driver to platform driver. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpiolib: of: remove gpio_to_desc() usageLinus Walleij2014-04-281-1/+1
| | | | | | | | | | | | As demonstrated by commit 390d82e312c56b75407a3606cbcde8c4bc7f10ae "gpiolib: ACPI: remove gpio_to_desc() usage" gpio_to_desc() must die. Replace one of its usage by the newly-introduced gpiochip_get_desc() function. Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: zevio: Get correct gpio output valueAxel Lin2014-04-281-2/+8
| | | | | | | | | Read gpio output value from ZEVIO_GPIO_OUTPUT. The spin_lock is required to ensure the direction is not changed before reading input/ouput value. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio: put GPIO IRQs into their own lock classLinus Walleij2014-04-281-0/+7
| | | | | | | | | | | Another feature that is duplicated in a number of GPIO irqchips is that these cascades IRQs are assigned their own lock class so as to avoid warnings about lockdep recursions. Do this also in the generic GPIO irqchip helpers for smooth transition to this core infrastructure. Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* gpio-sch: set output level after configuration of directionDaniel Krueger2014-04-281-4/+22
| | | | | | | | | | | | | | According to the datasheet, writing to the level register has no effect when GPIO is programmed as input. Actually the the level register is read-only when configured as input. Thus presetting the output level before switching to output is _NOT_ possible. Any writes are lost! Hence we set the level after configuring the GPIO as output. But we cannot prevent a short low pulse if direction is set to high and an external pull-up is connected. Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>