* [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices
@ 2014-09-11 1:40 bardliao
2014-09-12 13:55 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: bardliao @ 2014-09-11 1:40 UTC (permalink / raw)
To: broonie, lgirdwood; +Cc: oder_chiou, Bard Liao, alsa-devel, lars, flove
From: Bard Liao <bardliao@realtek.com>
This patch set cbj_en value for ACPI devices.
Signed-off-by: Bard Liao <bardliao@realtek.com>
---
sound/soc/codecs/rt286.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c
index e4f6102..7dfca82 100644
--- a/sound/soc/codecs/rt286.c
+++ b/sound/soc/codecs/rt286.c
@@ -1100,8 +1100,14 @@ static const struct i2c_device_id rt286_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, rt286_i2c_id);
+/* the default platform data for acpi devices */
+static struct rt286_platform_data rt286_acpi_data = {
+ .cbj_en = true,
+ .gpio2_en = false,
+};
+
static const struct acpi_device_id rt286_acpi_match[] = {
- { "INT343A", 0 },
+ { "INT343A", (unsigned long)&rt286_acpi_data },
{},
};
MODULE_DEVICE_TABLE(acpi, rt286_acpi_match);
@@ -1111,6 +1117,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
{
struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev);
struct rt286_priv *rt286;
+ struct device *dev = &i2c->dev;
+ const struct acpi_device_id *acpiid;
int i, ret;
rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286),
@@ -1141,6 +1149,13 @@ static int rt286_i2c_probe(struct i2c_client *i2c,
if (pdata)
rt286->pdata = *pdata;
+ /* enable jack combo mode on supported devices */
+ acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
+ if (acpiid) {
+ rt286->pdata = *(struct rt286_platform_data *)
+ acpiid->driver_data;
+ }
+
regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3);
for (i = 0; i < RT286_POWER_REG_LEN; i++)
--
1.8.1.1.439.g50a6b54
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices
2014-09-11 1:40 [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices bardliao
@ 2014-09-12 13:55 ` Mark Brown
2014-09-16 7:31 ` Liam Girdwood
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2014-09-12 13:55 UTC (permalink / raw)
To: bardliao; +Cc: oder_chiou, alsa-devel, lars, graeme.gregory, lgirdwood, flove
[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]
On Thu, Sep 11, 2014 at 09:40:54AM +0800, bardliao@realtek.com wrote:
> +/* the default platform data for acpi devices */
> +static struct rt286_platform_data rt286_acpi_data = {
> + .cbj_en = true,
> + .gpio2_en = false,
> +};
> +
> static const struct acpi_device_id rt286_acpi_match[] = {
> - { "INT343A", 0 },
> + { "INT343A", (unsigned long)&rt286_acpi_data },
> {},
> };
Why does this platform data apply to all boards using this ACPI ID?
Shouldn't this be _DSD data instead, or should we be doing quirks based
on DMI data?
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices
2014-09-12 13:55 ` Mark Brown
@ 2014-09-16 7:31 ` Liam Girdwood
2014-09-16 16:14 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Liam Girdwood @ 2014-09-16 7:31 UTC (permalink / raw)
To: Mark Brown
Cc: oder_chiou, alsa-devel, lars, graeme.gregory, lgirdwood, bardliao,
flove
On Fri, 2014-09-12 at 14:55 +0100, Mark Brown wrote:
> On Thu, Sep 11, 2014 at 09:40:54AM +0800, bardliao@realtek.com wrote:
>
> > +/* the default platform data for acpi devices */
> > +static struct rt286_platform_data rt286_acpi_data = {
> > + .cbj_en = true,
> > + .gpio2_en = false,
> > +};
> > +
> > static const struct acpi_device_id rt286_acpi_match[] = {
> > - { "INT343A", 0 },
> > + { "INT343A", (unsigned long)&rt286_acpi_data },
> > {},
> > };
>
> Why does this platform data apply to all boards using this ACPI ID?
> Shouldn't this be _DSD data instead, or should we be doing quirks based
> on DMI data?
Sadly there is no data within most/all current BIOSes that have this
ACPI id for the RT286. The BIOSes are a little behind in the development
here compared to the codec driver. So it's probably we will have to
support this and _DSD with this particular driver.
Liam
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices
2014-09-16 7:31 ` Liam Girdwood
@ 2014-09-16 16:14 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-09-16 16:14 UTC (permalink / raw)
To: Liam Girdwood
Cc: oder_chiou, alsa-devel, lars, graeme.gregory, lgirdwood, bardliao,
flove
[-- Attachment #1.1: Type: text/plain, Size: 688 bytes --]
On Tue, Sep 16, 2014 at 08:31:54AM +0100, Liam Girdwood wrote:
> On Fri, 2014-09-12 at 14:55 +0100, Mark Brown wrote:
> > Why does this platform data apply to all boards using this ACPI ID?
> > Shouldn't this be _DSD data instead, or should we be doing quirks based
> > on DMI data?
> Sadly there is no data within most/all current BIOSes that have this
> ACPI id for the RT286. The BIOSes are a little behind in the development
> here compared to the codec driver. So it's probably we will have to
> support this and _DSD with this particular driver.
They should all have DMI data (ie, board level identification), I can
see them not having _DSD but DMI has been there since forever.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-16 16:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 1:40 [PATCH v2] ASoC: rt286: Set cbj_en for ACPI devices bardliao
2014-09-12 13:55 ` Mark Brown
2014-09-16 7:31 ` Liam Girdwood
2014-09-16 16:14 ` Mark Brown
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).