aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8988.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/wm8988.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/wm8988.c')
-rw-r--r--sound/soc/codecs/wm8988.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 2862e4dced27..563cf898dafc 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -494,7 +494,7 @@ static int wm8988_set_dai_sysclk(struct snd_soc_dai *codec_dai,
494 int clk_id, unsigned int freq, int dir) 494 int clk_id, unsigned int freq, int dir)
495{ 495{
496 struct snd_soc_codec *codec = codec_dai->codec; 496 struct snd_soc_codec *codec = codec_dai->codec;
497 struct wm8988_priv *wm8988 = codec->private_data; 497 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
498 498
499 switch (freq) { 499 switch (freq) {
500 case 11289600: 500 case 11289600:
@@ -584,7 +584,7 @@ static int wm8988_pcm_startup(struct snd_pcm_substream *substream,
584 struct snd_soc_dai *dai) 584 struct snd_soc_dai *dai)
585{ 585{
586 struct snd_soc_codec *codec = dai->codec; 586 struct snd_soc_codec *codec = dai->codec;
587 struct wm8988_priv *wm8988 = codec->private_data; 587 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
588 588
589 /* The set of sample rates that can be supported depends on the 589 /* The set of sample rates that can be supported depends on the
590 * MCLK supplied to the CODEC - enforce this. 590 * MCLK supplied to the CODEC - enforce this.
@@ -609,7 +609,7 @@ static int wm8988_pcm_hw_params(struct snd_pcm_substream *substream,
609 struct snd_soc_pcm_runtime *rtd = substream->private_data; 609 struct snd_soc_pcm_runtime *rtd = substream->private_data;
610 struct snd_soc_device *socdev = rtd->socdev; 610 struct snd_soc_device *socdev = rtd->socdev;
611 struct snd_soc_codec *codec = socdev->card->codec; 611 struct snd_soc_codec *codec = socdev->card->codec;
612 struct wm8988_priv *wm8988 = codec->private_data; 612 struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec);
613 u16 iface = snd_soc_read(codec, WM8988_IFACE) & 0x1f3; 613 u16 iface = snd_soc_read(codec, WM8988_IFACE) & 0x1f3;
614 u16 srate = snd_soc_read(codec, WM8988_SRATE) & 0x180; 614 u16 srate = snd_soc_read(codec, WM8988_SRATE) & 0x180;
615 int coeff; 615 int coeff;
@@ -832,7 +832,7 @@ static int wm8988_register(struct wm8988_priv *wm8988,
832 INIT_LIST_HEAD(&codec->dapm_widgets); 832 INIT_LIST_HEAD(&codec->dapm_widgets);
833 INIT_LIST_HEAD(&codec->dapm_paths); 833 INIT_LIST_HEAD(&codec->dapm_paths);
834 834
835 codec->private_data = wm8988; 835 snd_soc_codec_set_drvdata(codec, wm8988);
836 codec->name = "WM8988"; 836 codec->name = "WM8988";
837 codec->owner = THIS_MODULE; 837 codec->owner = THIS_MODULE;
838 codec->dai = &wm8988_dai; 838 codec->dai = &wm8988_dai;