platform/x86: thinkpad-acpi: Add support for new hotkey for camera shutter switch
PATCH 1/1 platform/x86: thinkpad-acpi: Add support for new hotkey for camera shutter switch
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.
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +2 -0
@@ -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 } },
Signature · 1 line
2.43.0
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>
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?
And if this is purely a request is there some other thinkpad ACPI calls we can make to actually disable the camera or should this be fully handled in software in the OS / desktop-environment / camera stack ?
Regards,
Hans
Quoted 24 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hello Hans,
Thank you for reviewing patch.
Quoted 7 lines · Hans de Goede
Hi Nitin,
Quoted 4 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.
Quoted 6 lines
Quoted 2 lines
This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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. ?
Quoted 9 lines
And if this is purely a request is there some other thinkpad ACPI calls we can make to actually disable the camera or should this be fully handled in software in the OS / desktop-environment / camera stack ?
Regards,
Hans
Thanks & Regards,
Nitin Joshi
Quoted 28 lines
Quoted 27 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hi Nitin,
Quoted 12 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 7 lines · Hans de Goede
Hi Nitin,
Quoted 4 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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.
Regards,
Hans
Quoted 26 lines
Quoted 25 lines
Quoted 24 lines
---
drivers/platform/x86/thinkpad_acpi.c| 2 ++1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +0
-0@@ -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 */drivers/platform/x86/thinkpad_acpi.c +1
-0@@ -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} },
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand 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.
Quoted 5 lines
Regards,
Hans
Thanks & Regards,
Nitin Joshi
Quoted 30 lines
Quoted 29 lines
Quoted 28 lines
Quoted 27 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hi Nitin,
Quoted 32 lines · Nitin Joshi
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand we should also get the initial state and set the switch to the initial state before registering the input device.
Quoted 7 lines
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 fromthinkpad_acpidriver.
Please let me know, if i am missing something.
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?
Mark
Quoted 37 lines
Quoted 5 lines
Regards,
Hans
Thanks & Regards,
Nitin JoshiQuoted 30 lines
Quoted 29 lines
Quoted 28 lines
Quoted 27 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hello Mark,
Quoted 43 lines · Mark Pearson
Hi Nitin,
Quoted 32 lines · Nitin Joshi
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand we should also get the initial state and set the switch to the initial state before registering the input device.Quoted 7 lines
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 fromthinkpad_acpidriver.
Please let me know, if i am missing something.
Quoted 3 lines
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.
Quoted 2 lines
Mark
Thanks & Regards,
Nitin Joshi
Quoted 38 lines
Quoted 38 lines
Quoted 6 lines
Regards,
Hans
Thanks & Regards,
Nitin JoshiQuoted 30 lines
Quoted 29 lines
Quoted 28 lines
Quoted 27 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hi Nitin,
Quoted 44 lines · Nitin Joshi
Hello Mark,
Quoted 41 lines · Mark Pearson
Hi Nitin,
Quoted 38 lines · Nitin Joshi
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand 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 fromthinkpad_acpidriver.
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.
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 ?
Quoted 5 lines
Quoted 3 lines
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.
Regards,
Hans
Quoted 28 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 26 lines
Quoted 25 lines
Quoted 24 lines
---
drivers/platform/x86/thinkpad_acpi.c| 2 ++1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +0
-0@@ -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 */drivers/platform/x86/thinkpad_acpi.c +1
-0@@ -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} },
Hello Hans,
Thank you for your comments.
I am still confirming details and Sorry, its taking some time . I will reply below message after confirming.
Thanks & Regards,
Nitin Joshi
Quoted 108 lines · Hans de Goede
Hi Nitin,
Quoted 44 lines · Nitin Joshi
Hello Mark,
Quoted 41 lines · Mark Pearson
Hi Nitin,
Quoted 38 lines · Nitin Joshi
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand 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 fromthinkpad_acpidriver.
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.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 ?Quoted 5 lines
Quoted 3 lines
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.
Regards,
Hans
Quoted 28 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 26 lines
Quoted 25 lines
Quoted 24 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },
Hello Hans,
Quoted 55 lines · Hans de Goede
Hi Nitin,
Quoted 44 lines · Nitin Joshi
Hello Mark,
Quoted 41 lines · Mark Pearson
Hi Nitin,
Quoted 38 lines · Nitin Joshi
Hello Hans,
Quoted 21 lines · Hans de Goede
Hi Nitin,
Quoted 18 lines · Nitin Joshi
Hello Hans,
Thank you for reviewing patch.
Quoted 13 lines · Hans de Goede
Hi Nitin,
Quoted 6 lines · Nitin Joshi
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
0x131bhkey event when F9 key is pressed.This commit adds support for new hkey
0x131b.Signed-off-by Nitin Joshi <[email protected]>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
Quoted 8 lines
Quoted 2 lines
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_COVERand 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 fromthinkpad_acpidriver.
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.
Quoted 3 lines
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.
Quoted 4 lines
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.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
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
Quoted 4 lines
Regards,
Hans
Thanks & Regards,
Nitin Joshi
Quoted 33 lines
Quoted 32 lines
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
Quoted 30 lines
Quoted 29 lines
Quoted 28 lines
--- drivers/platform/x86/thinkpad_acpi.c | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/thinkpad_acpi.c +2
-0@@ -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 } },