]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
3 weeks agodt-bindings: gpio: Convert st,spear-spics-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:27:52 +0000 (15:27 -0500)] 
dt-bindings: gpio: Convert st,spear-spics-gpio to DT schema

Convert the ST SPEAr SPI CS GPIO binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20250714202753.3010240-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert abilis,tb10x-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:29:32 +0000 (15:29 -0500)] 
dt-bindings: gpio: Convert abilis,tb10x-gpio to DT schema

Convert the Abilis TB10x GPIO binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202934.3013189-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert apm,xgene-gpio-sb to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:20 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert apm,xgene-gpio-sb to DT schema

Convert APM X-Gene Standby GPIO binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202821.3011099-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert ti,twl4030-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:28 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert ti,twl4030-gpio to DT schema

Convert the TI TWL4030 PMIC GPIO binding to DT schema format. The number
of #interrupt-cells was wrong compared to what is in use. Correct it to
be 1.

Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202829.3011298-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert lantiq,gpio-mm-lantiq to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:35 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert lantiq,gpio-mm-lantiq to DT schema

Convert the Lantiq SoC External Bus memory mapped GPIO binding to DT
schema format. It's a straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202837.3011521-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert ti,keystone-dsp-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:49 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert ti,keystone-dsp-gpio to DT schema

Convert the TI Keystone DSP GPIO binding to DT schema format. The
"ti,syscon-dev" property was wrong and should be "gpio,syscon-dev"
instead.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202850.3011952-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert altr,pio-1.0 to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:29:04 +0000 (15:29 -0500)] 
dt-bindings: gpio: Convert altr,pio-1.0 to DT schema

Convert the altr,pio-1.0 binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202905.3012386-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert cirrus,clps711x-mctrl-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:29:17 +0000 (15:29 -0500)] 
dt-bindings: gpio: Convert cirrus,clps711x-mctrl-gpio to DT schema

Convert the cirrus,clps711x-mctrl-gpio binding to DT schema format.
Add the missing "gpio,syscon-dev" phandle property.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202919.3012764-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert cavium,octeon-3860-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:29:25 +0000 (15:29 -0500)] 
dt-bindings: gpio: Convert cavium,octeon-3860-gpio to DT schema

Convert the Cavium Octeon 3860 GPIO binding to DT schema format. It's a
straight forward conversion.

Looks like Octeon has no maintainers, so Bartosz is listed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202927.3012974-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert exar,xra1403 to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:12 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert exar,xra1403 to DT schema

Convert XRA1403 16-bit GPIO Expander binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202813.3010879-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert microchip,pic32mzda-gpio to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:06 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert microchip,pic32mzda-gpio to DT schema

Convert the Microchip PIC32 GPIO binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202807.3010652-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agodt-bindings: gpio: Convert lacie,netxbig-gpio-ext to DT schema
Rob Herring (Arm) [Mon, 14 Jul 2025 20:28:00 +0000 (15:28 -0500)] 
dt-bindings: gpio: Convert lacie,netxbig-gpio-ext to DT schema

Convert the Lacie NetxBig GPIO binding to DT schema format. It's a
straight forward conversion.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250714202801.3010442-1-robh@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xilinx: convert set_multiple() to the new API as well
Bartosz Golaszewski [Thu, 17 Jul 2025 13:11:15 +0000 (15:11 +0200)] 
gpio: xilinx: convert set_multiple() to the new API as well

The patch converting the driver to using new GPIO line value setters
only converted the set() callback and missed set_multiple(). Fix it now.

Fixes: 1919ea19a4ff ("gpio: xilinx: use new GPIO line value setter callbacks")
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20250717131116.53878-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agomisc: ti-fpc202: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 17 Jul 2025 13:03:56 +0000 (15:03 +0200)] 
misc: ti-fpc202: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250717130357.53491-2-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agomisc: ti-fpc202: remove unneeded direction check
Bartosz Golaszewski [Thu, 17 Jul 2025 13:03:55 +0000 (15:03 +0200)] 
misc: ti-fpc202: remove unneeded direction check

