aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ac97.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-23 17:55:23 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-01-27 05:30:54 -0500
commit6627a653bceb3a54e55e5cdc478ec5b8d5c9cc44 (patch)
tree9a6f157ad1123e4f047689bbf3c4ef88ec1259a4 /sound/soc/codecs/ac97.c
parent0db4d0705260dd4bddf1e5a5441c58bdf08bdc9f (diff)
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>
Diffstat (limited to 'sound/soc/codecs/ac97.c')
-rw-r--r--sound/soc/codecs/ac97.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 89d41277616..11f84b6e5cb 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -30,7 +30,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
30 struct snd_pcm_runtime *runtime = substream->runtime; 30 struct snd_pcm_runtime *runtime = substream->runtime;
31 struct snd_soc_pcm_runtime *rtd = substream->private_data; 31 struct snd_soc_pcm_runtime *rtd = substream->private_data;
32 struct snd_soc_device *socdev = rtd->socdev; 32 struct snd_soc_device *socdev = rtd->socdev;
33 struct snd_soc_codec *codec = socdev->codec; 33 struct snd_soc_codec *codec = socdev->card->codec;
34 34
35 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 35 int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
36 AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; 36 AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
@@ -84,10 +84,10 @@ static int ac97_soc_probe(struct platform_device *pdev)
84 84
85 printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION); 85 printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
86 86
87 socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); 87 socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
88 if (!socdev->codec) 88 if (!socdev->card->codec)
89 return -ENOMEM; 89 return -ENOMEM;
90 codec = socdev->codec; 90 codec = socdev->card->codec;
91 mutex_init(&codec->mutex); 91 mutex_init(&codec->mutex);
92 92
93 codec->name = "AC97"; 93 codec->name = "AC97";
@@ -123,21 +123,21 @@ bus_err:
123 snd_soc_free_pcms(socdev); 123 snd_soc_free_pcms(socdev);
124 124
125err: 125err:
126 kfree(socdev->codec); 126 kfree(socdev->card->codec);
127 socdev->codec = NULL; 127 socdev->card->codec = NULL;
128 return ret; 128 return ret;
129} 129}
130 130
131static int ac97_soc_remove(struct platform_device *pdev) 131static int ac97_soc_remove(struct platform_device *pdev)
132{ 132{
133 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 133 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
134 struct snd_soc_codec *codec = socdev->codec; 134 struct snd_soc_codec *codec = socdev->card->codec;
135 135
136 if (!codec) 136 if (!codec)
137 return 0; 137 return 0;
138 138
139 snd_soc_free_pcms(socdev); 139 snd_soc_free_pcms(socdev);
140 kfree(socdev->codec); 140 kfree(socdev->card->codec);
141 141
142 return 0; 142 return 0;
143} 143}
@@ -147,7 +147,7 @@ static int ac97_soc_suspend(struct platform_device *pdev, pm_message_t msg)
147{ 147{
148 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 148 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
149 149
150 snd_ac97_suspend(socdev->codec->ac97); 150 snd_ac97_suspend(socdev->card->codec->ac97);
151 151
152 return 0; 152 return 0;
153} 153}
@@ -156,7 +156,7 @@ static int ac97_soc_resume(struct platform_device *pdev)
156{ 156{
157 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 157 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
158 158
159 snd_ac97_resume(socdev->codec->ac97); 159 snd_ac97_resume(socdev->card->codec->ac97);
160 160
161 return 0; 161 return 0;
162} 162}