Skip to contentSkip to conversation

add support for SPI control mode to tlv320aic23

PATCH Applied Max Filippov 2 participants 4 messages Mar 6, 2014 – Mar 7, 2014

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover add support for SPI control mode to tlv320aic23

Hi,

this series splits I2C-specific part of tlv320aic23 codec driver into a separate file and adds SPI control mode support. It also updates Kconfigs of existing tlv320aic23 users so that I2C variant is selected.

Changes v1->v2:
- split i2c interface into separate file;
- implement spi interface in a separate file;
- update Kconfigs of existing users.

Max Filippov (2):
ASoC: tlv320aic23: add support for SPI control mode
ASoC: update Kconfig of AIC23 users to select I2C variant

 sound/soc/atmel/Kconfig            |  2 +-
 sound/soc/cirrus/Kconfig           |  2 +-
 sound/soc/codecs/Kconfig           | 11 ++++++-
 sound/soc/codecs/Makefile          |  4 +++
 sound/soc/codecs/tlv320aic23-i2c.c | 59 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/tlv320aic23-spi.c | 57 ++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/tlv320aic23.c     | 55 +++++++----------------------------
 sound/soc/codecs/tlv320aic23.h     |  6 ++++
 sound/soc/fsl/Kconfig              |  2 +-
 sound/soc/omap/Kconfig             |  4 +--
 sound/soc/samsung/Kconfig          |  2 +-
 sound/soc/tegra/Kconfig            |  2 +-
 12 files changed, 154 insertions(+), 52 deletions(-)
 create mode 100644 sound/soc/codecs/tlv320aic23-i2c.c
 create mode 100644 sound/soc/codecs/tlv320aic23-spi.c
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH v2 1/2 ASoC: tlv320aic23: add support for SPI control mode

tlv320aic23 chip control interface may work in either I2C or SPI mode depending on the MODE pin state. Functionality and register layout are independent of the control mode.

Implement bus-specific parts as separate modules.

---
Changes v1->v2:
- split i2c interface into separate file;
- implement spi interface in a separate file.

 sound/soc/codecs/Kconfig           | 11 ++++++-
 sound/soc/codecs/Makefile          |  4 +++
 sound/soc/codecs/tlv320aic23-i2c.c | 59 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/tlv320aic23-spi.c | 57 ++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/tlv320aic23.c     | 55 +++++++----------------------------
 sound/soc/codecs/tlv320aic23.h     |  6 ++++
 6 files changed, 147 insertions(+), 45 deletions(-)
 create mode 100644 sound/soc/codecs/tlv320aic23-i2c.c
 create mode 100644 sound/soc/codecs/tlv320aic23-spi.c
sound/soc/codecs/Kconfig +10 -1
index 983d087a..5e4fc04 100644
@@ -71,7 +71,8 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_STA529 if I2C
 	select SND_SOC_STAC9766 if SND_SOC_AC97_BUS
 	select SND_SOC_TAS5086 if I2C
-	select SND_SOC_TLV320AIC23 if I2C
+	select SND_SOC_TLV320AIC23_I2C if I2C
+	select SND_SOC_TLV320AIC23_SPI if SPI_MASTER
 	select SND_SOC_TLV320AIC26 if SPI_MASTER
 	select SND_SOC_TLV320AIC32X4 if I2C
 	select SND_SOC_TLV320AIC3X if I2C
@@ -357,6 +358,14 @@ config SND_SOC_TAS5086
 config SND_SOC_TLV320AIC23
 	tristate
 
+config SND_SOC_TLV320AIC23_I2C
+	tristate
+	select SND_SOC_TLV320AIC23
+
+config SND_SOC_TLV320AIC23_SPI
+	tristate
+	select SND_SOC_TLV320AIC23
+
 config SND_SOC_TLV320AIC26
 	tristate
 	depends on SPI
sound/soc/codecs/Makefile +4 -0
index bc12676..ed1fd89 100644
@@ -63,6 +63,8 @@ snd-soc-sta529-objs := sta529.o
 snd-soc-stac9766-objs := stac9766.o
 snd-soc-tas5086-objs := tas5086.o
 snd-soc-tlv320aic23-objs := tlv320aic23.o
+snd-soc-tlv320aic23-i2c-objs := tlv320aic23-i2c.o
+snd-soc-tlv320aic23-spi-objs := tlv320aic23-spi.o
 snd-soc-tlv320aic26-objs := tlv320aic26.o
 snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-tlv320aic32x4-objs := tlv320aic32x4.o
@@ -193,6 +195,8 @@ obj-$(CONFIG_SND_SOC_STA529)   += snd-soc-sta529.o
 obj-$(CONFIG_SND_SOC_STAC9766)	+= snd-soc-stac9766.o
 obj-$(CONFIG_SND_SOC_TAS5086)	+= snd-soc-tas5086.o
 obj-$(CONFIG_SND_SOC_TLV320AIC23)	+= snd-soc-tlv320aic23.o
+obj-$(CONFIG_SND_SOC_TLV320AIC23_I2C)	+= snd-soc-tlv320aic23-i2c.o
+obj-$(CONFIG_SND_SOC_TLV320AIC23_SPI)	+= snd-soc-tlv320aic23-spi.o
 obj-$(CONFIG_SND_SOC_TLV320AIC26)	+= snd-soc-tlv320aic26.o
 obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TLV320AIC32X4)     += snd-soc-tlv320aic32x4.o
