aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/rx51.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/rx51.c')
-rw-r--r--sound/soc/omap/rx51.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 88052d29617f..04b5723bf89b 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -31,6 +31,7 @@
31#include <sound/pcm.h> 31#include <sound/pcm.h>
32#include <sound/soc.h> 32#include <sound/soc.h>
33#include <sound/soc-dapm.h> 33#include <sound/soc-dapm.h>
34#include <plat/mcbsp.h>
34 35
35#include <asm/mach-types.h> 36#include <asm/mach-types.h>
36 37
@@ -76,7 +77,7 @@ static int rx51_startup(struct snd_pcm_substream *substream)
76{ 77{
77 struct snd_pcm_runtime *runtime = substream->runtime; 78 struct snd_pcm_runtime *runtime = substream->runtime;
78 struct snd_soc_pcm_runtime *rtd = substream->private_data; 79 struct snd_soc_pcm_runtime *rtd = substream->private_data;
79 struct snd_soc_codec *codec = rtd->socdev->card->codec; 80 struct snd_soc_codec *codec = rtd->codec;
80 81
81 snd_pcm_hw_constraint_minmax(runtime, 82 snd_pcm_hw_constraint_minmax(runtime,
82 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); 83 SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
@@ -89,8 +90,8 @@ static int rx51_hw_params(struct snd_pcm_substream *substream,
89 struct snd_pcm_hw_params *params) 90 struct snd_pcm_hw_params *params)
90{ 91{
91 struct snd_soc_pcm_runtime *rtd = substream->private_data; 92 struct snd_soc_pcm_runtime *rtd = substream->private_data;
92 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 93 struct snd_soc_dai *codec_dai = rtd->codec_dai;
93 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 94 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
94 int err; 95 int err;
95 96
96 /* Set codec DAI configuration */ 97 /* Set codec DAI configuration */
@@ -145,9 +146,9 @@ static int rx51_spk_event(struct snd_soc_dapm_widget *w,
145 struct snd_kcontrol *k, int event) 146 struct snd_kcontrol *k, int event)
146{ 147{
147 if (SND_SOC_DAPM_EVENT_ON(event)) 148 if (SND_SOC_DAPM_EVENT_ON(event))
148 gpio_set_value(RX51_SPEAKER_AMP_TWL_GPIO, 1); 149 gpio_set_value_cansleep(RX51_SPEAKER_AMP_TWL_GPIO, 1);
149 else 150 else
150 gpio_set_value(RX51_SPEAKER_AMP_TWL_GPIO, 0); 151 gpio_set_value_cansleep(RX51_SPEAKER_AMP_TWL_GPIO, 0);
151 152
152 return 0; 153 return 0;
153} 154}
@@ -240,9 +241,9 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = {
240 rx51_get_jack, rx51_set_jack), 241 rx51_get_jack, rx51_set_jack),
241}; 242};
242 243
243static int rx51_aic34_init(struct snd_soc_codec *codec) 244static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
244{ 245{
245 struct snd_soc_card *card = codec->socdev->card; 246 struct snd_soc_codec *codec = rtd->codec;
246 int err; 247 int err;
247 248
248 /* Set up NC codec pins */ 249 /* Set up NC codec pins */
@@ -266,7 +267,7 @@ static int rx51_aic34_init(struct snd_soc_codec *codec)
266 snd_soc_dapm_sync(codec); 267 snd_soc_dapm_sync(codec);
267 268
268 /* AV jack detection */ 269 /* AV jack detection */
269 err = snd_soc_jack_new(card, "AV Jack", 270 err = snd_soc_jack_new(codec, "AV Jack",
270 SND_JACK_VIDEOOUT, &rx51_av_jack); 271 SND_JACK_VIDEOOUT, &rx51_av_jack);
271 if (err) 272 if (err)
272 return err; 273 return err;
@@ -282,32 +283,20 @@ static struct snd_soc_dai_link rx51_dai[] = {
282 { 283 {
283 .name = "TLV320AIC34", 284 .name = "TLV320AIC34",
284 .stream_name = "AIC34", 285 .stream_name = "AIC34",
285 .cpu_dai = &omap_mcbsp_dai[0], 286 .cpu_dai_name = "omap-mcbsp-dai.1",
286 .codec_dai = &aic3x_dai, 287 .codec_dai_name = "tlv320aic3x-hifi",
288 .platform_name = "omap-pcm-audio",
289 .codec_name = "tlv320aic3x-codec.2-0018",
287 .init = rx51_aic34_init, 290 .init = rx51_aic34_init,
288 .ops = &rx51_ops, 291 .ops = &rx51_ops,
289 }, 292 },
290}; 293};
291 294
292/* Audio private data */
293static struct aic3x_setup_data rx51_aic34_setup = {
294 .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED,
295 .gpio_func[1] = AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT,
296};
297
298/* Audio card */ 295/* Audio card */
299static struct snd_soc_card rx51_sound_card = { 296static struct snd_soc_card rx51_sound_card = {
300 .name = "RX-51", 297 .name = "RX-51",
301 .dai_link = rx51_dai, 298 .dai_link = rx51_dai,
302 .num_links = ARRAY_SIZE(rx51_dai), 299 .num_links = ARRAY_SIZE(rx51_dai),
303 .platform = &omap_soc_platform,
304};
305
306/* Audio subsystem */
307static struct snd_soc_device rx51_snd_devdata = {
308 .card = &rx51_sound_card,
309 .codec_dev = &soc_codec_dev_aic3x,
310 .codec_data = &rx51_aic34_setup,
311}; 300};
312 301
313static struct platform_device *rx51_snd_device; 302static struct platform_device *rx51_snd_device;
@@ -330,9 +319,7 @@ static int __init rx51_soc_init(void)
330 goto err1; 319 goto err1;
331 } 320 }
332 321
333 platform_set_drvdata(rx51_snd_device, &rx51_snd_devdata); 322 platform_set_drvdata(rx51_snd_device, &rx51_sound_card);
334 rx51_snd_devdata.dev = &rx51_snd_device->dev;
335 *(unsigned int *)rx51_dai[0].cpu_dai->private_data = 1; /* McBSP2 */
336 323
337 err = platform_device_add(rx51_snd_device); 324 err = platform_device_add(rx51_snd_device);
338 if (err) 325 if (err)