Skip to contentSkip to conversation

ASoC: Add ADAV80x codec driver

PATCH Applied Lars-Peter Clausen 4 participants 9 messages Jun 27, 2011 – Jun 28, 2011

Subsystems (3)
lore
Share & tools
lore

Lars-Peter Clausen

author maintainer
#0 lore raw

PATCH v3 1/3 ASoC: Add ADAV80x codec driver

This patch adds support for the Analog Devices ADAV801 and ADAV803 audio codec.

---
Changes since v2:
* Allow to enable/disable SYSCLK outputs by using snd_soc_dai_set_sysclk Changes since v1:
* Sync register on resume
* Don't use arrays for the mux enums and controls
* Rework PLL handling. Use DAPM for powering the PLL and OSC down and use set_sysclk to select the system clock instead of doing this implicitly in set_pll.

---
 MAINTAINERS                |    1 +
 sound/soc/codecs/Kconfig   |    4 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/adav80x.c |  951 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/adav80x.h |   35 ++
 5 files changed, 993 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/codecs/adav80x.c
 create mode 100644 sound/soc/codecs/adav80x.h
MAINTAINERS +1 -0
index b3b3505..943f81e 100644
@@ -534,6 +534,7 @@ L:	[email protected] (moderated for non-subscribers)
 W:	http://wiki.analog.com/
 S:	Supported
 F:	sound/soc/codecs/adau*
+F:	sound/soc/codecs/adav*
 F:	sound/soc/codecs/ad1*
 F:	sound/soc/codecs/ssm*
 
sound/soc/codecs/Kconfig +4 -0
index 2998e65..ff43405 100644
@@ -17,6 +17,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_AD193X if SND_SOC_I2C_AND_SPI
 	select SND_SOC_AD1980 if SND_SOC_AC97_BUS
 	select SND_SOC_AD73311
+	select SND_SOC_ADAV80X
 	select SND_SOC_ADS117X
 	select SND_SOC_AK4104 if SPI_MASTER
 	select SND_SOC_AK4535 if I2C
@@ -137,6 +138,9 @@ config SND_SOC_ADAU1701
 	select SIGMA
 	tristate
 
+config SND_SOC_ADAV80X
+	tristate
+
 config SND_SOC_ADS117X
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 51cd3d4..4957431 100644
@@ -5,6 +5,7 @@ snd-soc-ad193x-objs := ad193x.o
 snd-soc-ad1980-objs := ad1980.o
 snd-soc-ad73311-objs := ad73311.o
 snd-soc-adau1701-objs := adau1701.o
+snd-soc-adav80x-objs := adav80x.o
 snd-soc-ads117x-objs := ads117x.o
 snd-soc-ak4104-objs := ak4104.o
 snd-soc-ak4535-objs := ak4535.o
@@ -99,6 +100,7 @@ obj-$(CONFIG_SND_SOC_AD193X)	+= snd-soc-ad193x.o
 obj-$(CONFIG_SND_SOC_AD1980)	+= snd-soc-ad1980.o
 obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
 obj-$(CONFIG_SND_SOC_ADAU1701)  += snd-soc-adau1701.o
+obj-$(CONFIG_SND_SOC_ADAV80X)  += snd-soc-adav80x.o
 obj-$(CONFIG_SND_SOC_ADS117X)	+= snd-soc-ads117x.o
 obj-$(CONFIG_SND_SOC_AK4104)	+= snd-soc-ak4104.o
 obj-$(CONFIG_SND_SOC_AK4535)	+= snd-soc-ak4535.o
sound/soc/codecs/adav80x.c new file +951 -0

951 lines not on this page · raw message

