Merge branch 'topic/tlv320aic23' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorMark Brown <broonie@linaro.org>
Fri, 7 Mar 2014 03:05:07 +0000 (11:05 +0800)
committerMark Brown <broonie@linaro.org>
Fri, 7 Mar 2014 03:05:07 +0000 (11:05 +0800)
Conflicts:
sound/soc/fsl/Kconfig

12 files changed:
sound/soc/atmel/Kconfig
sound/soc/cirrus/Kconfig
sound/soc/codecs/Kconfig
sound/soc/codecs/Makefile
sound/soc/codecs/tlv320aic23-i2c.c [new file with mode: 0644]
sound/soc/codecs/tlv320aic23-spi.c [new file with mode: 0644]
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic23.h
sound/soc/fsl/Kconfig
sound/soc/omap/Kconfig
sound/soc/samsung/Kconfig
sound/soc/tegra/Kconfig

index e634eb78ed03be1c76e2782c1215fd84f208e4da..4789619a52d86dc38b8da2222b11cbda50dd0a8c 100644 (file)
@@ -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.
index 06f938deda15bd0d888e7e6140d54f10ec9331b5..a0bf4a6103971f2cabe6fe6a9ce26d89c98a886e 100644 (file)
@@ -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.
index 983d087aa92aa83125903dc18cd420f57c2009eb..5e4fc048d42aee069ae488e51622d80fa21412ac 100644 (file)
@@ -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
index bc126764a44d02cb38b50f3ae74900a9ce490da2..ed1fd8925e43985e368ef6138104e93fc4085578 100644 (file)
@@ -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
diff --git a/sound/soc/codecs/tlv320aic23-i2c.c b/sound/soc/codecs/tlv320aic23-i2c.c
new file mode 100644 (file)
index 0000000..20fc460
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * ALSA SoC TLV320AIC23 codec driver I2C interface
+ *
+ * Author:      Arun KS, <arunks@mistralsolutions.com>
+ * Copyright:   (C) 2008 Mistral Solutions Pvt Ltd.,
+ *
+ * Based on sound/soc/codecs/wm8731.c by Richard Purdie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/regmap.h>
+#include <sound/soc.h>
+
+#include "tlv320aic23.h"
+
+static int tlv320aic23_i2c_probe(struct i2c_client *i2c,
+                                const struct i2c_device_id *i2c_id)
+{
+       struct regmap *regmap;
+
+       if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+               return -EINVAL;
+
+       regmap = devm_regmap_init_i2c(i2c, &tlv320aic23_regmap);
+       return tlv320aic23_probe(&i2c->dev, regmap);
+}
+
+static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c)
+{
+       snd_soc_unregister_codec(&i2c->dev);
+       return 0;
+}
+
+static const struct i2c_device_id tlv320aic23_id[] = {
+       {"tlv320aic23", 0},
+       {}
+};
+
+MODULE_DEVICE_TABLE(i2c, tlv320aic23_id);
+
+static struct i2c_driver tlv320aic23_i2c_driver = {
+       .driver = {
+                  .name = "tlv320aic23-codec",
+                  },
+       .probe = tlv320aic23_i2c_probe,
+       .remove = __exit_p(tlv320aic23_i2c_remove),
+       .id_table = tlv320aic23_id,
+};
+
+module_i2c_driver(tlv320aic23_i2c_driver);
+
+MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver I2C");
+MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/tlv320aic23-spi.c b/sound/soc/codecs/tlv320aic23-spi.c
new file mode 100644 (file)
index 0000000..585aea4
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * ALSA SoC TLV320AIC23 codec driver SPI interface
+ *
+ * Author:      Arun KS, <arunks@mistralsolutions.com>
+ * Copyright:   (C) 2008 Mistral Solutions Pvt Ltd.,
+ *
+ * Based on sound/soc/codecs/wm8731.c by Richard Purdie
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/regmap.h>
+#include <linux/spi/spi.h>
+#include <sound/soc.h>
+
+#include "tlv320aic23.h"
+
+static int aic23_spi_probe(struct spi_device *spi)
+{
+       int ret;
+       struct regmap *regmap;
+
+       dev_dbg(&spi->dev, "probing tlv320aic23 spi device\n");
+
+       spi->bits_per_word = 16;
+       spi->mode = SPI_MODE_0;
+       ret = spi_setup(spi);
+       if (ret < 0)
+               return ret;
+
+       regmap = devm_regmap_init_spi(spi, &tlv320aic23_regmap);
+       return tlv320aic23_probe(&spi->dev, regmap);
+}
+
+static int aic23_spi_remove(struct spi_device *spi)
+{
+       snd_soc_unregister_codec(&spi->dev);
+       return 0;
+}
+
+static struct spi_driver aic23_spi = {
+       .driver = {
+               .name = "tlv320aic23",
+               .owner = THIS_MODULE,
+       },
+       .probe = aic23_spi_probe,
+       .remove = aic23_spi_remove,
+};
+
+module_spi_driver(aic23_spi);
+
+MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver SPI");
+MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
+MODULE_LICENSE("GPL");
index 5d430cc56f51d42397c3190bf3bfb55b7f850dae..ab369ae76b8c6638b1a94016e246c604ebfb0bc7 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/pm.h>
-#include <linux/i2c.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
 #include <sound/core.h>
