]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
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>
5 weeks agogpio: stp-xway: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:32 +0000 (12:33 +0200)] 
gpio: stp-xway: 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-9-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: stmpe: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:31 +0000 (12:33 +0200)] 
gpio: stmpe: 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-8-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: sprd: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:30 +0000 (12:33 +0200)] 
gpio: sprd: 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: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-7-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: spear-spics: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:29 +0000 (12:33 +0200)] 
gpio: spear-spics: 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-6-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: spear-spics: remove unneeded callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:28 +0000 (12:33 +0200)] 
gpio: spear-spics: 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
implementations in the driver so drop them.

Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-5-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: siox: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:27 +0000 (12:33 +0200)] 
gpio: siox: 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: Thorsten Scherer <t.scherer@eckelmann.de>
Link: https://lore.kernel.org/r/20250625-gpiochip-set-rv-gpio-round2-v1-4-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: sch: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:26 +0000 (12:33 +0200)] 
gpio: sch: 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-3-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: sch311x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:25 +0000 (12:33 +0200)] 
gpio: sch311x: 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-2-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: sama5d2-piobu: use new GPIO line value setter callbacks
Bartosz Golaszewski [Wed, 25 Jun 2025 10:33:24 +0000 (12:33 +0200)] 
gpio: sama5d2-piobu: 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-1-bc110a3b52ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: pisosr: remove unneeded direction_output() callback
Bartosz Golaszewski [Wed, 25 Jun 2025 08:12:22 +0000 (10:12 +0200)] 
gpio: pisosr: remove unneeded direction_output() callback

GPIO core can handle input-only chips that don't implement the
direction_output() callback at all. There's no need for the driver to
provide a dummy implementation so drop it.

Link: https://lore.kernel.org/r/20250625081222.12744-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agomfd: adp5585: Add support for a reset pin
Nuno Sá [Tue, 1 Jul 2025 14:32:15 +0000 (15:32 +0100)] 
mfd: adp5585: Add support for a reset pin

Make sure to perform an Hardware reset during probe  if the pin is given
in FW.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-20-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agodt-bindings: mfd: adp5585: document reset gpio
Nuno Sá [Tue, 1 Jul 2025 14:32:14 +0000 (15:32 +0100)] 
dt-bindings: mfd: adp5585: document reset gpio

Add a reset gpio property. Note that for the adp5585-01 models, the
reset pin is used as the additional ROW5 which means there's no reset.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-19-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Support getting vdd regulator
Nuno Sá [Tue, 1 Jul 2025 14:32:13 +0000 (15:32 +0100)] 
mfd: adp5585: Support getting vdd regulator

Make sure we get and enable the VDD supply (if available).

Reviewed-by: Lee Jones <lee@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-18-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agoInput: adp5589: remove the driver
Nuno Sá [Tue, 1 Jul 2025 14:32:12 +0000 (15:32 +0100)] 
Input: adp5589: remove the driver

The adp5589 support is based on legacy platform data and there's no
upstream platform using this device.
Moreover, recently, with

commit
480a8ad683d7 ("mfd: adp5585: Add Analog Devices ADP5585 core support")

we overlapped support for the adp5585 device (gpiochip part of it) but
since it actually makes sense for the device to be supported under MFD, we
can complement it and add the keymap support for it (properly based on FW
properties). And that is what

commit
04840c5363a6 ("Input: adp5585: Add Analog Devices ADP5585/89 support")

is doing.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-17-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agoInput: adp5585: Add Analog Devices ADP5585/89 support
Nuno Sá [Tue, 1 Jul 2025 14:32:11 +0000 (15:32 +0100)] 
Input: adp5585: Add Analog Devices ADP5585/89 support

The ADP5585 is a 10/11 input/output port expander with a built in keypad
matrix decoder, programmable logic, reset generator, and PWM generator.
This driver supports the keyboard function using the platform device
registered by the core MFD driver.

The ADP5589 has 19 pins and also features an unlock function.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-16-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agogpio: adp5585: support gpi events
Nuno Sá [Tue, 1 Jul 2025 14:32:10 +0000 (15:32 +0100)] 
gpio: adp5585: support gpi events

Add support for adding GPIs to the event FIFO. This is done by adding
irq_chip support. Like this, one can use the input gpio_keys driver as a
"frontend" device and input handler.

As part of this change, we now implement .request() and .free() as we can't
blindly consume all available pins as GPIOs (example: some pins can be
used for forming a keymap matrix).