sound/soc/codecs/tlv320aic23-i2c.c new file +59 -0

59 lines not on this page · raw message

sound/soc/codecs/tlv320aic23-spi.c new file +57 -0

57 lines not on this page · raw message

sound/soc/codecs/tlv320aic23.c +11 -44

96 lines not on this page · raw message

sound/soc/codecs/tlv320aic23.h +6 -0
index e804120..3a7235a 100644
@@ -12,6 +12,12 @@
 #ifndef _TLV320AIC23_H
 #define _TLV320AIC23_H
 
+struct device;
+struct regmap_config;
+
+extern const struct regmap_config tlv320aic23_regmap;
+int tlv320aic23_probe(struct device *dev, struct regmap *regmap);
+
 /* Codec TLV320AIC23 */
 #define TLV320AIC23_LINVOL		0x00
 #define TLV320AIC23_RINVOL		0x01
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH v2 2/2 ASoC: update Kconfig of AIC23 users to select I2C variant

In reply to Max Filippov

Now that AIC23 supports two control interfaces all existing I2C users should select I2C variant.

---
Changes v1->v2:
- new patch.

 sound/soc/atmel/Kconfig   | 2 +-
 sound/soc/cirrus/Kconfig  | 2 +-
 sound/soc/fsl/Kconfig     | 2 +-
 sound/soc/omap/Kconfig    | 4 ++--
 sound/soc/samsung/Kconfig | 2 +-
 sound/soc/tegra/Kconfig   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/atmel/Kconfig +1 -1
index e634eb7..4789619 100644
@@ -58,6 +58,6 @@ config SND_AT91_SOC_AFEB9260
 	depends on ARCH_AT91 && ATMEL_SSC && ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC
 	select SND_ATMEL_SOC_PDC
 	select SND_ATMEL_SOC_SSC
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	help
 	  Say Y here to support sound on AFEB9260 board.
sound/soc/cirrus/Kconfig +1 -1
index 06f938d..a0bf4a6 100644
@@ -18,7 +18,7 @@ config SND_EP93XX_SOC_SNAPPERCL15
         tristate "SoC Audio support for Bluewater Systems Snapper CL15 module"
         depends on SND_EP93XX_SOC && MACH_SNAPPER_CL15
         select SND_EP93XX_SOC_I2S
-        select SND_SOC_TLV320AIC23
+        select SND_SOC_TLV320AIC23_I2C
         help
           Say Y or M here if you want to add support for I2S audio on the
           Bluewater Systems Snapper CL15 module.
sound/soc/fsl/Kconfig +1 -1
index 07f8f14..19a18a4 100644
@@ -170,7 +170,7 @@ config SND_SOC_EUKREA_TLV320
 		|| MACH_EUKREA_MBIMXSD35_BASEBOARD \
 		|| MACH_EUKREA_MBIMXSD51_BASEBOARD
 	depends on I2C
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	select SND_SOC_IMX_PCM_FIQ
 	select SND_SOC_IMX_AUDMUX
 	select SND_SOC_IMX_SSI
sound/soc/omap/Kconfig +2 -2
index 22ad9c5..e006593 100644
@@ -58,7 +58,7 @@ config SND_OMAP_SOC_OSK5912
 	tristate "SoC Audio support for omap osk5912"
 	depends on SND_OMAP_SOC && MACH_OMAP_OSK && I2C
 	select SND_OMAP_SOC_MCBSP
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	help
 	  Say Y if you want to add support for SoC audio on osk5912.
 
@@ -66,7 +66,7 @@ config SND_OMAP_SOC_AM3517EVM
 	tristate "SoC Audio support for OMAP3517 / AM3517 EVM"
 	depends on SND_OMAP_SOC && MACH_OMAP3517EVM && I2C
 	select SND_OMAP_SOC_MCBSP
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	help
 	  Say Y if you want to add support for SoC audio on the OMAP3517 / AM3517
 	  EVM.
sound/soc/samsung/Kconfig +1 -1
index 3507574..f2e2891 100644
@@ -117,7 +117,7 @@ config SND_SOC_SAMSUNG_SIMTEC_TLV320AIC23
 	tristate "SoC I2S Audio support for TLV320AIC23 on Simtec boards"
 	depends on SND_SOC_SAMSUNG && ARCH_S3C24XX
 	select SND_S3C24XX_I2S
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	select SND_SOC_SAMSUNG_SIMTEC
 
 config SND_SOC_SAMSUNG_SIMTEC_HERMES
sound/soc/tegra/Kconfig +1 -1
index 9f9c185..31198cf7 100644
@@ -105,7 +105,7 @@ config SND_SOC_TEGRA_TRIMSLICE
 	tristate "SoC Audio support for TrimSlice board"
 	depends on SND_SOC_TEGRA && I2C
 	select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC
-	select SND_SOC_TLV320AIC23
+	select SND_SOC_TLV320AIC23_I2C
 	help
 	  Say Y or M here if you want to add support for SoC audio on the
 	  TrimSlice platform.
Signature · 1 line
1.8.1.4
maintainer Applied
#3 lore raw
In reply to Max Filippov
Quoted 5 lines · Max Filippov

Hi,

this series splits I2C-specific part of tlv320aic23 codec driver into a separate file and adds SPI control mode support. It also updates Kconfigs of existing tlv320aic23 users so that I2C variant is selected.

Applied both, thanks.