summaryrefslogtreecommitdiffstats
path: root/lib/kobject_uevent.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-07-19 17:24:30 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-22 11:59:23 +0200
commit1455cf8dbfd06aa7651dcfccbadb7a093944ca65 (patch)
treee8fff0f10eb523b4d6ce1e48a443e998ba283497 /lib/kobject_uevent.c
parent6f7da290413ba713f0cdd9ff1a2a9bb129ef4f6c (diff)
downloadlinux-1455cf8dbfd06aa7651dcfccbadb7a093944ca65.tar.gz
linux-1455cf8dbfd06aa7651dcfccbadb7a093944ca65.tar.bz2
linux-1455cf8dbfd06aa7651dcfccbadb7a093944ca65.zip
driver core: emit uevents when device is bound to a driver
There are certain touch controllers that may come up in either normal (application) or boot mode, depending on whether firmware/configuration is corrupted when they are powered on. In boot mode the kernel does not create input device instance (because it does not necessarily know the characteristics of the input device in question). Another number of controllers does not store firmware in a non-volatile memory, and they similarly need to have firmware loaded before input device instance is created. There are also other types of devices with similar behavior. There is a desire to be able to trigger firmware loading via udev, but it has to happen only when driver is bound to a physical device (i2c or spi). These udev actions can not use ADD events, as those happen too early, so we are introducing BIND and UNBIND events that are emitted at the right moment. Also, many drivers create additional driver-specific device attributes when binding to the device, to provide userspace with additional controls. The new events allow userspace to adjust these driver-specific attributes without worrying that they are not there yet. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r--lib/kobject_uevent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 9a2b811966eb..4682e8545b5c 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -50,6 +50,8 @@ static const char *kobject_actions[] = {
[KOBJ_MOVE] = "move",
[KOBJ_ONLINE] = "online",
[KOBJ_OFFLINE] = "offline",
+ [KOBJ_BIND] = "bind",
+ [KOBJ_UNBIND] = "unbind",
};
/**