Message ID | 1415164166-15512-1-git-send-email-bardliao@realtek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Nov 05, 2014 at 01:09:26PM +0800, bardliao@realtek.com wrote: > +static struct dmi_system_id intel_platform[] __initdata = { > + { This is fine but can you please rename the variable from intel_platform to something more meaningful like the name of the reference design these are derived from or something? That way if we need to add some other quirk (and I guess we will) we won't have to rename this table - I guess anything that's using a DMI quirk will be some Intel based platform.
> -----Original Message----- > From: Mark Brown [mailto:broonie@kernel.org] > Sent: Thursday, November 06, 2014 1:23 AM > To: bardliao@realtek.com > Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; lars@metafoo.de; > flove@realtek.com; oder_chiou@realtek.com; Jie, Yang > Subject: Re: [PATCH] ASoC:rt286: set combo jack by dmi > > On Wed, Nov 05, 2014 at 01:09:26PM +0800, bardliao@realtek.com wrote: > > > +static struct dmi_system_id intel_platform[] __initdata = { > > + { > > This is fine but can you please rename the variable from intel_platform to > something more meaningful like the name of the reference design these are > derived from or something? That way if we need to add some other quirk > (and I guess we will) we won't have to rename this table - I guess anything > that's using a DMI quirk will be some Intel based platform. [Keyon] maybe we can use something like 'combo_jack_platform'?
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 97daa80..aa572b6 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -17,6 +17,7 @@ #include <linux/i2c.h> #include <linux/platform_device.h> #include <linux/spi/spi.h> +#include <linux/dmi.h> #include <linux/acpi.h> #include <sound/core.h> #include <sound/pcm.h> @@ -1205,6 +1206,16 @@ static const struct acpi_device_id rt286_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, rt286_acpi_match); +static struct dmi_system_id intel_platform[] __initdata = { + { + .ident = "Intel Wilson Beach", + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "Wilson Beach SDS") + } + }, + { } +}; + static int rt286_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -1240,6 +1251,9 @@ static int rt286_i2c_probe(struct i2c_client *i2c, if (pdata) rt286->pdata = *pdata; + if (dmi_check_system(intel_platform)) + rt286->pdata.cbj_en = true; + regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); for (i = 0; i < RT286_POWER_REG_LEN; i++)