All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nitin Joshi <nitjoshi@gmail.com>
To: "Hans de Goede" <hdegoede@redhat.com>,
	"Mark Pearson" <mpearson-lenovo@squebb.ca>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	Nitin Joshi1 <njoshi1@lenovo.com>
Subject: Re: [PATCH] platform/x86: thinkpad-acpi: Add support for new hotkey for camera shutter switch
Date: Tue, 22 Apr 2025 09:50:39 +0900	[thread overview]
Message-ID: <efc8ad1f-9fe9-4ba1-9013-e9f758da3ffc@gmail.com> (raw)
In-Reply-To: <c56025c9-da1a-428f-b5cf-4c3f0f9f51d6@redhat.com>

Hello Hans,

On 4/7/25 22:24, Hans de Goede wrote:
> Hi Nitin,
> 
> On 7-Apr-25 05:27, Nitin Joshi wrote:
>> Hello Mark,
>>
>> On 4/5/25 04:23, Mark Pearson wrote:
>>> Hi Nitin,
>>>
>>> On Fri, Apr 4, 2025, at 5:02 AM, Nitin Joshi wrote:
>>>> Hello Hans,
>>>>
>>>> On 4/4/25 16:25, Hans de Goede wrote:
>>>>> Hi Nitin,
>>>>>
>>>>> On 4-Apr-25 8:44 AM, Nitin Joshi wrote:
>>>>>> Hello Hans,
>>>>>>
>>>>>> Thank you for reviewing patch.
>>>>>>
>>>>>> On 4/3/25 19:34, Hans de Goede wrote:
>>>>>>> Hi Nitin,
>>>>>>>
>>>>>>> On 3-Apr-25 7:31 AM, Nitin Joshi wrote:
>>>>>>>> New Lenovo Thinkpad models, e.g. the 'X9-14 Gen 1' and 'X9-15 Gen 1'
>>>>>>>> has new shortcut on F9 key i.e to switch camera shutter and it
>>>>>>>> send a new 0x131b hkey event when F9 key is pressed.
>>>>>>>>
>>>>>>>> This commit adds support for new hkey 0x131b.
>>>>>>>> Signed-off-by: Nitin Joshi <nitjoshi@gmail.com>
>>>>>>>
>>>>>>> Does the EC also actually enable/disable the camera in response to
>>>>>>> this new hotkey, or is this purely a request to userspace / the OS
>>>>>>> to enable/disable the camera
>>>>>> Enable/disable is actually being done by EC. Camera enablement for these products are still in testing phase.
>>>>>> ?
>>>>>
>>>>> Ok, I assume we can also get the state (enabled vs disabled)
>>>>> e.g. from the event? In that case the events should be reported using
>>>>> EV_SW, SW_CAMERA_LENS_COVER and we should also get the initial
>>>>> state and set the switch to the initial state before registering
>>>>> the input device.
>>>> Enable/Disable status will be determine in IPU side which receives
>>>> notification from EC. So, the only way to determine the status would be
>>>> to determine the status in IPU side.
>>>> So, purpose of this patch will only to avoid "unhandled hkey event"
>>>> error from thinkpad_acpi driver.
>>>> Please let me know, if i am missing something.
> 
> We don't want to just avoid the "unhandled hkey event" message,
> we also want to send an event to userspace that the camera has
> been enabled or disabled, including information if it is
> being enabled or being disabled. This way userspace can show an OSD
> indicating that the camera has been enabled/disabled similar to how
> we do this when e.g. the mic is muted.
> 
> This must be reported to userspace using SW_CAMERA_LENS_COVER, which is
> what all kernel code which reports camera shutter state
> (be it a true shutter or hw blacking out of the image) is using now.
Thank you for your comments , Understood.
I have received ASL method to get camera shutter state. I am modifying 
code and will send next version of this patch soon. We will report 
status from this driver only.
> 
> Or maybe the IPU6 driver itself can report SW_CAMERA_LENS_COVER,
> assuming the IPU6 driver also receives an event when the camera
> shutter status changes ?
Please ignore my comment regarding IPU as we will report enable/disable 
from thinkpad_acpi driver only.
Although i need to confirm it but i came to know that "shutter closed" 
icon will be displayed in Camera View via IPU, when shutter is disable.
> 
>>> I hadn't thought about this - but we need to be able to track the status to make sure (eventually) that the right status gets displayed in userspace. It would be bad if it was out of sync with the IPU.
>>>
>>> Is the initial status always going to be disabled, or do we need a mechanism from Intel to probe the current status?
>>
>> I need to check regarding this but AFAIK, we don't have any other mechanism to probe current status. Also , there was some security concern involved in this which i need to clarify.
> 
> I don't see how userspace knowing if the shutter is in open/closed
> state impacts security. Userspace still cannot control the shutter.
Ack
> 
> Regards,
> 
> Hans
Thanks & Regards,
Nitin Joshi

