Skip to contentSkip to conversation

ASoC: Fix SPI driver binding for WM8987

PATCH In review Mark Brown 2 participants 7 messages Aug 3, 2011 – Aug 9, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Fix SPI driver binding for WM8987

As we had no id_table only the driver name would be matched against meaning that WM8987 devices wouldn't be bound.

---
 sound/soc/codecs/wm8750.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8750.c +8 -1
index 6cbf51b..2bb7bea 100644
@@ -779,11 +779,18 @@ static int __devexit wm8750_spi_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct spi_device_id wm8750_spi_ids[] = {
+	{ "wm8750", 0 },
+	{ "wm8987", 0 },
+};
+MODULE_DEVICE_TABLE(spi, wm8750_spi_id);
+
 static struct spi_driver wm8750_spi_driver = {
 	.driver = {
-		.name	= "wm8750-codec",
+		.name	= "wm8750",
 		.owner	= THIS_MODULE,
 	},
+	.id_table	= wm8750_spi_ids,
 	.probe		= wm8750_spi_probe,
 	.remove		= __devexit_p(wm8750_spi_remove),
 };
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mark Brown

As we had no id_table only the driver name would be matched against meaning that WM8987 devices wouldn't be bound.

Subject line is for wrong codec but otherwise (with new subject line)

Quoted 29 lines
---
 sound/soc/codecs/wm8750.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8750.c +8 -1
index 6cbf51b..2bb7bea 100644
@@ -779,11 +779,18 @@ static int __devexit wm8750_spi_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct spi_device_id wm8750_spi_ids[] = {
+	{ "wm8750", 0 },
+	{ "wm8987", 0 },
+};
+MODULE_DEVICE_TABLE(spi, wm8750_spi_id);
+
 static struct spi_driver wm8750_spi_driver = {
 	.driver = {
-		.name	= "wm8750-codec",
+		.name	= "wm8750",
 		.owner	= THIS_MODULE,
 	},
+	.id_table	= wm8750_spi_ids,
 	.probe		= wm8750_spi_probe,
 	.remove		= __devexit_p(wm8750_spi_remove),
 };
author
#2 lore raw
Quoted 5 lines · Liam Girdwood
Quoted 2 lines · Mark Brown

As we had no id_table only the driver name would be matched against meaning that WM8987 devices wouldn't be bound.

Subject line is for wrong codec but otherwise (with new subject line)

Hrm? Subject line says WM8987...

#3 lore raw
Quoted 8 lines · Mark Brown
Quoted 5 lines · Liam Girdwood
Quoted 2 lines · Mark Brown

As we had no id_table only the driver name would be matched against meaning that WM8987 devices wouldn't be bound.

Subject line is for wrong codec but otherwise (with new subject line)

Hrm? Subject line says WM8987...

But the diff said WM8750 iirc.

Liam

author
#4 lore raw
Quoted 5 lines · Liam Girdwood
Quoted 1 line · Mark Brown

Hrm? Subject line says WM8987...

But the diff said WM8750 iirc.

The issue being fixed is that the two devices are register compatible but for SPI we were only registering a device ID for wm8750, for I2C we'd got both IDs registered. The driver says wm8750 everywhere except the device IDs.

Acked-by
#5 lore raw
Quoted 11 lines · Mark Brown
Quoted 5 lines · Liam Girdwood
Quoted 1 line · Mark Brown

Hrm? Subject line says WM8987...

But the diff said WM8750 iirc.

The issue being fixed is that the two devices are register compatible but for SPI we were only registering a device ID for wm8750, for I2C we'd got both IDs registered. The driver says wm8750 everywhere except the device IDs.

Ah, ok - I would have just used WM8750 in subject instead.

author
#6 lore raw
Quoted 1 line · Liam Girdwood

Ah, ok - I would have just used WM8750 in subject instead.

It's specifically fixing wm8987, wm8750 was always fine but just happens to be in the same driver.