aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9713.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/wm9713.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/wm9713.c')
-rw-r--r--sound/soc/codecs/wm9713.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 0e60e16973d..54db9c52498 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1115,7 +1115,7 @@ static int wm9713_soc_suspend(struct platform_device *pdev,
1115 pm_message_t state) 1115 pm_message_t state)
1116{ 1116{
1117 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1117 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1118 struct snd_soc_codec *codec = socdev->codec; 1118 struct snd_soc_codec *codec = socdev->card->codec;
1119 u16 reg; 1119 u16 reg;
1120 1120
1121 /* Disable everything except touchpanel - that will be handled 1121 /* Disable everything except touchpanel - that will be handled
@@ -1133,7 +1133,7 @@ static int wm9713_soc_suspend(struct platform_device *pdev,
1133static int wm9713_soc_resume(struct platform_device *pdev) 1133static int wm9713_soc_resume(struct platform_device *pdev)
1134{ 1134{
1135 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1135 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1136 struct snd_soc_codec *codec = socdev->codec; 1136 struct snd_soc_codec *codec = socdev->card->codec;
1137 struct wm9713_priv *wm9713 = codec->private_data; 1137 struct wm9713_priv *wm9713 = codec->private_data;
1138 int i, ret; 1138 int i, ret;
1139 u16 *cache = codec->reg_cache; 1139 u16 *cache = codec->reg_cache;
@@ -1174,10 +1174,11 @@ static int wm9713_soc_probe(struct platform_device *pdev)
1174 1174
1175 printk(KERN_INFO "WM9713/WM9714 SoC Audio Codec %s\n", WM9713_VERSION); 1175 printk(KERN_INFO "WM9713/WM9714 SoC Audio Codec %s\n", WM9713_VERSION);
1176 1176
1177 socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); 1177 socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec),
1178 if (socdev->codec == NULL) 1178 GFP_KERNEL);
1179 if (socdev->card->codec == NULL)
1179 return -ENOMEM; 1180 return -ENOMEM;
1180 codec = socdev->codec; 1181 codec = socdev->card->codec;
1181 mutex_init(&codec->mutex); 1182 mutex_init(&codec->mutex);
1182 1183
1183 codec->reg_cache = kmemdup(wm9713_reg, sizeof(wm9713_reg), GFP_KERNEL); 1184 codec->reg_cache = kmemdup(wm9713_reg, sizeof(wm9713_reg), GFP_KERNEL);
@@ -1249,15 +1250,15 @@ priv_err:
1249 kfree(codec->reg_cache); 1250 kfree(codec->reg_cache);
1250 1251
1251cache_err: 1252cache_err:
1252 kfree(socdev->codec); 1253 kfree(socdev->card->codec);
1253 socdev->codec = NULL; 1254 socdev->card->codec = NULL;
1254 return ret; 1255 return ret;
1255} 1256}
1256 1257
1257static int wm9713_soc_remove(struct platform_device *pdev) 1258static int wm9713_soc_remove(struct platform_device *pdev)
1258{ 1259{
1259 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1260 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1260 struct snd_soc_codec *codec = socdev->codec; 1261 struct snd_soc_codec *codec = socdev->card->codec;
1261 1262
1262 if (codec == NULL) 1263 if (codec == NULL)
1263 return 0; 1264 return 0;