platform/x86: int3472/discrete: Create a LED class device for the privacy LED
authorHans de Goede <hdegoede@redhat.com>
Fri, 27 Jan 2023 20:37:27 +0000 (21:37 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 3 Feb 2023 09:22:35 +0000 (10:22 +0100)
commit5ae20a8050d08a51fef9769cd53237551f259dbe
tree7015b9464fda0c2828dd1ad01e3b825afef0c51f
parent9b1785a2e2af522c2a64034a8716b7d47375ffec
platform/x86: int3472/discrete: Create a LED class device for the privacy LED

On some systems, e.g. the Lenovo ThinkPad X1 Yoga gen 7 and the ThinkPad
X1 Nano gen 2 there is no clock-enable pin, triggering the:
"No clk GPIO. The privacy LED won't work" warning and causing the privacy
LED to not work.

Fix this by modeling the privacy LED as a LED class device rather then
integrating it with the registered clock.

Note this relies on media subsys changes to actually turn the LED on/off
when the sensor's v4l2_subdev's s_stream() operand gets called.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20230127203729.10205-4-hdegoede@redhat.com
drivers/platform/x86/intel/int3472/Makefile
drivers/platform/x86/intel/int3472/clk_and_regulator.c
drivers/platform/x86/intel/int3472/common.h
drivers/platform/x86/intel/int3472/discrete.c
drivers/platform/x86/intel/int3472/led.c [new file with mode: 0644]