Also note that the number of pins can now be obtained from the parent,
top level device. Hence the 'max_gpio' variable can be removed.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-15-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Add support for input devices
Nuno Sá [Tue, 1 Jul 2025 14:32:09 +0000 (15:32 +0100)] 
mfd: adp5585: Add support for input devices

The ADP558x family supports a built in keypad matrix decoder which can
be added as an Input device. In order to both support the Input and the
GPIO device, we need to create a bitmap of the supported pins and track
their usage since they can either be used as GPIOs (GPIs) or as part of
the keymap.

We also need to mark special pins busy in case some features are being
used (ex: pwm or reset events).

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-14-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Support reset and unlock events
Nuno Sá [Tue, 1 Jul 2025 14:32:08 +0000 (15:32 +0100)] 
mfd: adp5585: Support reset and unlock events

The ADP558x family of devices can be programmed to respond to some
especial events, In case of the unlock events, one can lock the keypad
and use KEYS or GPIs events to unlock it. For the reset events, one can
again use a combinations of GPIs/KEYs in order to generate an event that
will trigger the device to generate an output reset pulse.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-13-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Add support for event handling
Nuno Sá [Tue, 1 Jul 2025 14:32:07 +0000 (15:32 +0100)] 
mfd: adp5585: Add support for event handling

These devices are capable of generate FIFO based events based on KEY or
GPI presses. Add support for handling these events. This is in
preparation of adding full support for keymap and gpis based events.

Reviewed-by: Lee Jones <lee@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-12-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agodt-bindings: mfd: adp5585: add properties for input events
Nuno Sá [Tue, 1 Jul 2025 14:32:06 +0000 (15:32 +0100)] 
dt-bindings: mfd: adp5585: add properties for input events

Add properties related to input events. These devices can act as
keyboards and can support events either via a keymap Matrix or through
GPIs. Note that the device needs to be an interrupt controller for GPIs
based events.

We specifically need a property specifying the pins used by the keymap
matrix since these devices have no requirement for rows and columns to be
contiguous without holes which is enforced by the standard input
properties.

Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-11-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agopwm: adp5585: add support for adp5589
Nuno Sá [Tue, 1 Jul 2025 14:32:05 +0000 (15:32 +0100)] 
pwm: adp5585: add support for adp5589

Add support for the adp5589 I/O expander. From a PWM point of view it is
pretty similar to adp5585. Main difference is the address
of registers meaningful for configuring the PWM.

Acked-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-10-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agogpio: adp5585: add support for the adp5589 expander
Nuno Sá [Tue, 1 Jul 2025 14:32:04 +0000 (15:32 +0100)] 
gpio: adp5585: add support for the adp5589 expander

Support the adp5589 I/O expander which supports up to 19 pins. We need
to add a chip_info based struct since accessing register "banks"
and "bits" differs between devices.

Also some register addresses are different.

While at it move ADP558X_GPIO_MAX defines to the main header file and
rename them. That information will be needed by the top level device in
a following change.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-9-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Add a per chip reg struture
Nuno Sá [Tue, 1 Jul 2025 14:32:03 +0000 (15:32 +0100)] 
mfd: adp5585: Add a per chip reg struture

There are some differences in the register map between the devices.
Hence, add a register structure per device. This will be needed in
following patches.

On top of that adp5585_fill_regmap_config() is renamed and reworked so
that the current struct adp5585_info act as template (they indeed
contain all the different data between variants) which can then be
complemented depending on the device (as identified by the id register).
This is done like this since a lot of the data is pretty much the same
between variants of the same device.

Reviewed-by: Lee Jones <lee@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-8-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Add support for adp5589
Nuno Sá [Tue, 1 Jul 2025 14:32:02 +0000 (15:32 +0100)] 
mfd: adp5585: Add support for adp5589

The ADP5589 is a 19 I/O port expander with built-in keypad matrix decoder,
programmable logic, reset generator, and PWM generator.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-7-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Refactor how regmap defaults are handled
Nuno Sá [Tue, 1 Jul 2025 14:32:01 +0000 (15:32 +0100)] 
mfd: adp5585: Refactor how regmap defaults are handled

The only thing changing between variants is the regmap default
registers. Hence, instead of having a regmap configuration for every
variant (duplicating lots of fields), add a chip info type of structure
with a regmap ID to identify which defaults to use and populate
regmap_config at runtime given a template plus the id. Also note that
between variants, the defaults can be the same which means the chip info
structure can be used in more than one compatible.