As of commit 92ac7de3175e3 ("gpiolib: don't allow setting values on input
lines"), the GPIO core makes sure values cannot be set on input lines.
Remove the unnecessary check.

Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250717130357.53491-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: loongson-64bit: Extend GPIO irq support
Binbin Zhou [Mon, 14 Jul 2025 06:45:42 +0000 (14:45 +0800)] 
gpio: loongson-64bit: Extend GPIO irq support

Add the interrupt enable register offset (inten_offset) so that GPIO
interrupts can be enabled normally on more models.

According to the latest interface specifications, the definition of GPIO
interrupts in ACPI is similar to that in FDT. The GPIO interrupts are
listed one by one according to the GPIO number, and the corresponding
interrupt number can be obtained directly through the GPIO number
specified by the consumer.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://lore.kernel.org/r/20250714064542.2276247-1-zhoubinbin@loongson.cn
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: viperboard: Unlock on error in vprbrd_gpiob_direction_output()
Dan Carpenter [Tue, 15 Jul 2025 22:58:34 +0000 (17:58 -0500)] 
gpio: viperboard: Unlock on error in vprbrd_gpiob_direction_output()

Unlock before returning if vprbrd_gpiob_setdir() fails.

Fixes: 55e2d1eec110 ("gpio: viperboard: use new GPIO line value setter callbacks")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9e72018c-e46e-4e55-83e4-503da4d022fc@sabinyo.mountain
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: TODO: remove the task for the sysfs rework
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:57 +0000 (14:58 +0200)] 
gpio: TODO: remove the task for the sysfs rework

Remove the completed task tracking the rework of the sysfs interface and
add a new task to track the removal of the legacy bits and pieces.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-10-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: allow disabling the legacy parts of the GPIO sysfs interface
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:56 +0000 (14:58 +0200)] 
gpio: sysfs: allow disabling the legacy parts of the GPIO sysfs interface

Add a Kconfig switch allowing to disable the legacy parts of the GPIO
sysfs interface. This means that even though we keep the
/sys/class/gpio/ directory, it no longer contains the global
export/unexport attribute pair (instead, the user should use the
per-chip export/unpexport) nor the gpiochip$BASE entries. This option
default to y if GPIO sysfs is enabled but we'll default it to n at some
point in the future.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-9-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: export the GPIO directory locally in the gpiochip<id> directory
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:55 +0000 (14:58 +0200)] 
gpio: sysfs: export the GPIO directory locally in the gpiochip<id> directory

As a way to allow the user-space to stop referring to GPIOs by their
global numbers, introduce a parallel group of line attributes for
exported GPIO that live inside the GPIO chip class device and are
referred to by their HW offset within their parent chip.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-8-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: don't look up exported lines as class devices
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:54 +0000 (14:58 +0200)] 
gpio: sysfs: don't look up exported lines as class devices

In preparation for adding a parallel, per-chip attribute group for
exported GPIO lines, stop using class device APIs to refer to it in the
code. When unregistering the chip, don't call class_find_device() but
instead store exported lines in a linked list inside the GPIO chip data
object and look it up there.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-7-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: don't use driver data in sysfs callbacks for line attributes
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:53 +0000 (14:58 +0200)] 
gpio: sysfs: don't use driver data in sysfs callbacks for line attributes

Currently each exported GPIO is represented in sysfs as a separate class
device. This allows us to simply use dev_get_drvdata() to retrieve the
pointer passed to device_create_with_groups() from sysfs ops callbacks.

However, we're preparing to add a parallel set of per-line sysfs
attributes that will live inside the associated gpiochip group. They are
not registered as class devices and so have the parent device passed as
argument to their callbacks (the GPIO chip class device).

Put the attribute structs inside the GPIO descriptor data and
dereference the relevant ones using container_of() in the callbacks.
This way, we'll be able to reuse the same code for both the legacy and
new GPIO attributes.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-6-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: rename the data variable in gpiod_(un)export()
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:52 +0000 (14:58 +0200)] 
gpio: sysfs: rename the data variable in gpiod_(un)export()

In preparation for future commits which will make use of descriptor AND
GPIO-device data in the same functions rename the former from data to
desc_data separately which will make future changes smaller and easier
to read.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-5-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: pass gpiod_data directly to internal GPIO sysfs functions
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:51 +0000 (14:58 +0200)] 
gpio: sysfs: pass gpiod_data directly to internal GPIO sysfs functions

