summaryrefslogtreecommitdiffstats
path: root/drivers/gpio (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpio: ws16c48: Make irq_chip immutableWilliam Breathitt Gray2022-09-031-3/+7
| | | | | | | | | | | | Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: 104-idio-16: Make irq_chip immutableWilliam Breathitt Gray2022-09-031-7/+11
| | | | | | | | | | | | Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: 104-idi-48: Make irq_chip immutableWilliam Breathitt Gray2022-09-031-3/+7
| | | | | | | | | | | | Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: 104-dio-48e: Make irq_chip immutableWilliam Breathitt Gray2022-09-031-3/+7
| | | | | | | | | | | | Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: realtek-otto: switch to 32-bit I/OSander Vanheule2022-08-311-81/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | By using 16-bit I/O on the GPIO peripheral, which is apparently not safe on MIPS, the IMR can end up containing garbage. This then results in interrupt triggers for lines that don't have an interrupt handler associated. The irq_desc lookup fails, and the ISR will not be cleared, keeping the CPU busy until reboot, or until another IMR operation restores the correct value. This situation appears to happen very rarely, for < 0.5% of IMR writes. Instead of using 8-bit or 16-bit I/O operations on the 32-bit memory mapped peripheral registers, switch to using 32-bit I/O only, operating on the entire bank for all single bit line settings. For 2-bit line settings, with 16-bit port values, stick to manual (un)packing. This issue has been seen on RTL8382M (HPE 1920-16G), RTL8391M (Netgear GS728TP v2), and RTL8393M (D-Link DGS-1210-52 F3, Zyxel GS1900-48). Reported-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> # DGS-1210-52 Reported-by: Birger Koblitz <mail@birger-koblitz.de> # GS728TP Reported-by: Jan Hoffmann <jan@3e8.eu> # 1920-16G Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support") Signed-off-by: Sander Vanheule <sander@svanheule.net> Cc: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: pca953x: Add mutex_lock for regcache sync in PMHaibo Chen2022-08-311-1/+7
| | | | | | | | | | | | | | | | | | The regcache sync will set the cache_bypass = true, at that time, when there is regmap write operation, it will bypass the regmap cache, then the regcache sync will write back the value from cache to register, which is not as our expectation. Though regmap already use its internal lock to avoid such issue, but this driver force disable the regmap internal lock in its regmap config: disable_locking = true To avoid this issue, use the driver's own lock to do the protect in system PM. Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle") Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* gpio: mockup: remove gpio debugfs when remove deviceWei Yongjun2022-08-281-1/+8
| | | | | | | | | GPIO mockup debugfs is created in gpio_mockup_probe() but forgot to remove when remove device. This patch add a devm managed callback for removing them. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
* 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 <hulkci@huawei.com> Reported-by: Yuan Can <yuancan@huawei.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
* Merge tag 'gpio-updates-for-v6.0-rc1' of ↵Linus Torvalds2022-08-0528-1322/+977
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "Here are the updates for this merge window from the GPIO subsystem. We have more lines removed than added thanks to dropping of a driver for a platform that's no longer supported. Otherwise the changes are pretty straightforward: support for some new models, various improvements to existing drivers, some tweaks to the core library code and DT bindings updates. Summary: - remove gpio-vr41xx driver as the only platform using it got dropped too - add support for suspend/resume to gpio-davinci - improvements to the GPIO character device code - add support for disabling bias for in-kernel users (up until now only user-space could set it) - drop unused devm_gpio_free() - fix a refcount issue in gpiolib OF - use device match helpers where applicable - add support for a new model to gpio-rockchip - non-functional improvements in gpio-adp5588 - improve and simplify teardown in gpio-twl4030 and gpio-ucb1400 - modernize the gpio-74xx-mmio and gpio-adnp drivers - coding style improvements in gpio-xilinx, gpio-104-idi-48 - support new model (pca9571) in gpio-pca9570 - convert the DT bindings to YAML for gpio-mvebu and update the document - don't return error codes from remove() in gpio-brcmstb - add a library for the intel 8255 PPI interface and use it in drivers - reduce using magic numbers and improve code readability in several drivers - convert DT bindings to YAML for gpio-tpic2810 - add new models to DT bindings for gpio-frl-imx - Kconfig improvements - other minor tweaks and improvements" * tag 'gpio-updates-for-v6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (52 commits) dt-bindings: gpio: fsl-imx-gpio: Add i.MXRT compatibles gpio: 74xx-mmio: Use bits instead of plain numbers for flags gpio: xilinx: add missing blank line after declarations MAINTAINERS: Update Intel 8255 GPIO driver file list gpio: gpio-mm: Implement and utilize register structures gpio: 104-idi-48: Implement and utilize register structures gpio: 104-dio-48e: Implement and utilize register structures gpio: i8255: Introduce the Intel 8255 interface library module gpio: 104-idio-16: Implement and utilize register structures gpio: ws16c48: Implement and utilize register structures gpio: remove VR41XX related gpio driver dt-bindings: gpio: add pull-disable flag gpiolib: acpi: support bias pull disable gpiolib: of: support bias pull disable gpiolib: add support for bias pull disable gpio: 74xx-mmio: use bits.h macros for all masks gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in() gpio: 74xx-mmio: Make use of device properties gpiolib: cdev: compile out HTE unless CONFIG_HTE selected gpiolib: cdev: consolidate edge detector configuration flags ...
| * gpio: 74xx-mmio: Use bits instead of plain numbers for flagsAndy Shevchenko2022-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The initial code was misleading to use bitwise AND against plain number, and the commit d3054ba1db62 ("gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()") missed that. Switch definitions to be defined bits for the correct comparison. Fixes: d3054ba1db62 ("gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: xilinx: add missing blank line after declarationsShubhrajyoti Datta2022-07-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a missing blank line. No functional changes. WARNING: Missing a blank line after declarations 128: FILE: drivers/gpio/gpio-xilinx.c:120: + void __iomem *addr = chip->regs + reg + xgpio_regoffset(chip, bit / 32); + xgpio_set_value32(a, bit, xgpio_readreg(addr)); WARNING: Missing a blank line after declarations 136: FILE: drivers/gpio/gpio-xilinx.c:126: + void __iomem *addr = chip->regs + reg + xgpio_regoffset(chip, bit / 32); + xgpio_writereg(addr, xgpio_get_value32(a, bit)); Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Reviewed-by: Michal Simek <michal.simek@amd.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: gpio-mm: Implement and utilize register structuresWilliam Breathitt Gray2022-07-202-163/+40
| | | | | | | | | | | | | | | | | | | | | | | | Reduce magic numbers and improve code readability by implementing and utilizing named register data structures. The GPIO-MM device features an Intel 8255 compatible GPIO interface, so the i8255 GPIO module is selected and utilized as well. Tested-by: Fred Eckert <Frede@cmslaser.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 104-idi-48: Implement and utilize register structuresWilliam Breathitt Gray2022-07-202-83/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | Reduce magic numbers and improve code readability by implementing and utilizing named register data structures. The 104-IDI-48 device features an Intel 8255 compatible GPIO interface, so the i8255 GPIO module is selected and utilized as well. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: John Hentges <jhentges@accesio.com> Cc: Jay Dolan <jay.dolan@accesio.com> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 104-dio-48e: Implement and utilize register structuresWilliam Breathitt Gray2022-07-202-175/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | Reduce magic numbers and improve code readability by implementing and utilizing named register data structures. The 104-DIO-48E device features an Intel 8255 compatible GPIO interface, so the i8255 GPIO module is selected and utilized as well. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: John Hentges <jhentges@accesio.com> Cc: Jay Dolan <jay.dolan@accesio.com> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: i8255: Introduce the Intel 8255 interface library moduleWilliam Breathitt Gray2022-07-204-0/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exposes consumer library functions providing support for interfaces compatible with the venerable Intel 8255 Programmable Peripheral Interface (PPI). The Intel 8255 PPI first appeared in the early 1970s, initially for the Intel 8080 and later appearing in the original IBM-PC. The popularity of the original Intel 8255 chip led to many subsequent variants and clones of the interface in various chips and integrated circuits. Although still popular, interfaces compatible with the Intel 8255 PPI are nowdays typically found embedded in larger VLSI processing chips and FPGA components rather than as discrete ICs. A CONFIG_GPIO_I8255 Kconfig option is introduced by this patch. Modules wanting access to these i8255 library functions should select this Kconfig option, and import the I8255 symbol namespace. Tested-by: Fred Eckert <Frede@cmslaser.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: John Hentges <jhentges@accesio.com> Cc: Jay Dolan <jay.dolan@accesio.com> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 104-idio-16: Implement and utilize register structuresWilliam Breathitt Gray2022-07-201-18/+42
| | | | | | | | | | | | | | | | | | | | | | | | Reduce magic numbers and improve code readability by implementing and utilizing named register data structures. Tested-by: Fred Eckert <Frede@cmslaser.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: John Hentges <jhentges@accesio.com> Cc: Jay Dolan <jay.dolan@accesio.com> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: ws16c48: Implement and utilize register structuresWilliam Breathitt Gray2022-07-201-36/+84
| | | | | | | | | | | | | | | | | | | | Reduce magic numbers and improve code readability by implementing and utilizing named register data structures. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Cc: Paul Demetrotion <pdemetrotion@winsystems.com> Signed-off-by: William Breathitt Gray <william.gray@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: remove VR41XX related gpio driverThomas Bogendoerfer2022-07-193-548/+0
| | | | | | | | | | | | | | | | | | | | Commit d3164e2f3b0a ("MIPS: Remove VR41xx support") removed support for MIPS VR41xx platform, so remove exclusive drivers for this platform, too. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: acpi: support bias pull disableNuno Sá2022-07-191-0/+3
| | | | | | | | | | | | | | | | | | | | On top of looking at PULL_UP and PULL_DOWN flags, also look at PULL_DISABLE and set the appropriate GPIO flag. The GPIO core will then pass down this to controllers that support it. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: of: support bias pull disableNuno Sá2022-07-191-0/+7
| | | | | | | | | | | | | | | | | | | | On top of looking at PULL_UP and PULL_DOWN flags, also look at PULL_DISABLE and set the appropriate GPIO flag. The GPIO core will then pass down this to controllers that support it. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: add support for bias pull disableNuno Sá2022-07-191-2/+6
| | | | | | | | | | | | | | | | | | This change prepares the gpio core to look at firmware flags and set 'FLAG_BIAS_DISABLE' if necessary. It works in similar way to 'GPIO_PULL_DOWN' and 'GPIO_PULL_UP'. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 74xx-mmio: use bits.h macros for all masksAndy Shevchenko2022-07-191-1/+2
| | | | | | | | | | | | | | | | Make use of the GENMASK() (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()Andy Shevchenko2022-07-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's logically better to check the IN in ->direction_input() and _OUT in ->direction_output(). While at it, replace ternary with plain if-conditional for the sake of consistency with mmio_74xx_dir_out(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 74xx-mmio: Make use of device propertiesAndy Shevchenko2022-07-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: cdev: compile out HTE unless CONFIG_HTE selectedKent Gibson2022-07-191-35/+63
| | | | | | | | | | | | | | | | | | | | The majority of builds do not include HTE, so compile out hte functionality unless CONFIG_HTE is selected. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: cdev: consolidate edge detector configuration flagsKent Gibson2022-07-191-66/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine the polarity_change flag, struct line eflags, and hte enable flag into a single flag variable. The combination of these flags describes the configuration state of the edge detector, so formalize and clarify that by combining them into a single variable, edflags, in struct line. The edflags is a subset of the GPIO_V2_LINE_FLAGsb relevant to the edge detector, and is also a superset of the eflags it replaces. The eflags name is still used to describe the subset of edflags corresponding to the rising/falling edge flags where edflags is masked down to that subset. This consolidation reduces the number of variables being passed, simplifies state comparisons, and provides a more extensible foundation should additional edge sources be integrated in the future. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: cdev: simplify line event identificationKent Gibson2022-07-191-29/+15
| | | | | | | | | | | | | | | | | | | | Reorganise line event identification code to reduce code duplication, and replace if-else initializers with a helper function to improve readability. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
| * gpiolib: cdev: replace if-else chains with switchesKent Gibson2022-07-191-13/+18
| | | | | | | | | | | | | | | | | | | | Improve readability by replacing if-else chains with switch statements. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: cdev: simplify parameter in call to hte_edge_setupKent Gibson2022-07-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Improve readability by using the GPIO_V2_LINE_FLAG_EDGE_BOTH instead of combining the rising and falling edge flags. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Dipen Patel <dipenp@nvidia.com> Tested-by: Dipen Patel <dipenp@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpiolib: cdev: simplify linereq_freeKent Gibson2022-07-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The edge detector is only ever started after the line desc has been determined, so move edge_detector_stop() inside the line desc check, and merge the two checked regions into one. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Dipen Patel <dipenp@nvidia.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: 104-idi-48: unsigned to unsigned int cleanupAakash Sen Sharma2022-07-191-15/+15
| | | | | | | | | | | | | | Remove checkpatch warnings. No functional changes. Signed-off-by: Aakash Sen Sharma <aakashsensharma@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: GPIO_SAMA5D2_PIOBU should depend on ARCH_AT91Geert Uytterhoeven2022-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | The SAMA5D2 PIOBU is only present on some AT91/Microchip SoCs. Hence add a dependency on ARCH_AT91, to prevent asking the user about this driver when configuring a kernel without AT91/Microchip SoC support. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data()Liang He2022-07-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should use of_node_get() when a new reference of device_node is created. It is noted that the old reference stored in 'mm_gc->gc.of_node' should also be decreased. This patch is based on the fact that there is a call site in function 'qe_add_gpiochips()' of src file 'drivers\soc\fsl\qe\gpio.c'. In this function, of_mm_gpiochip_add_data() is contained in an iteration of for_each_compatible_node() which will automatically increase and decrease the refcount. So we need additional of_node_get() for the reference escape in of_mm_gpiochip_add_data(). Fixes: a19e3da5bc5f ("of/gpio: Kill of_gpio_chip and add members directly to gpio_chip") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * gpio: lp3943: unsigned to unsigned int cleanupShinyzenith2022-07-191-8/+8
| | | | | | | | | | | | | | Getting rid of checkpatch findings. No functional changes. Signed-off-by: Shinyzenith <aakashsensharma@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * Merge tag 'intel-gpio-v5.20-1' of ↵Bartosz Golaszewski2022-07-191-25/+18
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into TEST_MERGE intel-gpio for v5.20-1 * Clean up the GPIO driver of Intel EG20 PCH The following is an automated git shortlog grouped by driver: pch: - Change PCI device macros - Use dev_err_probe()
| | * gpio: pch: Change PCI device macrosAndy Shevchenko2022-06-211-9/+10
| | | | | | | | | | | | | | | | | | Use PCI_DEVICE_DATA macro. No functional changes are expected. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| | * gpio: pch: Use dev_err_probe()Andy Shevchenko2022-06-211-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the error path in ->probe() a bit by using dev_err_probe(). While at it, correct the messages since the called function were changed in the past. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
| * | gpiolib: of: Use device_match_of_node() helperAndy Shevchenko2022-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Instead of open coding, use device_match_of_node() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: adp5588: sort header inclusion alphabeticallyAndy Shevchenko2022-07-191-4/+4
| | | | | | | | | | | | | | | | | | | | | Sort header inclusion alphabetically. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: adp5588: Do not use defined value for driver name and compatibleAndy Shevchenko2022-07-191-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's wrong to use defined string literal for three semantically different cases, i.e.: 1) compatible string, which is part of ABI and has to have specific format; 2) I2C ID, which is user space visible and also ABI; 3) driver name, that can be changed. Drop the define and use appropriate string literals in place. While at it, drop comma at terminator entry of OF ID table. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: adp5588: Switch from of headers to mod_devicetable.hAndy Shevchenko2022-07-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing directly using of specific interfaces in this driver, so lets not include the headers. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: rockchip: add support for rk3588Jianqun Xu2022-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add V2.1 rockchip gpio controller type, which is part of the RK3588 SoC. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
| * | gpio: adnp: Make use of device propertiesAndy Shevchenko2022-07-191-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: adnp: use simple i2c probe functionAndy Shevchenko2022-07-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: pca9570: add pca9571 supportLucas Stach2022-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The PCA9571 very similar to the PCA9570, it only differs in the number of GPIOs. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: xgs-iproc: Drop if with an always false conditionUwe Kleine-König2022-07-191-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so chip is never NULL. Also note that returning an error code from a remove callback doesn't result in the device staying bound. It's still removed and devm callbacks are called. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: brcmstb: Make .remove() obviously always return 0Uwe Kleine-König2022-07-191-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | priv cannot be NULL because brcmstb_gpio_probe() calls platform_set_drvdata() with a non-NULL argument, so the check for !priv can be dropped. Also remove the variable ret that is only used to hide a bit that in the end zero is returned. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: ucb1400: Remove platform setup and teardown supportUwe Kleine-König2022-07-191-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no user of these callbacks. The motivation for this change is to stop returning an error code from the remove callback. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: twl4030: Don't return an error after WARN in .removeUwe Kleine-König2022-07-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning a non-zero value in a platform driver's remove callback only results in an error message ("remove callback returned a non-zero value. This will be ignored.", see platform_remove()), and then the device is removed anyhow. As there was just a WARN_ON triggered, return 0 to drop the follow up warning. The latter output is hardly relevant after the big WARN splat. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
| * | gpio: twl4030: Drop platform teardown callbackUwe Kleine-König2022-07-191-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no machine providing a teardown callback, so drop the unused code. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>