diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 15:32:05 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-25 15:32:05 (GMT) |
commit | 33081adf8b89d5a716d7e1c60171768d39795b39 (patch) | |
tree | 275de58bbbb5f7ddffcdc087844cfc7fbe4315be /sound/soc/sh/ssi.c | |
parent | c55960499f810357a29659b32d6ea594abee9237 (diff) | |
parent | 506ecbca71d07fa327dd986be1682e90885678ee (diff) | |
download | linux-33081adf8b89d5a716d7e1c60171768d39795b39.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (365 commits)
ALSA: hda - Disable sticky PCM stream assignment for AD codecs
ALSA: usb - Creative USB X-Fi volume knob support
ALSA: ca0106: Use card specific dac id for mute controls.
ALSA: ca0106: Allow different sound cards to use different SPI channel mappings.
ALSA: ca0106: Create a nice spot for mapping channels to dacs.
ALSA: ca0106: Move enabling of front dac out of hardcoded setup sequence.
ALSA: ca0106: Pull out dac powering routine into separate function.
ALSA: ca0106 - add Sound Blaster 5.1vx info.
ASoC: tlv320dac33: Use usleep_range for delays
ALSA: usb-audio: add Novation Launchpad support
ALSA: hda - Add workarounds for CT-IBG controllers
ALSA: hda - Fix wrong TLV mute bit for STAC/IDT codecs
ASoC: tpa6130a2: Error handling for broken chip
ASoC: max98088: Staticise m98088_eq_band
ASoC: soc-core: Fix codec->name memory leak
ALSA: hda - Apply ideapad quirk to Acer laptops with Cxt5066
ALSA: hda - Add some workarounds for Creative IBG
ALSA: hda - Fix wrong SPDIF NID assignment for CA0110
ALSA: hda - Fix codec rename rules for ALC662-compatible codecs
ALSA: hda - Add alc_init_jacks() call to other codecs
...
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 b378096..40bbdf1 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -92,8 +92,7 @@ struct ssi_priv { static int ssi_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; if (ssi->inuse) { pr_debug("ssi: already in use!\n"); return -EBUSY; @@ -105,8 +104,7 @@ static int ssi_startup(struct snd_pcm_substream *substream, static void ssi_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; ssi->inuse = 0; } @@ -114,8 +112,7 @@ static void ssi_shutdown(struct snd_pcm_substream *substream, static int ssi_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -135,8 +132,7 @@ static int ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct ssi_priv *ssi = &ssi_cpu_data[rtd->dai->cpu_dai->id]; + struct ssi_priv *ssi = &ssi_cpu_data[dai->id]; unsigned long ssicr = SSIREG(SSICR); unsigned int bits, channels, swl, recv, i; @@ -346,10 +342,9 @@ static struct snd_soc_dai_ops ssi_dai_ops = { .set_fmt = ssi_set_fmt, }; -struct snd_soc_dai sh4_ssi_dai[] = { +struct snd_soc_dai_driver sh4_ssi_dai[] = { { - .name = "SSI0", - .id = 0, + .name = "ssi-dai.0", .playback = { .rates = SSI_RATES, .formats = SSI_FMTS, @@ -366,8 +361,7 @@ struct snd_soc_dai sh4_ssi_dai[] = { }, #ifdef CONFIG_CPU_SUBTYPE_SH7760 { - .name = "SSI1", - .id = 1, + .name = "ssi-dai.1", .playback = { .rates = SSI_RATES, .formats = SSI_FMTS, @@ -384,19 +378,40 @@ struct snd_soc_dai sh4_ssi_dai[] = { }, #endif }; -EXPORT_SYMBOL_GPL(sh4_ssi_dai); -static int __init sh4_ssi_init(void) +static int __devinit sh4_soc_dai_probe(struct platform_device *pdev) +{ + return snd_soc_register_dais(&pdev->dev, sh4_ssi_dai, + ARRAY_SIZE(sh4_ssi_dai)); +} + +static int __devexit sh4_soc_dai_remove(struct platform_device *pdev) +{ + snd_soc_unregister_dai(&pdev->dev, ARRAY_SIZE(sh4_ssi_dai)); + return 0; +} + +static struct platform_driver sh4_ssi_driver = { + .driver = { + .name = "sh4-ssi-dai", + .owner = THIS_MODULE, + }, + + .probe = sh4_soc_dai_probe, + .remove = __devexit_p(sh4_soc_dai_remove), +}; + +static int __init snd_sh4_ssi_init(void) { - return snd_soc_register_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai)); + return platform_driver_register(&sh4_ssi_driver); } -module_init(sh4_ssi_init); +module_init(snd_sh4_ssi_init); -static void __exit sh4_ssi_exit(void) +static void __exit snd_sh4_ssi_exit(void) { - snd_soc_unregister_dais(sh4_ssi_dai, ARRAY_SIZE(sh4_ssi_dai)); + platform_driver_unregister(&sh4_ssi_driver); } -module_exit(sh4_ssi_exit); +module_exit(snd_sh4_ssi_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver"); |