sound/soc/codecs/adav80x.h new file +35 -0
new file mode 100644
index 0000000..adb0fc7
@@ -0,0 +1,35 @@
+/*
+ * header file for ADAV80X parts
+ *
+ * Copyright 2011 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef _ADAV80X_H
+#define _ADAV80X_H
+
+enum adav80x_pll_src {
+	ADAV80X_PLL_SRC_XIN,
+	ADAV80X_PLL_SRC_XTAL,
+	ADAV80X_PLL_SRC_MCLKI,
+};
+
+enum adav80x_pll {
+	ADAV80X_PLL1 = 0,
+	ADAV80X_PLL2 = 1,
+};
+
+enum adav80x_clk_src {
+	ADAV80X_CLK_XIN = 0,
+	ADAV80X_CLK_MCLKI = 1,
+	ADAV80X_CLK_PLL1 = 2,
+	ADAV80X_CLK_PLL2 = 3,
+	ADAV80X_CLK_XTAL = 6,
+
+	ADAV80X_CLK_SYSCLK1 = 6,
+	ADAV80X_CLK_SYSCLK2 = 7,
+	ADAV80X_CLK_SYSCLK3 = 8,
+};
+
+#endif
Signature · 1 line
1.7.2.5
author maintainer
#1 lore raw

PATCH v3 2/3 ASoC: Blackfin: Add machine driver for EVAL-ADAV80X boards

Add a machine driver to support the EVAL-ADAV801 and EVAL-ADAV803 boards connected to a Analog Devices BF5XX evaluation board.

---
 sound/soc/blackfin/Kconfig             |   13 +++
 sound/soc/blackfin/Makefile            |    2 +
 sound/soc/blackfin/bfin-eval-adav80x.c |  173 ++++++++++++++++++++++++++++++++
 3 files changed, 188 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/blackfin/bfin-eval-adav80x.c
sound/soc/blackfin/Kconfig +13 -0
index fa6a6d2..fe9d548 100644
@@ -27,6 +27,19 @@ config SND_SOC_BFIN_EVAL_ADAU1701
 	  board connected to one of the Blackfin evaluation boards like the
 	  BF5XX-STAMP or BF5XX-EZKIT.
 
+config SND_SOC_BFIN_EVAL_ADAV80X
+	tristate "Support for the EVAL-ADAV80X boards on Blackfin eval boards"
+	depends on SND_BF5XX_I2S && (SPI_MASTER || I2C)
+	select SND_BF5XX_SOC_I2S
+	select SND_SOC_ADAV80X
+	help
+	  Say Y if you want to add support for the Analog Devices EVAL-ADAV801 or
+	  EVAL-ADAV803 board connected to one of the Blackfin evaluation boards
+	  like the BF5XX-STAMP or BF5XX-EZKIT.
+
+	  Note: This driver assumes that the ADAV80X digital record and playback
+	  interfaces are connected to the first SPORT port on the BF5XX board.
+
 config SND_BF5XX_SOC_AD73311
 	tristate "SoC AD73311 Audio support for Blackfin"
 	depends on SND_BF5XX_I2S
sound/soc/blackfin/Makefile +2 -0
index f01bff6..6018bf5 100644
@@ -22,6 +22,7 @@ snd-ssm2602-objs := bf5xx-ssm2602.o
 snd-ad73311-objs := bf5xx-ad73311.o
 snd-ad193x-objs := bf5xx-ad193x.o
 snd-soc-bfin-eval-adau1701-objs := bfin-eval-adau1701.o
+snd-soc-bfin-eval-adav80x-objs := bfin-eval-adav80x.o
 
 obj-$(CONFIG_SND_BF5XX_SOC_AD1836) += snd-ad1836.o
 obj-$(CONFIG_SND_BF5XX_SOC_AD1980) += snd-ad1980.o
@@ -29,3 +30,4 @@ obj-$(CONFIG_SND_BF5XX_SOC_SSM2602) += snd-ssm2602.o
 obj-$(CONFIG_SND_BF5XX_SOC_AD73311) += snd-ad73311.o
 obj-$(CONFIG_SND_BF5XX_SOC_AD193X) += snd-ad193x.o
 obj-$(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701) += snd-soc-bfin-eval-adau1701.o
+obj-$(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) += snd-soc-bfin-eval-adav80x.o
sound/soc/blackfin/bfin-eval-adav80x.c new file +173 -0

173 lines not on this page · raw message

Signature · 1 line
1.7.2.5
Applied
#3 lore raw

Re: [PATCH v3 2/3] ASoC: Blackfin: Add machine driver for EVAL-ADAV80X boards

In reply to Lars-Peter Clausen
Quoted 2 lines · Lars-Peter Clausen

Add a machine driver to support the EVAL-ADAV801 and EVAL-ADAV803 boards connected to a Analog Devices BF5XX evaluation board.

Applied, thanks.

author maintainer
#4 lore raw

PATCH v3 3/3 Blackfin: bf537: Stamp: Register adav801 codec and ASoC machine driver

In reply to Lars-Peter Clausen

There is already an entry in the spi device table for the codec, but the modalias was wrong. Also the config symbol name for the codec is wrong, so this is fixed as well.

---
 arch/blackfin/mach-bf537/boards/stamp.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
arch/blackfin/mach-bf537/boards/stamp.c +16 -3
index 5d30566..198018e 100644
@@ -1000,9 +1000,9 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 	},
 #endif
 
-#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
+#if defined(CONFIG_SND_SOC_ADAV80X) || defined(CONFIG_SND_SOC_ADV80X_MODULE)
 	{
-		.modalias = "adav80x",
+		.modalias = "adav801",
 		.max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
 		.bus_num = 0,
 		.chip_select = 1,
@@ -2118,7 +2118,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
 	},
 #endif
 
-#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
+#if defined(CONFIG_SND_SOC_ADAV80X) || defined(CONFIG_SND_SOC_ADAV80X_MODULE)
 	{
 		I2C_BOARD_INFO("adav803", 0x10),
 	},
@@ -2553,6 +2553,14 @@ static struct platform_device bfin_ad73311_codec_device = {
 };
 #endif
 
+#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) || \
+	defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X_MODULE)
+static struct platform_device bfin_eval_adav801_device = {
+	.name = "bfin-eval-adav801",
+	.id = -1,
+};
+#endif
+
 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
 static struct platform_device bfin_i2s = {
 	.name = "bfin-i2s",
@@ -2833,6 +2841,11 @@ static struct platform_device *stamp_devices[] __initdata = {
 	defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701_MODULE)
 	&bf5xx_adau1701_device,
 #endif
+
+#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) || \
+	defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X_MODULE)
+	&bfin_eval_adav801_device,
+#endif
 };
 
 static int __init net2272_init(void)
Signature · 1 line
1.7.2.5
#5 lore raw

Re: [PATCH v3 3/3] Blackfin: bf537: Stamp: Register adav801 codec and ASoC machine driver

thanks, i'll add this to my tree
-mike