> 
> 
> 
> 
>>>>>>>> ---
>>>>>>>>      drivers/platform/x86/thinkpad_acpi.c | 2 ++
>>>>>>>>      1 file changed, 2 insertions(+)
>>>>>>>>
>>>>>>>> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>>>>>>>> index 0384cf311878..80f77f9c7a58 100644
>>>>>>>> --- a/drivers/platform/x86/thinkpad_acpi.c
>>>>>>>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>>>>>>>> @@ -182,6 +182,7 @@ enum tpacpi_hkey_event_t {
>>>>>>>>                                 * directly in the sparse-keymap.
>>>>>>>>                                 */
>>>>>>>>          TP_HKEY_EV_AMT_TOGGLE        = 0x131a, /* Toggle AMT on/off */
>>>>>>>> +    TP_HKEY_EV_CAMERASHUTTER_TOGGLE = 0x131b, /* Toggle Camera Shutter */
>>>>>>>>          TP_HKEY_EV_DOUBLETAP_TOGGLE    = 0x131c, /* Toggle trackpoint doubletap on/off */
>>>>>>>>          TP_HKEY_EV_PROFILE_TOGGLE    = 0x131f, /* Toggle platform profile in 2024 systems */
>>>>>>>>          TP_HKEY_EV_PROFILE_TOGGLE2    = 0x1401, /* Toggle platform profile in 2025 + systems */
>>>>>>>> @@ -3271,6 +3272,7 @@ static const struct key_entry keymap_lenovo[] __initconst = {
>>>>>>>>           * after switching to sparse keymap support. The mappings above use translated
>>>>>>>>           * scancodes to preserve uAPI compatibility, see tpacpi_input_send_key().
>>>>>>>>           */
>>>>>>>> +    { KE_KEY, TP_HKEY_EV_CAMERASHUTTER_TOGGLE, { KEY_CAMERA_ACCESS_TOGGLE } },
>>>>>>>>          { KE_KEY, 0x131d, { KEY_VENDOR } }, /* System debug info, similar to old ThinkPad key */
>>>>>>>>          { KE_KEY, 0x1320, { KEY_LINK_PHONE } },
>>>>>>>>          { KE_KEY, TP_HKEY_EV_TRACK_DOUBLETAP /* 0x8036 */, { KEY_PROG4 } },
>>>>>>>
>>>>>>
>>>>>
>>
> 


      parent reply	other threads:[~2025-04-22  0:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  5:31 [PATCH] platform/x86: thinkpad-acpi: Add support for new hotkey for camera shutter switch Nitin Joshi
2025-04-03 10:34 ` Hans de Goede
2025-04-04  6:44   ` Nitin Joshi
2025-04-04  7:25     ` Hans de Goede
2025-04-04  9:02       ` Nitin Joshi
2025-04-04 19:23         ` Mark Pearson
2025-04-07  3:27           ` Nitin Joshi
2025-04-07 13:24             ` Hans de Goede
2025-04-11  9:02               ` Nitin Joshi
2025-04-22  0:50               ` Nitin Joshi [this message]

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=efc8ad1f-9fe9-4ba1-9013-e9f758da3ffc@gmail.com \
    --to=nitjoshi@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=njoshi1@lenovo.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.