We don't use any fields from struct device in gpio_sysfs_request_irq(),
gpio_sysfs_free_irq() and gpio_sysfs_set_active_low(). We only use the
dev argument to get the associated struct gpiod_data pointer with
dev_get_drvdata().

To make the transition to not using dev_get_drvdata() across line
callbacks for sysfs attributes easier, pass gpiod_data directly to
these functions instead of having it wrapped in struct device.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-4-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: only get the dirent reference for the value attr once
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:50 +0000 (14:58 +0200)] 
gpio: sysfs: only get the dirent reference for the value attr once

There's no reason to retrieve the reference to the sysfs dirent every
time we request an interrupt, we can as well only do it once when
exporting the GPIO.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-3-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: add a parallel class device for each GPIO chip using device IDs
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:49 +0000 (14:58 +0200)] 
gpio: sysfs: add a parallel class device for each GPIO chip using device IDs

In order to enable moving away from the global GPIO numberspace-based
exporting of lines over sysfs: add a parallel, per-chip entry under
/sys/class/gpio/ for every registered GPIO chip, denoted by device ID
in the file name and not its base GPIO number.

Compared to the existing chip group: it does not contain the "base"
attribute as the goal of this change is to not refer to GPIOs by their
global number from user-space anymore. It also contains its own,
per-chip export/unexport attribute pair which allow to export lines by
their hardware offset within the chip.

Caveat #1: the new device cannot be a link to (or be linked to by) the
existing "gpiochip<BASE>" entry as we cannot create links in
/sys/class/xyz/.

Caveat #2: the new entry cannot be named "gpiochipX" as it could
conflict with devices whose base is statically defined to a low number.
Let's go with "chipX" instead.

While at it: the chip label is unique so update the untrue statement
when extending the docs.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-2-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: sysfs: use gpiod_is_equal() to compare GPIO descriptors
Bartosz Golaszewski [Fri, 4 Jul 2025 12:58:48 +0000 (14:58 +0200)] 
gpio: sysfs: use gpiod_is_equal() to compare GPIO descriptors

We have a dedicated comparator for GPIO descriptors that performs
additional checks and hides the implementation detail of whether the
same GPIO can be associated with two separate struct gpio_desc objects.
Use it in sysfs code

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-1-9289d8758243@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wcove: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 15 Jul 2025 08:19:45 +0000 (10:19 +0200)] 
gpio: wcove: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250715-gpiochip-set-rv-gpio-remaining-v2-2-072b4cf06330@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wcove: use regmap_assign_bits() in .set()
Bartosz Golaszewski [Tue, 15 Jul 2025 08:19:44 +0000 (10:19 +0200)] 
gpio: wcove: use regmap_assign_bits() in .set()

Replace the if-else with a direct call to the regmap_assign_bits()
helper and save a couple lines of code.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250715-gpiochip-set-rv-gpio-remaining-v2-1-072b4cf06330@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: pca953x: use regmap_update_bits() to improve performance
Hugo Villeneuve [Mon, 14 Jul 2025 13:37:30 +0000 (09:37 -0400)] 
gpio: pca953x: use regmap_update_bits() to improve performance

Using regmap_update_bits() allows to reduce the number of I2C transfers
when updating bits that haven't changed on non-volatile registers.

For example on a PCAL6416, when changing a GPIO direction from input to
output, the number of I2C transfers can be reduced from 4 to just 1 if
the pull resistors configuration hasn't changed and the output value
is the same as before.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20250714133730.6353-1-hugo@hugovil.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: zynqmp-modepin: set line value in .direction_output()
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:56 +0000 (08:41 +0200)] 
gpio: zynqmp-modepin: set line value in .direction_output()

It's ok to not do anything specific when setting direction but the
callback should still respect the line value the user requests.

Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-19-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: zynqmp-modepin: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:55 +0000 (08:41 +0200)] 
gpio: zynqmp-modepin: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-18-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: zynq: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:54 +0000 (08:41 +0200)] 
gpio: zynq: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-17-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: zevio: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:53 +0000 (08:41 +0200)] 
gpio: zevio: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-16-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xtensa: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:52 +0000 (08:41 +0200)] 
gpio: xtensa: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-15-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xtensa: remove unneeded .set() callback
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:51 +0000 (08:41 +0200)] 
gpio: xtensa: remove unneeded .set() callback