@@ -51,7 +50,7 @@ static const struct reg_default tlv320aic23_reg[] = {
        {  9, 0x0000 },
 };
 
-static const struct regmap_config tlv320aic23_regmap = {
+const struct regmap_config tlv320aic23_regmap = {
        .reg_bits = 7,
        .val_bits = 9,
 
@@ -64,16 +63,16 @@ static const struct regmap_config tlv320aic23_regmap = {
 static const char *rec_src_text[] = { "Line", "Mic" };
 static const char *deemph_text[] = {"None", "32Khz", "44.1Khz", "48Khz"};
 
-static const struct soc_enum rec_src_enum =
-       SOC_ENUM_SINGLE(TLV320AIC23_ANLG, 2, 2, rec_src_text);
+static SOC_ENUM_SINGLE_DECL(rec_src_enum,
+                           TLV320AIC23_ANLG, 2, rec_src_text);
 
 static const struct snd_kcontrol_new tlv320aic23_rec_src_mux_controls =
 SOC_DAPM_ENUM("Input Select", rec_src_enum);
 
-static const struct soc_enum tlv320aic23_rec_src =
-       SOC_ENUM_SINGLE(TLV320AIC23_ANLG, 2, 2, rec_src_text);
-static const struct soc_enum tlv320aic23_deemph =
-       SOC_ENUM_SINGLE(TLV320AIC23_DIGT, 1, 4, deemph_text);
+static SOC_ENUM_SINGLE_DECL(tlv320aic23_rec_src,
+                           TLV320AIC23_ANLG, 2, rec_src_text);
+static SOC_ENUM_SINGLE_DECL(tlv320aic23_deemph,
+                           TLV320AIC23_DIGT, 1, deemph_text);
 
 static const DECLARE_TLV_DB_SCALE(out_gain_tlv, -12100, 100, 0);
 static const DECLARE_TLV_DB_SCALE(input_gain_tlv, -1725, 75, 0);
@@ -557,7 +556,7 @@ static int tlv320aic23_resume(struct snd_soc_codec *codec)
        return 0;
 }
 
-static int tlv320aic23_probe(struct snd_soc_codec *codec)
+static int tlv320aic23_codec_probe(struct snd_soc_codec *codec)
 {
        int ret;
 
@@ -604,7 +603,7 @@ static int tlv320aic23_remove(struct snd_soc_codec *codec)
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_tlv320aic23 = {
-       .probe = tlv320aic23_probe,
+       .probe = tlv320aic23_codec_probe,
        .remove = tlv320aic23_remove,
        .suspend = tlv320aic23_suspend,
        .resume = tlv320aic23_resume,
@@ -617,57 +616,25 @@ static struct snd_soc_codec_driver soc_codec_dev_tlv320aic23 = {
        .num_dapm_routes = ARRAY_SIZE(tlv320aic23_intercon),
 };
 
-/*
- * If the i2c layer weren't so broken, we could pass this kind of data
- * around
- */
-static int tlv320aic23_codec_probe(struct i2c_client *i2c,
-                                  const struct i2c_device_id *i2c_id)
+int tlv320aic23_probe(struct device *dev, struct regmap *regmap)
 {
        struct aic23 *aic23;
-       int ret;
 
-       if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
-               return -EINVAL;
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
 
-       aic23 = devm_kzalloc(&i2c->dev, sizeof(struct aic23), GFP_KERNEL);
+       aic23 = devm_kzalloc(dev, sizeof(struct aic23), GFP_KERNEL);
        if (aic23 == NULL)
                return -ENOMEM;
 
-       aic23->regmap = devm_regmap_init_i2c(i2c, &tlv320aic23_regmap);
-       if (IS_ERR(aic23->regmap))
-               return PTR_ERR(aic23->regmap);
+       aic23->regmap = regmap;
 
-       i2c_set_clientdata(i2c, aic23);
+       dev_set_drvdata(dev, aic23);
 
-       ret =  snd_soc_register_codec(&i2c->dev,
-                       &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1);
-       return ret;
-}
-static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c)
-{
-       snd_soc_unregister_codec(&i2c->dev);
-       return 0;
+       return snd_soc_register_codec(dev, &soc_codec_dev_tlv320aic23,
+                                     &tlv320aic23_dai, 1);
 }
 
-static const struct i2c_device_id tlv320aic23_id[] = {
-       {"tlv320aic23", 0},
-       {}
-};
-
-MODULE_DEVICE_TABLE(i2c, tlv320aic23_id);
-
-static struct i2c_driver tlv320aic23_i2c_driver = {
-       .driver = {
-                  .name = "tlv320aic23-codec",
-                  },
-       .probe = tlv320aic23_codec_probe,
-       .remove = __exit_p(tlv320aic23_i2c_remove),
-       .id_table = tlv320aic23_id,
-};
-
-module_i2c_driver(tlv320aic23_i2c_driver);
-
 MODULE_DESCRIPTION("ASoC TLV320AIC23 codec driver");
 MODULE_AUTHOR("Arun KS <arunks@mistralsolutions.com>");
 MODULE_LICENSE("GPL");
index e804120bd3da3bae2354fe5bfd46809d93f561cb..3a7235a04a8966ea28a6cf31983ac2af892f5e17 100644 (file)
 #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
index c26ff3441f4376b8792a200cb393ffe3982c92dc..269cb7e8164cc5301683785d695be920b744d397 100644 (file)
@@ -171,7 +171,7 @@ config SND_SOC_EUKREA_TLV320
                || MACH_EUKREA_MBIMXSD51_BASEBOARD \
                || (OF && ARM)
        depends on I2C
-       select SND_SOC_TLV320AIC23
+       select SND_SOC_TLV320AIC23_I2C
        select SND_SOC_IMX_AUDMUX
        select SND_SOC_IMX_SSI
        select SND_SOC_FSL_SSI
index 22ad9c5654b5ebea99b6aecbc0b4271af62ef3e1..e00659351a4e2279a539a0a26a1117fa196419bb 100644 (file)
@@ -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.
index 454f41cfc82847e98a6297b2db5822db35d717a6..47a7a1b633aeebdddefdc0a9ff32b5c15b34e14f 100644 (file)
@@ -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
index 9f9c1856f822588b60843765cb4e57ec1eef9176..31198cf7f88d93829c2ccb7c7c5118583250f0b0 100644 (file)
@@ -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.
This page took 0.033814 seconds and 5 git commands to generate.