[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.2-164-g0ef82df
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2013-02-15 16:01:00
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 0ef82df1ba031cb97e4301620d7ccf23a67f2e0c (commit)
from d6fb919014755df4552dea08a22f3c95a6bc4314 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0ef82df1ba031cb97e4301620d7ccf23a67f2e0c
Author: Eric Jarrige <eri...@ar...>
Date: Fri Feb 15 17:04:22 2013 +0100
[LINUX] 2.6.38: update apf51_dev board to support wm8960 new audio input/ouput capabilities
-----------------------------------------------------------------------
Summary of changes:
.../408-armadeus-add_apf51-dev_baseboard.patch | 29 ++--
...soc-imx-add_apf51dev_wm8960_audio_support.patch | 179 ++++++++++++++------
2 files changed, 140 insertions(+), 68 deletions(-)
diff --git a/patches/linux/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch b/patches/linux/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
index 2d974ab..7a889aa 100644
--- a/patches/linux/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
+++ b/patches/linux/2.6.38/408-armadeus-add_apf51-dev_baseboard.patch
@@ -4,8 +4,8 @@ Signed-off-by: Julien Boibessot <jul...@ar...>
Index: linux-2.6.38.8/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38.8.orig/arch/arm/mach-mx5/Kconfig 2012-07-20 10:19:29.000000000 +0200
-+++ linux-2.6.38.8/arch/arm/mach-mx5/Kconfig 2012-07-20 14:54:06.000000000 +0200
+--- linux-2.6.38.8/arch/arm/mach-mx5/Kconfig
++++ linux-2.6.38.8/arch/arm/mach-mx5/Kconfig
@@ -175,4 +175,27 @@
Include support for Armadeus systems APF51 System On Module. This
includes specific configurations for the board and its peripherals.
@@ -36,8 +36,8 @@ Index: linux-2.6.38.8/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38.8/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38.8.orig/arch/arm/mach-mx5/Makefile 2012-07-20 10:19:29.000000000 +0200
-+++ linux-2.6.38.8/arch/arm/mach-mx5/Makefile 2012-07-20 14:54:06.000000000 +0200
+--- linux-2.6.38.8/arch/arm/mach-mx5/Makefile
++++ linux-2.6.38.8/arch/arm/mach-mx5/Makefile
@@ -8,6 +8,7 @@
obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -48,9 +48,9 @@ Index: linux-2.6.38.8/arch/arm/mach-mx5/Makefile
obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
Index: linux-2.6.38.8/arch/arm/mach-mx5/apf51dev-baseboard.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.8/arch/arm/mach-mx5/apf51dev-baseboard.c 2012-07-20 13:55:30.000000000 +0200
-@@ -0,0 +1,553 @@
+--- /dev/null
++++ linux-2.6.38.8/arch/arm/mach-mx5/apf51dev-baseboard.c
+@@ -0,0 +1,554 @@
+ /*
+ * Support for APF51's official development baseboard (APF51Dev)
+ *
@@ -356,10 +356,11 @@ Index: linux-2.6.38.8/arch/arm/mach-mx5/apf51dev-baseboard.c
+/* Audio (Wolfson WM8960 connected to I2C & SSI) */
+static struct wm8960_data apf51dev_wm8960_pdata = {
+ .capless = 0, /* Headphone outputs NOT configured in capless mode */
-+// .dres = ??; /* Discharge resistance for headphone outputs */
++ .shared_lrclk = 1,
++ .use_alrcgpio = 1,
+};
+
-+static struct imx_ssi_platform_data apf27dev_ssi_pdata = {
++static struct imx_ssi_platform_data apf51dev_ssi0_pdata = {
+ .flags = IMX_SSI_SYN | IMX_SSI_USE_I2S_SLAVE,
+};
+
@@ -582,14 +583,14 @@ Index: linux-2.6.38.8/arch/arm/mach-mx5/apf51dev-baseboard.c
+ MXC_AUDMUX_V2_PDCR_RXDSEL(MX51_AUDMUX_PORT1_SSI0));
+
+ mxc_audmux_v2_configure_port(MX51_AUDMUX_PORT1_SSI0,
-+ MXC_AUDMUX_V2_PTCR_SYN |
-+ MXC_AUDMUX_V2_PTCR_TCSEL(MX51_AUDMUX_PORT3) |
-+ MXC_AUDMUX_V2_PTCR_TCLKDIR |
++ MXC_AUDMUX_V2_PTCR_TFSDIR |
+ MXC_AUDMUX_V2_PTCR_TFSEL(MX51_AUDMUX_PORT3) |
-+ MXC_AUDMUX_V2_PTCR_TFSDIR,
++ MXC_AUDMUX_V2_PTCR_TCLKDIR |
++ MXC_AUDMUX_V2_PTCR_TCSEL(MX51_AUDMUX_PORT3) |
++ MXC_AUDMUX_V2_PTCR_SYN,
+ MXC_AUDMUX_V2_PDCR_RXDSEL(MX51_AUDMUX_PORT3));
+
-+ imx51_add_imx_ssi(0, &apf27dev_ssi_pdata);
++ imx51_add_imx_ssi(0, &apf51dev_ssi0_pdata);
+
+#if defined(CONFIG_KEYBOARD_IMX) || defined(CONFIG_KEYBOARD_IMX_MODULE)
+ imx51_add_imx_keypad(&apf51dev_keymap_data);
diff --git a/patches/linux/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch b/patches/linux/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
index 361fdba..54c2ec7 100644
--- a/patches/linux/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
+++ b/patches/linux/2.6.38/421-armadeus-asoc-imx-add_apf51dev_wm8960_audio_support.patch
@@ -1,12 +1,12 @@
-Index: linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c
+Index: linux-2.6.38.8/sound/soc/imx/apf51dev-wm8960.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c 2011-04-26 15:42:46.000000000 +0200
-@@ -0,0 +1,162 @@
+--- /dev/null
++++ linux-2.6.38.8/sound/soc/imx/apf51dev-wm8960.c
+@@ -0,0 +1,233 @@
+/*
+ * ASoC audio for APF51Dev (i.MX51 using Wolfson's WM8960)
+ *
-+ * Copyright (C) 2011 Armadeus Systems
++ * Copyright (C) 2011-13 Armadeus Systems
+ *
+ * Based on code which is:
+ * Copyright 2009 Sascha Hauer, Pengutronix <s....@pe...>
@@ -31,11 +31,22 @@ Index: linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c
+#include "../codecs/wm8960.h"
+#include "imx-ssi.h"
+
++static const struct snd_soc_dapm_route audio_map[] = {
++ {"Headphone Jack", NULL, "HP_L" },
++ {"Headphone Jack", NULL, "HP_R" },
++ {"Audio Ext", NULL, "SPK_LP" },
++ {"Audio Ext", NULL, "SPK_LN" },
++ {"Audio Ext", NULL, "SPK_RP" },
++ {"Audio Ext", NULL, "SPK_RN" },
++ {"LINPUT1", NULL, "MICB"},
++ {"LINPUT1", NULL, "Line Input" },
++};
+
-+#define FMT_PLAYBACK (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \
-+ SND_SOC_DAIFMT_CBM_CFM)
-+#define FMT_CAPTURE (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \
-+ SND_SOC_DAIFMT_CBM_CFM)
++static const struct snd_soc_dapm_widget wm8960_dapm_widgets[] = {
++ SND_SOC_DAPM_HP("Headphone Jack", NULL),
++ SND_SOC_DAPM_OUTPUT("Audio Ext"),
++ SND_SOC_DAPM_MIC("Line Input", NULL),
++};
+
+static int apf51dev_sound_hifi_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
@@ -43,88 +54,148 @@ Index: linux-2.6.38.1/sound/soc/imx/apf51dev-wm8960.c
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+ struct snd_soc_dai *codec_dai = rtd->codec_dai;
++ unsigned int rate = params_rate(params);
++ unsigned int pll_clk, dac_clkdiv, adc_clkdiv;
+ int ret;
+
-+ ret = snd_soc_dai_set_pll(codec_dai, 0, 0, 12000000, 12280000);
++ switch (rate) {
++ case 11025:
++ pll_clk = 11289600;
++ dac_clkdiv = WM8960_DAC_DIV_4;
++ adc_clkdiv = WM8960_ADC_DIV_4;
++ break;
++ case 22050:
++ pll_clk = 11289600;
++ dac_clkdiv = WM8960_DAC_DIV_2;
++ adc_clkdiv = WM8960_ADC_DIV_2;
++ break;
++ case 44100:
++ pll_clk = 11289600;
++ dac_clkdiv = WM8960_DAC_DIV_1;
++ adc_clkdiv = WM8960_ADC_DIV_1;
++ break;
++ case 8000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_6;
++ adc_clkdiv = WM8960_ADC_DIV_6;
++ break;
++ case 12000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_4;
++ adc_clkdiv = WM8960_ADC_DIV_4;
++ break;
++ case 16000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_3;
++ adc_clkdiv = WM8960_ADC_DIV_3;
++ break;
++ case 24000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_2;
++ adc_clkdiv = WM8960_ADC_DIV_2;
++ break;
++ case 32000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_1_5;
++ adc_clkdiv = WM8960_ADC_DIV_1_5;
++ break;
++ case 48000:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_1;
++ adc_clkdiv = WM8960_ADC_DIV_1;
++ break;
++ default:
++ pll_clk = 12288000;
++ dac_clkdiv = WM8960_DAC_DIV_1;
++ adc_clkdiv = WM8960_ADC_DIV_1;
++ break;
++
++ }
++ ret = snd_soc_dai_set_pll(codec_dai, 0, 0, 12000000, pll_clk);
++
+ if (ret) {
-+ printk("APF51: Unable to set WM8960 PLL\n");
++ printk(KERN_ERR "APF51: Unable to set WM8960 PLL\n");
+ return ret;
+ }
+
+ /* set cpu DAI configuration */
++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | \
++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
++ if (ret)
++ return ret;
++ ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | \
++ SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
++ if (ret)
++ return ret;
++
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-+ ret = snd_soc_dai_set_fmt(codec_dai, FMT_PLAYBACK);
-+ if (ret)
-+ return ret;
-+ ret = snd_soc_dai_set_fmt(cpu_dai, FMT_PLAYBACK);
-+ if (ret)
-+ return ret;
++ /* set DAC clock diverder */
++ snd_soc_dai_set_clkdiv(codec_dai, WM8960_DACDIV, dac_clkdiv);
++
+ } else {
-+ ret = snd_soc_dai_set_fmt(codec_dai, FMT_CAPTURE);
-+ if (ret)
-+ return ret;
-+ ret = snd_soc_dai_set_fmt(cpu_dai, FMT_CAPTURE);
-+ if (ret)
-+ return ret;
-+/* ret = snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 4, 32);
-+ if (ret)
-+ return ret;*/
++ /* set ADC clock diverder */
++ snd_soc_dai_set_clkdiv(codec_dai, WM8960_ADCDIV, adc_clkdiv);
++ snd_soc_dai_set_clkdiv(codec_dai, WM8960_DACDIV, dac_clkdiv);
+ }
+
-+ ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xfffffffc, 0xfffffffc, 2, 0);
++ ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0xfffffffc, 0xfffffffc, 2, 32);
+ if (ret)
+ return ret;
+
-+ return 0;
-+}
++ /* set BCLK devider */
++ snd_soc_dai_set_clkdiv(codec_dai, WM8960_BCLKDIV, WM8960_BCLK_DIV_4); /* 3 MHz */
+
-+static int apf51dev_sound_hifi_hw_free(struct snd_pcm_substream *substream)
-+{
-+ printk("--- %s %d\n", __func__, __LINE__);
+ return 0;
+}
+
+static struct snd_soc_ops apf51dev_sound_hifi_ops = {
+ .hw_params = apf51dev_sound_hifi_hw_params,
-+ .hw_free = apf51dev_sound_hifi_hw_free,
+};
+
-+static int apf51dev_sound_probe(struct platform_device *pdev)
++static int apf51dev_wm8960_init(struct snd_soc_pcm_runtime *rtd)
+{
-+ printk("--- %s %d\n", __func__, __LINE__);
-+ return 0;
-+}
++ struct snd_soc_codec *codec = rtd->codec;
++ struct snd_soc_dapm_context *dapm = &codec->dapm;
++ int err;
++
++ /* These endpoints are not being used. */
++ snd_soc_dapm_nc_pin(dapm, "LINPUT2");
++ snd_soc_dapm_nc_pin(dapm, "RINPUT2");
++ snd_soc_dapm_nc_pin(dapm, "LINPUT3");
++ snd_soc_dapm_nc_pin(dapm, "RINPUT3");
++ snd_soc_dapm_nc_pin(dapm, "OUT3");
++
++ /* Add jive specific widgets */
++ err = snd_soc_dapm_new_controls(dapm, wm8960_dapm_widgets,
++ ARRAY_SIZE(wm8960_dapm_widgets));
++ if (err) {
++ printk(KERN_ERR "%s: failed to add widgets (%d)\n",
++ __func__, err);
++ return err;
++ }
++
++ snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
++ snd_soc_dapm_sync(dapm);
+
-+static int apf51dev_sound_remove(struct platform_device *pdev)
-+{
-+ printk("--- %s %d\n", __func__, __LINE__);
+ return 0;
+}
+
+static struct snd_soc_dai_link apf51dev_dai_wm8960[] = {
+ {
-+ .name = "WM8960 Playback",
-+ .stream_name = "Playback",
-+ .codec_name = "wm8960-codec.1-001a",
-+ .platform_name = "imx-fiq-pcm-audio.0",
-+ .cpu_dai_name = "imx-ssi.0",
-+ .codec_dai_name = "wm8960-hifi",
-+ .ops = &apf51dev_sound_hifi_ops,
-+ },/* {
-+ .name = "WM8960 Capture",
-+ .stream_name = "Capture",
-+ .codec_name = "wm8960-codec.1-001a",
++ .name = "HiFi",
++ .stream_name = "HiFi",
++ .codec_name = "wm8960.1-001a",
+ .platform_name = "imx-fiq-pcm-audio.0",
+ .cpu_dai_name = "imx-ssi.0",
+ .codec_dai_name = "wm8960-hifi",
+ .ops = &apf51dev_sound_hifi_ops,
-+ },*/
++ .init = &apf51dev_wm8960_init,
++ .symmetric_rates = 1,
++ },
+};
+
+static struct snd_soc_card apf51dev_soc_card = {
+ .name = "APF51Dev-WM8960-audio",
-+ .probe = apf51dev_sound_probe,
-+ .remove = apf51dev_sound_remove,
+ .dai_link = apf51dev_dai_wm8960,
+ .num_links = ARRAY_SIZE(apf51dev_dai_wm8960),
+};
hooks/post-receive
--
armadeus
|