Linux kernel source tree
Go to file
Bartosz Golaszewski 07c61d4da4 gpiolib: notify user-space about in-kernel line state changes
We currently only notify user-space about line config changes that are
made from user-space. Any kernel config changes are not signalled.

Let's improve the situation by emitting the events closer to the source.
To that end let's call the relevant notifier chain from the functions
setting direction, gpiod_set_config(), gpiod_set_consumer_name() and
gpiod_toggle_active_low(). This covers all the options that we can
inform the user-space about. We ignore events which don't have
corresponding flags exported to user-space on purpose - otherwise the
user would see a config-changed event but the associated line-info would
remain unchanged.

gpiod_direction_output/input() can be called from any context.
Fortunately, we now emit line state events using an atomic notifier
chain, so it's no longer an issue.

Let's also add non-notifying wrappers around the direction setters in
order to not emit superfluous reconfigure events when requesting the
lines as the initial config should be part of the request notification.

Use gpio_do_set_config() instead of gpiod_set_debounce() for configuring
debouncing via hardware from the character device code to avoid multiple
reconfigure events.

Reviewed-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20241018-gpio-notify-in-kernel-events-v5-8-c79135e58a1c@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-10-22 08:59:09 +02:00
arch powerpc fixes for 6.12 #4 2024-10-12 17:16:21 -07:00
block block-6.12-20241004 2024-10-04 10:43:44 -07:00
certs
crypto move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Documentation dt-bindings: gpio-mmio: Add ngpios property 2024-10-18 09:45:33 +02:00
drivers gpiolib: notify user-space about in-kernel line state changes 2024-10-22 08:59:09 +02:00
fs two fixes for Windows symlink handling 2024-10-13 10:52:39 -07:00
include Linux 6.12-rc3 2024-10-14 09:03:34 +02:00
init
io_uring io_uring/rw: allow pollable non-blocking attempts for !FMODE_NOWAIT 2024-10-06 20:58:53 -06:00
ipc
kernel RCU fix for v6.12 2024-10-11 14:42:27 -07:00
lib slab fixes for 6.12-rc1 2024-10-04 12:05:39 -07:00
LICENSES
mm mm: zswap: delete comments for "value" member of 'struct zswap_entry'. 2024-10-09 12:47:19 -07:00
net USB fixes for 6.12-rc3 2024-10-13 09:21:36 -07:00
rust Driver core fix for 6.12-rc3 2024-10-13 09:10:52 -07:00
samples
scripts kbuild: deb-pkg: Remove blank first line from maint scripts 2024-10-07 02:36:38 +09:00
security bcachefs: do not use PF_MEMALLOC_NORECLAIM 2024-10-09 12:47:18 -07:00
sound sound fixes for 6.12-rc2 2024-10-04 11:29:46 -07:00
tools gpio: sloppy-logic-analyzer remove reference to rcu_momentary_dyntick_idle() 2024-10-21 09:12:53 +02:00
usr
virt
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap Driver core fix for 6.12-rc3 2024-10-13 09:10:52 -07:00
.rustfmt.toml
COPYING
CREDITS CREDITS: sort alphabetically by name 2024-10-09 12:47:19 -07:00
Kbuild
Kconfig
MAINTAINERS Linux 6.12-rc3 2024-10-14 09:03:34 +02:00
Makefile Linux 6.12-rc3 2024-10-13 14:33:32 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.