summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/wilco_ec/Kconfig
diff options
context:
space:
mode:
authorNick Crews <ncrews@chromium.org>2019-05-23 17:06:24 -0600
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-06-03 18:51:14 +0200
commitf7b0bc5eafa44941ddf92df6f46dd82cbfacec3e (patch)
tree58485db714fb1f8d95244437aff8be94fa34e478 /drivers/platform/chrome/wilco_ec/Kconfig
parentac5bdfdc0e1ccce0f23898f5500874e31198f5c2 (diff)
downloadlinux-stable-f7b0bc5eafa44941ddf92df6f46dd82cbfacec3e.tar.gz
linux-stable-f7b0bc5eafa44941ddf92df6f46dd82cbfacec3e.tar.bz2
linux-stable-f7b0bc5eafa44941ddf92df6f46dd82cbfacec3e.zip
platform/chrome: wilco_ec: Add event handling
The Wilco Embedded Controller can create custom events that are not handled as standard ACPI objects. These events can contain information about changes in EC controlled features, such as errors and events in the dock or display. For example, an event is triggered if the dock is plugged into a display incorrectly. These events are needed for telemetry and diagnostics reasons, and for possibly alerting the user. These events are triggered by the EC with an ACPI Notify(0x90), and then the BIOS reads the event buffer from EC RAM via an ACPI method. When the OS receives these events via ACPI, it passes them along to this driver. The events are put into a queue which can be read by a userspace daemon via a char device that implements read() and poll(). The event queue acts as a circular buffer of size 64, so if there are no userspace consumers the kernel will not run out of memory. The char device will appear at /dev/wilco_event{n}, where n is some small non-negative integer, starting from 0. Standard ACPI events such as the battery getting plugged/unplugged can also come through this path, but they are dealt with via other paths, and are ignored here. To test, you can tail the binary data with $ cat /dev/wilco_event0 | hexdump -ve '1/1 "%x\n"' and then create an event by plugging/unplugging the battery. Signed-off-by: Nick Crews <ncrews@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform/chrome/wilco_ec/Kconfig')
-rw-r--r--drivers/platform/chrome/wilco_ec/Kconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/platform/chrome/wilco_ec/Kconfig b/drivers/platform/chrome/wilco_ec/Kconfig
index e09e4cebe9b4..2c8f6f15f28f 100644
--- a/drivers/platform/chrome/wilco_ec/Kconfig
+++ b/drivers/platform/chrome/wilco_ec/Kconfig
@@ -18,3 +18,12 @@ config WILCO_EC_DEBUGFS
manipulation and allow for testing arbitrary commands. This
interface is intended for debug only and will not be present
on production devices.
+
+config WILCO_EC_EVENTS
+ tristate "Enable event forwarding from EC to userspace"
+ depends on WILCO_EC
+ help
+ If you say Y here, you get support for the EC to send events
+ (such as power state changes) to userspace. The EC sends the events
+ over ACPI, and a driver queues up the events to be read by a
+ userspace daemon from /dev/wilco_event using read() and poll().