aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8400.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8400.c')
-rw-r--r--sound/soc/codecs/wm8400.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index b432f4d4a324..7f5d080536a0 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -14,6 +14,7 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/slab.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/delay.h> 19#include <linux/delay.h>
19#include <linux/pm.h> 20#include <linux/pm.h>
@@ -76,7 +77,7 @@ struct wm8400_priv {
76static inline unsigned int wm8400_read(struct snd_soc_codec *codec, 77static inline unsigned int wm8400_read(struct snd_soc_codec *codec,
77 unsigned int reg) 78 unsigned int reg)
78{ 79{
79 struct wm8400_priv *wm8400 = codec->private_data; 80 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
80 81
81 if (reg == WM8400_INTDRIVBITS) 82 if (reg == WM8400_INTDRIVBITS)
82 return wm8400->fake_register; 83 return wm8400->fake_register;
@@ -90,7 +91,7 @@ static inline unsigned int wm8400_read(struct snd_soc_codec *codec,
90static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg, 91static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg,
91 unsigned int value) 92 unsigned int value)
92{ 93{
93 struct wm8400_priv *wm8400 = codec->private_data; 94 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
94 95
95 if (reg == WM8400_INTDRIVBITS) { 96 if (reg == WM8400_INTDRIVBITS) {
96 wm8400->fake_register = value; 97 wm8400->fake_register = value;
@@ -101,7 +102,7 @@ static int wm8400_write(struct snd_soc_codec *codec, unsigned int reg,
101 102
102static void wm8400_codec_reset(struct snd_soc_codec *codec) 103static void wm8400_codec_reset(struct snd_soc_codec *codec)
103{ 104{
104 struct wm8400_priv *wm8400 = codec->private_data; 105 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
105 106
106 wm8400_reset_codec_reg_cache(wm8400->wm8400); 107 wm8400_reset_codec_reg_cache(wm8400->wm8400);
107} 108}
@@ -925,7 +926,7 @@ static int wm8400_set_dai_sysclk(struct snd_soc_dai *codec_dai,
925 int clk_id, unsigned int freq, int dir) 926 int clk_id, unsigned int freq, int dir)
926{ 927{
927 struct snd_soc_codec *codec = codec_dai->codec; 928 struct snd_soc_codec *codec = codec_dai->codec;
928 struct wm8400_priv *wm8400 = codec->private_data; 929 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
929 930
930 wm8400->sysclk = freq; 931 wm8400->sysclk = freq;
931 return 0; 932 return 0;
@@ -1014,7 +1015,7 @@ static int wm8400_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
1014 unsigned int freq_out) 1015 unsigned int freq_out)
1015{ 1016{
1016 struct snd_soc_codec *codec = codec_dai->codec; 1017 struct snd_soc_codec *codec = codec_dai->codec;
1017 struct wm8400_priv *wm8400 = codec->private_data; 1018 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
1018 struct fll_factors factors; 1019 struct fll_factors factors;
1019 int ret; 1020 int ret;
1020 u16 reg; 1021 u16 reg;
@@ -1203,7 +1204,7 @@ static int wm8400_mute(struct snd_soc_dai *dai, int mute)
1203static int wm8400_set_bias_level(struct snd_soc_codec *codec, 1204static int wm8400_set_bias_level(struct snd_soc_codec *codec,
1204 enum snd_soc_bias_level level) 1205 enum snd_soc_bias_level level)
1205{ 1206{
1206 struct wm8400_priv *wm8400 = codec->private_data; 1207 struct wm8400_priv *wm8400 = snd_soc_codec_get_drvdata(codec);
1207 u16 val; 1208 u16 val;
1208 int ret; 1209 int ret;
1209 1210
@@ -1466,7 +1467,7 @@ static int wm8400_codec_probe(struct platform_device *dev)
1466 return -ENOMEM; 1467 return -ENOMEM;
1467 1468
1468 codec = &priv->codec; 1469 codec = &priv->codec;
1469 codec->private_data = priv; 1470 snd_soc_codec_set_drvdata(codec, priv);
1470 codec->control_data = dev_get_drvdata(&dev->dev); 1471 codec->control_data = dev_get_drvdata(&dev->dev);
1471 priv->wm8400 = dev_get_drvdata(&dev->dev); 1472 priv->wm8400 = dev_get_drvdata(&dev->dev);
1472 1473
@@ -1529,7 +1530,7 @@ err:
1529 1530
1530static int __exit wm8400_codec_remove(struct platform_device *dev) 1531static int __exit wm8400_codec_remove(struct platform_device *dev)
1531{ 1532{
1532 struct wm8400_priv *priv = wm8400_codec->private_data; 1533 struct wm8400_priv *priv = snd_soc_codec_get_drvdata(wm8400_codec);
1533 u16 reg; 1534 u16 reg;
1534 1535
1535 snd_soc_unregister_dai(&wm8400_dai); 1536 snd_soc_unregister_dai(&wm8400_dai);