Re: [PATCH] platform/x86: ideapad-laptop: Report camera switch as SW_CAMERA_LENS_COVER
From: Huang Wei
Date: Sun Sep 20 2026 - 02:42:36 EST
Hi Marco,
I went through the patch and the approach looks right to me - matching
what lenovo-wmi-camera does with SW_CAMERA_LENS_COVER is the correct
call, and reporting the initial state before input_register_device()
is the right way for EVIOCGSW to pick it up.
I initially wondered whether the lazy device creation could race
against a concurrent notification, but ideapad_wmi_notify() holds
ideapad_shared_mutex across the whole handler, so the init is
serialized. It might be worth a comment on the init function saying
it relies on that, since it's not obvious from the code itself - I
had to go and check.
One small thing: if ideapad_camera_switch_init() fails, the state
carried by that event is dropped, and every later event retries the
registration and warns again. Probably fine in practice, but a
persistent failure would log one warning per toggle.
Thanks also for the notes on the alternatives and the
suspend-staleness limitation, that context is really helpful for
review.
Huang Wei