GPIO core deals just fine with input-only controllers not implementing
the .set() callback. Remove the unneeded dummy implementation.

Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-14-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xra1403: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:50 +0000 (08:41 +0200)] 
gpio: xra1403: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-13-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xlp: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:49 +0000 (08:41 +0200)] 
gpio: xlp: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-12-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xlp: drop unneeded ngpio checks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:48 +0000 (08:41 +0200)] 
gpio: xlp: drop unneeded ngpio checks

GPIO core already makes sure that offsets higher than the number of GPIOs
are never passed to controller callbacks. We can remove the unnecessary
check.

Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-11-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xilinx: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:47 +0000 (08:41 +0200)] 
gpio: xilinx: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-10-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: xgene: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:46 +0000 (08:41 +0200)] 
gpio: xgene: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-9-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wm8994: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:45 +0000 (08:41 +0200)] 
gpio: wm8994: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-8-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wm8350: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:44 +0000 (08:41 +0200)] 
gpio: wm8350: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-7-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wm831x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:43 +0000 (08:41 +0200)] 
gpio: wm831x: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-6-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: winbond: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:42 +0000 (08:41 +0200)] 
gpio: winbond: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-5-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wcd934x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:40 +0000 (08:41 +0200)] 
gpio: wcd934x: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-3-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: wcd934x: check the return value of regmap_update_bits()
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:39 +0000 (08:41 +0200)] 
gpio: wcd934x: check the return value of regmap_update_bits()

regmap_update_bits() can fail so check its return value in
wcd_gpio_direction_output() for consistency with the rest of the code
and propagate any errors.

Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-2-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: vx855: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 9 Jul 2025 06:41:38 +0000 (08:41 +0200)] 
gpio: vx855: use new GPIO line value setter callbacks

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/20250709-gpiochip-set-rv-gpio-remaining-v1-1-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: virtio: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:25 +0000 (09:50 +0200)] 
gpio: virtio: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-12-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: viperboard: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:24 +0000 (09:50 +0200)] 
gpio: viperboard: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-11-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: uniphier: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:23 +0000 (09:50 +0200)] 
gpio: uniphier: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-10-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: twl6040: set line value in .direction_out()
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:22 +0000 (09:50 +0200)] 
gpio: twl6040: set line value in .direction_out()

It's ok for a GPIO controller to be output-only but the .direction_out()
callback must also set the requested line value.

Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-9-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: twl6040: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:21 +0000 (09:50 +0200)] 
gpio: twl6040: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-8-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: twl4030: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:20 +0000 (09:50 +0200)] 
gpio: twl4030: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-7-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: ts4900: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:19 +0000 (09:50 +0200)] 
gpio: ts4900: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-6-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: tqmx86: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:18 +0000 (09:50 +0200)] 
gpio: tqmx86: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Acked-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-5-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: tps68470: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:17 +0000 (09:50 +0200)] 
gpio: tps68470: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-4-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: tps65912: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:16 +0000 (09:50 +0200)] 
gpio: tps65912: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-3-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: tps65912: check the return value of regmap_update_bits()
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:15 +0000 (09:50 +0200)] 
gpio: tps65912: check the return value of regmap_update_bits()

regmap_update_bits() can fail, check its return value like we do
elsewhere in the driver.

Link: https://lore.kernel.org/r/20250707-gpiochip-set-rv-gpio-round4-v1-2-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpio: tps65910: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 7 Jul 2025 07:50:14 +0000 (09:50 +0200)] 
gpio: tps65910: use new GPIO line value setter callbacks

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/20250707-gpiochip-set-rv-gpio-round4-v1-1-35668aaaf6d2@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
3 weeks agogpiolib: don't use GPIO global numbers in debugfs output
Bartosz Golaszewski [Mon, 7 Jul 2025 14:13:13 +0000 (16:13 +0200)] 
gpiolib: don't use GPIO global numbers in debugfs output

One of the users of global GPIO numbers in the kernel are the debugfs
callbacks in GPIO drivers. Before converting any custom .dbg_show()
callbacks in individual modules, let's first make GPIO core stop using
GPIO base in debugfs output. Use hardware offsets instead.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250707141313.73169-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: rcar: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Geert Uytterhoeven [Wed, 9 Jul 2025 18:43:59 +0000 (20:43 +0200)] 
gpio: rcar: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Convert the Renesas R-Car GPIO driver from SIMPLE_DEV_PM_OPS() to
DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().  This lets us drop the
check for CONFIG_PM_SLEEP, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled, while increasing build coverage.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/e201140426daacaa799d73e2f76bfd96b6f5718f.1752086619.git.geert+renesas@glider.be
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: sim: allow to mark simulated lines as invalid
Bartosz Golaszewski [Mon, 30 Jun 2025 13:03:57 +0000 (15:03 +0200)] 
gpio: sim: allow to mark simulated lines as invalid

Add a new line-level, boolean property to the gpio-sim configfs
interface called 'valid'. It's set by default and the user can unset it
to make the line be included in the standard `gpio-reserved-ranges`
property when the chip is registered with GPIO core. This allows users
to specify which lines should not be available for requesting as GPIOs.

Link: https://lore.kernel.org/r/20250630130358.40352-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: pca953x: Add support for TI TCA6418
Maria Garcia [Thu, 3 Jul 2025 20:57:40 +0000 (22:57 +0200)] 
gpio: pca953x: Add support for TI TCA6418

The TI TCA6418 is a 18-channel I2C I/O expander. It is slightly
different to other models from the same family, such as TCA6416,
but has enough in common with them to make it work with just a
few tweaks, which are explained in the code's documentation.

Signed-off-by: Maria Garcia <mariagarcia7293@gmail.com>
Link: https://lore.kernel.org/r/20250703205740.45385-3-mariagarcia7293@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agodt-bindings: gpio: pca95xx: add TI TCA6418
Maria Garcia [Thu, 3 Jul 2025 20:57:39 +0000 (22:57 +0200)] 
dt-bindings: gpio: pca95xx: add TI TCA6418

The TCA6418E is a 18-channel I2C I/O expander with integrated ESD
protection.

Signed-off-by: Maria Garcia <mariagarcia7293@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250703205740.45385-2-mariagarcia7293@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: arizona: Remove redundant pm_runtime_mark_last_busy() calls
Sakari Ailus [Fri, 4 Jul 2025 07:54:08 +0000 (10:54 +0300)] 
gpio: arizona: Remove redundant pm_runtime_mark_last_busy() calls

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20250704075408.3217690-1-sakari.ailus@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agoMerge tag 'pm-runtime-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Bartosz Golaszewski [Mon, 7 Jul 2025 08:00:33 +0000 (10:00 +0200)] 
Merge tag 'pm-runtime-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into gpio/for-next

Runtime PM updates related to autosuspend for 6.17

Make several autosuspend functions mark last busy stamp and update
the documentation accordingly (Sakari Ailus).

4 weeks agogpio: tps6586x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:13 +0000 (11:14 +0200)] 
gpio: tps6586x: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-12-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tps65219: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:12 +0000 (11:14 +0200)] 
gpio: tps65219: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-11-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tps65218: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:11 +0000 (11:14 +0200)] 
gpio: tps65218: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-10-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tps65218: remove unneeded callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:10 +0000 (11:14 +0200)] 
gpio: tps65218: remove unneeded callbacks

GPIO core can handle output-only chips that don't implement the get()
and direction_input() callbacks. There's no need to provide dummy
implementation of the latter in the driver so drop it.

Link: https://lore.kernel.org/r/20250702-gpiochip-set-rv-gpio-round3-v1-9-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tps65086: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:09 +0000 (11:14 +0200)] 
gpio: tps65086: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-8-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tpic2810: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:08 +0000 (11:14 +0200)] 
gpio: tpic2810: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-7-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tpic2810: remove unneeded callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:07 +0000 (11:14 +0200)] 
gpio: tpic2810: remove unneeded callbacks

GPIO core can handle output-only chips that don't implement the get()
and direction_input() callbacks. There's no need to provide dummy
implementation of the latter in the driver so drop it.

