platform/x86: hp-wmi: Add HP WMI camera switch
authorJonathan Singer <jes965@nyu.edu>
Wed, 26 Apr 2023 18:48:52 +0000 (14:48 -0400)
committerHans de Goede <hdegoede@redhat.com>
Tue, 9 May 2023 09:54:42 +0000 (11:54 +0200)
commit604915f1c7b22a9c6ecbd6e16b092cdd5981f21e
treed50b17edcc9e37701dd4090d88e1171609186cee
parent01c10f88c9b7ab5767922531167f933cac32e9e9
platform/x86: hp-wmi: Add HP WMI camera switch

Previously, when the camera toggle switch was hit, the hp-wmi driver
would report an invalid event code. By adding a case for that in the
event handling switch statement we can eliminate that error code and
enable a framework for potential further kernel handling of that key.
This change was tested on my HP Envy x360 15-ey0023dx laptop, but it
would likely work for any HP laptop with a camera toggle button. Now
we emit an SW_CAMERA_LENS_COVER event, on a device that gets created
on the first such event so as to not report incorrectly the state of
the camera shutter before we can know its state.

Signed-off-by: Jonathan Singer <jes965@nyu.edu>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230426184852.2100-1-jes965@nyu.edu
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/hp/hp-wmi.c