linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yuan, Perry" <Perry.Yuan@dell.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: "hdegoede@redhat.com" <hdegoede@redhat.com>,
	"mgross@linux.intel.com" <mgross@linux.intel.com>,
	"pali@kernel.org" <pali@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"platform-driver-x86@vger.kernel.org" 
	<platform-driver-x86@vger.kernel.org>,
	"Limonciello, Mario" <Mario.Limonciello@dell.com>
Subject: RE: [PATCH]  platform/x86: dell-privacy: Add support for new privacy driver
Date: Wed, 11 Nov 2020 07:21:07 +0000	[thread overview]
Message-ID: <SJ0PR19MB4528E93631DA5FD8BE1D6E8D84E80@SJ0PR19MB4528.namprd19.prod.outlook.com> (raw)
In-Reply-To: <20201104014915.45tbmnrqvccbrd2k@srcf.ucam.org>

> -----Original Message-----
> From: Matthew Garrett <mjg59@srcf.ucam.org>
> Sent: Wednesday, November 4, 2020 9:49 AM
> To: Yuan, Perry
> Cc: hdegoede@redhat.com; mgross@linux.intel.com; pali@kernel.org; linux-
> kernel@vger.kernel.org; platform-driver-x86@vger.kernel.org; Limonciello,
> Mario
> Subject: Re: [PATCH] platform/x86: dell-privacy: Add support for new privacy
> driver
> 
> 
> [EXTERNAL EMAIL]
> 
> On Tue, Nov 03, 2020 at 04:55:42AM -0800, Perry Yuan wrote:
> 
> > +#define PRIVACY_PlATFORM_NAME  "dell-privacy-acpi"
> > +#define ACPI_PRIVACY_DEVICE	"\\_SB.PC00.LPCB.ECDV"
> 
> This looks like the EC rather than a privacy device? If so, you probably want
> to collaborate with the EC driver to obtain the handle rather than depending
> on the path, unless it's guaranteed that this path will never change.

Thanks Matthew
I will change the path to handle as you suggested.


> 
> > +static int micmute_led_set(struct led_classdev *led_cdev,
> > +               enum led_brightness brightness) {
> > +    acpi_status status;
> > +
> > +    status = acpi_evaluate_object(NULL, ACPI_PRIVACY_EC_ACK, NULL,
> NULL);
> > +    if (ACPI_FAILURE(status)) {
> > +        dev_err(led_cdev->dev, "Error setting privacy audio EC ack
> value: %d\n",status);
> > +        return -EIO;
> > +    }
> > +    return 0;
> > +}
> 
> What's actually being set here? You don't seem to be passing any arguments.

Yes,  it is a EC ack notification without any arguments needed. 
 

> 
> > +static const struct acpi_device_id privacy_acpi_device_ids[] = {
> > +    {"PNP0C09", 0},
> 
> Oooh no please don't do this - you'll trigger autoloading on everything that
> exposes a PNP0C09 device.

Got it , I need to adjust the driver register logic. 
In drivers/platform/x86/dell-privacy-wmi.c .
The privacy acpi driver will be loaded by privacy wmi driver.
The privacy wmi driver need to  check if the privacy device is present.
It can avoid loading driver on non-dell-privacy system. 


+static const struct wmi_device_id dell_wmi_privacy_wmi_id_table[] = {
+    { .guid_string = DELL_PRIVACY_GUID },
+    { },

 

 
> 
> --
> Matthew Garrett | mjg59@srcf.ucam.org

  reply	other threads:[~2020-11-11  7:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 12:55 Perry Yuan
2020-11-03 16:22 ` kernel test robot
2020-11-03 16:50 ` kernel test robot
2020-11-03 19:14 ` Barnabás Pőcze
2020-11-04  1:49 ` Matthew Garrett
2020-11-11  7:21   ` Yuan, Perry [this message]
2020-11-11  7:24     ` Matthew Garrett
2020-11-11 14:30       ` Limonciello, Mario
2020-11-12 15:06         ` Enrico Weigelt, metux IT consult
2020-11-12 15:31           ` Limonciello, Mario
2020-11-12 15:55             ` Hans de Goede
2020-11-12 15:57               ` Limonciello, Mario
2020-11-04  6:43 ` kernel test robot
2020-11-09 11:16 ` Hans de Goede
2020-11-11  7:24   ` Yuan, Perry

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=SJ0PR19MB4528E93631DA5FD8BE1D6E8D84E80@SJ0PR19MB4528.namprd19.prod.outlook.com \
    --to=perry.yuan@dell.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --subject='RE: [PATCH]  platform/x86: dell-privacy: Add support for new privacy driver' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).