diff mbox

ASoC: tlv320aix31xx: Add ACPI match for Lenovo 100S

Message ID 1461081620-23378-1-git-send-email-hadess@hadess.net (mailing list archive)
State Accepted
Commit 11f9192cc16cd26f16fb0fa2b18ce4440a7a1623
Headers show

Commit Message

Bastien Nocera April 19, 2016, 4 p.m. UTC
The Lenovo 100S netbook has a codec controller for which there is a
driver, but doesn't know how to access the device. This adds the
necessary ACPI table for the driver to find the device.

Device (TTLV)
{
    Name (_ADR, Zero)  // _ADR: Address
    Name (_HID, "10TI3100")  // _HID: Hardware ID
    Name (_CID, "10TI3100")  // _CID: Compatible ID
    Name (_DDN, "TI TLV320AIC3100 Codec Controller ")  // _DDN: DOS Device Name
    Name (_UID, One)  // _UID: Unique ID

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Tested-by: Jan Schmidt <jan@centricular.com>
---
 sound/soc/codecs/tlv320aic31xx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Mark Brown April 19, 2016, 4:41 p.m. UTC | #1
On Tue, Apr 19, 2016 at 06:00:20PM +0200, Bastien Nocera wrote:

> +static const struct acpi_device_id aic31xx_acpi_match[] = {
> +	{ "10TI3100", 0 },

An ACPI identifier that actually bears some resemblance to the name of
the part, will wonders never cease!  :)
Pierre-Louis Bossart April 19, 2016, 5:57 p.m. UTC | #2
On 04/19/2016 11:41 AM, Mark Brown wrote:
> On Tue, Apr 19, 2016 at 06:00:20PM +0200, Bastien Nocera wrote:
>
>> +static const struct acpi_device_id aic31xx_acpi_match[] = {
>> +	{ "10TI3100", 0 },
> An ACPI identifier that actually bears some resemblance to the name of
> the part, will wonders never cease!  :)
It's not a legit ACPI id but at least it's consistent with other BIOS. I 
see the same in a couple of DSDT I extracted. it'd be curious to see the 
schematics if you have them to help progress with Baytrail-CR support.
Mark Brown April 19, 2016, 6:43 p.m. UTC | #3
On Tue, Apr 19, 2016 at 12:57:40PM -0500, Pierre-Louis Bossart wrote:
> On 04/19/2016 11:41 AM, Mark Brown wrote:
> >On Tue, Apr 19, 2016 at 06:00:20PM +0200, Bastien Nocera wrote:

> >>+static const struct acpi_device_id aic31xx_acpi_match[] = {
> >>+	{ "10TI3100", 0 },

> >An ACPI identifier that actually bears some resemblance to the name of
> >the part, will wonders never cease!  :)

> It's not a legit ACPI id but at least it's consistent with other BIOS. I see
> the same in a couple of DSDT I extracted. it'd be curious to see the
> schematics if you have them to help progress with Baytrail-CR support.

It's in the right form at least, dunno if TI actually registered 10TI
properly or not though.
Pierre-Louis Bossart April 19, 2016, 7:25 p.m. UTC | #4
On 04/19/2016 01:43 PM, Mark Brown wrote:
> On Tue, Apr 19, 2016 at 12:57:40PM -0500, Pierre-Louis Bossart wrote:
>> On 04/19/2016 11:41 AM, Mark Brown wrote:
>>> On Tue, Apr 19, 2016 at 06:00:20PM +0200, Bastien Nocera wrote:
>>>> +static const struct acpi_device_id aic31xx_acpi_match[] = {
>>>> +	{ "10TI3100", 0 },
>>> An ACPI identifier that actually bears some resemblance to the name of
>>> the part, will wonders never cease!  :)
>> It's not a legit ACPI id but at least it's consistent with other BIOS. I see
>> the same in a couple of DSDT I extracted. it'd be curious to see the
>> schematics if you have them to help progress with Baytrail-CR support.
> It's in the right form at least, dunno if TI actually registered 10TI
> properly or not though.
The PNP ID for TI is TXN
The ACPI ID is TXNW
TI's PCI ID is 0x104C.

so nope, none of the legit vendor IDs match 10TI, which doesn't follow 
the rules... No one seems to care in the BIOS world though, it's 
becoming a lost cause.
Bastien Nocera April 19, 2016, 10:54 p.m. UTC | #5
On Tue, 2016-04-19 at 12:57 -0500, Pierre-Louis Bossart wrote:
> 
> On 04/19/2016 11:41 AM, Mark Brown wrote:
> > 
> > On Tue, Apr 19, 2016 at 06:00:20PM +0200, Bastien Nocera wrote:
> > 
> > > 
> > > +static const struct acpi_device_id aic31xx_acpi_match[] = {
> > > +	{ "10TI3100", 0 },
> > An ACPI identifier that actually bears some resemblance to the name of
> > the part, will wonders never cease!  :)
> It's not a legit ACPI id but at least it's consistent with other BIOS. I 
> see the same in a couple of DSDT I extracted. it'd be curious to see the 
> schematics if you have them to help progress with Baytrail-CR support.

The DSDT for that device is at:
http://noraisin.net/lenovo-100s/dsdt.dsl
diff mbox

Patch

diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c
index ee4def4..3c5e1df 100644
--- a/sound/soc/codecs/tlv320aic31xx.c
+++ b/sound/soc/codecs/tlv320aic31xx.c
@@ -28,6 +28,7 @@ 
 #include <linux/i2c.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/acpi.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/slab.h>
@@ -1280,10 +1281,19 @@  static const struct i2c_device_id aic31xx_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, aic31xx_i2c_id);
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id aic31xx_acpi_match[] = {
+	{ "10TI3100", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, aic31xx_acpi_match);
+#endif
+
 static struct i2c_driver aic31xx_i2c_driver = {
 	.driver = {
 		.name	= "tlv320aic31xx-codec",
 		.of_match_table = of_match_ptr(tlv320aic31xx_of_match),
+		.acpi_match_table = ACPI_PTR(aic31xx_acpi_match),
 	},
 	.probe		= aic31xx_i2c_probe,
 	.remove		= aic31xx_i2c_remove,