X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Ai Chao <aichao@kylinos.cn>
Cc: Armin Wolf <W_Armin@gmx.de>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>
Subject: Lenovo WMI camera driver, switching to SW_CAMERA_LENS_COVER ?
Date: Mon, 11 Nov 2024 15:33:51 +0100	[thread overview]
Message-ID: <5666914c-e8c2-481d-8fdf-aff82865c228@redhat.com> (raw)

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@redhat.com/

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


             reply	other threads:[~2024-11-11 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 14:33 Hans de Goede [this message]
2024-11-11 18:37 ` Lenovo WMI camera driver, switching to SW_CAMERA_LENS_COVER ? Armin Wolf
2024-11-18 15:02   ` Hans de Goede
2024-11-18 18:34     ` Armin Wolf
2024-11-20 10:55       ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5666914c-e8c2-481d-8fdf-aff82865c228@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=W_Armin@gmx.de \
    --cc=aichao@kylinos.cn \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox