diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-04-14 02:35:19 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-04-16 21:46:22 -0400 |
commit | b2c812e22de88bb79c290c0e718280f10b64a48d (patch) | |
tree | 4a5d967714cfb771db351cde525e6946897cca08 /sound/soc/codecs/uda1380.c | |
parent | 890c681275ab02623de1187f2d97fc355d76f372 (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/uda1380.c')
-rw-r--r-- | sound/soc/codecs/uda1380.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 9cd0a66b7663..ecba686563aa 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c | |||
@@ -476,7 +476,7 @@ static int uda1380_trigger(struct snd_pcm_substream *substream, int cmd, | |||
476 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 476 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
477 | struct snd_soc_device *socdev = rtd->socdev; | 477 | struct snd_soc_device *socdev = rtd->socdev; |
478 | struct snd_soc_codec *codec = socdev->card->codec; | 478 | struct snd_soc_codec *codec = socdev->card->codec; |
479 | struct uda1380_priv *uda1380 = codec->private_data; | 479 | struct uda1380_priv *uda1380 = snd_soc_codec_get_drvdata(codec); |
480 | int mixer = uda1380_read_reg_cache(codec, UDA1380_MIXER); | 480 | int mixer = uda1380_read_reg_cache(codec, UDA1380_MIXER); |
481 | 481 | ||
482 | switch (cmd) { | 482 | switch (cmd) { |
@@ -774,7 +774,7 @@ static int uda1380_register(struct uda1380_priv *uda1380) | |||
774 | INIT_LIST_HEAD(&codec->dapm_widgets); | 774 | INIT_LIST_HEAD(&codec->dapm_widgets); |
775 | INIT_LIST_HEAD(&codec->dapm_paths); | 775 | INIT_LIST_HEAD(&codec->dapm_paths); |
776 | 776 | ||
777 | codec->private_data = uda1380; | 777 | snd_soc_codec_set_drvdata(codec, uda1380); |
778 | codec->name = "UDA1380"; | 778 | codec->name = "UDA1380"; |
779 | codec->owner = THIS_MODULE; | 779 | codec->owner = THIS_MODULE; |
780 | codec->read = uda1380_read_reg_cache; | 780 | codec->read = uda1380_read_reg_cache; |