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>
This commit is contained in:
Daniel Campello
2019-11-06 09:33:19 -07:00
committed by Enric Balletbo i Serra
parent 3c4d77b689
commit 119a3cb6d6
5 changed files with 216 additions and 6 deletions

View File

@@ -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