Skip to contentSkip to conversation

ASoC: add Wolfson WM8973 codec driver

PATCH In review Xavier Hsu 3 participants 4 messages Jun 27, 2014 – Jul 2, 2014

Subsystems (4)
lore
Share & tools
lore

Xavier Hsu

author
#0 lore raw

PATCH 1/1 ASoC: add Wolfson WM8973 codec driver

This patch adds support for the wm8973 codec, based on the existing wm8971 codec driver.

Any comments about improving the patch are welcome. Thanks.

---
 Documentation/devicetree/bindings/sound/wm8973.txt |   26 +
 sound/soc/codecs/Kconfig                           |    4 +
 sound/soc/codecs/Makefile                          |    2 +
 sound/soc/codecs/wm8973.c                          | 1028 ++++++++++++++++++++
 sound/soc/codecs/wm8973.h                          |   57 ++
 5 files changed, 1117 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/wm8973.txt
 create mode 100644 sound/soc/codecs/wm8973.c
 create mode 100644 sound/soc/codecs/wm8973.h
Documentation/devicetree/bindings/sound/wm8973.txt new file +26 -0
new file mode 100644
index 0000000..2374873
@@ -0,0 +1,26 @@
+WM8973 audio CODEC
+
+These devices support both I2C and SPI (configured with pin strapping
+on the board).
+
+Required properties:
+
+  - compatible : "wlf,wm8973".
+
+  - reg : the I2C address of the device for I2C, the chip select
+          number for SPI.
+
+Optional properties:
+
+  - mclk-div : Setting the CLKDIV2 bit for dividing MCLK.
+    mclk-div = <0> (Default & not divide).
+    mclk-div = <1> (Divide by 2).
+
+Example:
+
+codec: wm8973@1a {
+	compatible = "wlf,wm8973";
+	reg = <0x1a>;
+
+	mclk-div = <1>;
+};
sound/soc/codecs/Kconfig +4 -0
index 350878e..acf83bd 100644
@@ -139,6 +139,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_WM8961 if I2C
 	select SND_SOC_WM8962 if I2C && INPUT
 	select SND_SOC_WM8971 if I2C
+	select SND_SOC_WM8973 if I2C
 	select SND_SOC_WM8974 if I2C
 	select SND_SOC_WM8978 if I2C
 	select SND_SOC_WM8983 if SND_SOC_I2C_AND_SPI
@@ -692,6 +693,9 @@ config SND_SOC_WM8962
 config SND_SOC_WM8971
 	tristate
 
+config SND_SOC_WM8973
+	tristate
+
 config SND_SOC_WM8974
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 1bd6e1c..aad29a3 100644
@@ -141,6 +141,7 @@ snd-soc-wm8960-objs := wm8960.o
 snd-soc-wm8961-objs := wm8961.o
 snd-soc-wm8962-objs := wm8962.o
 snd-soc-wm8971-objs := wm8971.o
+snd-soc-wm8973-objs := wm8973.o
 snd-soc-wm8974-objs := wm8974.o
 snd-soc-wm8978-objs := wm8978.o
 snd-soc-wm8983-objs := wm8983.o
@@ -303,6 +304,7 @@ obj-$(CONFIG_SND_SOC_WM8960)	+= snd-soc-wm8960.o
 obj-$(CONFIG_SND_SOC_WM8961)	+= snd-soc-wm8961.o
 obj-$(CONFIG_SND_SOC_WM8962)	+= snd-soc-wm8962.o
 obj-$(CONFIG_SND_SOC_WM8971)	+= snd-soc-wm8971.o
+obj-$(CONFIG_SND_SOC_WM8973)	+= snd-soc-wm8973.o
 obj-$(CONFIG_SND_SOC_WM8974)	+= snd-soc-wm8974.o
 obj-$(CONFIG_SND_SOC_WM8978)	+= snd-soc-wm8978.o
 obj-$(CONFIG_SND_SOC_WM8983)	+= snd-soc-wm8983.o
sound/soc/codecs/wm8973.c new file +1028 -0

1,028 lines not on this page · raw message

sound/soc/codecs/wm8973.h new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Xavier Hsu

This patch adds support for the wm8973 codec, based on the existing wm8971 codec driver.

Those two look really similar. Do you think they can both be supported by the same driver, rather than duplicating most of the code?

- Lars

#2 lore raw
Quoted 9 lines · Lars-Peter Clausen
Quoted 3 lines · Xavier Hsu

This patch adds support for the wm8973 codec, based on the existing wm8971 codec driver.

Those two look really similar. Do you think they can both be supported by the same driver, rather than duplicating most of the code?

- Lars

I am not super familiar with these two devices but looking through the two datasheets it certainly seems they should be supported by the same driver. I would like to see some reason if we were to not go down this route.

Thanks,
Charles

author
#3 lore raw

Hi Everybody :

I will provide an updated patch for supporting wm8971 and wm8973 soon.

Many Thanks.
Xavier

2014-07-01 19:05 GMT+08:00 Charles Keepax <
[email protected]>:

Quoted 19 lines · Lars-Peter Clausen
Quoted 9 lines · Xavier Hsu
Quoted 3 lines

This patch adds support for the wm8973 codec, based on the existing wm8971 codec driver.

Those two look really similar. Do you think they can both be supported by the same driver, rather than duplicating most of the code?

- Lars

I am not super familiar with these two devices but looking through the two datasheets it certainly seems they should be supported by the same driver. I would like to see some reason if we were to not go down this route.

Thanks,
Charles