Re: [PATCH] platform/chrome: cros_kbd_led_backlight: enable probing through EC_FEATURE_PWM_KEYB

From: Lee Jones
Date: Tue May 07 2024 - 04:29:20 EST


On Sun, 05 May 2024, Thomas Weißschuh wrote:

> The ChromeOS EC used in Framework laptops supports the standard cros
> keyboard backlight protocol.
> However the firmware on these laptops don't implement the ACPI ID
> GOOG0002 that is recognized by cros_kbd_led_backlight and they also
> don't use device tree.
>
> Extend the cros_ec MFD device to also load cros_kbd_led_backlight
> when the EC reports EC_FEATURE_PWM_KEYB.
>
> Tested on a Framework 13 AMD, Bios 3.05.
>
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
> ---
> This is based on
> https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
>
> The helper keyboard_led_is_mfd_device is a bit iffy, but I couldn't find
> a nicer way.
>
> * driver_data from platform_device_id is overwritten by the mfd platform data
> * Setting the driver_data in drivers/mfd/cros_ec_dev.c would expose the
> internals of cros_kbd_led_backlight
> ---
> drivers/mfd/cros_ec_dev.c | 9 ++++++

Split this out please.

> drivers/platform/chrome/cros_kbd_led_backlight.c | 41 +++++++++++++++++++++++-
> 2 files changed, 49 insertions(+), 1 deletion(-)

--
Lee Jones [李琼斯]