This will also make it simpler adding new chips with more variants.

Also note that the chip info structures are deliberately not const as
they will also contain lots of members that are the same between the
different devices variants and so we will fill those at runtime.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-6-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agodt-bindings: mfd: adp5585: document adp5589 I/O expander
Nuno Sá [Tue, 1 Jul 2025 14:32:00 +0000 (15:32 +0100)] 
dt-bindings: mfd: adp5585: document adp5589 I/O expander

The ADP5589 is a 19 I/O port expander with built-in keypad matrix decoder,
programmable logic, reset generator, and PWM generator.

We can't really have adp5589 devices fallback to adp5585 (which have
less pins) because there are some significant differences in the register
map.

Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-5-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Make use of MFD_CELL_NAME()
Nuno Sá [Tue, 1 Jul 2025 14:31:59 +0000 (15:31 +0100)] 
mfd: adp5585: Make use of MFD_CELL_NAME()

Use the helper macro. No functional change intended...

Whilst we're at it, now seems like a good time to update the Copyright.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-4-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Enable oscillator during probe
Nuno Sá [Tue, 1 Jul 2025 14:31:58 +0000 (15:31 +0100)] 
mfd: adp5585: Enable oscillator during probe

Make sure to enable the oscillator in the top device. This will allow to
not control this in the child PWM device as that would not work with
future support for keyboard matrix where the oscillator needs to be
always enabled (and so cannot be disabled by disabling PWM).

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Uwe Kleine-König <ukleinek@kernel.org>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-3-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agomfd: adp5585: Only add devices given in FW
Nuno Sá [Tue, 1 Jul 2025 14:31:57 +0000 (15:31 +0100)] 
mfd: adp5585: Only add devices given in FW

Not all devices (features) of the adp5585 device are mandatory to be
used in all platforms. Hence, check what's given in FW and dynamically
create the mfd_cell array to be given to devm_mfd_add_devices().

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-2-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agodt-bindings: mfd: adp5585: ease on the required properties
Nuno Sá [Tue, 1 Jul 2025 14:31:56 +0000 (15:31 +0100)] 
dt-bindings: mfd: adp5585: ease on the required properties

It is not mandatory to use all the capabilities of the device. One can
very well only use it as a gpio controller without the PWM support. This
will be even more evident when support for the matrix keymap is added.
Hence drop the requirements for PWM and GPIO.

Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-1-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
5 weeks agogpio: make gpiod_is_equal() arguments stricter
Bartosz Golaszewski [Fri, 20 Jun 2025 12:58:02 +0000 (14:58 +0200)] 
gpio: make gpiod_is_equal() arguments stricter

It makes no sense for a GPIO descriptor comparator to return true when
the arguments passed to it are NULL or IS_ERR(). Let's validate both and
return false unless both are valid GPIO descriptors.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/all/Z_aFBfjb17JxOwyk@black.fi.intel.com/
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/r/20250620-gpiod-is-equal-improv-v1-2-a75060505d2c@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
5 weeks agogpio: constify arguments of gpiod_is_equal()
Bartosz Golaszewski [Fri, 20 Jun 2025 12:58:01 +0000 (14:58 +0200)] 
gpio: constify arguments of gpiod_is_equal()

This function is not meant to modify the GPIO descriptors in any way so
we can safely constify both arguments.

Link: https://lore.kernel.org/r/20250620-gpiod-is-equal-improv-v1-1-a75060505d2c@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rcar: Use new line value setter callbacks
Geert Uytterhoeven [Wed, 25 Jun 2025 08:05:47 +0000 (10:05 +0200)] 
gpio: rcar: Use new line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
integers, so they can indicate failures.  Convert the driver to using
them.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/f09a0481fc0ddafb9aa05d903fbb42ef52332c03.1750838486.git.geert+renesas@glider.be
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rcar: Remove checks for empty bankmasks
Geert Uytterhoeven [Wed, 25 Jun 2025 08:05:46 +0000 (10:05 +0200)] 
gpio: rcar: Remove checks for empty bankmasks

The GPIO core never passes empty bankmasks to the callbacks for handling
multiple signals at once.  Remove the superfluous checks, and refactor
the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/29fb200d3f92e79cdd5ce4048d2847c265f337b4.1750838486.git.geert+renesas@glider.be
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: clps711x: drop unneeded platform_set_drvdata()
Bartosz Golaszewski [Wed, 18 Jun 2025 07:46:53 +0000 (09:46 +0200)] 
gpio: clps711x: drop unneeded platform_set_drvdata()

