- Sep 14, 2022
-
-
Sergio Paracuellos authored
Commit 6c846d02 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warnings are now observed for the mt7621 driver: gpio gpiochip0: (1e000600.gpio-bank0): not an immutable chip, please consider fixing it! gpio gpiochip1: (1e000600.gpio-bank1): not an immutable chip, please consider fixing it! gpio gpiochip2: (1e000600.gpio-bank2): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the mt7621 driver immutable. Tested-by:
Arınç ÜNAL <arinc.unal@arinc9.com> Signed-off-by:
Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Sep 13, 2022
-
-
Linus Walleij authored
This turns the IXP4xx GPIO irqchip into an immutable irqchip, a bit different from the standard template due to being hierarchical. Tested on the IXP4xx which uses drivers/ata/pata_ixp4xx_cf.c for a rootfs on compact flash with IRQs from this GPIO block to the CF ATA controller. Cc: Marc Zyngier <maz@kernel.org> Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Acked-by:
Marc Zyngier <maz@kernel.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Sep 07, 2022
-
-
Pali Rohár authored
Commit e39d5ef6 ("powerpc/5xxx: extend mpc8xxx_gpio driver to support mpc512x gpios") implemented support for IRQ_TYPE_LEVEL_LOW flow type in mpc512x via falling edge type. Do same for mpc85xx which support was added in commit 345e5c8a ("powerpc: Add interrupt support to mpc8xxx_gpio"). Fixes probing of lm90 hwmon driver on mpc85xx based board which use level interrupt. Without it kernel prints error and refuse lm90 to work: [ 15.258370] genirq: Setting trigger mode 8 for irq 49 failed (mpc8xxx_irq_set_type+0x0/0xf8) [ 15.267168] lm90 0-004c: cannot request IRQ 49 [ 15.272708] lm90: probe of 0-004c failed with error -22 Fixes: 345e5c8a ("powerpc: Add interrupt support to mpc8xxx_gpio") Signed-off-by:
Pali Rohár <pali@kernel.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Sep 03, 2022
-
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
- Aug 31, 2022
-
-
Sander Vanheule authored
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: 0d82fb11 ("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>
-
Haibo Chen authored
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: b7657430 ("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>
-
- Aug 28, 2022
-
-
Wei Yongjun authored
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>
-
- Aug 25, 2022
-
-
João H. Spies authored
Switching between falling/rising edges for IRQ_TYPE_EDGE_BOTH on pins that require debounce can cause the device to lose events due to a desync between pin state and irq type. This problem is resolved by switching between IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH instead. Fixes: 936ee267 ("gpio/rockchip: add driver for rockchip gpio") Signed-off-by:
João H. Spies <jhlspies@gmail.com> Link: https://lore.kernel.org/r/20220808025121.110223-1-jhlspies@gmail.com Signed-off-by:
Linus Walleij <linus.walleij@linaro.org>
-
- Aug 19, 2022
-
-
Bartosz Golaszewski authored
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>
-
- Jul 28, 2022
-
-
Andy Shevchenko authored
The initial code was misleading to use bitwise AND against plain number, and the commit d3054ba1 ("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: d3054ba1 ("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>
-
- Jul 26, 2022
-
-
Shubhrajyoti Datta authored
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>
-
- Jul 22, 2022
-
-
Srinivas Neeli authored
Current implementation is not able to configure more than 32 pins due to incorrect data type. So type casting with unsigned long to avoid it. Fixes: 02b3f84d ("xilinx: Switch to use bitmap APIs") Signed-off-by:
Srinivas Neeli <srinivas.neeli@xilinx.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Jul 20, 2022
-
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
William Breathitt Gray authored
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>
-
- Jul 19, 2022
-
-
Thomas Bogendoerfer authored
Commit d3164e2f ("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>
-
Haibo Chen authored
For regcache_sync_region, we need to use pca953x_recalc_addr() to get the real register address. Fixes: ec82d1eb ("gpio: pca953x: Zap ad-hoc reg_output cache") Fixes: 0f25fda8 ("gpio: pca953x: Zap ad-hoc reg_direction cache") Signed-off-by:
Haibo Chen <haibo.chen@nxp.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Haibo Chen authored
regmap will sync a range of registers, here use the correct range to make sure the sync do not touch other unexpected registers. Find on pca9557pw on imx8qxp/dxl evk board, this device support 8 pin, so only need one register(8 bits) to cover all the 8 pins's property setting. But when sync the output, we find it actually update two registers, output register and the following register. Fixes: b7657430 ("gpio: pca953x: Restore registers after suspend/resume cycle") Fixes: ec82d1eb ("gpio: pca953x: Zap ad-hoc reg_output cache") Fixes: 0f25fda8 ("gpio: pca953x: Zap ad-hoc reg_direction cache") Signed-off-by:
Haibo Chen <haibo.chen@nxp.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Haibo Chen authored
For the device use NO AI mode(not support auto address increment), only use the single read/write when config the regmap. We meet issue on PCA9557PW on i.MX8QXP/DXL evk board, this device do not support AI mode, but when do the regmap sync, regmap will sync 3 byte data to register 1, logically this means write first data to register 1, write second data to register 2, write third data to register 3. But this device do not support AI mode, finally, these three data write only into register 1 one by one. the reault is the value of register 1 alway equal to the latest data, here is the third data, no operation happened on register 2 and register 3. This is not what we expect. Fixes: 49427232 ("gpio: pca953x: Perform basic regmap conversion") Signed-off-by:
Haibo Chen <haibo.chen@nxp.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Nuno Sá authored
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>
-
Nuno Sá authored
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>
-
Nuno Sá authored
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>
-
Andy Shevchenko authored
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>
-
Andy Shevchenko authored
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>
-
Andy Shevchenko authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Kent Gibson authored
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>
-
Aakash Sen Sharma authored
Remove checkpatch warnings. No functional changes. Signed-off-by:
Aakash Sen Sharma <aakashsensharma@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Geert Uytterhoeven authored
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>
-
Liang He authored
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: a19e3da5 ("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>
-