ASoC: Push the codec runtime storage into the card structure
This is a further stage on the road to refactoring away the ASoC platform device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
@@ -30,7 +30,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_device *socdev = rtd->socdev;
|
||||
struct snd_soc_codec *codec = socdev->codec;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
|
||||
int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
|
||||
AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
|
||||
@@ -84,10 +84,10 @@ static int ac97_soc_probe(struct platform_device *pdev)
|
||||
|
||||
printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
|
||||
|
||||
socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
|
||||
if (!socdev->codec)
|
||||
socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
|
||||
if (!socdev->card->codec)
|
||||
return -ENOMEM;
|
||||
codec = socdev->codec;
|
||||
codec = socdev->card->codec;
|
||||
mutex_init(&codec->mutex);
|
||||
|
||||
codec->name = "AC97";
|
||||
@@ -123,21 +123,21 @@ bus_err:
|
||||
snd_soc_free_pcms(socdev);
|
||||
|
||||
err:
|
||||
kfree(socdev->codec);
|
||||
socdev->codec = NULL;
|
||||
kfree(socdev->card->codec);
|
||||
socdev->card->codec = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ac97_soc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
struct snd_soc_codec *codec = socdev->codec;
|
||||
struct snd_soc_codec *codec = socdev->card->codec;
|
||||
|
||||
if (!codec)
|
||||
return 0;
|
||||
|
||||
snd_soc_free_pcms(socdev);
|
||||
kfree(socdev->codec);
|
||||
kfree(socdev->card->codec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ static int ac97_soc_suspend(struct platform_device *pdev, pm_message_t msg)
|
||||
{
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
|
||||
snd_ac97_suspend(socdev->codec->ac97);
|
||||
snd_ac97_suspend(socdev->card->codec->ac97);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ static int ac97_soc_resume(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
|
||||
|
||||
snd_ac97_resume(socdev->codec->ac97);
|
||||
snd_ac97_resume(socdev->card->codec->ac97);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user