Skip to contentSkip to conversation

ASoC: Add WM8580 CODEC driver

PATCH In review Mark Brown 2 participants 5 messages Aug 6, 2008

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Add WM8580 CODEC driver

The WM8580 is an audio CODEC designed for DVD and surround sound applications, offering three stereo DACs and a stereo ADC.

---
 sound/soc/codecs/Kconfig  |    4 +
 sound/soc/codecs/Makefile |    2 +
 sound/soc/codecs/wm8580.c | 1055 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8580.h |   42 ++
 4 files changed, 1103 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/wm8580.c
 create mode 100644 sound/soc/codecs/wm8580.h
sound/soc/codecs/Kconfig +4 -0
index d7bacf6..eb79c5c 100644
@@ -5,6 +5,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_AK4535
 	select SND_SOC_UDA1380
 	select SND_SOC_WM8510
+	select SND_SOC_WM8580
 	select SND_SOC_WM8731
 	select SND_SOC_WM8750
 	select SND_SOC_WM8753
@@ -38,6 +39,9 @@ config SND_SOC_UDA1380
 config SND_SOC_WM8510
 	tristate
 
+config SND_SOC_WM8580
+	tristate
+
 config SND_SOC_WM8731
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 98808d9..7c694ca 100644
@@ -3,6 +3,7 @@ snd-soc-ad1980-objs := ad1980.o
 snd-soc-ak4535-objs := ak4535.o
 snd-soc-uda1380-objs := uda1380.o
 snd-soc-wm8510-objs := wm8510.o
+snd-soc-wm8580-objs := wm8580.o
 snd-soc-wm8731-objs := wm8731.o
 snd-soc-wm8750-objs := wm8750.o
 snd-soc-wm8753-objs := wm8753.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_SND_SOC_AD1980)	+= snd-soc-ad1980.o
 obj-$(CONFIG_SND_SOC_AK4535)	+= snd-soc-ak4535.o
 obj-$(CONFIG_SND_SOC_UDA1380)	+= snd-soc-uda1380.o
 obj-$(CONFIG_SND_SOC_WM8510)	+= snd-soc-wm8510.o
+obj-$(CONFIG_SND_SOC_WM8580)	+= snd-soc-wm8580.o
 obj-$(CONFIG_SND_SOC_WM8731)	+= snd-soc-wm8731.o
 obj-$(CONFIG_SND_SOC_WM8750)	+= snd-soc-wm8750.o
 obj-$(CONFIG_SND_SOC_WM8753)	+= snd-soc-wm8753.o
sound/soc/codecs/wm8580.c new file +1055 -0

1,055 lines not on this page · raw message

sound/soc/codecs/wm8580.h new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#1 lore raw

At Wed, 6 Aug 2008 13:18:26 +0100,

sound/soc/codecs/wm8580.c line 262

Quoted 8 lines · Mark Brown
sound/soc/codecs/wm8580.c new file +7 -0
+static inline unsigned int wm8580_read(struct snd_soc_codec *codec,
+				       unsigned int reg)
+{
+	switch (reg) {
+	default:
+		return wm8580_read_reg_cache(codec, reg);
+	}

Any addition in future? Otherwise let's remove unneeded switch.

Quoted 1 line

+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

Could you rewrite the code to follow the recent i2c framework? Then you can reduce lots of codes.

thanks,

Takashi

author
#2 lore raw
Quoted 8 lines · Takashi Iwai

sound/soc/codecs/wm8580.c line 262

Quoted 4 lines · Mark Brown
sound/soc/codecs/wm8580.c new file +4 -0
+	switch (reg) {
+	default:
+		return wm8580_read_reg_cache(codec, reg);
+	}

Any addition in future? Otherwise let's remove unneeded switch.

There are some non-cachable status registers for functions not yet supported in the driver.

Quoted 4 lines
Quoted 1 line

+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

Could you rewrite the code to follow the recent i2c framework? Then you can reduce lots of codes.

This and every other I2C driver in ASoC :/ . Since the system I'm using to develop this driver doesn't have a current enough I2C subsystem available at the moment to use the new framework it's not an ideal candidate for first conversion.

Doing this conversion is on my todo list but getting at least enough of v2 merged to allow dynamic codec driver registration should probably be done first.

#3 lore raw

At Wed, 6 Aug 2008 14:35:48 +0100,

Quoted 14 lines · Mark Brown
Quoted 8 lines · Takashi Iwai

sound/soc/codecs/wm8580.c line 262

Quoted 4 lines · Mark Brown
sound/soc/codecs/wm8580.c new file +4 -0
+	switch (reg) {
+	default:
+		return wm8580_read_reg_cache(codec, reg);
+	}

Any addition in future? Otherwise let's remove unneeded switch.

There are some non-cachable status registers for functions not yet supported in the driver.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)

Could you rewrite the code to follow the recent i2c framework? Then you can reduce lots of codes.

This and every other I2C driver in ASoC :/ .

cs4270.c was already converted by Timur :)

Quoted 8 lines

Since the system I'm using
to develop this driver doesn't have a current enough I2C subsystem available at the moment to use the new framework it's not an ideal candidate for first conversion.

Doing this conversion is on my todo list but getting at least enough of v2 merged to allow dynamic codec driver registration should probably be done first.

OK, then I'll apply your patch as is.
Let's see whether we do convert them soon later or wait for ASoC v2.

thanks,

Takashi

author
#4 lore raw
Quoted 8 lines · Takashi Iwai
Quoted 3 lines · Mark Brown

Doing this conversion is on my todo list but getting at least enough of v2 merged to allow dynamic codec driver registration should probably be done first.

OK, then I'll apply your patch as is.
Let's see whether we do convert them soon later or wait for ASoC v2.

I've got a half done merge of dynamic codec registration which should be the next bit of v2 to get backported - it should make it for 2.6.28 at the very least.