Lenovo WMI camera driver, switching to SW_CAMERA_LENS_COVER ?

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

 



Hi Ai,

I have been looking into all the different way the kernel is
currently communicating to userspace that a camera is disabled
by some form of on/off switch / privacy control, see:

https://lore.kernel.org/linuxa-media/a644fed4-aff5-4514-8e35-d6cab642d3dd@xxxxxxxxxx/

As I mention there my proposal is to standardize on
SW_CAMERA_LENS_COVER. This assumes that the button
which generates the WMI events actually enables /
disables the camera the hardware level.

The problem with the current KEY_CAMERA_ACCESS_ENABLE /
KEY_CAMERA_ACCESS_DISABLE events is that looking at the
HUTRR72 specification from which these come it talks about:
"Enables programmatic access to camera device"
which suggests that it is a request to the OS / desktop-
environment to block camera access at the software level,
rather then reporting back that a hw-level block is in place.

One problem with moving to a EV_SW like SW_CAMERA_LENS_COVER
is that that needs to report the correct value right away.

Is there a way to get the initial state of the camera through
the WMI interface so that we can report the correct as soon
as we register the input evdev device with SW_CAMERA_LENS_COVER
capability ?

Otherwise we could use the same solution which the hp-wmi driver
uses which is to delay registering the input device until
the first event (since then we do know the state), see:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/hp/hp-wmi.c#n792

and the caller of camera_shutter_input_setup().

Regards,

Hans





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

  Powered by Linux