There's no corresponding platform_get_drvdata() used in this module or
the higher-level gpio-mmio. Let's remove the unneeded call to
platform_set_drvdata().

Link: https://lore.kernel.org/r/20250618074653.25555-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: sa1100: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:25 +0000 (10:33 +0200)] 
gpio: sa1100: 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/20250619-gpiochip-set-rv-gpio-v2-12-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rtd: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:24 +0000 (10:33 +0200)] 
gpio: rtd: 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/20250619-gpiochip-set-rv-gpio-v2-11-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rockchip: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:23 +0000 (10:33 +0200)] 
gpio: rockchip: 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: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-10-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rdc321x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:21 +0000 (10:33 +0200)] 
gpio: rdc321x: 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/20250619-gpiochip-set-rv-gpio-v2-8-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: rc5t583: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:20 +0000 (10:33 +0200)] 
gpio: rc5t583: 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/20250619-gpiochip-set-rv-gpio-v2-7-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pxa: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:19 +0000 (10:33 +0200)] 
gpio: pxa: 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/20250619-gpiochip-set-rv-gpio-v2-6-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pmic-eic-sprd: drop unneeded .set() callback
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:18 +0000 (10:33 +0200)] 
gpio: pmic-eic-sprd: drop unneeded .set() callback

The lines on this chip are input-only. GPIO core can handle the missing
.set() callback so there's no need to implement a dummy here. Drop it.

Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-5-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pl061: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:17 +0000 (10:33 +0200)] 
gpio: pl061: 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: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-4-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pch: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:16 +0000 (10:33 +0200)] 
gpio: pch: 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: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-3-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pcf857x: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:15 +0000 (10:33 +0200)] 
gpio: pcf857x: 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/20250619-gpiochip-set-rv-gpio-v2-2-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: pca9570: use new GPIO line value setter callbacks
Bartosz Golaszewski [Thu, 19 Jun 2025 08:33:14 +0000 (10:33 +0200)] 
gpio: pca9570: 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/20250619-gpiochip-set-rv-gpio-v2-1-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: ts5500: use new GPIO line value setter callbacks
Daniel Sullivan [Sun, 22 Jun 2025 00:12:33 +0000 (17:12 -0700)] 
gpio: ts5500: 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.

Signed-off-by: Daniel Sullivan <danieljsullivan7@gmail.com>
Link: https://lore.kernel.org/r/aFdKce3Go9iF4A6m@danv-Standard-PC-Q35-ICH9-2009
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
6 weeks agogpio: sysfs: fix use-after-free in error path
Antonio Quartulli [Sun, 22 Jun 2025 22:02:21 +0000 (00:02 +0200)] 
gpio: sysfs: fix use-after-free in error path

When invoking device_create_with_groups(), its return value is stored
in `data->cdev_base`. However, in case of faiure, `data` is first freed
and then derefernced in order to return `data->cdev_base`.

Fix the use-after-free by extracting the error code before free'ing
`data`.

Fixes: fd19792851db ("gpio: sysfs: remove the mockdev pointer from struct gpio_device")
Addresses-Coverity-ID: 1644512 ("Memory - illegal accesses  (USE_AFTER_FREE)")
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Link: https://lore.kernel.org/r/20250622220221.28025-1-antonio@mandelbit.com
[Bartosz: added Fixes: tag, tweaked commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: sysfs: remove the mockdev pointer from struct gpio_device
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:21 +0000 (16:38 +0200)] 
gpio: sysfs: remove the mockdev pointer from struct gpio_device

The usage of the mockdev pointer in struct gpio_device is limited to the
GPIO sysfs code. There's no reason to keep it in this top-level
structure. Create a separate structure containing the reference to the
GPIO device and the dummy class device that will be passed to
device_create_with_groups(). The !gdev->mockdev checks can be removed as
long as we make sure that all operations on the GPIO class are protected
with the sysfs lock.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-6-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: sysfs: remove unneeded headers
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:20 +0000 (16:38 +0200)] 
gpio: sysfs: remove unneeded headers

No symbols from the linux/idr.h or linux/spinlock.h headers are used in
this file so remove them. We also don't technically need linux/list.h
currently but one of the follow-up commits will start using it so let's
leave it.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-5-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: sysfs: refactor the coding style
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:19 +0000 (16:38 +0200)] 
gpio: sysfs: refactor the coding style

Update the code to be more consistent with the rest of the codebase.
Mostly correctly align line-breaks, remove unneeded tabs, stray newlines
& spaces and tweak the comment style.

