- May 14, 2022
-
-
William Breathitt Gray authored
This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by:
David Laight <David.Laight@ACULAB.COM> Signed-off-by:
William Breathitt Gray <william.gray@linaro.org> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
William Breathitt Gray authored
This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by:
David Laight <David.Laight@ACULAB.COM> Signed-off-by:
William Breathitt Gray <william.gray@linaro.org> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Moses Christopher Bollavarapu authored
Remove of_gpio.h header file, replace of_* functions and structs with appropriate alternatives. Signed-off-by:
Moses Christopher Bollavarapu <mosescb.dev@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>
-
- May 05, 2022
-
-
Bartosz Golaszewski authored
Merge branch 'irq/gpio-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into gpio/for-next This pulls in changes improving the handling of immutable irqchips in core gpiolib and several drivers.
-
Jon Hunter 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 warning is now observed for the max77620 gpio driver ... WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip, please consider fixing it! Fix the above warning by making the max77620 gpio driver immutable. Signed-off-by:
Jon Hunter <jonathanh@nvidia.com> Reviewed-by:
Marc Zyngier <maz@kernel.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Justin Chen authored
The NXP PCA5608 is the 8-bit version of PCA5616. Signed-off-by:
Justin Chen <justinpopo6@gmail.com> Acked-by:
Florian Fainelli <f.fainelli@gmail.com> Acked-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Justin Chen authored
Add support for pca6408 which is the 8-bit version of the pca6416. https://www.nxp.com/docs/en/data-sheet/PCA6408A.pdf Signed-off-by:
Justin Chen <justinpopo6@gmail.com> Acked-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Uwe Kleine-König authored
The only user of max732x_platform_data is arch/arm/mach-pxa/littleton.c and it only uses .gpio_base. So drop the other members from the data struct and simplify the driver accordingly. The motivating side effect of this change is that the .remove() callback cannot return a nonzero error code any more which prepares making i2c remove callbacks return void. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- May 02, 2022
-
-
Peng Fan authored
i.MX7ULP, i.MX8 and i.MX9 use this driver, so drop the SOC_VF610 dependcy to make the driver could be built for i.MX platform. Signed-off-by:
Peng Fan <peng.fan@nxp.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Bartosz Golaszewski authored
Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v5.19-1 * Introduce helpers to iterate over GPIO chip nodes and covert some drivers gpiolib: - Introduce a helper to get first GPIO controller node - Introduce gpiochip_node_count() helper - Introduce for_each_gpiochip_node() loop helper pinctrl: - meson: Replace custom code by gpiochip_node_count() call - meson: Enable COMPILE_TEST - meson: Rename REG_* to MESON_REG_* - armada-37xx: Reuse GPIO fwnode in armada_37xx_irqchip_register() - armada-37xx: Switch to use fwnode instead of of_node - samsung: Switch to use for_each_gpiochip_node() helper - samsung: Drop redundant node parameter in samsung_banks_of_node_get() - npcm7xx: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Replace custom code by gpiochip_node_count() call - stm32: Switch to use for_each_gpiochip_node() helper - stm32: Replace custom code by gpiochip_node_count() call
-
Alexander Shiyan authored
Since version 5.13, the standard syscon bindings have been added to all clps711x DT nodes, so we can now use the more general syscon_regmap_lookup_by_phandle function to get the syscon pointer. This patch removes the usage of the syscon_regmap_lookup_by_compatible function as it is no longer used in the driver. Signed-off-by:
Alexander Shiyan <eagle.alexander923@gmail.com> Reviewed-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Apr 26, 2022
-
-
Uwe Kleine-König authored
All teardown functions return 0. Also there is little sense in returning a negative error code from an i2c remove function as this only results in emitting an error message but the device is removed nevertheless. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Linus Walleij authored
The boardfiles for IXP4xx have been deleted. Delete all the quirks and code dealing with that boot path and rely solely on device tree boot. Fix some missing static keywords that the kernel test robot was complaining about while we're at it. Cc: Bartosz Golaszewski <brgl@bgdev.pl> Acked-by:
Marc Zyngier <maz@kernel.org> Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Krzysztof Kozlowski authored
Typical GPIO lines like enable, powerdown, reset or wakeup are not documented as common, which leads to new variations of these (e.g. pwdn-gpios). Add a common schema which serves also as a documentation for preferred naming. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Apr 25, 2022
-
-
Schspa Shi authored
In case of PREEMPT_RT, there is a raw_spinlock -> spinlock dependency as the lockdep report shows. __irq_set_handler irq_get_desc_buslock __irq_get_desc_lock raw_spin_lock_irqsave(&desc->lock, *flags); // raw spinlock get here __irq_do_set_handler mask_ack_irq dwapb_irq_ack spin_lock_irqsave(&gc->bgpio_lock, flags); // sleep able spinlock irq_put_desc_busunlock Replace with a raw lock to avoid BUGs. This lock is only used to access registers, and It's safe to replace with the raw lock without bad influence. [ 15.090359][ T1] ============================= [ 15.090365][ T1] [ BUG: Invalid wait context ] [ 15.090373][ T1] 5.10.59-rt52-00983-g186a6841c682-dirty #3 Not tainted [ 15.090386][ T1] ----------------------------- [ 15.090392][ T1] swapper/0/1 is trying to lock: [ 15.090402][ T1] 70ff00018507c188 (&gc->bgpio_lock){....}-{3:3}, at: _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090470][ T1] other info that might help us debug this: [ 15.090477][ T1] context-{5:5} [ 15.090485][ T1] 3 locks held by swapper/0/1: [ 15.090497][ T1] #0: c2ff0001816de1a0 (&dev->mutex){....}-{4:4}, at: __device_driver_lock+0x98/0x104 [ 15.090553][ T1] #1: ffff90001485b4b8 (irq_domain_mutex){+.+.}-{4:4}, at: irq_domain_associate+0xbc/0x6d4 [ 15.090606][ T1] #2: 4bff000185d7a8e0 (lock_class){....}-{2:2}, at: _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090654][ T1] stack backtrace: [ 15.090661][ T1] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.59-rt52-00983-g186a6841c682-dirty #3 [ 15.090682][ T1] Hardware name: Horizon Robotics Journey 5 DVB (DT) [ 15.090692][ T1] Call trace: ...... [ 15.090811][ T1] _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090828][ T1] dwapb_irq_ack+0xb4/0x300 [ 15.090846][ T1] __irq_do_set_handler+0x494/0xb2c [ 15.090864][ T1] __irq_set_handler+0x74/0x114 [ 15.090881][ T1] irq_set_chip_and_handler_name+0x44/0x58 [ 15.090900][ T1] gpiochip_irq_map+0x210/0x644 Signed-off-by:Schspa Shi <schspa@gmail.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by:
Linus Walleij <linus.walleij@linaro.org> Acked-by:
Doug Berger <opendmb@gmail.com> Acked-by:
Serge Semin <fancer.lancer@gmail.com> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Apr 19, 2022
-
-
Marc Zyngier authored
Update the documentation to get rid of the per-gpio_irq_chip irq_chip structure, and give examples of the new pattern. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-11-maz@kernel.org
-
Marc Zyngier authored
5 drivers are converted, a few hundred to go. Definitely worth of a TODO entry, in the hope that someone will notice it and do a bulk update. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-10-maz@kernel.org
-
Marc Zyngier authored
Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-9-maz@kernel.org
-
Marc Zyngier authored
Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-8-maz@kernel.org
-
Marc Zyngier authored
Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-7-maz@kernel.org
-
Marc Zyngier authored
Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-6-maz@kernel.org
-
Marc Zyngier authored
Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Acked-by:
Thierry Reding <treding@nvidia.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-5-maz@kernel.org
-
Marc Zyngier authored
Add a couple of new helpers to make it slightly simpler to convert drivers to immutable irq_chip structures: - GPIOCHIP_IRQ_RESOURCE_HELPERS populates the irq_chip structure with the resource management callbacks - gpio_irq_chip_set_chip() populates the gpio_irq_chip.chip structure, avoiding the proliferation of ugly casts Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-4-maz@kernel.org
-
Marc Zyngier authored
The GPIO subsystem has a couple of internal helpers to manage resources on behalf of the irqchip. Expose them so that GPIO drivers can use them directly. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-3-maz@kernel.org
-
Marc Zyngier authored
In order to move away from gpiolib messing with the internals of unsuspecting irqchips, add a flag by which irqchips advertise that they are not to be messed with, and do solemnly swear that they correctly call into the gpiolib helpers when required. Also nudge the users into converting their drivers to the new model. Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by:
Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220419141846.598305-2-maz@kernel.org
-
Linus Walleij authored
There are some special clock amendments for two machines formerly detected by their machine_is() boardfile macro. They are now migrated to device tree so use of_machine_is_compatible() instead. Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
- Apr 18, 2022
-
-
Andy Shevchenko authored
Since we have generic function to count GPIO controller nodes under a given device, there is no need to open code it. Replace custom code by gpiochip_node_count() call. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Neil Armstrong <narmstrong@baylibre.com>
-
Andy Shevchenko authored
Enable COMPILE_TEST for a better test coverage. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Neil Armstrong <narmstrong@baylibre.com>
-
Andy Shevchenko authored
Currently compilation test fails on x86 due to name collision. The usual way to fix that is to move both conflicting parts to their own namespaces. Rename REG_* to MESON_REG_* as a prerequisite for enabling COMPILE_TEST. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Neil Armstrong <narmstrong@baylibre.com>
-
Andy Shevchenko authored
Since we have fwnode of the first found GPIO controller assigned to the struct gpio_chip, we may reuse it in the armada_37xx_irqchip_register(). Signed-off-by:Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-
Andy Shevchenko authored
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by:Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-
- Apr 15, 2022
-
-
Andy Shevchenko authored
Introduce a helper to get first GPIO controller node which drivers may want to use. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Marek Szyprowski <m.szyprowski@samsung.com>
-
Andy Shevchenko authored
Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, switch to fwnode APIs where it makes sense. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-
Andy Shevchenko authored
The node is taken from the device pointer, which is supplied as a parameter, hence no need to have a separate parameter for node. Drop redundant node parameter in samsung_banks_of_node_get(). While at it, drop "of_" part in the samsung_banks_of_node_get() and samsung_banks_of_node_put() function names to avoid additional churn in the next changes. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-
- Apr 11, 2022
-
-
Sander Vanheule authored
The RTL931x SoC series has support for 32 GPIOs, although not all lines may be broken out to a physical pad. The GPIO bank's parent interrupt can be routed to either or both of the SoC's CPU cores by the GIC. Line-by-line IRQ balancing is not possible on these SoCs. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Sander Vanheule authored
Add the "realtek,rlt9310-gpio", "realtek,otto-gpio" compatible for GPIO nodes on the RTL931x SoC series. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Acked-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Sander Vanheule authored
The RTL930x SoC series has support for 24 GPIOs, with the port order reversed compared to RTL838x and RTL839x. The RTL930x series also has two CPUs (VPEs) and can distribute individual GPIO interrupts between them. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Sander Vanheule authored
On SoCs with multiple cores, it is possible that the GPIO interrupt controller supports assigning specific pins to one or more cores. IRQ balancing can be performed on a line-by-line basis if the parent interrupt is routed to all available cores, which is the default upon initialisation. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Sander Vanheule authored
The GPIO port layout on the RTL930x SoC series is reversed compared to the RTL838x and RTL839x SoC series. Add new port offset calculator functions to ensure the correct order is used when reading port IRQ data, and ensure bgpio uses the right byte ordering. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-
Sander Vanheule authored
Add the "realtek,rlt9300-gpio", "realtek,otto-gpio" compatible for GPIO nodes on the RTL930x SoC series. This SoC requires an extra register range, defining the interrupt CPU mapping registers. Signed-off-by:
Sander Vanheule <sander@svanheule.net> Reviewed-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by:
Bartosz Golaszewski <brgl@bgdev.pl>
-