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/wm8961.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/wm8961.c')
-rw-r--r-- | sound/soc/codecs/wm8961.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index d2342c5e0425..bab393feb945 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -630,7 +630,7 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, | |||
630 | struct snd_soc_dai *dai) | 630 | struct snd_soc_dai *dai) |
631 | { | 631 | { |
632 | struct snd_soc_codec *codec = dai->codec; | 632 | struct snd_soc_codec *codec = dai->codec; |
633 | struct wm8961_priv *wm8961 = codec->private_data; | 633 | struct wm8961_priv *wm8961 = snd_soc_codec_get_drvdata(codec); |
634 | int i, best, target, fs; | 634 | int i, best, target, fs; |
635 | u16 reg; | 635 | u16 reg; |
636 | 636 | ||
@@ -721,7 +721,7 @@ static int wm8961_set_sysclk(struct snd_soc_dai *dai, int clk_id, | |||
721 | int dir) | 721 | int dir) |
722 | { | 722 | { |
723 | struct snd_soc_codec *codec = dai->codec; | 723 | struct snd_soc_codec *codec = dai->codec; |
724 | struct wm8961_priv *wm8961 = codec->private_data; | 724 | struct wm8961_priv *wm8961 = snd_soc_codec_get_drvdata(codec); |
725 | u16 reg = snd_soc_read(codec, WM8961_CLOCKING1); | 725 | u16 reg = snd_soc_read(codec, WM8961_CLOCKING1); |
726 | 726 | ||
727 | if (freq > 33000000) { | 727 | if (freq > 33000000) { |
@@ -1064,7 +1064,7 @@ static int wm8961_register(struct wm8961_priv *wm8961) | |||
1064 | INIT_LIST_HEAD(&codec->dapm_widgets); | 1064 | INIT_LIST_HEAD(&codec->dapm_widgets); |
1065 | INIT_LIST_HEAD(&codec->dapm_paths); | 1065 | INIT_LIST_HEAD(&codec->dapm_paths); |
1066 | 1066 | ||
1067 | codec->private_data = wm8961; | 1067 | snd_soc_codec_set_drvdata(codec, wm8961); |
1068 | codec->name = "WM8961"; | 1068 | codec->name = "WM8961"; |
1069 | codec->owner = THIS_MODULE; | 1069 | codec->owner = THIS_MODULE; |
1070 | codec->dai = &wm8961_dai; | 1070 | codec->dai = &wm8961_dai; |