No functional change.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-4-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: sysfs: call mutex_destroy() in gpiod_unexport()
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:18 +0000 (16:38 +0200)] 
gpio: sysfs: call mutex_destroy() in gpiod_unexport()

While not critical, it's useful to have the corresponding call to
mutex_destroy() whenever we use mutex_init(). Add the call right before
kfreeing the GPIO data.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-3-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agoDocumentation: gpio: document the active_low field in the sysfs ABI
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:17 +0000 (16:38 +0200)] 
Documentation: gpio: document the active_low field in the sysfs ABI

Exported GPIO lines also have the active_low attribute which is not
documented. Add a short mention for it.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-2-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agoDocumentation: gpio: undocument removed behavior
Bartosz Golaszewski [Tue, 10 Jun 2025 14:38:16 +0000 (16:38 +0200)] 
Documentation: gpio: undocument removed behavior

Since commit 700cdf7ed00f ("gpio: sysfs: make the sysfs export behavior
consistent"), named GPIO lines are no longer exported in sysfs as links
named after the them. Drop the misleading bit from the ABI docs.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpio-sysfs-chip-export-v1-1-a8c7aa4478b1@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agoplatform: cznic: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 09:43:58 +0000 (11:43 +0200)] 
platform: cznic: 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.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-platform-cznic-v1-1-30afd2444756@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mmio: don't use legacy GPIO chip setters
Bartosz Golaszewski [Wed, 18 Jun 2025 13:02:07 +0000 (15:02 +0200)] 
gpio: mmio: don't use legacy GPIO chip setters

We've converted this driver to using the new GPIO line value setters but
missed the instances where the legacy callback is accessed directly using
the function pointer. This will lead to a NULL-pointer dereference as
this pointer is no longer populated. The issue needs fixing locally as
well as in the already converted previously users of gpio-mmio.

Fixes: b908d35d0003 ("gpio: mmio: use new GPIO line value setter callbacks")
Reported-by: Klara Modin <klarasmodin@gmail.com>
Closes: https://lore.kernel.org/all/2rw2sncevdiyirpdovotztlg77apcq2btzytuv5jnm55aqhlne@swtts3hl53tw/
Tested-by: Klara Modin <klarasmodin@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250618-gpio-mmio-fix-setter-v1-2-2578ffb77019@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: npcm-sgpio: don't use legacy GPIO chip setters
Bartosz Golaszewski [Wed, 18 Jun 2025 13:02:06 +0000 (15:02 +0200)] 
gpio: npcm-sgpio: don't use legacy GPIO chip setters

We've converted this driver to using the new GPIO line value setters but
missed the instance where the legacy callback is accessed directly using
the function pointer. This will lead to a NULL-pointer dereference as
this pointer is no longer populated. Fix it.

Fixes: 0e1a8930c941 ("gpio: npcm-sgpio: use new GPIO line value setter callbacks")
Link: https://lore.kernel.org/r/20250618-gpio-mmio-fix-setter-v1-1-2578ffb77019@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agoMerge tag 'gpio-mmio-bgpiof-no-input-flag-for-v6.17' into gpio/for-next
Bartosz Golaszewski [Thu, 19 Jun 2025 07:10:20 +0000 (09:10 +0200)] 
Merge tag 'gpio-mmio-bgpiof-no-input-flag-for-v6.17' into gpio/for-next

Immutable tag for the pinctrl tree to pull from

Add the BGPIOF_NO_INPUT to the gpio-mmio API.

7 weeks agogpio: mmio: add BGPIOF_NO_INPUT flag for GPO gpiochip
Clément Le Goffic [Fri, 13 Jun 2025 10:14:12 +0000 (12:14 +0200)] 
gpio: mmio: add BGPIOF_NO_INPUT flag for GPO gpiochip

When using bgpio_init with a gpiochip acting as a GPO (output only), the
gpiochip ops `direction_input` was set to `bgpio_simple_dir_in` by
default but we have no input ability.

Adding this flag allows to set a valid ops for the `direction_output`
ops without setting a valid ops for `direction_input` by default.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Link: https://lore.kernel.org/r/20250613-hdp-upstream-v5-1-6fd6f0dc527c@foss.st.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agodt-bindings: gpio: arm,pl061: Drop interrupt properties as required
Rob Herring (Arm) [Mon, 9 Jun 2025 22:08:59 +0000 (17:08 -0500)] 
dt-bindings: gpio: arm,pl061: Drop interrupt properties as required

