diff mbox

ASoC: rt5645: Add dmi_system_id "Google Terra"

Message ID 1448333729-11065-1-git-send-email-bardliao@realtek.com (mailing list archive)
State Accepted
Commit 6b3cecd11539178978e1f54fe1363c39fe0db045
Headers show

Commit Message

Bard Liao Nov. 24, 2015, 2:55 a.m. UTC
Add platform specific data for Terra project.

Signed-off-by: Luke_Yin@asus.com <Luke_Yin@asus.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
---
 sound/soc/codecs/rt5645.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Mark Brown Nov. 25, 2015, 12:01 p.m. UTC | #1
On Tue, Nov 24, 2015 at 10:55:29AM +0800, Bard Liao wrote:

> +	{
> +		.ident = "Google Terra",
> +		.callback = strago_quirk_cb,
> +		.matches = {
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Terra"),
> +		},
> +	},

It might make more sense to just have a single entry for all these
Google platforms and extend this table rather than adding a complete new
entry for every platform - they're all the same and it'd make the table
smaller.
Bard Liao Nov. 26, 2015, 9:19 a.m. UTC | #2
> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Wednesday, November 25, 2015 8:02 PM
> To: Bard Liao
> Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; lars@metafoo.de;
> Flove; Oder Chiou; John Lin; Luke_Yin@asus.com
> Subject: Re: [PATCH] ASoC: rt5645: Add dmi_system_id "Google Terra"
> 
> On Tue, Nov 24, 2015 at 10:55:29AM +0800, Bard Liao wrote:
> 
> > +	{
> > +		.ident = "Google Terra",
> > +		.callback = strago_quirk_cb,
> > +		.matches = {
> > +			DMI_MATCH(DMI_PRODUCT_NAME, "Terra"),
> > +		},
> > +	},
> 
> It might make more sense to just have a single entry for all these Google
> platforms and extend this table rather than adding a complete new entry
> for every platform - they're all the same and it'd make the table smaller.

Totally agree. We are trying to simplify the code. The idea is using
DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE") for all google project
except a few projects with different HW design. We will use if else
statement to match the projects with special HW design first and the
general ones. Also, I think those can support DT/ACPI should have higher
priority than DMI match, right?

> 
> ------Please consider the environment before printing this e-mail.
Mark Brown Nov. 26, 2015, 11:11 a.m. UTC | #3
On Thu, Nov 26, 2015 at 09:19:08AM +0000, Bard Liao wrote:

> > > +	{
> > > +		.ident = "Google Terra",
> > > +		.callback = strago_quirk_cb,
> > > +		.matches = {
> > > +			DMI_MATCH(DMI_PRODUCT_NAME, "Terra"),
> > > +		},
> > > +	},

> > It might make more sense to just have a single entry for all these Google
> > platforms and extend this table rather than adding a complete new entry
> > for every platform - they're all the same and it'd make the table smaller.

> Totally agree. We are trying to simplify the code. The idea is using
> DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE") for all google project
> except a few projects with different HW design. We will use if else
> statement to match the projects with special HW design first and the

OK, that's a bit more than what I was thinking but sounds good - my
thought was just to merge entries so there were more things in the
.matches table.

> general ones. Also, I think those can support DT/ACPI should have higher
> priority than DMI match, right?

That might lead to problems - one thing DMI gets used for is to override
information from the firmware to fix bugs in what it's doing.
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 2c4f06f..7b140cc 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3572,6 +3572,13 @@  static const struct dmi_system_id dmi_platform_intel_braswell[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Wizpig"),
 		},
 	},
+	{
+		.ident = "Google Terra",
+		.callback = strago_quirk_cb,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_NAME, "Terra"),
+		},
+	},
 	{ }
 };