aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/n810.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/n810.c')
-rw-r--r--sound/soc/omap/n810.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 62e292f4931..7e3c20c965c 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -115,25 +115,8 @@ static int n810_hw_params(struct snd_pcm_substream *substream,
115{ 115{
116 struct snd_soc_pcm_runtime *rtd = substream->private_data; 116 struct snd_soc_pcm_runtime *rtd = substream->private_data;
117 struct snd_soc_dai *codec_dai = rtd->codec_dai; 117 struct snd_soc_dai *codec_dai = rtd->codec_dai;
118 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
119 int err; 118 int err;
120 119
121 /* Set codec DAI configuration */
122 err = snd_soc_dai_set_fmt(codec_dai,
123 SND_SOC_DAIFMT_I2S |
124 SND_SOC_DAIFMT_NB_NF |
125 SND_SOC_DAIFMT_CBM_CFM);
126 if (err < 0)
127 return err;
128
129 /* Set cpu DAI configuration */
130 err = snd_soc_dai_set_fmt(cpu_dai,
131 SND_SOC_DAIFMT_I2S |
132 SND_SOC_DAIFMT_NB_NF |
133 SND_SOC_DAIFMT_CBM_CFM);
134 if (err < 0)
135 return err;
136
137 /* Set the codec system clock for DAC and ADC */ 120 /* Set the codec system clock for DAC and ADC */
138 err = snd_soc_dai_set_sysclk(codec_dai, 0, 12000000, 121 err = snd_soc_dai_set_sysclk(codec_dai, 0, 12000000,
139 SND_SOC_CLOCK_IN); 122 SND_SOC_CLOCK_IN);
@@ -274,7 +257,6 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
274{ 257{
275 struct snd_soc_codec *codec = rtd->codec; 258 struct snd_soc_codec *codec = rtd->codec;
276 struct snd_soc_dapm_context *dapm = &codec->dapm; 259 struct snd_soc_dapm_context *dapm = &codec->dapm;
277 int err;
278 260
279 /* Not connected */ 261 /* Not connected */
280 snd_soc_dapm_nc_pin(dapm, "MONO_LOUT"); 262 snd_soc_dapm_nc_pin(dapm, "MONO_LOUT");
@@ -286,21 +268,6 @@ static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd)
286 snd_soc_dapm_nc_pin(dapm, "LINE2L"); 268 snd_soc_dapm_nc_pin(dapm, "LINE2L");
287 snd_soc_dapm_nc_pin(dapm, "LINE2R"); 269 snd_soc_dapm_nc_pin(dapm, "LINE2R");
288 270
289 /* Add N810 specific controls */
290 err = snd_soc_add_controls(codec, aic33_n810_controls,
291 ARRAY_SIZE(aic33_n810_controls));
292 if (err < 0)
293 return err;
294
295 /* Add N810 specific widgets */
296 snd_soc_dapm_new_controls(dapm, aic33_dapm_widgets,
297 ARRAY_SIZE(aic33_dapm_widgets));
298
299 /* Set up N810 specific audio path audio_map */
300 snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
301
302 snd_soc_dapm_sync(dapm);
303
304 return 0; 271 return 0;
305} 272}
306 273
@@ -312,6 +279,8 @@ static struct snd_soc_dai_link n810_dai = {
312 .platform_name = "omap-pcm-audio", 279 .platform_name = "omap-pcm-audio",
313 .codec_name = "tlv320aic3x-codec.2-0018", 280 .codec_name = "tlv320aic3x-codec.2-0018",
314 .codec_dai_name = "tlv320aic3x-hifi", 281 .codec_dai_name = "tlv320aic3x-hifi",
282 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
283 SND_SOC_DAIFMT_CBM_CFM,
315 .init = n810_aic33_init, 284 .init = n810_aic33_init,
316 .ops = &n810_ops, 285 .ops = &n810_ops,
317}; 286};
@@ -321,6 +290,13 @@ static struct snd_soc_card snd_soc_n810 = {
321 .name = "N810", 290 .name = "N810",
322 .dai_link = &n810_dai, 291 .dai_link = &n810_dai,
323 .num_links = 1, 292 .num_links = 1,
293
294 .controls = aic33_n810_controls,
295 .num_controls = ARRAY_SIZE(aic33_n810_controls),
296 .dapm_widgets = aic33_dapm_widgets,
297 .num_dapm_widgets = ARRAY_SIZE(aic33_dapm_widgets),
298 .dapm_routes = audio_map,
299 .num_dapm_routes = ARRAY_SIZE(audio_map),
324}; 300};
325 301
326static struct platform_device *n810_snd_device; 302static struct platform_device *n810_snd_device;