Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1322200pxb; Thu, 4 Mar 2021 08:28:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz59TmQdjhMVk91VlbTj/si5HACie5kZ4XRMrauFYyb44nzVDZgoojDqZpkCHkzQe2capeJ X-Received: by 2002:a17:907:3e06:: with SMTP id hp6mr5268093ejc.254.1614875324035; Thu, 04 Mar 2021 08:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614875324; cv=none; d=google.com; s=arc-20160816; b=GODkgi+4sRy5kwIYdjYAOTXC6BwCvHOtpefgBTGBxDlOhIgApNnyAAN7KyD/Ogxx+k 7qlwTtAwoPYRP++MjpPQ3zKQ6+NRnxzZTd9C5WtUvUOIPxcSRSIkFgyizBr6LqgIumA9 LUZwdcWPFif26LCRLrmCRKnAv5RCtwKAG71/ecG1NrphUFxxQbfHBmfUKoUD6NPIRHs1 uA1h/7YRFI16ueA2rsO4IfVneMKDhPdONOtYECoZGJ4sLxP6EUXJGya+YapLxqheXrVi ififqPMDJGjEelGrhYBsDzhbcbh0nB+jEjsyygyMU9WqyQwkMhLo7feSkiLD/0O1CTR0 MlLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=7K0se92r7ie361EjQsRfU3OZ4yW7lXC/6pKaDKswuCo=; b=x0vmzyk8hNeBL01ytejFrvFL2CJ6J+9or/dB/CWx28I3VgwEwXzQX9Pq21OhlvjHDl DnvZT3A0zTgYMdNtK9SrEX0jUcihzdWKUr4kkK6+6yYcG6T+wAPqI91pheljj+ApHkGv aSVTMshOPIFp1Z/akF/TEjA/Sm1a4xxc80cbB8Cs/X5nmye3WbkCrPAqweYhR5i0SSz0 +Y2oxWUw4DetxojKur6CwFqY3gU/TmtLXe5xfz+aUN+Kie7LC8SfXhrdZQYnpfTkDf4l qdlwEmurEf+bHxOxDH182YESw+k+gRsCMx302cKqfCpPRm5hxq/x5XLvtr714UorZosu rrLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JMOtIwm5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m24si4567149eda.304.2021.03.04.08.28.20; Thu, 04 Mar 2021 08:28:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JMOtIwm5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235138AbhCDKvo (ORCPT + 99 others); Thu, 4 Mar 2021 05:51:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28754 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238946AbhCDKv0 (ORCPT ); Thu, 4 Mar 2021 05:51:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614855000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7K0se92r7ie361EjQsRfU3OZ4yW7lXC/6pKaDKswuCo=; b=JMOtIwm5s2OtCs3CMc6EZJaYPnvbIzwhajRxY2noBl14FJVZSB/1FlsfAR7noKkJqlZZO2 EnDL3NUQDcfTR/2ntRvzWHWeMxPxo20fcAR7+KIe/GE0XTiFXQlx9RKsf0Yg+tX5Y3SIO+ XTtxd5KtQ2clRaX1rLGQJtFszcgzIgw= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-xRc6P5XpO0KjZDr1Sn_-Gg-1; Thu, 04 Mar 2021 05:49:59 -0500 X-MC-Unique: xRc6P5XpO0KjZDr1Sn_-Gg-1 Received: by mail-ed1-f70.google.com with SMTP id v27so6887109edx.1 for ; Thu, 04 Mar 2021 02:49:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7K0se92r7ie361EjQsRfU3OZ4yW7lXC/6pKaDKswuCo=; b=NLvwTR7CLQTnKqNpzKhaX71s6Ijuc3qBJ8BIyQsgBPs0haeRUxf9GABuMICQlVAwqS lSkp7kyy+CnkeqnwXwQuBKU6AVN3+Yz8/rpQy6vCFTbHMfRnAM2qThPziAf9SllzxZws 9IXhIa2HQbTkgtaEwoXhJPG7rvj1c8BXfHSTViB7MgjppdscNoKvAIHm+Qf6cTjiM3w7 SqQtDEuAsldou28DlBPNpL8lT6zPhxRXqJLXxfZcIuOOQxer7XIuojl6zMCK0L97AsMF HBHLe4vB/N/9Fxr+W6/9uHZemMusJbr+lnq/OgWT+Qzt7bQ7vcdNMwfZ452WgCaOQ/eJ F+Ig== X-Gm-Message-State: AOAM533enfdTxo3g9xGC/JjqppvLQb8xz3UyxYjQKaNXA8RMDafChp0T 5l1JZf6YylR4uzsi04C11mYAG8i3N4cSwa8SgV7bsUt/Mgjam41r9mQ6xmIQ6+TTMlMBwgc82gA u+23Z268g+yAyOgygun2DUFQC X-Received: by 2002:a17:906:3b84:: with SMTP id u4mr3419390ejf.431.1614854997441; Thu, 04 Mar 2021 02:49:57 -0800 (PST) X-Received: by 2002:a17:906:3b84:: with SMTP id u4mr3419376ejf.431.1614854997294; Thu, 04 Mar 2021 02:49:57 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id l12sm2799011edb.39.2021.03.04.02.49.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Mar 2021 02:49:56 -0800 (PST) Subject: Re: [PATCH v2 1/2] platform/x86: dell-privacy: Add support for Dell hardware privacy To: Perry Yuan , =?UTF-8?Q?Barnab=c3=a1s_P=c5=91cze?= , Perry Yuan Cc: "mgross@linux.intel.com" , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Limonciello Mario References: <20201228132855.17544-1-Perry_Yuan@Dell.com> <7def1cdc-e275-9ae6-4941-55517359bb1e@gmail.com> From: Hans de Goede Message-ID: Date: Thu, 4 Mar 2021 11:49:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2/16/21 8:24 AM, Perry Yuan wrote: > Hi Hans: > > On 2021/1/13 2:37, Hans de Goede wrote: >> Hi, >> >> I know there already is a v3 out and I will try to get around to reviewing >> that soon, still 1 remark about the discussion surrounding v2: >> >> On 1/11/21 2:42 PM, Perry Yuan wrote: >> >> >> >>>>> *The flow is like this: >>>>> 1) User presses key. HW does stuff with this key (timeout is started) >>>>> 2) Event is emitted from FW >>>>> 3) Event 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. >>>>> >>>> Please proofread the commit message again, and pay attention to capitalization >>>> and spacing. >>> I want to reformat it and move the commit info to cover letter. >> >> Please also put a copy of this as a comment in either the wmi or the >> acpi driver (with a comment pointing to the comment in the other) this is >> important info to have for someone reading the code and trying to understand >> how this all fits together. >> >> Regards, >> >> Hans >> > Hans. > I have added the comments to the dell-privacy  driver file in V4 > > ----------------------------------------------------------------------------------- > drivers/platform/x86/dell-privacy-wmi.c > > EXPORT_SYMBOL_GPL(dell_privacy_valid); > /* >  * The flow of privacy event: >  * 1) User presses key. HW does stuff with this key (timeout is started) >  * 2) WMI event is emitted from BIOS >  * 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 defined by >  *    dell-privacy-acpi driver. >  *    codec driver will call like this to switch micmute led state. >  *      ledtrig_audio_set(LED_AUDIO_MICMUTE, 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. >  */ > void dell_privacy_process_event(int type, int code, int status) > { >         struct privacy_wmi_data *priv; >         const struct key_entry *key; > >         mutex_lock(&list_mutex); > .... > > ----------------------------------------------------------------------------------- > drivers/platform/x86/dell-privacy-acpi.c > > /* >  * Pressing the mute key activates a time delayed circuit to physically cut >  * off the mute. The LED is in the same circuit, so it reflects the true >  * state of the HW mute.  The reason for the EC "ack" is so that software >  * can first invoke a SW mute before the HW circuit is cut off.  Without SW >  * cutting this off first does not affect the time delayed muting or status >  * of the LED but there is a possibility of a "popping" noise. >  * >  * If the EC receives the SW ack, the circuit will be activated before the >  * delay completed. >  * >  * Exposing as an LED device allows the codec drivers notification path to >  * EC ACK to work >  */ > static int dell_privacy_leds_setup(struct device *dev) > { >         struct privacy_acpi_priv *priv = dev_get_drvdata(dev); >         int ret = 0; > > ..... > This looks good, thank you. Regards, Hans