diff options
Diffstat (limited to 'sound/soc/sh/ssi.c')
-rw-r--r-- | sound/soc/sh/ssi.c | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index b378096cadb1..40bbdf1591dc 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c | |||
@@ -92,8 +92,7 @@ struct ssi_priv { | |||
92 | static int ssi_startup(struct snd_pcm_substream *substream, | 92 | static int ssi_startup(struct snd_pcm_substream *substream, |
93 | struct snd_soc_dai *dai) | 93 | struct snd_soc_dai *dai) |
94 | { | 94 | { |
95 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 95 | struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; |
96 | struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; | ||
97 | if (ssi->inuse) { | 96 | if (ssi->inuse) { |
98 | pr_debug("ssi: already in use!\n"); | 97 | pr_debug("ssi: already in use!\n"); |
99 | return -EBUSY; | 98 | return -EBUSY; |
@@ -105,8 +104,7 @@ static int ssi_startup(struct snd_pcm_substream *substream, | |||
105 | static void ssi_shutdown(struct snd_pcm_substream *substream, | 104 | static void ssi_shutdown(struct snd_pcm_substream *substream, |
106 | struct snd_soc_dai *dai) | 105 | struct snd_soc_dai *dai) |
107 | { | 106 | { |
108 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 107 | struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; |
109 | struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; | ||
110 | 108 | ||
111 | ssi->inuse = 0; | 109 | ssi->inuse = 0; |
112 | } | 110 | } |
@@ -114,8 +112,7 @@ static void ssi_shutdown(struct snd_pcm_substream *substream, | |||
114 | static int ssi_trigger(struct snd_pcm_substream *substream, int cmd, | 112 | static int ssi_trigger(struct snd_pcm_substream *substream, int cmd, |
115 | struct snd_soc_dai *dai) | 113 | struct snd_soc_dai *dai) |
116 | { | 114 | { |
117 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 115 | struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; |
118 | struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; | ||
119 | 116 | ||
120 | switch (cmd) { | 117 | switch (cmd) { |
121 | case SNDRV_PCM_TRIGGER_START: | 118 | case SNDRV_PCM_TRIGGER_START: |
@@ -135,8 +132,7 @@ static int ssi_hw_params(struct snd_pcm_substream *substream, | |||
135 | struct snd_pcm_hw_params *params, | 132 | struct snd_pcm_hw_params *params, |
136 | struct snd_soc_dai *dai) | 133 | struct snd_soc_dai *dai) |
137 | { | 134 | { |
138 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 135 | struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; |
139 | struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; | ||
140 | unsigned long ssicr = SSIREG(SSICR); | 136 | unsigned long ssicr = SSIREG(SSICR); |
141 | unsigned int bits, channels, swl, recv, i; | 137 | unsigned int bits, channels, swl, recv, i; |
142 | 138 | ||
@@ -346,10 +342,9 @@ static struct snd_soc_dai_ops ssi_dai_ops = { | |||
346 | .set_fmt = ssi_set_fmt, | 342 | .set_fmt = ssi_set_fmt, |
347 | }; | 343 | }; |
348 | 344 | ||
349 | struct snd_soc_dai sh4_ssi_dai[] = { | 345 | struct snd_soc_dai_driver sh4_ssi_dai[] = { |
350 | { | 346 | { |
351 | .name = "SSI0", | 347 | .name = "ssi-dai.0", |
352 | .id = 0, | ||
353 | .playback = { | 348 | .playback = { |
354 | .rates = SSI_RATES, | 349 | .rates = SSI_RATES, |
355 | .formats = SSI_FMTS, | 350 | .formats = SSI_FMTS, |
@@ -366,8 +361,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { | |||
366 | }, | 361 | }, |
367 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 | 362 | #ifdef CONFIG_CPU_SUBTYPE_SH7760 |
368 | { | 363 | { |
369 | .name = "SSI1", | 364 | .name = "ssi-dai.1", |
370 | .id = 1, | ||
371 | .playback = { | 365 | .playback = { |
372 | .rates = SSI_RATES, | 366 | .rates = SSI_RATES, |
373 | .formats = SSI_FMTS, | 367 | .formats = SSI_FMTS, |
@@ -384,19 +378,40 @@ struct snd_soc_dai sh4_ssi_dai[] = { | |||
384 | }, | 378 | }, |
385 | #endif | 379 | #endif |
386 | }; | 380 | }; |
387 | EXPORT_SYMBOL_GPL(sh4_ssi_dai); | ||
388 | 381 | ||
389 | static int __init sh4_ssi_init(void) | 382 | static int __devinit sh4_soc_dai_probe(struct platform_device *pdev) |
383 | { | ||
384 | return snd_soc_register_dais(&pdev->dev, sh4_ssi_dai, | ||
385 | ARRAY_SIZE(sh4_ssi_dai)); | ||
386 | } | ||
387 | |||
388 | static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) | ||
389 | { | ||
390 | snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); | ||
391 | return 0; | ||
392 | } | ||
393 | |||
394 | static struct platform_driver sh4_ssi_driver = { | ||
395 | .driver = { | ||
396 | .name = "sh4-ssi-dai", | ||
397 | .owner = THIS_MODULE, | ||
398 | }, | ||
399 | |||
400 | .probe = sh4_soc_dai_probe, | ||
401 | .remove = __devexit_p(sh4_soc_dai_remove), | ||
402 | }; | ||
403 | |||
404 | static int __init snd_sh4_ssi_init(void) | ||
390 | { | 405 | { |
391 | return snd_soc_register_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai)); | 406 | return platform_driver_register(&sh4_ssi_driver); |
392 | } | 407 | } |
393 | module_init(sh4_ssi_init); | 408 | module_init(snd_sh4_ssi_init); |
394 | 409 | ||
395 | static void __exit sh4_ssi_exit(void) | 410 | static void __exit snd_sh4_ssi_exit(void) |
396 | { | 411 | { |
397 | snd_soc_unregister_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai)); | 412 | platform_driver_unregister(&sh4_ssi_driver); |
398 | } | 413 | } |
399 | module_exit(sh4_ssi_exit); | 414 | module_exit(snd_sh4_ssi_exit); |
400 | 415 | ||
401 | MODULE_LICENSE("GPL"); | 416 | MODULE_LICENSE("GPL"); |
402 | MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver"); | 417 | MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver"); |