Hi,
On 4/12/21 11:19 AM, Perry Yuan wrote:
> From: Perry Yuan
>
> add support for Dell privacy driver for the Dell units equipped
> hardware privacy design, which protect users privacy of audio and
> camera from hardware level. Once the audio or camera privacy mode
> activated, any applications will not get any audio or video stream
> when user pressed ctrl+F4 hotkey, audio privacy mode will be
> enabled, micmute led will be also changed accordingly
> The micmute led is fully controlled by hardware & EC(embedded controller)
> and camera mute hotkey is Ctrl+F9. Currently design only emits
> SW_CAMERA_LENS_COVER event while the camera lens shutter will be
> changed by EC & HW(hardware) control
>
> *The flow is like this:
> 1) User presses key. HW does stuff with this key (timeout timer is started)
> 2) WMI event is emitted from BIOS to kernel
> 3) WMI event is received by dell-privacy
> 4) KEY_MICMUTE emitted from dell-privacy
> 5) Userland picks up key and modifies kcontrol for SW mute
> 6) Codec kernel driver catches and calls ledtrig_audio_set, like this:
>ledtrig_audio_set(LED_AUDIO_MICMUTE, rt715->micmute_led ? LED_ON :LED_OFF);
> 7) If "LED" is set to on dell-privacy notifies EC, and timeout is cancelled,
>HW mic mute activated. If EC not notified, HW mic mute will also be
>activated when timeout used up, it is just later than active ack
>
> Signed-off-by: Perry Yuan
> ---
> v5 -> v6:
> * addressed feedback from Hans
> * addressed feedback from Pierre
> * optimize some debug format with dev_dbg()
> * remove platform driver,combined privacy acpi driver into single wmi
> driver file
> * optimize sysfs interface with string added to be more clearly reading
> * remove unused function and clear header file
Thank you, almost there. A few small remarks inline.
> v4 -> v5:
> * addressed feedback from Randy Dunlap
> * addressed feedback from Pierre-Louis Bossart
> * rebase to latest 5.12 rc4 upstream kernel
> * fix some space alignment problem
> v3 -> v4:
> * fix format for Kconfig
> * add sysfs document
> * add flow comments to the privacy wmi/acpi driver
> * addressed feedback from Barnabás Pőcze[Thanks very much]
> * export privacy_valid to make the global state simpler to query
> * fix one issue which will block the dell-laptop driver to load when
> privacy driver invalid
> * addressed feedback from Pierre-Louis Bossart,remove the EC ID match
> v2 -> v3:
> * add sysfs attributes doc
> v1 -> v2:
> * query EC handle from EC driver directly.
> * fix some code style.
> * add KEY_END to keymap array.
> * clean platform device when cleanup called
> * use hexadecimal format for log print in dev_dbg
> * remove __set_bit for the report keys from probe.
> * fix keymap leak
> * add err_free_keymap in dell_privacy_wmi_probe
> * wmi driver will be unregistered if privacy_acpi_init() fails
> * add sysfs attribute files for user space query.
> * add leds micmute driver to privacy acpi
> * add more design info the commit info
> ---
> ---
> .../testing/sysfs-platform-dell-privacy-wmi | 55 +++
> drivers/platform/x86/dell/Kconfig | 14 +
> drivers/platform/x86/dell/Makefile| 1 +
> drivers/platform/x86/dell/dell-laptop.c | 23 +-
> drivers/platform/x86/dell/dell-privacy-wmi.c | 394 ++
> drivers/platform/x86/dell/dell-privacy-wmi.h | 23 +
> drivers/platform/x86/dell/dell-wmi.c | 8 +-
> 7 files changed, 511 insertions(+), 7 deletions(-)
> create mode 100644 Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
> create mode 100644 drivers/platform/x86/dell/dell-privacy-wmi.c
> create mode 100644 drivers/platform/x86/dell/dell-privacy-wmi.h
>
> diff --git a/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
> b/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
> new file mode 100644
> index ..7f9e18705861
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
> @@ -0,0 +1,55 @@
> +What:
> /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
> +Date:Apr 2021
> +KernelVersion: 5.13
> +Contact: "perry.y...@dell.com>"
> +Description:
> + Display which dell hardware level privacy devices are supported
> + “Dell Privacy” is a set of HW, FW, and SW features to enhance
> + Dell’s commitment to platform privacy for MIC, Camera, and
> + ePrivacy screens.
> + The supported hardware privacy devices are:
> +Attributes:
> + Microphone Mute:
> + Identifies the local microphone can be muted by
> hardware, no applications
> + is available to capture system mic sound
> +
> + Camera Shutter:
> + Identifies camera shutter controlled by
> hardware, which is a micromechanical
> + shutter assembly that is built onto the camera