diff options
Diffstat (limited to 'sound/soc/omap/n810.c')
-rw-r--r-- | sound/soc/omap/n810.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index 08e09d72790f..a3b6d897ad84 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -97,7 +97,7 @@ static int n810_startup(struct snd_pcm_substream *substream) | |||
97 | { | 97 | { |
98 | struct snd_pcm_runtime *runtime = substream->runtime; | 98 | struct snd_pcm_runtime *runtime = substream->runtime; |
99 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 99 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
100 | struct snd_soc_codec *codec = rtd->socdev->card->codec; | 100 | struct snd_soc_codec *codec = rtd->codec; |
101 | 101 | ||
102 | snd_pcm_hw_constraint_minmax(runtime, | 102 | snd_pcm_hw_constraint_minmax(runtime, |
103 | SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); | 103 | SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2); |
@@ -115,8 +115,8 @@ static int n810_hw_params(struct snd_pcm_substream *substream, | |||
115 | struct snd_pcm_hw_params *params) | 115 | struct snd_pcm_hw_params *params) |
116 | { | 116 | { |
117 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 117 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
118 | struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; | 118 | struct snd_soc_dai *codec_dai = rtd->codec_dai; |
119 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 119 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
120 | int err; | 120 | int err; |
121 | 121 | ||
122 | /* Set codec DAI configuration */ | 122 | /* Set codec DAI configuration */ |
@@ -271,8 +271,9 @@ static const struct snd_kcontrol_new aic33_n810_controls[] = { | |||
271 | n810_get_input, n810_set_input), | 271 | n810_get_input, n810_set_input), |
272 | }; | 272 | }; |
273 | 273 | ||
274 | static int n810_aic33_init(struct snd_soc_codec *codec) | 274 | static int n810_aic33_init(struct snd_soc_pcm_runtime *rtd) |
275 | { | 275 | { |
276 | struct snd_soc_codec *codec = rtd->codec; | ||
276 | int err; | 277 | int err; |
277 | 278 | ||
278 | /* Not connected */ | 279 | /* Not connected */ |
@@ -307,8 +308,10 @@ static int n810_aic33_init(struct snd_soc_codec *codec) | |||
307 | static struct snd_soc_dai_link n810_dai = { | 308 | static struct snd_soc_dai_link n810_dai = { |
308 | .name = "TLV320AIC33", | 309 | .name = "TLV320AIC33", |
309 | .stream_name = "AIC33", | 310 | .stream_name = "AIC33", |
310 | .cpu_dai = &omap_mcbsp_dai[0], | 311 | .cpu_dai_name = "omap-mcbsp-dai.1", |
311 | .codec_dai = &aic3x_dai, | 312 | .platform_name = "omap-pcm-audio", |
313 | .codec_name = "tlv320aic3x-codec.2-0018", | ||
314 | .codec_dai_name = "tlv320aic3x-hifi", | ||
312 | .init = n810_aic33_init, | 315 | .init = n810_aic33_init, |
313 | .ops = &n810_ops, | 316 | .ops = &n810_ops, |
314 | }; | 317 | }; |
@@ -316,33 +319,12 @@ static struct snd_soc_dai_link n810_dai = { | |||
316 | /* Audio machine driver */ | 319 | /* Audio machine driver */ |
317 | static struct snd_soc_card snd_soc_n810 = { | 320 | static struct snd_soc_card snd_soc_n810 = { |
318 | .name = "N810", | 321 | .name = "N810", |
319 | .platform = &omap_soc_platform, | ||
320 | .dai_link = &n810_dai, | 322 | .dai_link = &n810_dai, |
321 | .num_links = 1, | 323 | .num_links = 1, |
322 | }; | 324 | }; |
323 | 325 | ||
324 | /* Audio private data */ | ||
325 | static struct aic3x_setup_data n810_aic33_setup = { | ||
326 | .gpio_func[0] = AIC3X_GPIO1_FUNC_DISABLED, | ||
327 | .gpio_func[1] = AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT, | ||
328 | }; | ||
329 | |||
330 | /* Audio subsystem */ | ||
331 | static struct snd_soc_device n810_snd_devdata = { | ||
332 | .card = &snd_soc_n810, | ||
333 | .codec_dev = &soc_codec_dev_aic3x, | ||
334 | .codec_data = &n810_aic33_setup, | ||
335 | }; | ||
336 | |||
337 | static struct platform_device *n810_snd_device; | 326 | static struct platform_device *n810_snd_device; |
338 | 327 | ||
339 | /* temporary i2c device creation until this can be moved into the machine | ||
340 | * support file. | ||
341 | */ | ||
342 | static struct i2c_board_info i2c_device[] = { | ||
343 | { I2C_BOARD_INFO("tlv320aic3x", 0x1b), } | ||
344 | }; | ||
345 | |||
346 | static int __init n810_soc_init(void) | 328 | static int __init n810_soc_init(void) |
347 | { | 329 | { |
348 | int err; | 330 | int err; |
@@ -351,15 +333,11 @@ static int __init n810_soc_init(void) | |||
351 | if (!(machine_is_nokia_n810() || machine_is_nokia_n810_wimax())) | 333 | if (!(machine_is_nokia_n810() || machine_is_nokia_n810_wimax())) |
352 | return -ENODEV; | 334 | return -ENODEV; |
353 | 335 | ||
354 | i2c_register_board_info(1, i2c_device, ARRAY_SIZE(i2c_device)); | ||
355 | |||
356 | n810_snd_device = platform_device_alloc("soc-audio", -1); | 336 | n810_snd_device = platform_device_alloc("soc-audio", -1); |
357 | if (!n810_snd_device) | 337 | if (!n810_snd_device) |
358 | return -ENOMEM; | 338 | return -ENOMEM; |
359 | 339 | ||
360 | platform_set_drvdata(n810_snd_device, &n810_snd_devdata); | 340 | platform_set_drvdata(n810_snd_device, &snd_soc_n810); |
361 | n810_snd_devdata.dev = &n810_snd_device->dev; | ||
362 | *(unsigned int *)n810_dai.cpu_dai->private_data = 1; /* McBSP2 */ | ||
363 | err = platform_device_add(n810_snd_device); | 341 | err = platform_device_add(n810_snd_device); |
364 | if (err) | 342 | if (err) |
365 | goto err1; | 343 | goto err1; |