aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2015-04-08gpio: arrange Kconfig symbols alphabeticallyLinus Walleij1-145/+145
This rearranges the GPIO drivers Kconfig symbols alphabetically as the top comment in the file already states they should be. No functional changes whatsoever. Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: ich: Implement get_direction functionAaron Sierra1-0/+6
Allow the kernel to query the driver for a GPIO's pin direction. Signed-off-by: Aaron Sierra <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: use (!foo) instead of (foo == NULL)Varka Bhadram6-7/+7
Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: arizona: drop owner assignment from platform_driversVarka Bhadram1-1/+0
This driver no need to set the owner field, it will be populated by driver core. Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: max7300: remove 'ret' variableVarka Bhadram1-3/+1
Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: use devm_kzallocVarka Bhadram2-5/+5
We can use devres API for allocating memory. No need of using kfree. Signed-off-by: Varka Bhadram <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: sch: use uapi/linux/pci_ids.h directlyMichael S. Tsirkin1-1/+1
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h, use the new header directly so we can drop the wrapper in include/linux/pci_ids.h. Signed-off-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: x-gene: fix devm_ioremap_resource() checkVladimir Zapolskiy1-1/+1
devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never returns NULL, fix the check to prevent access to invalid virtual address. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-08gpio: loongson: Add Loongson-3A/3B GPIO driver supportHuacai Chen2-20/+30
Improve Loongson-2's GPIO driver to support Loongson-3A/3B, and update Loongson-3's default config file. Acked-by: Ralf Baechle <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-04-07MIPS: Move Loongson GPIO driver to drivers/gpioHuacai Chen3-0/+112
Move Loongson-2's GPIO driver to drivers/gpio and add Kconfig options. Acked-by: Ralf Baechle <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: Remove gpio-msm-v1 driverStephen Boyd3-723/+0
This driver is orphaned now that mach-msm has been removed. Delete it. Cc: David Brown <[email protected]> Cc: Bryan Huntsman <[email protected]> Cc: Daniel Walker <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Kumar Gala <[email protected]>
2015-03-27gpio: gpio-tb10x: remove incorrect __exit markupDmitry Torokhov1-1/+1
Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: syscon: reduce message level when direction reg offset not in dtGrygorii Strashko1-1/+1
Now GPIO syscon driver produces bunch of warnings during the boot of Kesytone 2 SoCs: gpio-syscon soc:keystone_dsp_gpio@02620240: can't read the dir register offset! gpio-syscon soc:keystone_dsp_gpio@2620244: can't read the dir register offset! This message unintentionally was added using dev_err(), but its actual log level is debug, because third cell of "ti,syscon-dev" is optional. Hence change it to dev_dbg() as it should be. This patch fixes commit: 5a3e3f8 ("gpio: syscon: retriave syscon node and regs offsets from dt") Reported-by: Russell King <[email protected]> Tested-by: Murali Karicheri <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: get rid of GPIO_INDEX() macroGrygorii Strashko1-9/+0
Now OMAP GPIO driver prepared for GPIO_INDEX() macro removing. Do It ;) Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: get rid of omap_irq_to_gpio()Grygorii Strashko1-12/+5
Now OMAP GPIO driver prepared for omap_irq_to_gpio() removing. Do it ;) Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: get rid of GPIO_BIT() macroGrygorii Strashko1-1/+0
Now OMAP GPIO driver prepared for GPIO_BIT() macro removing. Do it ;) Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: convert gpio irq functions to use GPIO offsetGrygorii Strashko1-33/+34
Convert GPIO IRQ functions to use GPIO offset instead of system GPIO numbers. This allows to drop unneeded conversations between system GPIO <-> GPIO offset which are done in many places and many times. It is safe to do now because: - gpiolib always passes GPIO offset to GPIO controller - OMAP GPIO driver converted to use IRQ domain, so struct irq_data->hwirq contains GPIO offset This is preparation step before removing: #define GPIO_INDEX(bank, gpio) #define GPIO_BIT(bank, gpio) int omap_irq_to_gpio() Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: drop 'gpio' param from omap_gpio_init_irq()Grygorii Strashko1-7/+5
The 'gpio' parameter isn't needed any more as it duplicates 'offset' parameter, so drop it. Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: convert debounce functions switch to use gpio offsetGrygorii Strashko1-7/+7
Convert debounce functions to use GPIO offset instead of system GPIO numbers. This allows to drop unneeded conversations between system GPIO <-> GPIO offset which are done in many places and many times. It is safe to do now because: - gpiolib always passes GPIO offset to GPIO controller - OMAP GPIO driver converted to use IRQ domain This is preparation step before removing: #define GPIO_INDEX(bank, gpio) #define GPIO_BIT(bank, gpio) int omap_irq_to_gpio() Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: simplify omap_set_gpio_dataout_x()Grygorii Strashko1-5/+5
Both functions omap_set_gpio_dataout_reg() and omap_set_gpio_dataout_mask() accept GPIO offset as 'gpio' input parameter, so rename it to 'offset' and drop usage of GPIO_BIT() macro. Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27gpio: omap: convert omap_gpio_is_input() to use gpio offsetGrygorii Strashko1-6/+4
Convert omap_gpio_is_input() to use GPIO offset instead of mask and, in such way, make code simpler and remove few lines of code. Tested-by: Tony Lindgren <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Acked-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-27altera_gpio_probe() can be statickbuild test robot1-1/+1
Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-26mfd: tc3589x: Enforce device-tree only modeLinus Walleij2-3/+1
All systems using the TC3589x multifunction expander uses devicetree, so don't clutter the place with a lot of and assume it is there. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2015-03-26gpio: rcar: Prevent module clock disable when wake-up is enabledGeert Uytterhoeven1-2/+31
When the GPIO module is needed for wake-up, it's module clock must not be disabled. Hence implement irq_chip.irq_set_wake(), which increments/decrements the clock's enable_count when needed, and forwards the wake-up state to the upstream interrupt controller. This fixes wake-up from s2ram using gpio-keys when using a PM Domain to manage the module clock. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-26gpio: rcar: Add more register documentationGeert Uytterhoeven1-12/+12
Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-26gpio: rcar: Use local variable gpio_chip in gpio_rcar_probe()Geert Uytterhoeven1-3/+3
The existing variable gpio_chip already points to the gpiochip instance, hence use it everywhere. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-26gpio/crystalcove: Add additional GPIO for Panel controlShobhit Kumar1-1/+6
Export PANEL_EN/DISABLE (offset 0x52) as additional GPIO. Needed by display driver to enable the DSI panel on BYT platform where the Panel EN/Disable control is routed thorugh CRC PMIC CC: Samuel Ortiz <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Thierry Reding <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Shobhit Kumar <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-19gpio: dwapb: enable for QuarkAndy Shevchenko1-2/+1
The Intel Quark SoC contains the DW GPIO on board. While fixing the build error the commit 1972c97db5b0 (gpio: dwapb: fix compile errors) disables the possibility to build the driver on X86, i.e. Intel Quark. The patch reenables it for Intel Quark as well. Since we have Intel Quark SoC introduced in 4.0-rc1 I would like to make this fix available there as well, though the actual MFD driver [1] is applied only for next version. [1] https://lkml.org/lkml/2015/2/1/217 Fixes: 1972c97db5b0 (gpio: dwapb: fix compile errors) Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-19gpio / ACPI: Use local variable instead of ACPI_HANDLE()Rafael J. Wysocki1-1/+1
In acpi_gpiochip_request_interrupts() the handle local variable already contains the value that we want to pass to acpi_walk_resources(), so it is better to use that variable instead of evaluating ACPI_HANDLE() once more for the same device. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-19gpio / ACPI: Avoid unnecessary checks in __gpiod_get_index()Rafael J. Wysocki1-7/+9
If dev is NULL in __gpiod_get_index() and both ACPI and OF are enabled, it will be checked twice before the code decides to give up with DT/ACPI lookup, so avoid that. Also use the observation that ACPI_COMPANION() is much more efficient than ACPI_HANDLE(), because the latter uses the former and carries out a check and a pointer dereference on top of it, so replace the ACPI_HANDLE() check with an ACPI_COMPANION() one which does not require the additional IS_ENABLED(CONFIG_ACPI) check too. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-19gpiolib: translate pin number in GPIO ACPI callbacksqipeng.zha1-0/+10
If GPIO driver use pin mapping, need to translate pin number between ACPI table and GPIO driver. This issue is found on one platform with Cherryview gpio controller, kernel is hang when executed _PS0 method of one ACPI device, since without this translation, it access invalid gpiodesc array. Verified it works again with this patch. Signed-off-by: qipeng.zha <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-17gpio: f7188x: add GPIO support for F71869AAndreas Bofjall2-5/+25
Add support for the GPIOs found on the Fintek SuperI/O chip F71869A, such as the one found on the Jetway JNF99-525 motherboard, to the f7188x gpio driver. Signed-off-by: Andreas Bofjall <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-17gpio: f7188x: add GPIO support for F71869Andreas Bofjall2-5/+24
Add support for the GPIOs found on the Fintek SuperI/O chip F71869, such as the one found on the Jetway NF96u-525 motherboard, to the f7188x gpio driver. Signed-off-by: Andreas Bofjall <[email protected]> Tested-by: Les Schaffer <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-17gpio: f7188x: correct spelling of "Fintek"Andreas Bofjall1-1/+1
The company is called "Fintek", not "Fintech". Fix it. Signed-off-by: Andreas Bofjall <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-17gpio: fix constconst in devresLinus Walleij1-1/+1
Commit 1feb57a245a4910b03202a814ffc51a900bd4aca "gpio: add parameter to allow the use named gpios" includes a double-consted array. What we want is not const const * but const * const (const pointer to const data). Fix this. Reported-by: Dan Carpenter <[email protected]> Cc: Olliver Schinagl <[email protected]> Cc: Rojhalat Ibrahim <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-16driver core / ACPI: Represent ACPI companions using fwnode_handleRafael J. Wysocki1-0/+2
Now that we have struct fwnode_handle, we can use that to point to ACPI companions from struct device objects instead of pointing to struct acpi_device directly. There are two benefits from that. First, the somewhat ugly and hackish struct acpi_dev_node can be dropped and, second, the same struct fwnode_handle pointer can be used in the future to point to other (non-ACPI) firmware device node types. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Grant Likely <[email protected]>
2015-03-09gpio: omap: irq_shutdown: remove unnecessary call of gpiochip_unlock_as_irqGrygorii Strashko1-1/+0
GPIOLib core implemnts irqchip->irq_request/release_resources callbacks internally and these callbacks already contain clalls of gpiochip_lock/unlock_as_irq(). Hence, remove unnecessary call of gpiochip_unlock_as_irq() from omap_gpio_irq_shutdown(). Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-09gpio: pxa: simplify BANK_OFF macro offset calculationRob Herring1-2/+1
The macro BANK_OFF which calculates the base offset for each GPIO port. The macro is needlessly complex and unreadable. Simplify the calculation to a simple math operation. Signed-off-by: Rob Herring <[email protected]> Cc: [email protected] Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-09gpio: dwapb: re-enable GPIO_DWAPB for arm64Kefeng Wang1-1/+1
Hisilicon arm64 soc uses designWare gpio, re-enable it after commit 1972c97db5b(gpio: dwapb: fix compile errors). Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-07drivers/gpio: Altera soft IP GPIO driverTien Hock Loh3-0/+385
Adds a new driver for Altera soft GPIO IP. The driver is able to do read/write and allows GPIO to be a interrupt controller. Tested on Altera GHRD on interrupt handling and IO. v10: - Updated conflicting device tree parameters - Removed unused headers - Used macro instead of magic numbers for ngpio - Code readability cleanup using ?: and temporal variables - Removed leftover garbage and unnecessary function calls - Checked bgpio_init but unusable because Altera GPIO may not be a multiple of 8 bits v9: - Removed duplicated initialization on set_type using temporals to improve code readability in calling generic_handle_irq - Using ?: ternary to reduce code size v8: - Using for_each_set_bit - Added const for struct definition - Removed naggy pr_err - Sort alpha header - Remove unused macros - Use fixed width data types instead of unsigned long - Whitespace issue fixes - Removed _relaxed function for better compatibility across different CPU - Changed irq_create_mapping to platform_get_irq updated implementation to use gpiochip_irqchip_add - Reserve interrupt-cells number 2 in device tree binding for future use - Remove confusing sections on devicetree bindings - Added tristate Kconfig help text v7: - Used dev_warn instead of pr_warn - Clean up unnecesarry if else indentation v6: - Added irq_startup and irq_shutdown - Changed bitwise clamping style - Cleanup bitwise operation to improve readability change naming of mapped irqs from virq to mapped_irq v5: - Dispose irq_domain mapping correctly - Update optional binding description in binding docs v4: - Added vendor prefix to devicetree binding for IP specific properties using MMIO GPIO helper library instead of manually map PIO to memory - altera_gpio_chip inline struct documentation to kerneldoc - Using dev_ print to print a better failure message v2, v3: - Do not reference NO_IRQ - Updated irq_set_type to only allow the hardware configured irq type Signed-off-by: Tien Hock Loh <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-06gpio: vf610: Replaces comma between expression statements by semicolonAxel Lin1-8/+8
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-05gpio: mpc8xxx: remove __initdata annotation for mpc8xxx_gpio_ids[]Kevin Hao1-1/+1
Since commit 98686d9a52ee ("gpio: mpc8xxx: Convert to platform device interface"), we get the following section mismatch warning. Remove the __initdata annotation to fix it. WARNING: vmlinux.o(.data+0xbc28): Section mismatch in reference from the variable mpc8xxx_plat_driver to the variable .init.data:mpc8xxx_gpio_ids The variable mpc8xxx_plat_driver references the variable __initdata mpc8xxx_gpio_ids If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Signed-off-by: Kevin Hao <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-05gpiolib: add devm_gpiod_get_array and devm_gpiod_put_array functionsRojhalat Ibrahim1-0/+89
Add device managed variants of gpiod_get_array() / gpiod_put_array() functions for conveniently obtaining and disposing of an entire array of GPIOs with one function call. Signed-off-by: Rojhalat Ibrahim <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-05gpiolib: add gpiod_get_array and gpiod_put_array functionsRojhalat Ibrahim3-0/+236
Introduce new functions for conveniently obtaining and disposing of an entire array of GPIOs with one function call. ACPI parts tested by Mika Westerberg, DT parts tested by Rojhalat Ibrahim. Change log: v5: move the ACPI functions to gpiolib-acpi.c v4: - use shorter names for members of struct gpio_descs - rename lut_gpio_count to platform_gpio_count for clarity - add check for successful memory allocation - use ERR_CAST() v3: - rebase on current linux-gpio devel branch - fix ACPI GPIO counting - allow for zero-sized arrays - make the flags argument mandatory for the new functions - clarify documentation v2: change interface Suggested-by: Alexandre Courbot <[email protected]> Signed-off-by: Rojhalat Ibrahim <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Tested-by: Mika Westerberg <[email protected]> Tested-by: Rojhalat Ibrahim <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-05gpiolib: define gpio suffixes globallyRojhalat Ibrahim2-8/+9
Avoid multiple identical definitions of the gpio suffix strings by putting them into a global constant array. Signed-off-by: Rojhalat Ibrahim <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-04gpio: add parameter to allow the use named gpiosOlliver Schinagl1-1/+17
The gpio binding document says that new code should always use named gpios. Patch 40b73183 added support to parse a list of gpios from child nodes, but does not make it possible to use named gpios. This patch adds the con_id property and implements it is done in gpiolib.c, where the old-style of using unnamed gpios still works. Signed-off-by: Olliver Schinagl <[email protected]> Acked-by: Bryan Wu <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-04gpio: pcf857x: Propagate wake-up setting to parent irq controllerGeert Uytterhoeven1-3/+34
The pcf857x GPIO and interrupt controller uses dummy_irq_chip, which does not implement irq_chip.irq_set_wake() and does not set IRQCHIP_SKIP_SET_WAKE. This causes two s2ram issues if wake-up is enabled for the pcf857x GPIO pins: 1. During resume from s2ram, the following warning is printed: WARNING: CPU: 0 PID: 1046 at kernel/irq/manage.c:537 irq_set_irq_wake+0x9c/0xf8() Unbalanced IRQ 113 wake disable 2. Wake-up through the pcf857x GPIO pins may fail, as the parent interrupt controller may be suspended. Migrate the pcf857x GPIO and interrupt controller from dummy_irq_chip to its own irq_chip. This irq chip implements irq_chip.irq_set_wake() to propagate its wake-up setting to the parent interrupt controller. This fixes wake-up through gpio-keys on sh73a0/kzm9g, where the pcf857x interrupt is cascaded to irq-renesas-intc-irqpin, and the latter must not be suspended when wake-up is enabled. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-04gpio: pcf857x: Switch to use gpiolib irqchip helpersGeert Uytterhoeven2-94/+28
Switch the PCF857x GPIO driver to use the gpiolib irqchip helpers. This driver uses a nested threaded interrupt, hence handle_nested_irq() and gpiochip_set_chained_irqchip() must be used. Note that this removes the checks added in commit 21fd3cd1874a2ac8 ("gpio: pcf857x: call the gpio user handler iff gpio_to_irq is done"), as the interrupt mappings are no longer created on-demand by the driver, but by gpiochip_irqchip_add() during initialization. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-04gpio: add GPIO hogging mechanismBenoit Parrot3-19/+219
Based on Boris Brezillion's work this is a reworked patch of his initial GPIO hogging mechanism. This patch provides a way to initially configure specific GPIO when the GPIO controller is probed. The actual DT scanning to collect the GPIO specific data is performed as part of gpiochip_add(). The purpose of this is to allow specific GPIOs to be configured without any driver specific code. This is particularly useful because board design are getting increasingly complex and given SoC pins can now have more than 10 mux values, a lot of connections are now dependent on external IO muxes to switch various modes. Specific drivers should not necessarily need to be aware of what accounts to a specific board implementation. This board level "description" should be best kept as part of the dts file. Signed-off-by: Benoit Parrot <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-03-02gpio: max732x: convert to GPIOLIB_IRQCHIPLinus Walleij2-93/+43
Take a sweep to bring the irq support for the MAX732x expanders into the gpiolib core to cut down on duplicated code. Only compile tested! I need some feedback from people using this expander with interrupts to tell me if things go right or wrong when I do this. Cc: Semen Protsenko <[email protected]> Cc: Mans Rullgard <[email protected]> Signed-off-by: Linus Walleij <[email protected]>