Diff
Modified: trunk/sound/soc/codecs/Kconfig (8507 => 8508)
--- trunk/sound/soc/codecs/Kconfig 2010-03-19 03:13:24 UTC (rev 8507)
+++ trunk/sound/soc/codecs/Kconfig 2010-03-19 04:09:15 UTC (rev 8508)
@@ -13,9 +13,7 @@
select SND_SOC_L3
select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
select SND_SOC_AD183X if SPI_MASTER
- select SND_SOC_AD193X
- select SND_SOC_AD193X_SPI if SPI_MASTER
- select SND_SOC_AD193X_I2C if I2C
+ select SND_SOC_AD193X if SND_SOC_I2C_AND_SPI
select SND_SOC_AD1980 if SND_SOC_AC97_BUS
select SND_SOC_ADS117X
select SND_SOC_AD73311 if I2C
@@ -94,12 +92,6 @@
config SND_SOC_AD193X
tristate
-config SND_SOC_AD193X_SPI
- tristate
-
-config SND_SOC_AD193X_I2C
- tristate
-
config SND_SOC_AD1980
tristate
Modified: trunk/sound/soc/codecs/Makefile (8507 => 8508)
--- trunk/sound/soc/codecs/Makefile 2010-03-19 03:13:24 UTC (rev 8507)
+++ trunk/sound/soc/codecs/Makefile 2010-03-19 04:09:15 UTC (rev 8508)
@@ -1,8 +1,6 @@
snd-soc-ac97-objs := ac97.o
snd-soc-ad183x-objs := ad183x.o
snd-soc-ad193x-objs := ad193x.o
-snd-soc-ad193x-spi-objs := ad193x-spi.o
-snd-soc-ad193x-i2c-objs := ad193x-i2c.o
snd-soc-ad1980-objs := ad1980.o
snd-soc-ad73311-objs := ad73311.o
snd-soc-adau1361-objs := adau1361.o
@@ -64,8 +62,6 @@
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AD183X) += snd-soc-ad183x.o
obj-$(CONFIG_SND_SOC_AD193X) += snd-soc-ad193x.o
-obj-$(CONFIG_SND_SOC_AD193X_SPI)+= snd-soc-ad193x-spi.o
-obj-$(CONFIG_SND_SOC_AD193X_I2C)+= snd-soc-ad193x-i2c.o
obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o
obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
obj-$(CONFIG_SND_SOC_ADAU1361) += snd-soc-adau1361.o
Deleted: trunk/sound/soc/codecs/ad193x-i2c.c (8507 => 8508)
--- trunk/sound/soc/codecs/ad193x-i2c.c 2010-03-19 03:13:24 UTC (rev 8507)
+++ trunk/sound/soc/codecs/ad193x-i2c.c 2010-03-19 04:09:15 UTC (rev 8508)
@@ -1,56 +0,0 @@
-/*
- * AD193X Audio Codec I2C bus driver
- *
- * Copyright 2010 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/i2c.h>
-#include <sound/soc.h>
-#include "ad193x.h"
-
-static int __devinit ad193x_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
-{
- return ad193x_bus_probe(&client->dev, client, SND_SOC_I2C);
-}
-
-static int __devexit ad193x_i2c_remove(struct i2c_client *client)
-{
- return ad193x_bus_remove(&client->dev);
-}
-
-static const struct i2c_device_id ad193x_id[] = {
- { "ad1937", 0 },
- { }
-};
-MODULE_DEVICE_TABLE(i2c, ad193x_id);
-
-static struct i2c_driver ad193x_i2c_driver = {
- .driver = {
- .name = "ad193x",
- },
- .probe = ad193x_i2c_probe,
- .remove = __devexit_p(ad193x_i2c_remove),
- .id_table = ad193x_id,
-};
-
-static __init int ad193x_i2c_init(void)
-{
- return i2c_add_driver(&ad193x_i2c_driver);
-}
-module_init(ad193x_i2c_init);
-
-static __exit void ad193x_i2c_exit(void)
-{
- i2c_del_driver(&ad193x_i2c_driver);
-}
-module_exit(ad193x_i2c_exit);
-
-MODULE_DESCRIPTION("ASoC ad193x i2c driver");
-MODULE_AUTHOR("Barry Song <[email protected]>");
-MODULE_LICENSE("GPL");
Deleted: trunk/sound/soc/codecs/ad193x-spi.c (8507 => 8508)
--- trunk/sound/soc/codecs/ad193x-spi.c 2010-03-19 03:13:24 UTC (rev 8507)
+++ trunk/sound/soc/codecs/ad193x-spi.c 2010-03-19 04:09:15 UTC (rev 8508)
@@ -1,49 +0,0 @@
-/*
- * AD193X Audio Codec SPI bus driver
- *
- * Copyright 2010 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/spi/spi.h>
-#include <sound/soc.h>
-#include "ad193x.h"
-
-static int __devinit ad193x_spi_probe(struct spi_device *spi)
-{
- return ad193x_bus_probe(&spi->dev, spi, SND_SOC_SPI);
-}
-
-static int __devexit ad193x_spi_remove(struct spi_device *spi)
-{
- return ad193x_bus_remove(&spi->dev);
-}
-
-static struct spi_driver ad193x_spi_driver = {
- .driver = {
- .name = "ad193x",
- .owner = THIS_MODULE,
- },
- .probe = ad193x_spi_probe,
- .remove = __devexit_p(ad193x_spi_remove),
-};
-
-static int __init ad193x_spi_init(void)
-{
- return spi_register_driver(&ad193x_spi_driver);
-}
-module_init(ad193x_spi_init);
-
-static void __exit ad193x_spi_exit(void)
-{
- spi_unregister_driver(&ad193x_spi_driver);
-}
-module_exit(ad193x_spi_exit);
-
-MODULE_DESCRIPTION("ASoC ad193x spi driver");
-MODULE_AUTHOR("Barry Song <[email protected]>");
-MODULE_LICENSE("GPL");
Modified: trunk/sound/soc/codecs/ad193x.c (8507 => 8508)
--- trunk/sound/soc/codecs/ad193x.c 2010-03-19 03:13:24 UTC (rev 8507)
+++ trunk/sound/soc/codecs/ad193x.c 2010-03-19 04:09:15 UTC (rev 8508)
@@ -10,6 +10,8 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
+#include <linux/i2c.h>
+#include <linux/spi/spi.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -468,6 +470,91 @@
};
EXPORT_SYMBOL_GPL(soc_codec_dev_ad193x);
+#if defined(CONFIG_SPI_MASTER)
+static int __devinit ad193x_spi_probe(struct spi_device *spi)
+{
+ return ad193x_bus_probe(&spi->dev, spi, SND_SOC_SPI);
+}
+
+static int __devexit ad193x_spi_remove(struct spi_device *spi)
+{
+ return ad193x_bus_remove(&spi->dev);
+}
+
+static struct spi_driver ad193x_spi_driver = {
+ .driver = {
+ .name = "ad193x",
+ .owner = THIS_MODULE,
+ },
+ .probe = ad193x_spi_probe,
+ .remove = __devexit_p(ad193x_spi_remove),
+};
+#endif
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+static const struct i2c_device_id ad193x_id[] = {
+ { "ad1936", 0 },
+ { "ad1937", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, ad193x_id);
+
+static int __devinit ad193x_i2c_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ return ad193x_bus_probe(&client->dev, client, SND_SOC_I2C);
+}
+
+static int __devexit ad193x_i2c_remove(struct i2c_client *client)
+{
+ return ad193x_bus_remove(&client->dev);
+}
+
+static struct i2c_driver ad193x_i2c_driver = {
+ .driver = {
+ .name = "ad193x",
+ },
+ .probe = ad193x_i2c_probe,
+ .remove = __devexit_p(ad193x_i2c_remove),
+ .id_table = ad193x_id,
+};
+#endif
+
+static int __init ad193x_modinit(void)
+{
+ int ret;
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ ret = i2c_add_driver(&ad193x_i2c_driver);
+ if (ret != 0) {
+ printk(KERN_ERR "Failed to register AD193X I2C driver: %d\n",
+ ret);
+ }
+#endif
+
+#if defined(CONFIG_SPI_MASTER)
+ ret = spi_register_driver(&ad193x_spi_driver);
+ if (ret != 0) {
+ printk(KERN_ERR "Failed to register AD193X SPI driver: %d\n",
+ ret);
+ }
+#endif
+ return ret;
+}
+module_init(ad193x_modinit);
+
+static void __exit ad193x_modexit(void)
+{
+#if defined(CONFIG_SPI_MASTER)
+ spi_unregister_driver(&ad193x_spi_driver);
+#endif
+
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ i2c_del_driver(&ad193x_i2c_driver);
+#endif
+}
+module_exit(ad193x_modexit);
+
MODULE_DESCRIPTION("ASoC ad193x driver");
MODULE_AUTHOR("Barry Song <[email protected]>");
MODULE_LICENSE("GPL");