linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] AMD_SFH: Add a DMI quirk entry for Chromebooks
@ 2022-08-16 10:21 Akihiko Odaki
  2022-08-18  4:59 ` Basavaraj Natikar
  0 siblings, 1 reply; 3+ messages in thread
From: Akihiko Odaki @ 2022-08-16 10:21 UTC (permalink / raw)
  Cc: Basavaraj Natikar, Jiri Kosina, Benjamin Tissoires, linux-input,
	linux-kernel, Akihiko Odaki, Mario Limonciello

Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
functionalities, even including the registers necessary for feature
detections.

The behavior was observed with Lenovo ThinkPad C13 Yoga.

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 4b90c86ee5f8..47774b9ab3de 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
 	return 0;
 }
 
+static const struct dmi_system_id dmi_nodevs[] = {
+	{
+		/*
+		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
+		 * Hub instead of Sensor Hub Fusion and leaves MP2
+		 * uninitialized, which disables all functionalities, even
+		 * including the registers necessary for feature detections.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
+		},
+	},
+	{ }
+};
+
 static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct amd_mp2_dev *privdata;
 	int rc;
 
+	if (dmi_first_match(dmi_nodevs))
+		return -ENODEV;
+
 	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
 	if (!privdata)
 		return -ENOMEM;
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] AMD_SFH: Add a DMI quirk entry for Chromebooks
  2022-08-16 10:21 [PATCH v3] AMD_SFH: Add a DMI quirk entry for Chromebooks Akihiko Odaki
@ 2022-08-18  4:59 ` Basavaraj Natikar
  2022-08-25  9:43   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Basavaraj Natikar @ 2022-08-18  4:59 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Basavaraj Natikar, Jiri Kosina, Benjamin Tissoires, linux-input,
	linux-kernel, Mario Limonciello

On 8/16/2022 3:51 PM, Akihiko Odaki wrote:
> Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
> of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> functionalities, even including the registers necessary for feature
> detections.
>
> The behavior was observed with Lenovo ThinkPad C13 Yoga.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> index 4b90c86ee5f8..47774b9ab3de 100644
> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> @@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
>  	return 0;
>  }
>  
> +static const struct dmi_system_id dmi_nodevs[] = {
> +	{
> +		/*
> +		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
> +		 * Hub instead of Sensor Hub Fusion and leaves MP2
> +		 * uninitialized, which disables all functionalities, even
> +		 * including the registers necessary for feature detections.
> +		 */
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
> +		},
> +	},
> +	{ }
> +};
> +
>  static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  {
>  	struct amd_mp2_dev *privdata;
>  	int rc;
>  
> +	if (dmi_first_match(dmi_nodevs))
> +		return -ENODEV;
> +
>  	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
>  	if (!privdata)
>  		return -ENOMEM;

Could you please prefix amd_sfh patches with 'HID: amd_sfh:'
With that addressed,

Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>

Thanks,
--
Basavaraj 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] AMD_SFH: Add a DMI quirk entry for Chromebooks
  2022-08-18  4:59 ` Basavaraj Natikar
@ 2022-08-25  9:43   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2022-08-25  9:43 UTC (permalink / raw)
  To: Basavaraj Natikar
  Cc: Akihiko Odaki, Basavaraj Natikar, Benjamin Tissoires,
	linux-input, linux-kernel, Mario Limonciello

On Thu, 18 Aug 2022, Basavaraj Natikar wrote:

> On 8/16/2022 3:51 PM, Akihiko Odaki wrote:
> > Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead
> > of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all
> > functionalities, even including the registers necessary for feature
> > detections.
> >
> > The behavior was observed with Lenovo ThinkPad C13 Yoga.
> >
> > Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> > Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> > ---
> >  drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> >
> > diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> > index 4b90c86ee5f8..47774b9ab3de 100644
> > --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> > +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
> > @@ -288,11 +288,29 @@ int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
> >  	return 0;
> >  }
> >  
> > +static const struct dmi_system_id dmi_nodevs[] = {
> > +	{
> > +		/*
> > +		 * Google Chromebooks use Chrome OS Embedded Controller Sensor
> > +		 * Hub instead of Sensor Hub Fusion and leaves MP2
> > +		 * uninitialized, which disables all functionalities, even
> > +		 * including the registers necessary for feature detections.
> > +		 */
> > +		.matches = {
> > +			DMI_MATCH(DMI_SYS_VENDOR, "Google"),
> > +		},
> > +	},
> > +	{ }
> > +};
> > +
> >  static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> >  {
> >  	struct amd_mp2_dev *privdata;
> >  	int rc;
> >  
> > +	if (dmi_first_match(dmi_nodevs))
> > +		return -ENODEV;
> > +
> >  	privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL);
> >  	if (!privdata)
> >  		return -ENOMEM;
> 
> Could you please prefix amd_sfh patches with 'HID: amd_sfh:'
> With that addressed,
> 
> Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>

I have fixed that up and applied. Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-25  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 10:21 [PATCH v3] AMD_SFH: Add a DMI quirk entry for Chromebooks Akihiko Odaki
2022-08-18  4:59 ` Basavaraj Natikar
2022-08-25  9:43   ` Jiri Kosina

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).