diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-03-16 12:38:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-16 12:38:41 -0400 |
commit | 27b92d4ff2be2359a21ff4acde5b63563ff720e2 (patch) | |
tree | 49691b22fe1318aa68d5ebdff74795f004f0cf8f /sound/soc/imx | |
parent | 5de0ee574be8f6922a6c33f2fbc7e9b130a2f626 (diff) | |
parent | e58a8947b0264ec1f43ce5deef563b72acf1284f (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/imx')
-rw-r--r-- | sound/soc/imx/Kconfig | 13 | ||||
-rw-r--r-- | sound/soc/imx/Makefile | 2 | ||||
-rw-r--r-- | sound/soc/imx/eukrea-tlv320.c | 3 | ||||
-rw-r--r-- | sound/soc/imx/imx-ssi.c | 5 | ||||
-rw-r--r-- | sound/soc/imx/mx27vis-aic32x4.c | 137 |
5 files changed, 157 insertions, 3 deletions
diff --git a/sound/soc/imx/Kconfig b/sound/soc/imx/Kconfig index 642270a635ea..d8f130d39dd9 100644 --- a/sound/soc/imx/Kconfig +++ b/sound/soc/imx/Kconfig | |||
@@ -30,6 +30,16 @@ config SND_MXC_SOC_WM1133_EV1 | |||
30 | Enable support for audio on the i.MX31ADS with the WM1133-EV1 | 30 | Enable support for audio on the i.MX31ADS with the WM1133-EV1 |
31 | PMIC board with WM8835x fitted. | 31 | PMIC board with WM8835x fitted. |
32 | 32 | ||
33 | config SND_SOC_MX27VIS_AIC32X4 | ||
34 | tristate "SoC audio support for Visstrim M10 boards" | ||
35 | depends on MACH_IMX27_VISSTRIM_M10 | ||
36 | select SND_SOC_TVL320AIC32X4 | ||
37 | select SND_MXC_SOC_SSI | ||
38 | select SND_MXC_SOC_MX2 | ||
39 | help | ||
40 | Say Y if you want to add support for SoC audio on Visstrim SM10 | ||
41 | board with TLV320AIC32X4 codec. | ||
42 | |||
33 | config SND_SOC_PHYCORE_AC97 | 43 | config SND_SOC_PHYCORE_AC97 |
34 | tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards" | 44 | tristate "SoC Audio support for Phytec phyCORE (and phyCARD) boards" |
35 | depends on MACH_PCM043 || MACH_PCA100 | 45 | depends on MACH_PCM043 || MACH_PCA100 |
@@ -44,7 +54,8 @@ config SND_SOC_EUKREA_TLV320 | |||
44 | tristate "Eukrea TLV320" | 54 | tristate "Eukrea TLV320" |
45 | depends on MACH_EUKREA_MBIMX27_BASEBOARD \ | 55 | depends on MACH_EUKREA_MBIMX27_BASEBOARD \ |
46 | || MACH_EUKREA_MBIMXSD25_BASEBOARD \ | 56 | || MACH_EUKREA_MBIMXSD25_BASEBOARD \ |
47 | || MACH_EUKREA_MBIMXSD35_BASEBOARD | 57 | || MACH_EUKREA_MBIMXSD35_BASEBOARD \ |
58 | || MACH_EUKREA_MBIMXSD51_BASEBOARD | ||
48 | select SND_SOC_TLV320AIC23 | 59 | select SND_SOC_TLV320AIC23 |
49 | select SND_MXC_SOC_SSI | 60 | select SND_MXC_SOC_SSI |
50 | select SND_MXC_SOC_FIQ | 61 | select SND_MXC_SOC_FIQ |
diff --git a/sound/soc/imx/Makefile b/sound/soc/imx/Makefile index b67fc02a4ecc..d6d609ba7e24 100644 --- a/sound/soc/imx/Makefile +++ b/sound/soc/imx/Makefile | |||
@@ -10,8 +10,10 @@ obj-$(CONFIG_SND_MXC_SOC_MX2) += snd-soc-imx-mx2.o | |||
10 | # i.MX Machine Support | 10 | # i.MX Machine Support |
11 | snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o | 11 | snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o |
12 | snd-soc-phycore-ac97-objs := phycore-ac97.o | 12 | snd-soc-phycore-ac97-objs := phycore-ac97.o |
13 | snd-soc-mx27vis-aic32x4-objs := mx27vis-aic32x4.o | ||
13 | snd-soc-wm1133-ev1-objs := wm1133-ev1.o | 14 | snd-soc-wm1133-ev1-objs := wm1133-ev1.o |
14 | 15 | ||
15 | obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o | 16 | obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o |
16 | obj-$(CONFIG_SND_SOC_PHYCORE_AC97) += snd-soc-phycore-ac97.o | 17 | obj-$(CONFIG_SND_SOC_PHYCORE_AC97) += snd-soc-phycore-ac97.o |
18 | obj-$(CONFIG_SND_SOC_MX27VIS_AIC32X4) += snd-soc-mx27vis-aic32x4.o | ||
17 | obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o | 19 | obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o |
diff --git a/sound/soc/imx/eukrea-tlv320.c b/sound/soc/imx/eukrea-tlv320.c index 1e9bccae4e80..75fb4b83548b 100644 --- a/sound/soc/imx/eukrea-tlv320.c +++ b/sound/soc/imx/eukrea-tlv320.c | |||
@@ -98,7 +98,8 @@ static int __init eukrea_tlv320_init(void) | |||
98 | int ret; | 98 | int ret; |
99 | 99 | ||
100 | if (!machine_is_eukrea_cpuimx27() && !machine_is_eukrea_cpuimx25sd() | 100 | if (!machine_is_eukrea_cpuimx27() && !machine_is_eukrea_cpuimx25sd() |
101 | && !machine_is_eukrea_cpuimx35sd()) | 101 | && !machine_is_eukrea_cpuimx35sd() |
102 | && !machine_is_eukrea_cpuimx51sd()) | ||
102 | /* return happy. We might run on a totally different machine */ | 103 | /* return happy. We might run on a totally different machine */ |
103 | return 0; | 104 | return 0; |
104 | 105 | ||
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index 30894ea7f333..bc92ec620004 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c | |||
@@ -108,7 +108,7 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) | |||
108 | break; | 108 | break; |
109 | case SND_SOC_DAIFMT_DSP_B: | 109 | case SND_SOC_DAIFMT_DSP_B: |
110 | /* data on rising edge of bclk, frame high with data */ | 110 | /* data on rising edge of bclk, frame high with data */ |
111 | strcr |= SSI_STCR_TFSL; | 111 | strcr |= SSI_STCR_TFSL | SSI_STCR_TXBIT0; |
112 | break; | 112 | break; |
113 | case SND_SOC_DAIFMT_DSP_A: | 113 | case SND_SOC_DAIFMT_DSP_A: |
114 | /* data on rising edge of bclk, frame high 1clk before data */ | 114 | /* data on rising edge of bclk, frame high 1clk before data */ |
@@ -656,6 +656,9 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
656 | ssi->dma_params_rx.dma_addr = res->start + SSI_SRX0; | 656 | ssi->dma_params_rx.dma_addr = res->start + SSI_SRX0; |
657 | ssi->dma_params_tx.dma_addr = res->start + SSI_STX0; | 657 | ssi->dma_params_tx.dma_addr = res->start + SSI_STX0; |
658 | 658 | ||
659 | ssi->dma_params_tx.burstsize = 4; | ||
660 | ssi->dma_params_rx.burstsize = 4; | ||
661 | |||
659 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx0"); | 662 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx0"); |
660 | if (res) | 663 | if (res) |
661 | ssi->dma_params_tx.dma = res->start; | 664 | ssi->dma_params_tx.dma = res->start; |
diff --git a/sound/soc/imx/mx27vis-aic32x4.c b/sound/soc/imx/mx27vis-aic32x4.c new file mode 100644 index 000000000000..054110b91d42 --- /dev/null +++ b/sound/soc/imx/mx27vis-aic32x4.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | * mx27vis-aic32x4.c | ||
3 | * | ||
4 | * Copyright 2011 Vista Silicon S.L. | ||
5 | * | ||
6 | * Author: Javier Martin <javier.martin@vista-silicon.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
21 | * MA 02110-1301, USA. | ||
22 | */ | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | #include <linux/moduleparam.h> | ||
26 | #include <linux/device.h> | ||
27 | #include <linux/i2c.h> | ||
28 | #include <sound/core.h> | ||
29 | #include <sound/pcm.h> | ||
30 | #include <sound/soc.h> | ||
31 | #include <sound/soc-dapm.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <mach/audmux.h> | ||
34 | |||
35 | #include "../codecs/tlv320aic32x4.h" | ||
36 | #include "imx-ssi.h" | ||
37 | |||
38 | static int mx27vis_aic32x4_hw_params(struct snd_pcm_substream *substream, | ||
39 | struct snd_pcm_hw_params *params) | ||
40 | { | ||
41 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
42 | struct snd_soc_dai *codec_dai = rtd->codec_dai; | ||
43 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | ||
44 | int ret; | ||
45 | u32 dai_format; | ||
46 | |||
47 | dai_format = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_NB_NF | | ||
48 | SND_SOC_DAIFMT_CBM_CFM; | ||
49 | |||
50 | /* set codec DAI configuration */ | ||
51 | snd_soc_dai_set_fmt(codec_dai, dai_format); | ||
52 | |||
53 | /* set cpu DAI configuration */ | ||
54 | snd_soc_dai_set_fmt(cpu_dai, dai_format); | ||
55 | |||
56 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, | ||
57 | 25000000, SND_SOC_CLOCK_OUT); | ||
58 | if (ret) { | ||
59 | pr_err("%s: failed setting codec sysclk\n", __func__); | ||
60 | return ret; | ||
61 | } | ||
62 | |||
63 | ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, | ||
64 | SND_SOC_CLOCK_IN); | ||
65 | if (ret) { | ||
66 | pr_err("can't set CPU system clock IMX_SSP_SYS_CLK\n"); | ||
67 | return ret; | ||
68 | } | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static struct snd_soc_ops mx27vis_aic32x4_snd_ops = { | ||
74 | .hw_params = mx27vis_aic32x4_hw_params, | ||
75 | }; | ||
76 | |||
77 | static struct snd_soc_dai_link mx27vis_aic32x4_dai = { | ||
78 | .name = "tlv320aic32x4", | ||
79 | .stream_name = "TLV320AIC32X4", | ||
80 | .codec_dai_name = "tlv320aic32x4-hifi", | ||
81 | .platform_name = "imx-pcm-audio.0", | ||
82 | .codec_name = "tlv320aic32x4.0-0018", | ||
83 | .cpu_dai_name = "imx-ssi.0", | ||
84 | .ops = &mx27vis_aic32x4_snd_ops, | ||
85 | }; | ||
86 | |||
87 | static struct snd_soc_card mx27vis_aic32x4 = { | ||
88 | .name = "visstrim_m10-audio", | ||
89 | .dai_link = &mx27vis_aic32x4_dai, | ||
90 | .num_links = 1, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device *mx27vis_aic32x4_snd_device; | ||
94 | |||
95 | static int __init mx27vis_aic32x4_init(void) | ||
96 | { | ||
97 | int ret; | ||
98 | |||
99 | mx27vis_aic32x4_snd_device = platform_device_alloc("soc-audio", -1); | ||
100 | if (!mx27vis_aic32x4_snd_device) | ||
101 | return -ENOMEM; | ||
102 | |||
103 | platform_set_drvdata(mx27vis_aic32x4_snd_device, &mx27vis_aic32x4); | ||
104 | ret = platform_device_add(mx27vis_aic32x4_snd_device); | ||
105 | |||
106 | if (ret) { | ||
107 | printk(KERN_ERR "ASoC: Platform device allocation failed\n"); | ||
108 | platform_device_put(mx27vis_aic32x4_snd_device); | ||
109 | } | ||
110 | |||
111 | /* Connect SSI0 as clock slave to SSI1 external pins */ | ||
112 | mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, | ||
113 | MXC_AUDMUX_V1_PCR_SYN | | ||
114 | MXC_AUDMUX_V1_PCR_TFSDIR | | ||
115 | MXC_AUDMUX_V1_PCR_TCLKDIR | | ||
116 | MXC_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_PPCR1_SSI_PINS_1) | | ||
117 | MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_PPCR1_SSI_PINS_1) | ||
118 | ); | ||
119 | mxc_audmux_v1_configure_port(MX27_AUDMUX_PPCR1_SSI_PINS_1, | ||
120 | MXC_AUDMUX_V1_PCR_SYN | | ||
121 | MXC_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0) | ||
122 | ); | ||
123 | |||
124 | return ret; | ||
125 | } | ||
126 | |||
127 | static void __exit mx27vis_aic32x4_exit(void) | ||
128 | { | ||
129 | platform_device_unregister(mx27vis_aic32x4_snd_device); | ||
130 | } | ||
131 | |||
132 | module_init(mx27vis_aic32x4_init); | ||
133 | module_exit(mx27vis_aic32x4_exit); | ||
134 | |||
135 | MODULE_AUTHOR("Javier Martin <javier.martin@vista-silicon.com>"); | ||
136 | MODULE_DESCRIPTION("ALSA SoC AIC32X4 mx27 visstrim"); | ||
137 | MODULE_LICENSE("GPL"); | ||