[tip:core/locking] ASoC: add saarb machine driver for 88pm860x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  b6905d0b1652efddb96cefdb3c8552cac8d98ed2
Gitweb:     http://git.kernel.org/tip/b6905d0b1652efddb96cefdb3c8552cac8d98ed2
Author:     Haojian Zhuang <haojian.zhuang@xxxxxxxxx>
AuthorDate: Thu, 19 Aug 2010 00:36:30 +0800
Committer:  Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
CommitDate: Wed, 18 Aug 2010 18:04:55 +0100

ASoC: add saarb machine driver for 88pm860x

88PM860x codec is used in Marvell saarb development board. 88PM860x codec
is used as master mode for SSP communication. Only I2S format is supported.

Signed-off-by: Haojian Zhuang <haojian.zhuang@xxxxxxxxxxx>
Acked-by: Liam Girdwood <lrg@xxxxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
 sound/soc/pxa/Kconfig                  |    9 ++++
 sound/soc/pxa/Makefile                 |    2 +
 sound/soc/pxa/{tavorevb3.c => saarb.c} |   70 ++++++++++++++++----------------
 3 files changed, 46 insertions(+), 35 deletions(-)

diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 04ddc7b..37f191b 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -117,6 +117,15 @@ config SND_PXA2XX_SOC_PALM27X
 	  Say Y if you want to add support for SoC audio on
 	  Palm T|X, T5, E2 or LifeDrive handheld computer.
 
+config SND_SOC_SAARB
+	tristate "SoC Audio support for Marvell Saarb"
+	depends on SND_PXA2XX_SOC && MACH_SAARB
+	select SND_PXA_SOC_SSP
+	select SND_SOC_88PM860X
+	help
+	  Say Y if you want to add support for SoC audio on the
+	  Marvell Saarb reference platform.
+
 config SND_SOC_TAVOREVB3
 	tristate "SoC Audio support for Marvell Tavor EVB3"
 	depends on SND_PXA2XX_SOC && MACH_TAVOREVB3
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 315941f..0766016 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -19,6 +19,7 @@ snd-soc-e800-objs := e800_wm9712.o
 snd-soc-spitz-objs := spitz.o
 snd-soc-em-x270-objs := em-x270.o
 snd-soc-palm27x-objs := palm27x.o
+snd-soc-saarb-objs := saarb.o
 snd-soc-tavorevb3-objs := tavorevb3.o
 snd-soc-zylonite-objs := zylonite.o
 snd-soc-magician-objs := magician.o
@@ -39,6 +40,7 @@ obj-$(CONFIG_SND_PXA2XX_SOC_PALM27X) += snd-soc-palm27x.o
 obj-$(CONFIG_SND_PXA2XX_SOC_MAGICIAN) += snd-soc-magician.o
 obj-$(CONFIG_SND_PXA2XX_SOC_MIOA701) += snd-soc-mioa701.o
 obj-$(CONFIG_SND_PXA2XX_SOC_Z2) += snd-soc-z2.o
+obj-$(CONFIG_SND_SOC_SAARB) += snd-soc-saarb.o
 obj-$(CONFIG_SND_SOC_TAVOREVB3) += snd-soc-tavorevb3.o
 obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
 obj-$(CONFIG_SND_PXA2XX_SOC_IMOTE2) += snd-soc-imote2.o
diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/saarb.c
similarity index 73%
copy from sound/soc/pxa/tavorevb3.c
copy to sound/soc/pxa/saarb.c
index 248c283..d63cb47 100644
--- a/sound/soc/pxa/tavorevb3.c
+++ b/sound/soc/pxa/saarb.c
@@ -1,5 +1,5 @@
 /*
- * tavorevb3.c -- SoC audio for Tavor EVB3
+ * saarb.c -- SoC audio for saarb
  *
  * Copyright (C) 2010 Marvell International Ltd.
  * 	Haojian Zhuang <haojian.zhuang@xxxxxxxxxxx>
@@ -26,9 +26,9 @@
 #include "../codecs/88pm860x-codec.h"
 #include "pxa-ssp.h"
 
-static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd);
+static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd);
 
-static struct platform_device *evb3_snd_device;
+static struct platform_device *saarb_snd_device;
 
 static struct snd_soc_jack hs_jack, mic_jack;
 
@@ -40,18 +40,18 @@ static struct snd_soc_jack_pin mic_jack_pins[] = {
 	{ .pin = "Headset Mic 2",	.mask = SND_JACK_MICROPHONE, },
 };
 
-/* tavorevb3 machine dapm widgets */
-static const struct snd_soc_dapm_widget evb3_dapm_widgets[] = {
-	SND_SOC_DAPM_HP("Headset Stereophone", NULL),
+/* saarb machine dapm widgets */
+static const struct snd_soc_dapm_widget saarb_dapm_widgets[] = {
+	SND_SOC_DAPM_HP("Headphone Stereophone", NULL),
 	SND_SOC_DAPM_LINE("Lineout Out 1", NULL),
 	SND_SOC_DAPM_LINE("Lineout Out 2", NULL),
 	SND_SOC_DAPM_SPK("Ext Speaker", NULL),
 	SND_SOC_DAPM_MIC("Ext Mic 1", NULL),
-	SND_SOC_DAPM_MIC("Headset Mic 2", NULL),
+	SND_SOC_DAPM_MIC("Headset Mic", NULL),
 	SND_SOC_DAPM_MIC("Ext Mic 3", NULL),
 };
 
-/* tavorevb3 machine audio map */
+/* saarb machine audio map */
 static const struct snd_soc_dapm_route audio_map[] = {
 	{"Headset Stereophone", NULL, "HS1"},
 	{"Headset Stereophone", NULL, "HS2"},
@@ -75,8 +75,8 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"Mic3 Bias", NULL, "Ext Mic 3"},
 };
 
