diff options
Diffstat (limited to 'sound/soc/sh/hac.c')
-rw-r--r-- | sound/soc/sh/hac.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c index 41db75af3c69..c87e3ff28a0a 100644 --- a/sound/soc/sh/hac.c +++ b/sound/soc/sh/hac.c | |||
@@ -239,8 +239,7 @@ static int hac_hw_params(struct snd_pcm_substream *substream, | |||
239 | struct snd_pcm_hw_params *params, | 239 | struct snd_pcm_hw_params *params, |
240 | struct snd_soc_dai *dai) | 240 | struct snd_soc_dai *dai) |
241 | { | 241 | { |
242 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 242 | struct hac_priv *hac = &hac_cpu_data[dai->id]; |
243 | struct hac_priv *hac = &hac_cpu_data[rtd->dai->cpu_dai->id]; | ||
244 | int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; | 243 | int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; |
245 | 244 | ||
246 | switch (params->msbits) { | 245 | switch (params->msbits) { |
@@ -271,10 +270,9 @@ static struct snd_soc_dai_ops hac_dai_ops = { | |||
271 | .hw_params = hac_hw_params, | 270 | .hw_params = hac_hw_params, |
272 | }; | 271 | }; |
273 | 272 | ||
274 | struct snd_soc_dai sh4_hac_dai[] = { | 273 | static struct snd_soc_dai_driver sh4_hac_dai[] = { |
275 | { | 274 | { |
276 | .name = "HAC0", | 275 | .name = "hac-dai.0", |
277 | .id = 0, | ||
278 | .ac97_control = 1, | 276 | .ac97_control = 1, |
279 | .playback = { | 277 | .playback = { |
280 | .rates = AC97_RATES, | 278 | .rates = AC97_RATES, |
@@ -292,8 +290,7 @@ struct snd_soc_dai sh4_hac_dai[] = { | |||
292 | }, | 290 | }, |
293 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 | 291 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 |
294 | { | 292 | { |
295 | .name = "HAC1", | 293 | .name = "hac-dai.1", |
296 | .ac97_control = 1, | ||
297 | .id = 1, | 294 | .id = 1, |
298 | .playback = { | 295 | .playback = { |
299 | .rates = AC97_RATES, | 296 | .rates = AC97_RATES, |
@@ -312,19 +309,40 @@ struct snd_soc_dai sh4_hac_dai[] = { | |||
312 | }, | 309 | }, |
313 | #endif | 310 | #endif |
314 | }; | 311 | }; |
315 | EXPORT_SYMBOL_GPL(sh4_hac_dai); | ||
316 | 312 | ||
317 | static int __init sh4_hac_init(void) | 313 | static int __devinit hac_soc_platform_probe(struct platform_device *pdev) |
314 | { | ||
315 | return snd_soc_register_dais(&pdev->dev, sh4_hac_dai, | ||
316 | ARRAY_SIZE(sh4_hac_dai)); | ||
317 | } | ||
318 | |||
319 | static int __devexit hac_soc_platform_remove(struct platform_device *pdev) | ||
320 | { | ||
321 | snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(sh4_hac_dai)); | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | static struct platform_driver hac_pcm_driver = { | ||
326 | .driver = { | ||
327 | .name = "hac-pcm-audio", | ||
328 | .owner = THIS_MODULE, | ||
329 | }, | ||
330 | |||
331 | .probe = hac_soc_platform_probe, | ||
332 | .remove = __devexit_p(hac_soc_platform_remove), | ||
333 | }; | ||
334 | |||
335 | static int __init sh4_hac_pcm_init(void) | ||
318 | { | 336 | { |
319 | return snd_soc_register_dais(sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai)); | 337 | return platform_driver_register(&hac_pcm_driver); |
320 | } | 338 | } |
321 | module_init(sh4_hac_init); | 339 | module_init(sh4_hac_pcm_init); |
322 | 340 | ||
323 | static void __exit sh4_hac_exit(void) | 341 | static void __exit sh4_hac_pcm_exit(void) |
324 | { | 342 | { |
325 | snd_soc_unregister_dais(sh4_hac_dai, ARRAY_SIZE(sh4_hac_dai)); | 343 | platform_driver_unregister(&hac_pcm_driver); |
326 | } | 344 | } |
327 | module_exit(sh4_hac_exit); | 345 | module_exit(sh4_hac_pcm_exit); |
328 | 346 | ||
329 | MODULE_LICENSE("GPL"); | 347 | MODULE_LICENSE("GPL"); |
330 | MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver"); | 348 | MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver"); |