aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8900.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-14 02:35:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-16 21:46:22 -0400
commitb2c812e22de88bb79c290c0e718280f10b64a48d (patch)
tree4a5d967714cfb771db351cde525e6946897cca08 /sound/soc/codecs/wm8900.c
parent890c681275ab02623de1187f2d97fc355d76f372 (diff)
ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct device in the CODEC to provide diagnostics via a sysfs class rather than via the device tree, at which point it's much better to use the struct device private data rather than having two places to store it. Provide an accessor function to allow this change to be made more easily, and update all the CODEC drivers are updated. To ensure use of the accessor the private data structure member is renamed, meaning that if code developed with older an older core that still uses private_data is merged it will fail to build. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8900.c')
-rw-r--r--sound/soc/codecs/wm8900.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index dbc368c08263..19a6b25988c8 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -744,7 +744,7 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
744static int wm8900_set_fll(struct snd_soc_codec *codec, 744static int wm8900_set_fll(struct snd_soc_codec *codec,
745 int fll_id, unsigned int freq_in, unsigned int freq_out) 745 int fll_id, unsigned int freq_in, unsigned int freq_out)
746{ 746{
747 struct wm8900_priv *wm8900 = codec->private_data; 747 struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
748 struct _fll_div fll_div; 748 struct _fll_div fll_div;
749 unsigned int reg; 749 unsigned int reg;
750 750
@@ -1131,7 +1131,7 @@ static int wm8900_suspend(struct platform_device *pdev, pm_message_t state)
1131{ 1131{
1132 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1132 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1133 struct snd_soc_codec *codec = socdev->card->codec; 1133 struct snd_soc_codec *codec = socdev->card->codec;
1134 struct wm8900_priv *wm8900 = codec->private_data; 1134 struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
1135 int fll_out = wm8900->fll_out; 1135 int fll_out = wm8900->fll_out;
1136 int fll_in = wm8900->fll_in; 1136 int fll_in = wm8900->fll_in;
1137 int ret; 1137 int ret;
@@ -1155,7 +1155,7 @@ static int wm8900_resume(struct platform_device *pdev)
1155{ 1155{
1156 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1156 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1157 struct snd_soc_codec *codec = socdev->card->codec; 1157 struct snd_soc_codec *codec = socdev->card->codec;
1158 struct wm8900_priv *wm8900 = codec->private_data; 1158 struct wm8900_priv *wm8900 = snd_soc_codec_get_drvdata(codec);
1159 u16 *cache; 1159 u16 *cache;
1160 int i, ret; 1160 int i, ret;
1161 1161
@@ -1205,7 +1205,7 @@ static __devinit int wm8900_i2c_probe(struct i2c_client *i2c,
1205 return -ENOMEM; 1205 return -ENOMEM;
1206 1206
1207 codec = &wm8900->codec; 1207 codec = &wm8900->codec;
1208 codec->private_data = wm8900; 1208 snd_soc_codec_set_drvdata(codec, wm8900);
1209 codec->reg_cache = &wm8900->reg_cache[0]; 1209 codec->reg_cache = &wm8900->reg_cache[0];
1210 codec->reg_cache_size = WM8900_MAXREG; 1210 codec->reg_cache_size = WM8900_MAXREG;
1211 1211
@@ -1304,7 +1304,7 @@ static __devexit int wm8900_i2c_remove(struct i2c_client *client)
1304 wm8900_set_bias_level(wm8900_codec, SND_SOC_BIAS_OFF); 1304 wm8900_set_bias_level(wm8900_codec, SND_SOC_BIAS_OFF);
1305 1305
1306 wm8900_dai.dev = NULL; 1306 wm8900_dai.dev = NULL;
1307 kfree(wm8900_codec->private_data); 1307 kfree(snd_soc_codec_get_drvdata(wm8900_codec));
1308 wm8900_codec = NULL; 1308 wm8900_codec = NULL;
1309 1309
1310 return 0; 1310 return 0;