summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'gpio-v3.18-1' of ↵Linus Torvalds2014-10-0922-478/+1054
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO changes from Linus Walleij: "This is the bulk of GPIO changes for the v3.18 development cycle: - Increase the default ARCH_NR_GPIO from 256 to 512. This was done to avoid having a custom <asm/gpio.h> header for the x86 architecture - GPIO is custom and complicated enough as it is already! We want to move to a radix to store the descriptors going forward, and finally get rid of this fixed array size altogether. - Endgame patching of the gpio_remove() semantics initiated by Abdoulaye Berthe. It is not accepted by the system that the removal of a GPIO chip fails during eg reboot or shutdown, and therefore the return value has now painfully been refactored away. For special cases like GPIO expanders on a hot-pluggable bus like USB, we may later add some gpiochip_try_remove() call, but for the cases we have now, return values are moot. - Some incremental refactoring of the gpiolib core and ACPI GPIO library for more descriptor usage. - Refactor the chained IRQ handler set-up method to handle also threaded, nested interrupts and set up the parent IRQ correctly. Switch STMPE and TC3589x drivers to use this registration method. - Add a .irq_not_threaded flag to the struct gpio_chip, so that also GPIO expanders that block but are still not using threaded IRQ handlers. - New drivers for the ARM64 X-Gene SoC GPIO controller. - The syscon GPIO driver has been improved to handle the "DSP GPIO" found on the TI Keystone 2 SoC:s. - ADNP driver switched to use gpiolib irqchip helpers. - Refactor the DWAPB driver to support being instantiated from and MFD cell (platform device). - Incremental feature improvement in the Zynq, MCP23S08, DWAPB, OMAP, Xilinx and Crystalcove drivers. - Various minor fixes" * tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (52 commits) gpio: pch: Build context save/restore only for PM pinctrl: abx500: get rid of unused variable gpio: ks8695: fix 'else should follow close brace '}'' gpio: stmpe: add verbose debug code gpio: stmpe: fix up interrupt enable logic gpio: staticize xway_stp_init() gpio: handle also nested irqchips in the chained handler set-up gpio: set parent irq on chained handlers gpiolib: irqchip: use irq_find_mapping while removing irqchip gpio: crystalcove: support virtual GPIO pinctrl: bcm281xx: make Kconfig dependency more strict gpio: kona: enable only on BCM_MOBILE or for compile testing gpio, bcm-kona, LLVMLinux: Remove use of __initconst gpio: Fix ngpio in gpio-xilinx driver gpio: dwapb: fix pointer to integer cast gpio: xgene: Remove unneeded #ifdef CONFIG_OF guard gpio: xgene: Remove unneeded forward declation for struct xgene_gpio gpio: xgene: Fix missing spin_lock_init() gpio: ks8695: fix switch case indentation gpiolib: add irq_not_threaded flag to gpio_chip ...
| * gpio: pch: Build context save/restore only for PMThierry Reding2014-10-021-0/+2
| | | | | | | | | | | | | | | | | | | | The pch_gpio_save_reg_conf() and pch_gpio_restore_reg_conf() functions are only used in pch_gpio_suspend() and pch_gpio_resume(), respectively. Since the latter are only built if PM is enabled, make the former build under the same conditions. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: ks8695: fix 'else should follow close brace '}''Varka Bhadram2014-10-021-6/+4
| | | | | | | | | | Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: stmpe: add verbose debug codeLinus Walleij2014-10-021-0/+75
| | | | | | | | | | | | | | | | To troubleshoot the STMPE GPIO driver, some more detailed debug information giving the exact info on how each pin is used will be helpful. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: stmpe: fix up interrupt enable logicLinus Walleij2014-10-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | The STMPE driver assumes that the passed in IRQ type is for rising or falling IRQs, not both, even though the hardware actually supports this perfectly well. Likewise the check for level IRQs is done against just high or low level types, not for the case where it is combined with other IRQs. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: staticize xway_stp_init()Linus Walleij2014-09-301-1/+1
| | | | | | | | | | | | This initcall is only called from the driver itself, staticize it. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: handle also nested irqchips in the chained handler set-upLinus Walleij2014-09-263-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | To unify how we connect cascaded IRQ chips to parent IRQs, if NULL us passed as handler to the gpiochip_set_chained_irqchip() function, assume the chips is nested rather than chained, and we still get the parent set up correctly by way of this function call. Alter the drivers for tc3589x and stmpe to use this to set up their chained handlers as a demonstration of the usage. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: set parent irq on chained handlersLinus Walleij2014-09-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | If the IRQ from the parent is nested the IRQ may need to be resent under certain conditions. Currently the chained IRQ handler in gpiolib does not handle connecting nested IRQs but it is conceptually correct to indicate the actual parent IRQ. Reported-by: Grygorii Strashko <grygorii.strashko@ti.com> Reported-by: Lothar Waßmann <LW@karo-electronics.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpiolib: irqchip: use irq_find_mapping while removing irqchipGrygorii Strashko2014-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no guarantee that VIRQs will be allocated sequentially for gpio irqchip in gpiochip_irqchip_add(). Therefore, it's unsafe to dispose VIRQ in gpiochip_irqchip_remove() basing on index relatively to stored irq_base value. Hence, use irq_find_mapping for VIRQ finding in gpiochip_irqchip_remove() instead of irq_base + index. Reported-by: Wang, Yalin <Yalin.Wang@sonymobile.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: crystalcove: support virtual GPIOAaron Lu2014-09-251-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtual GPIO introduced in ACPI table of Baytrail-T based system is used to solve a problem under Windows. We do not have such problems under Linux so we do not actually need them. But we have to tell GPIO library that the Crystal Cove GPIO chip has this many GPIO pins or the common GPIO handler will refuse any access to those high number GPIO pins, which will resulted in a failure evaluation of every ACPI control method that is used to turn on/off power resource and/or report sensor temperatures. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> [changed vgpio number from 0x5e to 94] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: kona: enable only on BCM_MOBILE or for compile testingUwe Kleine-König2014-09-251-1/+1
| | | | | | | | | | | | | | | | | | This change makes it easier to configure a kernel for a real machine by not showing the option to enable it at all if COMPILE_TEST is off. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio, bcm-kona, LLVMLinux: Remove use of __initconstBehan Webster2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The __initconst is in the wrong place, and when moved to the correct place it uncovers an error where the variable is used by non-init data structures. Instead merely make them const and put the const in the right spot. Signed-off-by: Behan Webster <behanw@converseincode.com> Reviewed-by: Mark Charlebois <charlebm@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Matt Porter <mporter@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: Fix ngpio in gpio-xilinx driverGernot Vormayr2014-09-241-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | If one adds gpio-controller; to the chip in the devicetree, then initialization fails with 'gpiochip_find_base: cannot find free range', because ngpio is 0. This patch fixes the bug. This version includes the suggestions from Linus Walleij. Tested on ml507 board. Signed-off-by: Gernot Vormayr <gvormayr@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: dwapb: fix pointer to integer castLinus Walleij2014-09-241-2/+2
| | | | | | | | | | | | | | | | The statements BUG_ON(ctx == 0) was implicitly casting a pointer to an integer for comparison. Do this with a bool test instead to get away from sparse warnings. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: xgene: Remove unneeded #ifdef CONFIG_OF guardAxel Lin2014-09-241-2/+0
| | | | | | | | | | | | | | This driver depends on OF_GPIO, so it won't be built if !CONFIG_OF. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: xgene: Remove unneeded forward declation for struct xgene_gpioAxel Lin2014-09-241-2/+0
| | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: xgene: Fix missing spin_lock_init()Axel Lin2014-09-241-0/+1
| | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: ks8695: fix switch case indentationVarka Bhadram2014-09-241-10/+10
| | | | | | | | | | Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpiolib: add irq_not_threaded flag to gpio_chipOctavian Purdila2014-09-241-1/+1
| | | | | | | | | | | | | | | | Some GPIO chips (e.g. the DLN2 USB adapter) have blocking get/set operation but do not need a threaded irq handler. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: Fix return value check in xgene_gpio_probe()Wei Yongjun2014-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | In case of error, the function devm_ioremap_nocache() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * GPIO: gpiolib: trivial: Add missing carriage returnAlexander Shiyan2014-09-231-1/+1
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: omap: Fix interrupt namesNishanth Menon2014-09-231-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When viewing the /proc/interrupts, there is no information about which GPIO bank a specific gpio interrupt is hooked on to. This is more than a bit irritating as such information can esily be provided back to the user and at times, can be crucial for debug. So, instead of displaying something like: 31: 0 0 GPIO 0 palmas 32: 0 0 GPIO 27 mmc0 Display the following with appropriate device name: 31: 0 0 4ae10000.gpio 0 palmas 32: 0 0 4805d000.gpio 27 mmc0 This requires that we create irq_chip instance specific for each GPIO bank which is trivial to achieve. Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Acked-by: Kevin Hilman <khilman@linaro.org> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: samsung: Remove remaining check for CONFIG_S5P_GPIO_DRVSTRPaul Bolle2014-09-231-50/+0
| | | | | | | | | | | | | | | | | | | | Commit d78c16ccde96 ("ARM: SAMSUNG: Remove remaining legacy code") removed the Kconfig symbol S5P_GPIO_DRVSTR. It didn't remove one check for the related macro. Remove that check and the dead code it hides. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: use container_of to resolve cs5535_gpio_chip from gpio_chipFabian Frederick2014-09-231-3/+6
| | | | | | | | | | | | | | Use container_of instead of casting first structure member. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * GPIO: gpio-dwapb: Suspend & Resume PM enablingWeike Chen2014-09-231-0/+115
| | | | | | | | | | | | | | | | | | | | This patch enables suspend and resume mode for the power management, and it is based on Josef Ahmad's previous work. Reviewed-by: Hock Leong Kweh <hock.leong.kweh@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Weike Chen <alvin.chen@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * GPIO: gpio-dwapb: Support DebounceWeike Chen2014-09-231-2/+34
| | | | | | | | | | | | | | | | | | | | This patch enables 'debounce' for the designware GPIO, and it is based on Josef Ahmad's previous work. Reviewed-by: Hock Leong Kweh <hock.leong.kweh@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Weike Chen <alvin.chen@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * GPIO: gpio-dwapb: Change readl&writel to dwapb_read&dwapb_writeWeike Chen2014-09-231-10/+27
| | | | | | | | | | | | | | | | This patch replaces 'readl&writel' with 'dwapb_read&dwapb_write'. Reviewed-by: Shevchenko, Andriy <andriy.shevchenko@intel.com> Signed-off-by: Weike Chen <alvin.chen@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * GPIO: gpio-dwapb: Enable platform driver binding to MFD driverWeike Chen2014-09-232-58/+167
| | | | | | | | | | | | | | | | | | | | | | | | The Synopsys DesignWare APB GPIO driver only supports open firmware devices. But, like Intel Quark X1000 SOC, which has a single PCI function exporting a GPIO and an I2C controller, it is a Multifunction device. This patch is to enable the current Synopsys DesignWare APB GPIO driver to support the Multifunction device which exports the designware GPIO controller. Reviewed-by: Hock Leong Kweh <hock.leong.kweh@intel.com> Signed-off-by: Weike Chen <alvin.chen@intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: gpiolib: set gpiochip_remove retval to voidabdoulaye berthe2014-09-231-17/+7
| | | | | | | | | | | | | | | | This avoids handling gpiochip remove error in device remove handler. Signed-off-by: Abdoulaye Berthe <berthe.ab@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: remove remaining users of gpiochip_remove() retvalLinus Walleij2014-09-234-19/+7
| | | | | | | | | | | | | | | | | | | | | | Some drivers accidentally still use the return value from gpiochip_remove(). Get rid of them so we can simplify this function and get rid of the return value. Cc: Abdoulaye Berthe <berthe.ab@gmail.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * driver:gpio remove all usage of gpio_remove retval in driverabdoulaye berthe2014-09-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | this remove all reference to gpio_remove retval in all driver except pinctrl and gpio. the same thing is done for gpio and pinctrl in two different patches. Signed-off-by: Abdoulaye Berthe <berthe.ab@gmail.com> Acked-by: Michael Büsch <m@bues.ch> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: syscon: reuse for keystone 2 socsGrygorii Strashko2014-09-161-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Keystone SOCs, ARM host can send interrupts to DSP cores using the DSP GPIO controller IP. Each DSP GPIO controller provides 28 IRQ signals for each DSP core. This is one of the component used by the IPC mechanism used on Keystone SOCs. Keystone 2 DSP GPIO controller has specific features: - each GPIO can be configured only as output pin; - setting GPIO value to 1 causes IRQ generation on target DSP core; - reading pin value returns 0 - if IRQ was handled or 1 - IRQ is still pending. This patch updates gpio-syscon driver to be reused by Keystone 2 SoCs, because the Keystone 2 DSP GPIO controller is controlled through Syscon devices and, as requested by Linus Walleij, such kind of GPIO controllers should be integrated with drivers/gpio/gpio-syscon.c driver. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: syscon: retrive syscon node and regs offsets from dtGrygorii Strashko2014-09-161-8/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds handling of new "gpio,syscon-dev" DT property, which allows to specify syscon node and data/direction registers offsets in DT. "gpio,syscon-dev" has following format: gpio,syscon-dev = <&syscon_dev data_reg_offset [direction_reg_offset]>; where - syscon_dev - phandle on syscon node - data_reg_offset - offset of data register (in bytes) - direction_reg_offset - offset of dirrection register (optional, in bytes) for example: gpio,syscon-dev = <&devctrl 0x254>; In such way, the support of multiple Syscon GPIO devices is added. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: syscon: add soc specific callback to assign output valueGrygorii Strashko2014-09-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Some SoCs (like Keystone) may require to perform special sequence of operations to assign output GPIO value, so default implementation of .set() callback from gpio-syscon driver can't be used. Hence, add optional, SoC specific callback to assign output gpio value. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mcp23s08 to support both device tree and platform dataSonic Zhang2014-09-042-31/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device tree is not enabled in some architecture where gpio driver mcp23s08 is still required. v2-changes: - Parse device tree properties into platform data other than individual variables. v3-changes: - Use of_node in gpio_chip device structure, because the struct device * always has an of_node which is NULL when OF is not used. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: zynq: Fixed broken wakeup implementationEzra Savard2014-09-041-14/+20
| | | | | | | | | | | | | | | | | | | | Use of unmask/mask in set_wake was an incorrect implementation. The new implementation correctly sets wakeup for the gpio chip's IRQ so the gpio chip will not sleep while wakeup-enabled gpio are in use. Signed-off-by: Ezra Savard <ezra.savard@xilinx.com> Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: zynq: Mask non-wakeup GPIO interrupts on suspendEzra Savard2014-09-041-1/+3
| | | | | | | | | | | | | | | | | | Added flag to the GPIO chip so that IRQ from non-wakeup GPIO will not wake the system. Signed-off-by: Ezra Savard <ezra.savard@xilinx.com> Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: zynq: Take bank offset into account when reporting a IRQLars-Peter Clausen2014-09-031-1/+9
| | | | | | | | | | | | | | | | | | | | When looking up the IRQ the bank offset needs to be taken into account. Otherwise interrupts for banks other than bank 0 get incorrectly reported as interrupts for bank 0. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: adnp: switch to use irqchip helpersLinus Walleij2014-09-022-108/+48
| | | | | | | | | | | | | | | | | | | | | | This switches the ADNP GPIO driver to use the gpiolib irqchip helpers. Also do some random refactoring to make it look like most other GPIO drivers. Cc: Roland Stigge <stigge@antcom.de> Cc: Lars Poeschel <poeschel@lemonage.de> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: change gpiochip_request_own_desc() prototypeAlexandre Courbot2014-08-292-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current prototype of gpiochip_request_own_desc() requires to obtain a pointer to a descriptor. This is in contradiction to all other GPIO request schemes, and imposes an extra step of obtaining a descriptor to drivers. Most drivers actually cannot even perform that step since the function that does it (gpichip_get_desc()) is gpiolib-private. Change gpiochip_request_own_desc() to return a descriptor from a (chip, hwnum) tuple and update users of this function (currently gpiolib-acpi only). Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: acpi: normalize use of gpiochip_get_desc()Alexandre Courbot2014-08-291-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | GPIO descriptors are changing from unique and permanent tokens to allocated resources. Therefore gpiochip_get_desc() cannot be used as a way to obtain a global GPIO descriptor anymore. This patch updates the gpiolib ACPI support code to keep and use the descriptor returned by a centralized call to gpiochip_get_desc(). Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: zynq: Reduce level of indention in zynq_gpio_irqhandler()Lars-Peter Clausen2014-08-291-12/+19
| | | | | | | | | | | | | | | | | | zynq_gpio_irqhandler() uses up to 7 tabs of indention in some parts. Refactor things to use a helper function for the inner loop to reduce the indention to a sane level. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: zynq: Remove .owner field for driverMichal Simek2014-08-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to init .owner field. Based on the patch from Peter Griffin <peter.griffin@linaro.org> "mmc: remove .owner field for drivers using module_platform_driver" This patch removes the superflous .owner field for drivers which use the module_platform_driver API, as this is overriden in platform_driver_register anyway." Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: Add APM X-Gene SoC GPIO controller supportFeng Kan2014-08-283-0/+260
| | | | | | | | | | | | | | Add APM X-Gene SoC gpio controller driver. Signed-off-by: Feng Kan <fkan@apm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: pca953x: Drop deprecated DT bindingsMarkus Pargmann2014-08-281-51/+3
| | | | | | | | | | | | | | | | Drop deprecated DT bindings and use automaticly assigned gpio and irq bases. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | Merge tag 'pm+acpi-3.17-rc7' of ↵Linus Torvalds2014-09-251-1/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management fixes from Rafael Wysocki: "These are regression fixes (ACPI hotplug, cpufreq, hibernation, ACPI LPSS driver), fixes for stuff that never worked correctly (ACPI GPIO support in some cases and a wrong sign of an error code in the ACPI core in one place), and one blacklist item for ACPI backlight handling. Specifics: - Revert of a recent hibernation core commit that introduced a NULL pointer dereference during resume for at least one user (Rafael J Wysocki). - Fix for the ACPI LPSS (Low-Power Subsystem) driver to disable asynchronous PM callback execution for LPSS devices during system suspend/resume (introduced in 3.16) which turns out to break ordering expectations on some systems. From Fu Zhonghui. - cpufreq core fix related to the handling of sysfs nodes during system suspend/resume that has been broken for intel_pstate since 3.15 from Lan Tianyu. - Restore the generation of "online" uevents for ACPI container devices that was removed in 3.14, but some user space utilities turn out to need them (Rafael J Wysocki). - The cpufreq core fails to release a lock in an error code path after changes made in 3.14. Fix from Prarit Bhargava. - ACPICA and ACPI/GPIO fixes to make the handling of ACPI GPIO operation regions (which means AML using GPIOs) work correctly in all cases from Bob Moore and Srinivas Pandruvada. - Fix for a wrong sign of the ACPI core's create_modalias() return value in case of an error from Mika Westerberg. - ACPI backlight blacklist entry for ThinkPad X201s from Aaron Lu" * tag 'pm+acpi-3.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()" gpio / ACPI: Use pin index and bit length ACPICA: Update to GPIO region handler interface. ACPI / platform / LPSS: disable async suspend/resume of LPSS devices cpufreq: release policy->rwsem on error cpufreq: fix cpufreq suspend/resume for intel_pstate ACPI / scan: Correct error return value of create_modalias() ACPI / video: disable native backlight for ThinkPad X201s ACPI / hotplug: Generate online uevents for ACPI containers
| * | gpio / ACPI: Use pin index and bit lengthSrinivas Pandruvada2014-09-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix code when the operation region callback is for an gpio, which is not at index 0 and for partial pins in a GPIO definition. For example: Name (GMOD, ResourceTemplate () { //3 Outputs that define the Power mode of the device GpioIo (Exclusive, PullDown, , , , "\\_SB.GPI2") {10, 11, 12} }) } If opregion callback calls is for: - Set pin 10, then address = 0 and bit length = 1 - Set pin 11, then address = 1 and bit length = 1 - Set for both pin 11 and pin 12, then address = 1, bit length = 2 This change requires updated ACPICA gpio operation handler code to send the pin index and bit length. Fixes: 473ed7be0da0 (gpio / ACPI: Add support for ACPI GPIO operation regions) Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: 3.15+ <stable@vger.kernel.org> # 3.15+: 75ec6e55f138 ACPICA: Update to GPIO region handler interface. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | | gpio: Fix potential NULL handler data in chained irqchip handlerJarkko Nikula2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is possibility with misconfigured pins that interrupt occurs instantly after setting irq_set_chained_handler() in gpiochip_set_chained_irqchip(). Now if handler gets called before irq_set_handler_data() the handler gets NULL handler data. Fix this by moving irq_set_handler_data() call before irq_set_chained_handler() in gpiochip_set_chained_irqchip(). Cc: Stable <stable@vger.kernel.org> # 3.15+ Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
* | | gpio: Fix gpio direction flags not getting setAdrian Hunter2014-09-241-1/+1
|/ / | | | | | | | | | | | | | | | | | | GPIO direction flags are not getting set because an 'if' statement is the wrong way around. Cc: Stable <stable@vger.kernel.org> # 3.15+ Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | gpio: bt8xx: fix release of managed resourcesMichael Auchter2014-08-291-3/+0
|/ | | | | | | | These resources are managed by devres, and should not be explicitly released. Signed-off-by: Michael Auchter <a@phire.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
OpenPOWER on IntegriCloud