-static int evb3_i2s_hw_params(struct snd_pcm_substream *substream,
-			      struct snd_pcm_hw_params *params)
+static int saarb_i2s_hw_params(struct snd_pcm_substream *substream,
+				struct snd_pcm_hw_params *params)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
@@ -97,21 +97,21 @@ static int evb3_i2s_hw_params(struct snd_pcm_substream *substream,
 			SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
 	if (ret < 0)
 		return ret;
-
 	ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
 			SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
 	if (ret < 0)
 		return ret;
 
 	ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width);
+
 	return ret;
 }
 
-static struct snd_soc_ops evb3_i2s_ops = {
-	.hw_params	= evb3_i2s_hw_params,
+static struct snd_soc_ops saarb_i2s_ops = {
+	.hw_params	= saarb_i2s_hw_params,
 };
 
-static struct snd_soc_dai_link evb3_dai[] = {
+static struct snd_soc_dai_link saarb_dai[] = {
 	{
 		.name		= "88PM860x I2S",
 		.stream_name	= "I2S Audio",
@@ -119,24 +119,24 @@ static struct snd_soc_dai_link evb3_dai[] = {
 		.codec_dai_name	= "88pm860x-i2s",
 		.platform_name	= "pxa-pcm-audio",
 		.codec_name	= "88pm860x-codec",
-		.init		= evb3_pm860x_init,
-		.ops		= &evb3_i2s_ops,
+		.init		= saarb_pm860x_init,
+		.ops		= &saarb_i2s_ops,
 	},
 };
 
-static struct snd_soc_card snd_soc_card_evb3 = {
-	.name = "Tavor EVB3",
-	.dai_link = evb3_dai,
-	.num_links = ARRAY_SIZE(evb3_dai),
+static struct snd_soc_card snd_soc_card_saarb = {
+	.name = "Saarb",
+	.dai_link = saarb_dai,
+	.num_links = ARRAY_SIZE(saarb_dai),
 };
 
-static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd)
+static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_codec *codec = rtd->codec;
 	int ret;
 
-	snd_soc_dapm_new_controls(codec, evb3_dapm_widgets,
-				  ARRAY_SIZE(evb3_dapm_widgets));
+	snd_soc_dapm_new_controls(codec, saarb_dapm_widgets,
+				  ARRAY_SIZE(saarb_dapm_widgets));
 	snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
 
 	/* connected pins */
@@ -168,33 +168,33 @@ static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-static int __init tavorevb3_init(void)
+static int __init saarb_init(void)
 {
 	int ret;
 
-	if (!machine_is_tavorevb3())
+	if (!machine_is_saarb())
 		return -ENODEV;
-	evb3_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!evb3_snd_device)
+	saarb_snd_device = platform_device_alloc("soc-audio", -1);
+	if (!saarb_snd_device)
 		return -ENOMEM;
 
-	platform_set_drvdata(evb3_snd_device, &snd_soc_card_evb3);
+	platform_set_drvdata(saarb_snd_device, &snd_soc_card_saarb);
 
-	ret = platform_device_add(evb3_snd_device);
+	ret = platform_device_add(saarb_snd_device);
 	if (ret)
-		platform_device_put(evb3_snd_device);
+		platform_device_put(saarb_snd_device);
 
 	return ret;
 }
 
-static void __exit tavorevb3_exit(void)
+static void __exit saarb_exit(void)
 {
-	platform_device_unregister(evb3_snd_device);
+	platform_device_unregister(saarb_snd_device);
 }
 
-module_init(tavorevb3_init);
-module_exit(tavorevb3_exit);
+module_init(saarb_init);
+module_exit(saarb_exit);
 
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@xxxxxxxxxxx>");
-MODULE_DESCRIPTION("ALSA SoC 88PM860x Tavor EVB3");
+MODULE_DESCRIPTION("ALSA SoC 88PM860x Saarb");
 MODULE_LICENSE("GPL");
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux