mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: 艾超 <aichao@kylinos.cn>, hdegoede <hdegoede@redhat.com>,
	"ilpo.jarvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	platform-driver-x86 <platform-driver-x86@vger.kernel.org>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v5] platform/x86: add lenovo wmi camera button driver
Date: Fri, 8 Mar 2024 17:15:48 +0100	[thread overview]
Message-ID: <c07dedf3-175c-4748-b6d3-e1effe9cad41@gmx.de> (raw)
In-Reply-To: <1vk29ojvhrf-1vk4tk6plf0@nsmail7.0.0--kylin--1>

Am 08.03.24 um 09:40 schrieb 艾超:

> Hi
>
>     thanks for your help.
>
> > Is there a way to determine the current state of the camera switch
> without having
> > to wait for an WMI event?
>
> There is no other way to detemine the current state of the camera
> switch without
>
> a WMI event.
>
>
> > If its not possible to determine the current state of the camera
> switch, then your
> > driver has to defer the initialization of the input device until it
> knows the current
> > state of the camera switch. Otherwise the initial switch state
> reported by the
> > input device might be wrong.
>
> > In this case, that means your driver must initialize the input
> device when receiving
> > a valid WMI event for the first time.
>
> > Basically when your driver receives a WMI event, it has to check if
> the input device
> > is already initialized. If this is not the case, then the input
> device is initialized.
> > Please protect this check and the input device initialization with a
> mutex, since WMI
> > event handling is multithreaded.
>
>
> This Camera is a UVC device, and the Carema device is already
> initialized before the WMI
>
> event .  Whether the camera switch is on or off, we can used lsusb to
> check the Camera.
>
> This wmi-camera driver only need to report the current state of the
> camera switch.
>
>
> Thanks.
>
>     Ai Chao
>
I see, so userspace will notice when the camera is disabled. Since the camera disappears from
the USB bus when the switch is activated, i wonder if SW_CAMERA_LENS_COVER is the right thing
to use in this case after all.

I CCed the maintainer of the input subsystem so that he can maybe provide some advise.
I for example would, taking the above information above the UVC device into account, say that
KEY_CAMERA_ACCESS_ENABLE/KEY_CAMERA_ACCESS_DISABLE is more suitable. Then userspace has to
keep track of the camera state (through lsusb for example).

Maybe someone knowing the input subsystem can provide some advise on what to do in this case?

Thanks,
Armin Wolf


       reply	other threads:[~2024-03-08 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1vk29ojvhrf-1vk4tk6plf0@nsmail7.0.0--kylin--1>
2024-03-08 16:15 ` Armin Wolf [this message]
2024-03-10  4:52   ` Dmitry Torokhov
2024-03-07  8:59 Ai Chao
2024-03-07 18:17 ` Armin Wolf
2024-03-08  8:44 ` Ilpo Järvinen

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=c07dedf3-175c-4748-b6d3-e1effe9cad41@gmx.de \
    --to=w_armin@gmx.de \
    --cc=aichao@kylinos.cn \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®