Link: https://lore.kernel.org/r/20250702-gpiochip-set-rv-gpio-round3-v1-6-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: timberdale: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:06 +0000 (11:14 +0200)] 
gpio: timberdale: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-5-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: thunderx: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:05 +0000 (11:14 +0200)] 
gpio: thunderx: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-4-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tegra: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:04 +0000 (11:14 +0200)] 
gpio: tegra: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-3-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tegra186: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:03 +0000 (11:14 +0200)] 
gpio: tegra186: use new GPIO line value setter callbacks

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/20250702-gpiochip-set-rv-gpio-round3-v1-2-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: tegra186: don't call the set() callback directly
Bartosz Golaszewski [Wed, 2 Jul 2025 09:14:02 +0000 (11:14 +0200)] 
gpio: tegra186: don't call the set() callback directly

Drivers should not dereference GPIO chip callbacks directly. Move the
module's set() function higher to make it available to the
direction_output() callback and call it instead.

Link: https://lore.kernel.org/r/20250702-gpiochip-set-rv-gpio-round3-v1-1-0d23be74f71d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: en7523: use new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:15 +0000 (11:22 +0200)] 
gpio: en7523: use new generic GPIO chip API

Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-8-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: 74xx-mmio: use new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:14 +0000 (11:22 +0200)] 
gpio: 74xx-mmio: use new generic GPIO chip API

Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-7-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: cadence: use new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:13 +0000 (11:22 +0200)] 
gpio: cadence: use new generic GPIO chip API

Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-6-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: cadence: use lock guards
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:12 +0000 (11:22 +0200)] 
gpio: cadence: use lock guards

Simplify the code by using lock guards for the bgpio_lock. While at it:
move the gpio/driver.h include into its correct place alphabetically.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-5-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: clps711x: use new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:11 +0000 (11:22 +0200)] 
gpio: clps711x: use new generic GPIO chip API

Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-4-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: mxc: use new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:10 +0000 (11:22 +0200)] 
gpio: mxc: use new generic GPIO chip API

Convert the driver to using the new generic GPIO chip interfaces from
linux/gpio/generic.h.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-3-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: mxc: use lock guards for the generic GPIO chip lock
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:09 +0000 (11:22 +0200)] 
gpio: mxc: use lock guards for the generic GPIO chip lock

Simplify the code by using lock guards for the bgpio_lock.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-2-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: generic: add new generic GPIO chip API
Bartosz Golaszewski [Wed, 2 Jul 2025 09:22:08 +0000 (11:22 +0200)] 
gpio: generic: add new generic GPIO chip API

As the first step in removing the fields specific to the gpio-mmio
module from struct gpio_chip, we introduce a new set of generic GPIO
chip interfaces that are meant to replace the existing bgpio_ ones.

The new initialization function - gpio_generic_chip_init() - takes a
configuration structure as argument instead of 9 separate parameters.
This will allow easy extension if needed in the future. We hide the
locking details behind a set of helpers in order to be able to move the
raw spinlock out of struct gpio_chip without the users noticing.

For now, the new APIs just wrap the existing ones. Once all users have
been converted to the new interfaces, we'll pull them into gpio-mmio and
implement them in a backward-compatible way while also moving all fields
specific to the generic GPIO chip into struct gpio_generic_chip.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250702-gpio-mmio-rework-v2-1-6b77aab684d8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agoMerge tag 'gpio-mmio-remove-bgpio-pdata-for-v6.17-rc1' into gpio/for-next
Bartosz Golaszewski [Mon, 7 Jul 2025 07:42:37 +0000 (09:42 +0200)] 
Merge tag 'gpio-mmio-remove-bgpio-pdata-for-v6.17-rc1' into gpio/for-next

Immutable branch between GPIO, MFD and ARM-SoC for v6.17-rc1

Remove struct bgpio_pdata after converting its users to generic device
properties.

4 weeks agogpio: mmio: remove struct bgpio_pdata
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:40 +0000 (13:49 +0200)] 
gpio: mmio: remove struct bgpio_pdata

With no more users, we can now remove struct bgpio_pdata. Move the
relevant bits from bgpio_parse_fw() into bgpio_pdev_probe() while
maintaining the logical ordering (get flags before calling
bgpio_init()).

Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-6-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agoARM: s3c: crag6410: use generic device properties for gpio-mmio
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:39 +0000 (13:49 +0200)] 
ARM: s3c: crag6410: use generic device properties for gpio-mmio

