summaryrefslogtreecommitdiff
path: root/include/linux/platform_data/wilco-ec.h
diff options
context:
space:
mode:
authorDaniel Campello <campello@chromium.org>2019-11-06 09:33:19 -0700
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-11-19 18:12:19 +0100
commit119a3cb6d687259f2be333351c1c5d634204e68b (patch)
tree89b13f1f278e731f16dd953e406ce0796aa00fe2 /include/linux/platform_data/wilco-ec.h
parent3c4d77b68928df6c2bf07f4c3ba8e5d5e490bf4e (diff)
platform/chrome: wilco_ec: Add keyboard backlight LED support
The EC is in charge of controlling the keyboard backlight on the Wilco platform. We expose a standard LED class device named platform::kbd_backlight. Since the EC will never change the backlight level of its own accord, we don't need to implement a brightness_get() method. Signed-off-by: Nick Crews <ncrews@chromium.org> Signed-off-by: Daniel Campello <campello@chromium.org> Reviewed-by: Daniel Campello <campello@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'include/linux/platform_data/wilco-ec.h')
-rw-r--r--include/linux/platform_data/wilco-ec.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/platform_data/wilco-ec.h b/include/linux/platform_data/wilco-ec.h
index 0d104e780632..afede15a95bf 100644
--- a/include/linux/platform_data/wilco-ec.h
+++ b/include/linux/platform_data/wilco-ec.h
@@ -122,6 +122,19 @@ struct wilco_ec_message {
*/
int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg);
+/**
+ * wilco_keyboard_leds_init() - Set up the keyboard backlight LEDs.
+ * @ec: EC device to query.
+ *
+ * After this call, the keyboard backlight will be exposed through a an LED
+ * device at /sys/class/leds.
+ *
+ * This may sleep because it uses wilco_ec_mailbox().
+ *
+ * Return: 0 on success, negative error code on failure.
+ */
+int wilco_keyboard_leds_init(struct wilco_ec_device *ec);
+
/*
* A Property is typically a data item that is stored to NVRAM
* by the EC. Each of these data items has an index associated