Re: [PATCH 09/19] platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 29, 2023 at 9:16 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Use the (new) PMIC LED driver for pen icon LED control instead of using
> custom WMI calls for this.
>
> This will also work on the Android version of the Lenovo Yoga Book 1,
> where there is no WMI interface for this.
>
> The dev_id of the lookup is set using dev_name() so that it will also
> work for both the Windows YB1 WMI-device as well as the Android YB1
> platform-device. While at it also move the gpio_lookup to using dev_name()
> for the dev_id.
>
> Note this also removes the need to turn of the LED during suspend since
> the PMIC LED driver now already does that.

...

> +       led_add_lookup(&yogabook_pen_led);
> +       data->pen_led = devm_led_get(dev, "pen-icon-led");
> +       led_remove_lookup(&yogabook_pen_led);

Wondering if we should start at some point helpers like

devm_led_get_with_table() which will do the above.

P.S. All the same probably makes sense to (ACPI) GPIO, PWM, etc calls.

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux