Bartosz Golaszewski
34e61ba819
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 >
2025-07-02 11:05:09 +02:00
Bartosz Golaszewski
26981e8906
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 >
2025-06-30 08:58:26 +02:00
Bartosz Golaszewski
08ad63bbd6
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 >
2025-06-30 08:58:26 +02:00
Geert Uytterhoeven
3315e39e56
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 >
2025-06-26 10:52:04 +02:00
Geert Uytterhoeven
28a9ab01f6
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 >
2025-06-26 10:52:04 +02:00
Bartosz Golaszewski
23b33cf124
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 >
2025-06-25 09:53:51 +02:00
Bartosz Golaszewski
cb908f3699
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
d68ddf651d
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
6731ad96e8
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
76033f1f92
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
309ea58111
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
f1ff31c8ef
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
fecdef830c
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
201e0f24a5
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
74260fb09c
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
4027438be8
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 >
2025-06-23 09:25:46 +02:00
Bartosz Golaszewski
40b71f1171
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 >
2025-06-23 09:25:45 +02:00
Daniel Sullivan
a0cfbc67d7
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 >
2025-06-23 09:17:44 +02:00
Antonio Quartulli
e6bb78570f
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: fd19792851 ("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 >
2025-06-23 09:14:15 +02:00
Bartosz Golaszewski
fd19792851
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 >
2025-06-20 09:29:15 +02:00
Bartosz Golaszewski
982ec96c38
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 >
2025-06-20 09:29:14 +02:00
Bartosz Golaszewski
dc665b5248
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 >
2025-06-20 09:29:14 +02:00
Bartosz Golaszewski
e1f02b40a7
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 >
2025-06-20 09:29:14 +02:00
Bartosz Golaszewski
1ae8603074
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 >
2025-06-20 09:29:14 +02:00
Bartosz Golaszewski
5ed0d32805
Documentation: gpio: undocument removed behavior
...
Since commit 700cdf7ed0 ("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 >
2025-06-20 09:29:14 +02:00
Bartosz Golaszewski
9da895e970
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 >
2025-06-19 09:15:05 +02:00
Bartosz Golaszewski
cbb887a76b
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: b908d35d00 ("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 >
2025-06-19 09:13:44 +02:00
Bartosz Golaszewski
1fd7d21095
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: 0e1a8930c9 ("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 >
2025-06-19 09:13:44 +02:00
Bartosz Golaszewski
0a00514881
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.
2025-06-19 09:10:20 +02:00
Clément Le Goffic
deefc70834
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 >
2025-06-19 09:05:33 +02:00
Rob Herring (Arm)
7b20980ffc
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 >
2025-06-18 12:21:31 +02:00
Bartosz Golaszewski
f3763403a6
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 >
2025-06-17 11:09:31 +02:00
Bartosz Golaszewski
57065d62e6
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 >
2025-06-17 11:09:31 +02:00
Bartosz Golaszewski
f026145614
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 >
2025-06-17 11:09:31 +02:00
Bartosz Golaszewski
0e1a8930c9
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 >
2025-06-17 11:09:31 +02:00
Bartosz Golaszewski
aaec273c7b
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 >
2025-06-17 11:09:31 +02:00
Bartosz Golaszewski
88a775454a
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
e63d9fbe9f
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
3aa3628f81
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
80d42372d9
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
b454580cf1
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
d277461819
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 >
2025-06-17 11:09:30 +02:00
Bartosz Golaszewski
b908d35d00
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 >
2025-06-17 11:09:30 +02:00
Michal Simek
d03b53c913
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 60dbdc6e08 ("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 >
2025-06-17 11:08:53 +02:00
Stefan Wahren
3678649357
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 >
2025-06-16 09:52:21 +02:00
Krzysztof Kozlowski
bddfad9f7e
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 >
2025-06-16 09:45:14 +02:00
Jiri Slaby (SUSE)
7b2c2f1eb3
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 >
2025-06-16 09:42:24 +02:00
David Lechner
0a99f2d8ff
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 >
2025-06-16 09:29:42 +02:00
Bartosz Golaszewski
97a7ea2b8f
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 >
2025-06-10 11:41:01 +02:00
Frank Li
114ab5afdf
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 >
2025-06-10 10:09:41 +02:00