aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel/snd-soc-afeb9260.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/atmel/snd-soc-afeb9260.c')
-rw-r--r--sound/soc/atmel/snd-soc-afeb9260.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/sound/soc/atmel/snd-soc-afeb9260.c b/sound/soc/atmel/snd-soc-afeb9260.c
index 4ca667d477f9..f65f08beac31 100644
--- a/sound/soc/atmel/snd-soc-afeb9260.c
+++ b/sound/soc/atmel/snd-soc-afeb9260.c
@@ -46,29 +46,8 @@ static int afeb9260_hw_params(struct snd_pcm_substream *substream,
46{ 46{
47 struct snd_soc_pcm_runtime *rtd = substream->private_data; 47 struct snd_soc_pcm_runtime *rtd = substream->private_data;
48 struct snd_soc_dai *codec_dai = rtd->codec_dai; 48 struct snd_soc_dai *codec_dai = rtd->codec_dai;
49 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
50 int err; 49 int err;
51 50
52 /* Set codec DAI configuration */
53 err = snd_soc_dai_set_fmt(codec_dai,
54 SND_SOC_DAIFMT_I2S|
55 SND_SOC_DAIFMT_NB_IF |
56 SND_SOC_DAIFMT_CBM_CFM);
57 if (err < 0) {
58 printk(KERN_ERR "can't set codec DAI configuration\n");
59 return err;
60 }
61
62 /* Set cpu DAI configuration */
63 err = snd_soc_dai_set_fmt(cpu_dai,
64 SND_SOC_DAIFMT_I2S |
65 SND_SOC_DAIFMT_NB_IF |
66 SND_SOC_DAIFMT_CBM_CFM);
67 if (err < 0) {
68 printk(KERN_ERR "can't set cpu DAI configuration\n");
69 return err;
70 }
71
72 /* Set the codec system clock for DAC and ADC */ 51 /* Set the codec system clock for DAC and ADC */
73 err = 52 err =
74 snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, SND_SOC_CLOCK_IN); 53 snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, SND_SOC_CLOCK_IN);
@@ -91,7 +70,7 @@ static const struct snd_soc_dapm_widget tlv320aic23_dapm_widgets[] = {
91 SND_SOC_DAPM_MIC("Mic Jack", NULL), 70 SND_SOC_DAPM_MIC("Mic Jack", NULL),
92}; 71};
93 72
94static const struct snd_soc_dapm_route audio_map[] = { 73static const struct snd_soc_dapm_route afeb9260_audio_map[] = {
95 {"Headphone Jack", NULL, "LHPOUT"}, 74 {"Headphone Jack", NULL, "LHPOUT"},
96 {"Headphone Jack", NULL, "RHPOUT"}, 75 {"Headphone Jack", NULL, "RHPOUT"},
97 76
@@ -106,13 +85,6 @@ static int afeb9260_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
106 struct snd_soc_codec *codec = rtd->codec; 85 struct snd_soc_codec *codec = rtd->codec;
107 struct snd_soc_dapm_context *dapm = &codec->dapm; 86 struct snd_soc_dapm_context *dapm = &codec->dapm;
108 87
109 /* Add afeb9260 specific widgets */
110 snd_soc_dapm_new_controls(dapm, tlv320aic23_dapm_widgets,
111 ARRAY_SIZE(tlv320aic23_dapm_widgets));
112
113 /* Set up afeb9260 specific audio path audio_map */
114 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
115
116 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 88 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
117 snd_soc_dapm_enable_pin(dapm, "Line In"); 89 snd_soc_dapm_enable_pin(dapm, "Line In");
118 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 90 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
@@ -129,6 +101,8 @@ static struct snd_soc_dai_link afeb9260_dai = {
129 .platform_name = "atmel_pcm-audio", 101 .platform_name = "atmel_pcm-audio",
130 .codec_name = "tlv320aic23-codec.0-001a", 102 .codec_name = "tlv320aic23-codec.0-001a",
131 .init = afeb9260_tlv320aic23_init, 103 .init = afeb9260_tlv320aic23_init,
104 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF |
105 SND_SOC_DAIFMT_CBM_CFM,
132 .ops = &afeb9260_ops, 106 .ops = &afeb9260_ops,
133}; 107};
134 108
@@ -138,6 +112,11 @@ static struct snd_soc_card snd_soc_machine_afeb9260 = {
138 .owner = THIS_MODULE, 112 .owner = THIS_MODULE,
139 .dai_link = &afeb9260_dai, 113 .dai_link = &afeb9260_dai,
140 .num_links = 1, 114 .num_links = 1,
115
116 .dapm_widgets = tlv320aic23_dapm_widgets,
117 .num_dapm_widgets = ARRAY_SIZE(tlv320aic23_dapm_widgets),
118 .dapm_routes = afeb9260_audio_map,
119 .num_dapm_routes = ARRAY_SIZE(afeb9260_audio_map),
141}; 120};
142 121
143static struct platform_device *afeb9260_snd_device; 122static struct platform_device *afeb9260_snd_device;