diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-13 04:27:27 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-14 14:53:43 -0500 |
commit | 12e3080c4fd849d7da139b536844fa3378188a58 (patch) | |
tree | 07be0bc54ca77266f7320c8d4b0e07bf902b573c /sound/soc/codecs | |
parent | 07276572e639793565333baac16de48e4c55ed7f (diff) |
ASoC: wm8995: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 1b97de2e4e67..4fbc7689339a 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -249,7 +249,8 @@ static int configure_clock(struct snd_soc_codec *codec) | |||
249 | static int check_clk_sys(struct snd_soc_dapm_widget *source, | 249 | static int check_clk_sys(struct snd_soc_dapm_widget *source, |
250 | struct snd_soc_dapm_widget *sink) | 250 | struct snd_soc_dapm_widget *sink) |
251 | { | 251 | { |
252 | int reg = snd_soc_read(source->codec, WM8994_CLOCKING_1); | 252 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); |
253 | int reg = snd_soc_read(codec, WM8994_CLOCKING_1); | ||
253 | const char *clk; | 254 | const char *clk; |
254 | 255 | ||
255 | /* Check what we're currently using for CLK_SYS */ | 256 | /* Check what we're currently using for CLK_SYS */ |
@@ -806,7 +807,7 @@ static void active_dereference(struct snd_soc_codec *codec) | |||
806 | static int clk_sys_event(struct snd_soc_dapm_widget *w, | 807 | static int clk_sys_event(struct snd_soc_dapm_widget *w, |
807 | struct snd_kcontrol *kcontrol, int event) | 808 | struct snd_kcontrol *kcontrol, int event) |
808 | { | 809 | { |
809 | struct snd_soc_codec *codec = w->codec; | 810 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
810 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 811 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
811 | 812 | ||
812 | switch (event) { | 813 | switch (event) { |
@@ -981,7 +982,7 @@ static void vmid_dereference(struct snd_soc_codec *codec) | |||
981 | static int vmid_event(struct snd_soc_dapm_widget *w, | 982 | static int vmid_event(struct snd_soc_dapm_widget *w, |
982 | struct snd_kcontrol *kcontrol, int event) | 983 | struct snd_kcontrol *kcontrol, int event) |
983 | { | 984 | { |
984 | struct snd_soc_codec *codec = w->codec; | 985 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
985 | 986 | ||
986 | switch (event) { | 987 | switch (event) { |
987 | case SND_SOC_DAPM_PRE_PMU: | 988 | case SND_SOC_DAPM_PRE_PMU: |
@@ -1037,7 +1038,7 @@ static bool wm8994_check_class_w_digital(struct snd_soc_codec *codec) | |||
1037 | static int aif1clk_ev(struct snd_soc_dapm_widget *w, | 1038 | static int aif1clk_ev(struct snd_soc_dapm_widget *w, |
1038 | struct snd_kcontrol *kcontrol, int event) | 1039 | struct snd_kcontrol *kcontrol, int event) |
1039 | { | 1040 | { |
1040 | struct snd_soc_codec *codec = w->codec; | 1041 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1041 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1042 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1042 | struct wm8994 *control = wm8994->wm8994; | 1043 | struct wm8994 *control = wm8994->wm8994; |
1043 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; | 1044 | int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; |
@@ -1135,7 +1136,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w, | |||
1135 | static int aif2clk_ev(struct snd_soc_dapm_widget *w, | 1136 | static int aif2clk_ev(struct snd_soc_dapm_widget *w, |
1136 | struct snd_kcontrol *kcontrol, int event) | 1137 | struct snd_kcontrol *kcontrol, int event) |
1137 | { | 1138 | { |
1138 | struct snd_soc_codec *codec = w->codec; | 1139 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1139 | int i; | 1140 | int i; |
1140 | int dac; | 1141 | int dac; |
1141 | int adc; | 1142 | int adc; |
@@ -1220,7 +1221,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, | |||
1220 | static int aif1clk_late_ev(struct snd_soc_dapm_widget *w, | 1221 | static int aif1clk_late_ev(struct snd_soc_dapm_widget *w, |
1221 | struct snd_kcontrol *kcontrol, int event) | 1222 | struct snd_kcontrol *kcontrol, int event) |
1222 | { | 1223 | { |
1223 | struct snd_soc_codec *codec = w->codec; | 1224 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1224 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1225 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1225 | 1226 | ||
1226 | switch (event) { | 1227 | switch (event) { |
@@ -1238,7 +1239,7 @@ static int aif1clk_late_ev(struct snd_soc_dapm_widget *w, | |||
1238 | static int aif2clk_late_ev(struct snd_soc_dapm_widget *w, | 1239 | static int aif2clk_late_ev(struct snd_soc_dapm_widget *w, |
1239 | struct snd_kcontrol *kcontrol, int event) | 1240 | struct snd_kcontrol *kcontrol, int event) |
1240 | { | 1241 | { |
1241 | struct snd_soc_codec *codec = w->codec; | 1242 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1242 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1243 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1243 | 1244 | ||
1244 | switch (event) { | 1245 | switch (event) { |
@@ -1256,7 +1257,7 @@ static int aif2clk_late_ev(struct snd_soc_dapm_widget *w, | |||
1256 | static int late_enable_ev(struct snd_soc_dapm_widget *w, | 1257 | static int late_enable_ev(struct snd_soc_dapm_widget *w, |
1257 | struct snd_kcontrol *kcontrol, int event) | 1258 | struct snd_kcontrol *kcontrol, int event) |
1258 | { | 1259 | { |
1259 | struct snd_soc_codec *codec = w->codec; | 1260 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1260 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1261 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1261 | 1262 | ||
1262 | switch (event) { | 1263 | switch (event) { |
@@ -1289,7 +1290,7 @@ static int late_enable_ev(struct snd_soc_dapm_widget *w, | |||
1289 | static int late_disable_ev(struct snd_soc_dapm_widget *w, | 1290 | static int late_disable_ev(struct snd_soc_dapm_widget *w, |
1290 | struct snd_kcontrol *kcontrol, int event) | 1291 | struct snd_kcontrol *kcontrol, int event) |
1291 | { | 1292 | { |
1292 | struct snd_soc_codec *codec = w->codec; | 1293 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1293 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 1294 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
1294 | 1295 | ||
1295 | switch (event) { | 1296 | switch (event) { |
@@ -1331,7 +1332,7 @@ static int micbias_ev(struct snd_soc_dapm_widget *w, | |||
1331 | static int dac_ev(struct snd_soc_dapm_widget *w, | 1332 | static int dac_ev(struct snd_soc_dapm_widget *w, |
1332 | struct snd_kcontrol *kcontrol, int event) | 1333 | struct snd_kcontrol *kcontrol, int event) |
1333 | { | 1334 | { |
1334 | struct snd_soc_codec *codec = w->codec; | 1335 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1335 | unsigned int mask = 1 << w->shift; | 1336 | unsigned int mask = 1 << w->shift; |
1336 | 1337 | ||
1337 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1338 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
@@ -1372,7 +1373,7 @@ SOC_DAPM_SINGLE("DAC1 Switch", WM8994_SPEAKER_MIXER, 0, 1, 0), | |||
1372 | static int post_ev(struct snd_soc_dapm_widget *w, | 1373 | static int post_ev(struct snd_soc_dapm_widget *w, |
1373 | struct snd_kcontrol *kcontrol, int event) | 1374 | struct snd_kcontrol *kcontrol, int event) |
1374 | { | 1375 | { |
1375 | struct snd_soc_codec *codec = w->codec; | 1376 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
1376 | dev_dbg(codec->dev, "SRC status: %x\n", | 1377 | dev_dbg(codec->dev, "SRC status: %x\n", |
1377 | snd_soc_read(codec, | 1378 | snd_soc_read(codec, |
1378 | WM8994_RATE_STATUS)); | 1379 | WM8994_RATE_STATUS)); |