The GPIO device in crag6410 is registered with struct bgpio_pdata passed
as platform_data to the gpio-mmio driver. We want to remove the
bgpio_pdata from the kernel and the gpio-mmio driver is now also able to
get the relevant values from the software node. Set up device properties
and switch to using platform_device_info to register the device as
platform_add_devices() doesn't allow us to pass device properties to the
driver model.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-5-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agoARM: omap1: ams-delta: use generic device properties for gpio-mmio
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:38 +0000 (13:49 +0200)] 
ARM: omap1: ams-delta: use generic device properties for gpio-mmio

The two latch GPIO devices in ams-delta are registered with struct
bgpio_pdata passed as platform_data to the gpio-mmio driver. We want to
remove the bgpio_pdata from the kernel and the gpio-mmio driver is now
also able to get the relevant values from the software node. Set up
device properties and switch to using platform_device_info to register
the devices as platform_add_devices() doesn't allow us to pass device
properties to the driver model.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-4-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agomfd: vexpress-sysreg: set-up software nodes for gpio-mmio
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:37 +0000 (13:49 +0200)] 
mfd: vexpress-sysreg: set-up software nodes for gpio-mmio

Replace struct bgpio_pdata - that we plan to remove - with software
nodes containing properties encoding the same values thatr can now be
parsed by gpio-mmio.

Acked-by: Lee Jones <lee@kernel.org>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-3-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: mmio: get chip label and GPIO base from device properties
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:36 +0000 (13:49 +0200)] 
gpio: mmio: get chip label and GPIO base from device properties

Ahead of removing struct bgpio_pdata support from the gpio-mmio generic
module, let's add support for getting the relevant values from generic
device properties. "label" is a semi-standardized property in some GPIO
drivers so let's go with it. There's no standard "base" property, so
let's use the name "gpio-mmio,base" to tie it to this driver
specifically. The number of GPIOs will be retrieved using
gpiochip_get_ngpios() so there's no need to look it up in the software
node.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-2-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: mmio: drop the big-endian platform device variant
Bartosz Golaszewski [Tue, 1 Jul 2025 11:49:35 +0000 (13:49 +0200)] 
gpio: mmio: drop the big-endian platform device variant

There are no more users of the "basic-mmio-gpio-be" platform device ID
in the kernel. We can safely drop it.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250701-gpio-mmio-pdata-v2-1-ebf34d273497@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
4 weeks agogpio: reg: use new GPIO line value setter callbacks
Bartosz Golaszewski [Mon, 23 Jun 2025 07:57:16 +0000 (09:57 +0200)] 
gpio: reg: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the legacy generic
gpio-reg module to using them. We have to update the two legacy ARM
platforms that use it at the same time as they call the set_multiple()
callbacks directly (they shouldn't but it's old technical debt I
suppose).

Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250623-gpiochip-set-rv-gpio-v3-1-90f0e170a846@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: palmas: Allow building as a module
Aaron Kling [Wed, 2 Jul 2025 18:22:51 +0000 (13:22 -0500)] 
gpio: palmas: Allow building as a module

The driver works fine as a module, so allowing building as such. This
adds an exit handler to support module unload.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://lore.kernel.org/r/20250702-gpio-palmas-gpio-v4-1-26ba48252f27@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agoMerge tag 'ib-mfd-gpio-input-pwm-v6.17' of git://git.kernel.org/pub/scm/linux/kernel...
Bartosz Golaszewski [Thu, 3 Jul 2025 08:35:04 +0000 (10:35 +0200)] 
Merge tag 'ib-mfd-gpio-input-pwm-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into gpio/for-next

Immutable branch between MFD, GPIO, Input and PWM due for the v6.17 merge window

5 weeks agogpio: tc3589x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:35 +0000 (12:33 +0200)] 
gpio: tc3589x: use new GPIO line value setter callbacks

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/20250625-gpiochip-set-rv-gpio-round2-v1-12-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: tangier: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:34 +0000 (12:33 +0200)] 
gpio: tangier: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-11-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: syscon: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:33 +0000 (12:33 +0200)] 
gpio: syscon: use new GPIO line value setter callbacks

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/20250625-gpiochip-set-rv-gpio-round2-v1-10-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>