It is possible that the PL061 doesn't have any interrupt connected and
can't be an interrupt provider, so drop the interrupt properties as
required.

The LG LG131x SoCs are one example of this.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250609220900.3035642-1-robh@kernel.org
[Bartosz: g/pl011/pl061/]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: palmas: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:22 +0000 (14:33 +0200)] 
gpio: palmas: 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/20250610-gpiochip-set-rv-gpio-v1-12-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: omap: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:21 +0000 (14:33 +0200)] 
gpio: omap: 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/20250610-gpiochip-set-rv-gpio-v1-11-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: octeon: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:20 +0000 (14:33 +0200)] 
gpio: octeon: 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/20250610-gpiochip-set-rv-gpio-v1-10-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: npcm-sgpio: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:19 +0000 (14:33 +0200)] 
gpio: npcm-sgpio: 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/20250610-gpiochip-set-rv-gpio-v1-9-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: nomadik: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:18 +0000 (14:33 +0200)] 
gpio: nomadik: 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: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-8-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: msc313: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:17 +0000 (14:33 +0200)] 
gpio: msc313: 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: Daniel Palmer <daniel@thingy.jp>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-7-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mpsse: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:16 +0000 (14:33 +0200)] 
gpio: mpsse: 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/20250610-gpiochip-set-rv-gpio-v1-6-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mpfs: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:15 +0000 (14:33 +0200)] 
gpio: mpfs: 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/20250610-gpiochip-set-rv-gpio-v1-5-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mpc5200: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:14 +0000 (14:33 +0200)] 
gpio: mpc5200: 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/20250610-gpiochip-set-rv-gpio-v1-4-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: moxtet: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:13 +0000 (14:33 +0200)] 
gpio: moxtet: 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: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-3-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mm-lantiq: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:12 +0000 (14:33 +0200)] 
gpio: mm-lantiq: 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: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-2-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: mmio: use new GPIO line value setter callbacks
Bartosz Golaszewski [Tue, 10 Jun 2025 12:33:11 +0000 (14:33 +0200)] 
gpio: mmio: 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: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-gpio-v1-1-3a9a3c1472ff@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agodt-bindings: gpio: gpio-xilinx: Mark clocks as required property
Michal Simek [Mon, 16 Jun 2025 07:43:18 +0000 (09:43 +0200)] 
dt-bindings: gpio: gpio-xilinx: Mark clocks as required property

