Skip to contentSkip to conversation

ASoC: pxa add Marvell Littleton platform audio support

PATCH In review Eric Miao 2 participants 3 messages Jun 3, 2009 – Jun 4, 2009

Subsystems (3)
lore
Share & tools
lore

Eric Miao

author
#0 lore raw

PATCH 3/4 ASoC: pxa add Marvell Littleton platform audio support

---
 sound/soc/pxa/Kconfig     |    9 ++
 sound/soc/pxa/Makefile    |    2 +
 sound/soc/pxa/littleton.c |  228 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 239 insertions(+), 0 deletions(-)
 create mode 100644 sound/soc/pxa/littleton.c
sound/soc/pxa/Kconfig +9 -0
index ad8a10f..a4ad5ba 100644
@@ -134,3 +134,12 @@ config SND_PXA2XX_SOC_MIOA701
         help
           Say Y if you want to add support for SoC audio on the
           MIO A701.
+
+config SND_PXA2XX_SOC_LITTLETON
+        tristate "SoC Audio support for Marvell littleton"
+        depends on SND_PXA2XX_SOC && MACH_LITTLETON
+        select SND_PXA_SOC_SSP
+        select SND_SOC_DA9034
+        help
+          Say Y if you want to add support for SoC audio on the
+          Marvell Littleton.
sound/soc/pxa/Makefile +2 -0
index 4b90c3c..94c719d 100644
@@ -22,6 +22,7 @@ snd-soc-palm27x-objs := palm27x.o
 snd-soc-zylonite-objs := zylonite.o
 snd-soc-magician-objs := magician.o
 snd-soc-mioa701-objs := mioa701_wm9713.o
+snd-soc-littleton-objs := littleton.o
 
 obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
 obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
@@ -34,4 +35,5 @@ obj-$(CONFIG_SND_PXA2XX_SOC_EM_X270) += snd-soc-em-x270.o
 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_LITTLETON) += snd-soc-littleton.o
 obj-$(CONFIG_SND_SOC_ZYLONITE) += snd-soc-zylonite.o
sound/soc/pxa/littleton.c new file +228 -0

228 lines not on this page · raw message

Signature · 1 line
1.6.0.4
#2 lore raw
In reply to Eric Miao

On Wed, Jun 03, 2009 at 08:35:23PM +0800, Eric Miao wrote:

Sorry, missed a couple of things earlier:

sound/soc/pxa/littleton.c line 46

Quoted 10 lines
sound/soc/pxa/littleton.c new file +10 -0
+static const char *hifi_mode_select[] = {
+	"HIFI 64FS LEFT_J, SSP CLK Master FRM Master",
+	"HIFI 64FS I2S ,   SSP CLK Master FRM Master",
+	"HIFI 32FS LEFT_J, SSP CLK Master FRM Master",
+	"HIFI 32FS I2S ,   SSP CLK Master FRM Master",
+};
+
+static const struct soc_enum littleton_enum[] = {
+	SOC_ENUM_SINGLE_EXT(4, hifi_mode_select),
+};

BTW, for this control you really should add a comment explaining that this is for test purposes only and that normal systems would not wish to expose this control to applications but should just pick a suitable configuration.

Quoted 7 lines
sound/soc/pxa/littleton.c new file +7 -0
+static int littleton_hifi_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->dai->codec_dai;
+	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+	struct ssp_clk_div *clkdiv;

sound/soc/pxa/littleton.c line 119

Quoted 10 lines
sound/soc/pxa/littleton.c new file +10 -0
+	struct clk *clk_pout;
+	int format;
+
+	clk_pout = clk_get(NULL, "CLK_POUT");
+	if (IS_ERR(clk_pout)) {
+		pr_err("failed to get POUT clock\n");
+		return PTR_ERR(clk_pout);
+	}
+
+	clk_enable(clk_pout);

At the minute clk_put is never released.

hw_params() can be repeatedly called while the stream is open, especially by OSS emulation. You should acquire the clock once at driver startup time and probably move the enable and disable to startup() and shutdown().