aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-pxa.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: rename GPIO set callbacks back to their original namesBartosz Golaszewski2025-08-071-1/+1
| | | | | | | | | | | The conversion of all GPIO drivers to using the .set_rv() and .set_multiple_rv() callbacks from struct gpio_chip (which - unlike their predecessors - return an integer and allow the controller drivers to indicate failures to users) is now complete and the legacy ones have been removed. Rename the new callbacks back to their original names in one sweeping change. Signed-off-by: Bartosz Golaszewski <[email protected]>
* Revert "gpio: pxa: Make irq_chip immutable"Bartosz Golaszewski2025-08-031-7/+1
| | | | | | | | | | | | | | This reverts commit 20117cf426b6 ("gpio: pxa: Make irq_chip immutableas") as it caused a regression on samsung coreprimevelte and we've not been able to fix it so far. Cc: [email protected] # v6.16 Fixes: 20117cf426b6 ("gpio: pxa: Make irq_chip immutableas") Reported-by: Duje Mihanović <[email protected]> Closes: https://lore.kernel.org/all/3367665.aeNJFYEL58@radijator/ Tested-by: Duje Mihanović <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: pxa: use new GPIO line value setter callbacksBartosz Golaszewski2025-06-231-2/+4
| | | | | | | | | struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: Use dev_fwnode() where applicable across driversJiri Slaby (SUSE)2025-06-161-3/+2
| | | | | | | | | | | | | irq_domain_create_simple() takes fwnode as the first argument. It can be extracted from the struct device using dev_fwnode() helper instead of using of_node with of_fwnode_handle(). So use the dev_fwnode() helper where applicable. Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Link: https://lore.kernel.org/r/[email protected] [Bartosz: tweaked the commit message] Signed-off-by: Bartosz Golaszewski <[email protected]>
* Merge tag 'gpio-updates-for-v6.16-rc1' of ↵Linus Torvalds2025-05-271-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have three new drivers, some refactoring in the GPIO core, lots of various changes across many drivers, new configfs interface for the virtual gpio-aggregator module and DT-bindings updates. The treewide conversion of GPIO drivers to using the new value setter callbacks is ongoing with another round of GPIO drivers updated. You will also see these commits coming in from other subsystems as with the relevant changes merged into mainline last cycle, I've started converting GPIO providers located elsewhere than drivers/gpio/. GPIO core: - use more lock guards where applicable - refactor GPIO ACPI code and shrink it in the process by 8% - move GPIO ACPI quirks into a separate file - remove unneeded #ifdef - convert GPIO devres helpers to using devm_add_action() where applicable which shrinks and simplifies the code - refactor GPIO descriptor validation in GPIO consumer interfaces - don't allow setting values on input lines in the GPIO core which will take off the burden from GPIO drivers of checking this down the line - provide gpiod_is_equal() as a way of safely comparing two GPIO descriptors (the only current user is in regulator core) New drivers: - add the GPIO module for the max77759 multifunction device - add the GPIO driver for the VeriSilicon BLZP1600 GPIO controller - add the GPIO driver for the Spacemit K1 SoC Driver improvements: - convert more drivers to using the new GPIO line value setter callbacks - convert more drivers to making the irq_chip immutable as is recommended by the interrupt subsystem - extend build testing coverage by enabling more modules to be built with COMPILE_TEST=y - extend the gpio-aggregator module with a configfs interface that makes the setup easier for user-space than the existing driver-level sysfs attributes and also adds more advanced configuration features (such as referring to aggregated lines by their original names or modifying their names as exposed by the aggregated chip) - add a missing mutex_destroy() in gpio-imx-scu - add an OF polarity quirk for s5m8767 - allow building gpio-vf610 as a loadable module - make gpio-mxc not hardcode its GPIO base number with GPIO SYSFS interface disabled (another small step towards getting rid of the global GPIO numberspace) - add support for level-triggered interrupts to gpio-pca953x - don't double-check the ngpios property in gpio-ds4520 as GPIO core already does it - don't double-check the number of GPIOs in gpio-imx-scu as GPIO core already does it - remove unused callbacks from gpio-max3191x DT bindings: - add device-tree bindings for max77759, spacemit,k1 and blzp1600 (new drivers added this cycle) - document more properties for gpio-vf610 and gpio-tegra186 - document a new pca95xx variant - fix style of examples in several GPIO DT-binding documents Misc: - TODO list updates" * tag 'gpio-updates-for-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (123 commits) gpio: timberdale: select GPIOLIB_IRQCHIP gpio: lpc18xx: select GPIOLIB_IRQCHIP gpio: grgpio: select GPIOLIB_IRQCHIP gpio: bcm-kona: select GPIOLIB_IRQCHIP dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges gpio: davinci: select GPIOLIB_IRQCHIP gpiolib-acpi: Update file references in the Documentation and MAINTAINERS gpiolib: acpi: Move quirks to a separate file gpiolib: acpi: Add acpi_gpio_need_run_edge_events_on_boot() getter gpiolib: acpi: Handle deferred list via new API gpiolib: acpi: Make sure we fill struct acpi_gpio_info gpiolib: acpi: Switch to use enum in acpi_gpio_in_ignore_list() gpiolib: acpi: Use temporary variable for struct acpi_gpio_info gpiolib: remove unneeded #ifdef gpio: mpc8xxx: select GPIOLIB_IRQCHIP gpio: pxa: select GPIOLIB_IRQCHIP gpio: pxa: Make irq_chip immutable gpio: timberdale: Make irq_chip immutable gpio: xgene-sb: Make irq_chip immutable gpio: davinci: Make irq_chip immutable ...
| * gpio: pxa: Make irq_chip immutablePeng Fan2025-05-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Constify pxa_muxed_gpio_chip, flag the irq_chip as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
* | gpio: Switch to irq_domain_create_*()Jiri Slaby (SUSE)2025-05-161-3/+3
|/ | | | | | | | | | | | | | | | | | | | | irq_domain_add_*() interfaces are going away as being obsolete now. Switch to the preferred irq_domain_create_*() ones. Those differ in the node parameter: They take more generic struct fwnode_handle instead of struct device_node. Therefore, of_fwnode_handle() is added around the original parameter. Note some of the users can likely use dev->fwnode directly instead of indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not guaranteed to be set for all, so this has to be investigated on case to case basis (by people who can actually test with the HW). [ tglx: Fix up subject prefix ] Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
* treewide: rename pinctrl_gpio_direction_output_new()Bartosz Golaszewski2023-11-041-1/+1
| | | | | | | | Now that pinctrl_gpio_direction_output() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Linus Walleij <[email protected]>
* treewide: rename pinctrl_gpio_direction_input_new()Bartosz Golaszewski2023-11-041-1/+1
| | | | | | | | Now that pinctrl_gpio_direction_input() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Linus Walleij <[email protected]>
* gpio: pxa: use new pinctrl GPIO helpersBartosz Golaszewski2023-11-041-2/+2
| | | | | | | | | Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Linus Walleij <[email protected]>
* gpio: pxa: disable pinctrl calls for MMP_GPIODuje Mihanović2023-10-021-0/+1
| | | | | | | | | | Similarly to PXA3xx and MMP2, pinctrl-single isn't capable of setting pin direction on MMP either. Fixes: a770d946371e ("gpio: pxa: add pin control gpio direction and request") Signed-off-by: Duje Mihanović <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: Explicitly include correct DT includesRob Herring2023-07-191-1/+0
| | | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Romain Perier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: pxa: remove unused gpio_is_pxa_type functionTom Rix2023-03-221-5/+0
| | | | | | | | | | | | | clang with W=1 reports drivers/gpio/gpio-pxa.c:174:19: error: unused function 'gpio_is_pxa_type' [-Werror,-Wunused-function] static inline int gpio_is_pxa_type(int type) ^ This function is not used, so remove it. Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: pxa: use devres for the clock structBartosz Golaszewski2022-08-191-9/+2
| | | | | | | | | | The clock is never released after probe(). Use devres to not leak resources. Reported-by: Hulk Robot <[email protected]> Reported-by: Yuan Can <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
* gpio: Setup parent device and get rid of unnecessary of_node assignmentAndy Shevchenko2021-12-171-5/+3
| | | | | | | | | | | | Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: Bulk conversion to generic_handle_domain_irq()Marc Zyngier2021-08-121-5/+4
| | | | | | | | | | | Wherever possible, replace constructs that match either generic_handle_irq(irq_find_mapping()) or generic_handle_irq(irq_linear_revmap()) to a single call to generic_handle_domain_irq(). Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
* gpio: pxa: Fix return value of pxa_gpio_probe()Tiezhu Yang2020-05-251-2/+2
| | | | | | | | | When call function devm_platform_ioremap_resource(), we should use IS_ERR() to check the return value and return PTR_ERR() if failed. Fixes: 542c25b7a209 ("drivers: gpio: pxa: use devm_platform_ioremap_resource()") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* gpio: Unconditionally assign .request()/.free()Thierry Reding2020-04-021-5/+2
| | | | | | | | | | | The gpiochip_generic_request() and gpiochip_generic_free() functions can now deal properly with chips that don't have any pin-ranges defined, so they can be assigned unconditionally. Suggested-by: Linus Walleij <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not thereLubomir Rintel2020-02-101-2/+2
| | | | | | | | | | | | Not all platforms use those. Let's use platform_get_irq_byname_optional() instead platform_get_irq_byname() so that we avoid a useless warning: [ 1.359455] pxa-gpio d4019000.gpio: IRQ gpio0 not found [ 1.359583] pxa-gpio d4019000.gpio: IRQ gpio1 not found Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner2019-06-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
* gpio: pxa: Make two symbols staticYueHaibing2019-04-231-2/+2
| | | | | | | | | | | | | Fix sparse warnings: drivers/gpio/gpio-pxa.c:580:29: warning: symbol 'pxa_irq_domain_ops' was not declared. Should it be static? drivers/gpio/gpio-pxa.c:819:20: warning: symbol 'pxa_gpio_syscore_ops' was not declared. Should it be static? Reported-by: Hulk Robot <[email protected]> Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* drivers: gpio: pxa: use devm_platform_ioremap_resource()Enrico Weigelt, metux IT consult2019-04-041-6/+2
| | | | | | | | Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: avoid attempting to set pin direction via pinctrl on MMP2Lubomir Rintel2019-02-141-0/+1
| | | | | | | | | | | | Similarly to PXA3xx, pinctrl-single can't set pin direction on MMP2 either. See also: commit 9dabfdd84bdfa ("gpio: pxa: disable pinctrl calls for PXA3xx") Cc: [email protected] Fixes: a770d946371e ("gpio: pxa: add pin control gpio direction and request") Signed-off-by: Lubomir Rintel <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: fix legacy non pinctrl aware builds againRobert Jarzmik2018-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out by Gregor, spitz keyboard matrix is broken, with or without CONFIG_PINCTRL set, quoting : "The gpio matrix keypard on the Zaurus C3x00 (see spitz.c) does not work properly. Noticeable are that rshift+c does nothing where as lshift+c creates C. Opposite it is for rshift+a vs lshift+a, here only rshift works. This affects a few other combinations using the rshift or lshift buttons." As a matter of fact, as for platform_data based builds CONFIG_PINCTRL=n is required for now (as opposed for devicetree builds where it should be set), this means gpio driver should change the direction, which is what was attempted by commit c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds"). Unfortunately, the input case was inverted, and the direction change was never done. This wasn't seen up until now because the initial platform setup (MFP) was setting this direction. Yet in Gregory's case, the matrix-keypad driver changes back and forth the direction dynamically, and this is why he's the first to report it. Fixes: c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds") Tested-by: Greg <[email protected]> Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: handle corner case of unprobed deviceRobert Jarzmik2018-08-291-0/+6
| | | | | | | | | | | | | | | | | In the corner case where the gpio driver probe fails, for whatever reason, the suspend and resume handlers will still be called as they have to be registered as syscore operations. This applies as well when no probe was called while the driver has been built in the kernel. Nicolas tracked this in : https://bugzilla.kernel.org/show_bug.cgi?id=200905 Therefore, add a failsafe in these function, and test if a proper probe succeeded and the driver is functional. Signed-off-by: Robert Jarzmik <[email protected]> Reported-by: Nicolas Chauvet <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: remove set but not used variable 'gpio_offset'Wei Yongjun2018-08-021-4/+1
| | | | | | | | | | | | | Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpio/gpio-pxa.c: In function "pxa_gpio_probe": drivers/gpio/gpio-pxa.c:629:35: warning: variable "gpio_offset" set but not used [-Wunused-but-set-variable] int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; ^ Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: disable pinctrl calls for PXA3xxDaniel Mack2018-07-291-8/+27
| | | | | | | | | | | | | | | | | The pxa3xx driver uses the pinctrl-single driver since a while which does not implement a .gpio_set_direction() callback. The pinmux core will simply return 0 in this case, and the pxa3xx gpio driver hence believes the pinctrl driver did its job and returns as well. This effectively makes pxa_gpio_direction_{input,output} no-ops. To fix this, do not call into the pinctrl subsystem for the PXA3xx platform for now. We can revert this once the pinctrl-single driver learned to support setting pin directions. Signed-off-by: Daniel Mack <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Fix potential NULL dereferenceWei Yongjun2018-07-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference a bit later in the code. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = platform_get_resource(pdev, t, n); + if (!res) + return -EINVAL; ... when != res == NULL e = devm_ioremap(e1, res->start, e2); Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Include the right headerLinus Walleij2018-05-241-1/+1
| | | | | | This is a GPIO driver, include only <linux/gpio/driver.h>. Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Use of_device_get_match_data()Thierry Reding2018-05-161-7/+1
| | | | | | | Use of_device_get_match_data() instead of open-coding it. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Use library functionsLinus Walleij2017-10-061-12/+2
| | | | | | | | | These request/free functions are just reimplementations of the standard helpers in gpiolib. Delete them and replace with the helpers. Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* pinctrl/gpio: Unify namespace for cross-callsLinus Walleij2017-09-221-2/+2
| | | | | | | | | The pinctrl_request_gpio() and pinctrl_free_gpio() break the nice namespacing in the other cross-calls like pinctrl_gpio_foo(). Just rename them and all references so we have one namespace with all cross-calls under pinctrl_gpio_*(). Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: remove gpio_to_irq() from hw irq handlersGrygorii Strashko2017-08-141-3/+5
| | | | | | | | | gpio_to_irq() API expected to be used by GPIO consumers and not drivers and there are no guarantee that its gpiolib implementation is irq safe. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: use devm_irq_alloc_descs()Bartosz Golaszewski2017-03-151-1/+1
| | | | | | | | | This driver never frees the interrupt descriptors it allocates. Fix it by using the resource managed version of irq_alloc_descs(). Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: fix legacy non pinctrl aware buildsRobert Jarzmik2016-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In legacy pxa builds, ie. non device-tree and platform-data only builds, pinctrl is not yet available. As a consequence, the pinctrl gpio direction change function is a stub, returning always success. In the current state, the gpio driver direction function believes the pinctrl direction change was successful, and exits without actually changing the gpio direction. This patch changes the logic : - if the pinctrl direction function fails, gpio direction will report that failure - if the pinctrl direction function succeeds, gpio direction is changed by the gpio driver anyway. This is sub optimal in the pinctrl aware case, as the gpio direction will be changed twice: once by pinctrl function and another time by the gpio direction function. Yet it should be acceptable in this form, as this is functional for all pxa platforms (device-tree and platform-data), and moreover changing a gpio direction is very very seldom, usually in machine initialization, seldom in drivers probe, and an exception for ac97 reset bug. Fixes: a770d946371e ("gpio: pxa: add pin control gpio direction and request") Reported-by: Guenter Roeck <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: use gpiochip data pointerLinus Walleij2016-01-051-4/+5
| | | | | | | | | | 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: Daniel Mack <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: checking IS_ERR() instead of NULLDan Carpenter2016-01-051-2/+2
| | | | | | | | | irq_domain_add_legacy() returns NULL on error, it doesn't return error pointers. Fixes: 384ca3c6a28d ('gpio: pxa: change the interrupt management') Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: fixes non devicetree buildsRobert Jarzmik2015-12-221-13/+13
| | | | | | | | | | | The commit "gpio: pxa: change the interrupt management" should have taken care of moving an ifdef to not englobe irqdomain related structures anymore, as they are used now for all builds. This repairs the broken builds where CONFIG_OF=n. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: add pin control gpio direction and requestRobert Jarzmik2015-12-151-0/+23
| | | | | | | | | | | | | | | | | | | If a pin control driver is available, use it to change the gpio direction. If not fallback to directly manipulating the gpio direction register. The reason to use the pin control driver first is that pin control in pxa2xx architecture implies changing the gpio direction, even for non gpio functions. In order to do it atomically, only one driver should control the gpio direction, and if a pin controller is available, it has to be him. There is a small catch : if CONFIG_PINCTRL is selected, then a pinctrl driver has to be probed. If not, gpio_request() will return -EPROBE_DEFER as pinctrl_request_gpio() returns it in that case. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: change the interrupt managementRobert Jarzmik2015-12-101-63/+82
| | | | | | | | | | | | | | | | | | The interrupt management is changed by this patch to rely on chip data instead of chained interrupts. The main goal is to loosen the dependency on the global pxa chip structure in favor of the passed chip data. The secondary goal is to better show in /proc/interrupts the difference between interrupts for gpio0 and gpio1 (directly wired to interrupt controller), and the other gpios (wired onto a third line in the interrupt controller). The last advantage of this patch is that the interrupt is actually requested, so that another driver cannot steal this line, or overwrite the handler. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: convert to devm_ioremapRobert Jarzmik2015-12-101-5/+2
| | | | | | | Use the device managed ioremap to simplify the probe function. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: convert to one gpiochipRobert Jarzmik2015-12-101-101/+120
| | | | | | | | | | | | | | | The pxa gpio IP is provided by one chip, which holds multiple banks. Another reason the driver should register only one gpiochip instead of multiple gpiochips (ie. 1 per each bank) is that for pincontrol and devicetree integration (think gpio-ranges), it's impossible to have the contiguous pin range 0..127 mapped to gpios 0..127. This patch, amongst other thinks, paves the path to loosen the bond with the global structure variable pxa_gpio_chip. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: change initcall level second attemptRobert Jarzmik2015-11-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | This patch is a second attempt at what was previously in commit 6c7e660a27da ("gpio: pxa: set initcall level to module init"). The goal is the same : enable gpio & pinctrl driver to work together. As pinctrl driver will be initialized at device level, the gpio should be as well, so that the deferring mechanism is honored. Yet this patch should also respect the legacy platforms, so the set of constraints is : - in legacy platforms (ie. non dt), gpio_[gs]et_*() should be available for machine code => core initcall - in new platforms (ie. dt based), pinctrl will be available and no machine code => device initcall In order to fullfill all these constraints, the initcall level is either postcore for non devicetree platforms, and device for devicetree platforms. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* genirq: Remove irq argument from irq flow handlersThomas Gleixner2015-09-161-1/+1
| | | | | | | | | | | | | | Most interrupt flow handlers do not use the irq argument. Those few which use it can retrieve the irq number from the irq descriptor. Remove the argument. Search and replace was done with coccinelle and some extra helper scripts around it. Thanks to Julia for her help! Signed-off-by: Thomas Gleixner <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Jiang Liu <[email protected]>
* gpio: kill off set_irq_flags usageRob Herring2015-07-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | set_irq_flags is ARM specific with custom flags which have genirq equivalents. Convert drivers to use the genirq interfaces directly, so we can kill off set_irq_flags. The translation of flags is as follows: IRQF_VALID -> !IRQ_NOREQUEST IRQF_PROBE -> !IRQ_NOPROBE IRQF_NOAUTOEN -> IRQ_NOAUTOEN For IRQs managed by an irqdomain, the irqdomain core code handles clearing and setting IRQ_NOREQUEST already, so there is no need to do this in .map() functions and we can simply remove the set_irq_flags calls. Some users also modify IRQ_NOPROBE and this has been maintained although it is not clear that is really needed as most platforms don't use probing. There appears to be a great deal of blind copy and paste of this code. Signed-off-by: Rob Herring <[email protected]> Cc: Michael Hennerich <[email protected]> Acked-by: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Ray Jui <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Thierry Reding <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: simplify BANK_OFF macro offset calculationRob Herring2015-03-091-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]>
* gpio: pxa: add PXA1928 gpio type supportRob Herring2015-02-031-2/+15
| | | | | | | | | | | | | Add support for PXA1928 GPIOs. The PXA1928 adds a 6th bank from previous generations. Signed-off-by: Jing Xiang <[email protected]> Signed-off-by: Xiangzhan Meng <[email protected]> [robh: ported to 3.19 from vendor kernel] Signed-off-by: Rob Herring <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: remove mach IRQ includesRob Herring2015-02-031-20/+18
| | | | | | | | | | | | | In preparation to enable ARCH_MMP on ARM64, the include of mach/irqs.h must be eliminated. mach/irqs.h was being included for IRQ_GPIO{0,1}, but these IRQs are always passed in as resources now. We can use irq0 and irq1 and get rid of IRQ_GPIOx. Get rid of the ifdef in the process as it is no longer needed. Signed-off-by: Rob Herring <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio-pxa: gpio0 and gpio1 support on dtAndrew Ruder2014-07-071-0/+5
| | | | | | | | | | pxa_gpio_probe() has some issues supporting the gpio0 and gpio1 interrupts under device-tree - it never actually sets up the chain handler to get interrupts on edge detect for GPIO0 and GPIO1. Signed-off-by: Andrew Ruder <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
* gpio: pxa: Make of_device_id array constJingoo Han2014-06-191-1/+1
| | | | | | | | | Make of_device_id array const, because all OF functions handle it as const. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Neil Zhang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>