On Microblaze platforms there is no need to handle clocks because the
system is starting with clocks enabled (can be described via fixed clock
node or clock-frequency property or not described at all).
With using soft IPs with SOC platforms there is mandatory to handle clocks
as is explained in commit 60dbdc6e08d6 ("dt-bindings: net: emaclite: Add
clock support").
That's why make clock as required in dt binding because it is present in
both configurations and should be described even there is no way how to
handle it on Microblaze systems.

There is also need to describe missing axi gpio clock in fpga-region.yaml
not to introduce new error when make dt_binding_check runs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Xu Yilun <yilun.xu@intel.com> # fpga
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/94151cfbcff5e4ae05894981c7e398b605d4b00a.1750059796.git.michal.simek@amd.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: raspberrypi-exp: use new GPIO line value setter callbacks
Stefan Wahren [Sat, 14 Jun 2025 11:12:16 +0000 (13:12 +0200)] 
gpio: raspberrypi-exp: 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.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20250614111216.93677-1-wahrenst@gmx.net
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: sloppy-logic-analyzer: Fully open-code compatible for grepping
Krzysztof Kozlowski [Fri, 13 Jun 2025 07:16:28 +0000 (09:16 +0200)] 
gpio: sloppy-logic-analyzer: Fully open-code compatible for grepping

It is very useful to find driver implementing compatibles with `git grep
compatible`, so driver should not use defines for that string, even if
this means string will be effectively duplicated.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250613071627.46687-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: Use dev_fwnode() where applicable across drivers
Jiri Slaby (SUSE) [Wed, 11 Jun 2025 10:43:34 +0000 (12:43 +0200)] 
gpio: Use dev_fwnode() where applicable across drivers

irq_domain_create_simple() takes fwnode as the first argument. It can be
extracted from the struct device using dev_fwnode() helper instead of
using of_node with of_fwnode_handle().

So use the dev_fwnode() helper where applicable.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250611104348.192092-6-jirislaby@kernel.org
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
7 weeks agogpio: virtuser: use gpiod_multi_set_value_cansleep()
David Lechner [Wed, 11 Jun 2025 18:50:26 +0000 (13:50 -0500)] 
gpio: virtuser: use gpiod_multi_set_value_cansleep()

Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of
gpiod_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20250611-gpio-virtuser-use-gpiod_multi_set_value_cansleep-v1-1-43b4adf6c807@baylibre.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agogpio: TODO: add a task for removing MMIO-specific fields from gpio_chip
Bartosz Golaszewski [Tue, 27 May 2025 11:13:53 +0000 (13:13 +0200)] 
gpio: TODO: add a task for removing MMIO-specific fields from gpio_chip

Currently for CONFIG_GPIO_GENERIC=y each struct gpio_chip object
contains the fields relevant only for gpio-mmio users. It's not an
insignificant number either as it's several pointers and integers.

It makes sense to remove these fields from struct gpio_chip into a
dedicated structure but this is not trivial due to how the bgpio_init()
function is implemented.

Add a task for tracking this rework.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250527111353.71540-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agodt-bindings: gpio: convert nxp,lpc1850-gpio.txt to yaml format
Frank Li [Mon, 2 Jun 2025 14:42:58 +0000 (10:42 -0400)] 
dt-bindings: gpio: convert nxp,lpc1850-gpio.txt to yaml format

Convert nxp,lpc1850-gpio.txt to yaml format.

Additional changes:
- remove interrupt-controller and #interupt-cells from required list to
  match existed dts files.
- remove gpio consumer in examples.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250602144259.944257-1-Frank.Li@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agogpiolib: Move GPIO_DYNAMIC_* constants to its only user
Andy Shevchenko [Sat, 31 May 2025 19:55:44 +0000 (22:55 +0300)] 
gpiolib: Move GPIO_DYNAMIC_* constants to its only user

There is no need to export GPIO_DYNAMIC_* constants, especially via
legacy header which is subject to remove. Move the mentioned constants
to its only user, i.e. gpiolib.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531195801.3632110-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agogpio: Remove unused 'struct gpio' definition
Andy Shevchenko [Sat, 31 May 2025 19:55:43 +0000 (22:55 +0300)] 
gpio: Remove unused 'struct gpio' definition

There is no user for the legacy 'struct gpio', remove it for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531195801.3632110-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agodt-bindings: gpio: convert gpio-74xx-mmio.txt to yaml format
Frank Li [Wed, 4 Jun 2025 14:46:30 +0000 (10:46 -0400)] 
dt-bindings: gpio: convert gpio-74xx-mmio.txt to yaml format

Convert gpio-74xx-mmio.txt to yaml format.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250604144631.1141430-1-Frank.Li@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agogpiolib: Remove unused devm_gpio_request()
Andy Shevchenko [Sat, 31 May 2025 21:21:39 +0000 (00:21 +0300)] 
gpiolib: Remove unused devm_gpio_request()

Remove devm_gpio_request() due to lack of users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531212331.3635269-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agousb: gadget: pxa25x_udc: Switch to use devm_gpio_request_one()
Andy Shevchenko [Sat, 31 May 2025 21:21:38 +0000 (00:21 +0300)] 
usb: gadget: pxa25x_udc: Switch to use devm_gpio_request_one()

devm_gpio_request() is going to be removed. This driver is only user of that
API. Convert it to use different API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531212331.3635269-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agodt-bindings: gpio: convert gpio-pisosr.txt to yaml format
Frank Li [Thu, 22 May 2025 22:37:41 +0000 (18:37 -0400)] 
dt-bindings: gpio: convert gpio-pisosr.txt to yaml format

Covert gpio-pisosr.txt to yaml format.

Additional changes:
- Add ref to spi-peripheral-props.yaml.
- Set ngpios max value to 32.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250522223742.516254-1-Frank.Li@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2 months agoLinux 6.16-rc1 v6.16-rc1
Linus Torvalds [Sun, 8 Jun 2025 20:44:43 +0000 (13:44 -0700)] 
Linux 6.16-rc1

2 months agoMerge tag 'turbostat-2025.06.08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Jun 2025 18:44:41 +0000 (11:44 -0700)] 
Merge tag 'turbostat-2025.06.08' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Pull turbostat updates from Len Brown:

 - Add initial DMR support, which required smarter RAPL probe

 - Fix AMD MSR RAPL energy reporting

 - Add RAPL power limit configuration output

 - Minor fixes

* tag 'turbostat-2025.06.08' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
  tools/power turbostat: version 2025.06.08
  tools/power turbostat: Add initial support for BartlettLake
  tools/power turbostat: Add initial support for DMR
  tools/power turbostat: Dump RAPL sysfs info
  tools/power turbostat: Avoid probing the same perf counters
  tools/power turbostat: Allow probing RAPL with platform_features->rapl_msrs cleared
  tools/power turbostat: Clean up add perf/msr counter logic
  tools/power turbostat: Introduce add_msr_counter()
  tools/power turbostat: Remove add_msr_perf_counter_()
  tools/power turbostat: Remove add_cstate_perf_counter_()
  tools/power turbostat: Remove add_rapl_perf_counter_()
  tools/power turbostat: Quit early for unsupported RAPL counters
  tools/power turbostat: Always check rapl_joules flag
  tools/power turbostat: Fix AMD package-energy reporting
  tools/power turbostat: Fix RAPL_GFX_ALL typo
  tools/power turbostat: Add Android support for MSR device handling
  tools/power turbostat.8: pm_domain wording fix
  tools/power turbostat.8: fix typo: idle_pct should be pct_idle

2 months agoMerge tag 'timers-cleanups-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Jun 2025 18:33:00 +0000 (11:33 -0700)] 
Merge tag 'timers-cleanups-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer cleanup from Thomas Gleixner:
 "The delayed from_timer() API cleanup:

  The renaming to the timer_*() namespace was delayed due massive
  conflicts against Linux-next. Now that everything is upstream finish
  the conversion"

* tag 'timers-cleanups-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  treewide, timers: Rename from_timer() to timer_container_of()

2 months agoMerge tag 'x86-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Jun 2025 18:27:20 +0000 (11:27 -0700)] 
Merge tag 'x86-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "A small set of x86 fixes:

   - Cure IO bitmap inconsistencies

     A failed fork cleans up all resources of the newly created thread
     via exit_thread(). exit_thread() invokes io_bitmap_exit() which
     does the IO bitmap cleanups, which unfortunately assume that the
     cleanup is related to the current task, which is obviously bogus.

     Make it work correctly

   - A lockdep fix in the resctrl code removed the clearing of the
     command buffer in two places, which keeps stale error messages
     around. Bring them back.

   - Remove unused trace events"

* tag 'x86-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  fs/resctrl: Restore the rdt_last_cmd_clear() calls after acquiring rdtgroup_mutex
  x86/iopl: Cure TIF_IO_BITMAP inconsistencies
  x86/fpu: Remove unused trace events

2 months agoMerge tag 'timers-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Jun 2025 18:25:13 +0000 (11:25 -0700)] 
Merge tag 'timers-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Thomas Gleixner:
 "Add the missing seq_file forward declaration in the timer namespace
  header"

* tag 'timers-urgent-2025-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timens: Add struct seq_file forward declaration

2 months agotools/power turbostat: version 2025.06.08
Len Brown [Sun, 8 Jun 2025 16:31:59 +0000 (12:31 -0400)] 
tools/power turbostat: version 2025.06.08

Add initial DMR support, which required smarter RAPL probe
Fix AMD MSR RAPL energy reporting
Add RAPL power limit configuration output
Minor fixes

Signed-off-by: Len Brown <len.brown@intel.com>
2 months agotools/power turbostat: Add initial support for BartlettLake
Zhang Rui [Fri, 18 Apr 2025 06:04:26 +0000 (14:04 +0800)] 
tools/power turbostat: Add initial support for BartlettLake

Add initial support for BartlettLake.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2 months agotools/power turbostat: Add initial support for DMR
Zhang Rui [Mon, 4 Mar 2024 06:54:40 +0000 (14:54 +0800)] 
tools/power turbostat: Add initial support for DMR

Add initial support for DMR.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2 months agotools/power turbostat: Dump RAPL sysfs info
Zhang Rui [Fri, 30 May 2025 06:01:31 +0000 (14:01 +0800)] 
tools/power turbostat: Dump RAPL sysfs info

for example:

intel-rapl:1: psys 28.0s:100W 976.0us:100W
intel-rapl:0: package-0 28.0s:57W,max:15W 2.4ms:57W
intel-rapl:0/intel-rapl:0:0: core disabled
intel-rapl:0/intel-rapl:0:1: uncore disabled
intel-rapl-mmio:0: package-0 28.0s:28W,max:15W 2.4ms:57W

[lenb: simplified format]

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
squish me

Signed-off-by: Len Brown <len.brown@intel.com>