aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/dfbmcs320.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-03-07 08:04:59 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-07 12:20:01 +0000
commita077ff9034897232ab4208f55880221390bd6877 (patch)
tree04ff533fc1bd53c69252efc811523f67e2fc9a39 /sound/soc/codecs/dfbmcs320.c
parentf5c4ffbd65892829f7ec503a89ea24eb0fc952dc (diff)
ASoC: Add driver for the dfbmcs320 bluetooth module
This patch adds a codec driver for the dfbmcs320 bluetooth module, which is used on the neo1973 boards. The patch also modifies the neo1937_wm8753 sound board driver to use the new driver instead of registering the bluetooth DAI manually. Previously there was a name mismatch between the bluetooth DAI and the bluetooth DAI link and the sound card was not instantiated, with this patch the issue is no longer present and sound support works again. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/dfbmcs320.c')
-rw-r--r--sound/soc/codecs/dfbmcs320.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/sound/soc/codecs/dfbmcs320.c b/sound/soc/codecs/dfbmcs320.c
new file mode 100644
index 00000000000..704bbde6573
--- /dev/null
+++ b/sound/soc/codecs/dfbmcs320.c
@@ -0,0 +1,72 @@
+/*
+ * Driver for the DFBM-CS320 bluetooth module
+ * Copyright 2011 Lars-Peter Clausen <lars@metafoo.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <sound/soc.h>
+
+static struct snd_soc_dai_driver dfbmcs320_dai = {
+ .name = "dfbmcs320-pcm",
+ .playback = {
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_8000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .capture = {
+ .channels_min = 1,
+ .channels_max = 1,
+ .rates = SNDRV_PCM_RATE_8000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+};
+
+static struct snd_soc_codec_driver soc_codec_dev_dfbmcs320;
+
+static int __devinit dfbmcs320_probe(struct platform_device *pdev)
+{
+ return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_dfbmcs320,
+ &dfbmcs320_dai, 1);
+}
+
+static int __devexit dfbmcs320_remove(struct platform_device *pdev)
+{
+ snd_soc_unregister_codec(&pdev->dev);
+
+ return 0;
+}
+
+static struct platform_driver dfmcs320_driver = {
+ .driver = {
+ .name = "dfbmcs320",
+ .owner = THIS_MODULE,
+ },
+ .probe = dfbmcs320_probe,
+ .remove = __devexit_p(dfbmcs320_remove),
+};
+
+static int __init dfbmcs320_init(void)
+{
+ return platform_driver_register(&dfmcs320_driver);
+}
+module_init(dfbmcs320_init);
+
+static void __exit dfbmcs320_exit(void)
+{
+ platform_driver_unregister(&dfmcs320_driver);
+}
+module_exit(dfbmcs320_exit);
+
+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
+MODULE_DESCRIPTION("ASoC DFBM-CS320 bluethooth module driver");
+MODULE_LICENSE("GPL");