aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
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 /include/sound
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 'include/sound')
-rw-r--r--include/sound/soc.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 4ab3dad4a9c9..01e9c66ddc6d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -414,7 +414,7 @@ struct snd_soc_codec {
414 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ 414 struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
415 unsigned int active; 415 unsigned int active;
416 unsigned int pcm_devs; 416 unsigned int pcm_devs;
417 void *private_data; 417 void *drvdata;
418 418
419 /* codec IO */ 419 /* codec IO */
420 void *control_data; /* codec control (i2c/3wire) data */ 420 void *control_data; /* codec control (i2c/3wire) data */
@@ -597,6 +597,17 @@ static inline unsigned int snd_soc_write(struct snd_soc_codec *codec,
597 return codec->write(codec, reg, val); 597 return codec->write(codec, reg, val);
598} 598}
599 599
600static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec,
601 void *data)
602{
603 codec->drvdata = data;
604}
605
606static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec)
607{
608 return codec->drvdata;
609}
610
600#include <sound/soc-dai.h> 611#include <sound/soc-dai.h>
601 612
602#endif 613#endif