diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-30 15:26:15 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-14 12:54:35 -0400 |
commit | 018a455ac95a8cb7ad9f0ebe1019bb44cc19284c (patch) | |
tree | 0ed7e94e90ec38a2f68381a24044cb0ed5e58441 | |
parent | 308f4b044efbfbb2b7d0d076e9dcb7f961f6171b (diff) |
ASoC: wm8350: Remove direct usage of codec->control_data
Supports regmap conversion.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8350.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index f40999c0e3c6..555ee146ae0d 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -92,7 +92,7 @@ static inline int wm8350_out1_ramp_step(struct snd_soc_codec *codec) | |||
92 | { | 92 | { |
93 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); | 93 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); |
94 | struct wm8350_output *out1 = &wm8350_data->out1; | 94 | struct wm8350_output *out1 = &wm8350_data->out1; |
95 | struct wm8350 *wm8350 = codec->control_data; | 95 | struct wm8350 *wm8350 = wm8350_data->wm8350; |
96 | int left_complete = 0, right_complete = 0; | 96 | int left_complete = 0, right_complete = 0; |
97 | u16 reg, val; | 97 | u16 reg, val; |
98 | 98 | ||
@@ -158,7 +158,7 @@ static inline int wm8350_out2_ramp_step(struct snd_soc_codec *codec) | |||
158 | { | 158 | { |
159 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); | 159 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); |
160 | struct wm8350_output *out2 = &wm8350_data->out2; | 160 | struct wm8350_output *out2 = &wm8350_data->out2; |
161 | struct wm8350 *wm8350 = codec->control_data; | 161 | struct wm8350 *wm8350 = wm8350_data->wm8350; |
162 | int left_complete = 0, right_complete = 0; | 162 | int left_complete = 0, right_complete = 0; |
163 | u16 reg, val; | 163 | u16 reg, val; |
164 | 164 | ||
@@ -774,7 +774,8 @@ static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
774 | int clk_id, unsigned int freq, int dir) | 774 | int clk_id, unsigned int freq, int dir) |
775 | { | 775 | { |
776 | struct snd_soc_codec *codec = codec_dai->codec; | 776 | struct snd_soc_codec *codec = codec_dai->codec; |
777 | struct wm8350 *wm8350 = codec->control_data; | 777 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); |
778 | struct wm8350 *wm8350 = wm8350_data->wm8350; | ||
778 | u16 fll_4; | 779 | u16 fll_4; |
779 | 780 | ||
780 | switch (clk_id) { | 781 | switch (clk_id) { |
@@ -927,7 +928,8 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, | |||
927 | struct snd_soc_dai *codec_dai) | 928 | struct snd_soc_dai *codec_dai) |
928 | { | 929 | { |
929 | struct snd_soc_codec *codec = codec_dai->codec; | 930 | struct snd_soc_codec *codec = codec_dai->codec; |
930 | struct wm8350 *wm8350 = codec->control_data; | 931 | struct wm8350_data *wm8350_data = snd_soc_codec_get_drvdata(codec); |
932 | struct wm8350 *wm8350 = wm8350_data->wm8350; | ||
931 | u16 iface = snd_soc_read(codec, WM8350_AI_FORMATING) & | 933 | u16 iface = snd_soc_read(codec, WM8350_AI_FORMATING) & |
932 | ~WM8350_AIF_WL_MASK; | 934 | ~WM8350_AIF_WL_MASK; |
933 | 935 | ||
@@ -966,12 +968,15 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, | |||
966 | static int wm8350_mute(struct snd_soc_dai *dai, int mute) | 968 | static int wm8350_mute(struct snd_soc_dai *dai, int mute) |
967 | { | 969 | { |
968 | struct snd_soc_codec *codec = dai->codec; | 970 | struct snd_soc_codec *codec = dai->codec; |
969 | struct wm8350 *wm8350 = codec->control_data; | 971 | unsigned int val; |
970 | 972 | ||
971 | if (mute) | 973 | if (mute) |
972 | wm8350_set_bits(wm8350, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA); | 974 | val = WM8350_DAC_MUTE_ENA; |
973 | else | 975 | else |
974 | wm8350_clear_bits(wm8350, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA); | 976 | val = 0; |
977 | |||
978 | snd_soc_update_bits(codec, WM8350_DAC_MUTE, WM8350_DAC_MUTE_ENA, val); | ||
979 | |||
975 | return 0; | 980 | return 0; |
976 | } | 981 | } |
977 | 982 | ||
@@ -1040,8 +1045,8 @@ static int wm8350_set_fll(struct snd_soc_dai *codec_dai, | |||
1040 | unsigned int freq_out) | 1045 | unsigned int freq_out) |
1041 | { | 1046 | { |
1042 | struct snd_soc_codec *codec = codec_dai->codec; | 1047 | struct snd_soc_codec *codec = codec_dai->codec; |
1043 | struct wm8350 *wm8350 = codec->control_data; | ||
1044 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1048 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1049 | struct wm8350 *wm8350 = priv->wm8350; | ||
1045 | struct _fll_div fll_div; | 1050 | struct _fll_div fll_div; |
1046 | int ret = 0; | 1051 | int ret = 0; |
1047 | u16 fll_1, fll_4; | 1052 | u16 fll_1, fll_4; |
@@ -1092,8 +1097,8 @@ static int wm8350_set_fll(struct snd_soc_dai *codec_dai, | |||
1092 | static int wm8350_set_bias_level(struct snd_soc_codec *codec, | 1097 | static int wm8350_set_bias_level(struct snd_soc_codec *codec, |
1093 | enum snd_soc_bias_level level) | 1098 | enum snd_soc_bias_level level) |
1094 | { | 1099 | { |
1095 | struct wm8350 *wm8350 = codec->control_data; | ||
1096 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1100 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1101 | struct wm8350 *wm8350 = priv->wm8350; | ||
1097 | struct wm8350_audio_platform_data *platform = | 1102 | struct wm8350_audio_platform_data *platform = |
1098 | wm8350->codec.platform_data; | 1103 | wm8350->codec.platform_data; |
1099 | u16 pm1; | 1104 | u16 pm1; |
@@ -1349,7 +1354,7 @@ int wm8350_hp_jack_detect(struct snd_soc_codec *codec, enum wm8350_jack which, | |||
1349 | struct snd_soc_jack *jack, int report) | 1354 | struct snd_soc_jack *jack, int report) |
1350 | { | 1355 | { |
1351 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1356 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1352 | struct wm8350 *wm8350 = codec->control_data; | 1357 | struct wm8350 *wm8350 = priv->wm8350; |
1353 | int irq; | 1358 | int irq; |
1354 | int ena; | 1359 | int ena; |
1355 | 1360 | ||
@@ -1432,7 +1437,7 @@ int wm8350_mic_jack_detect(struct snd_soc_codec *codec, | |||
1432 | int detect_report, int short_report) | 1437 | int detect_report, int short_report) |
1433 | { | 1438 | { |
1434 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1439 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1435 | struct wm8350 *wm8350 = codec->control_data; | 1440 | struct wm8350 *wm8350 = priv->wm8350; |
1436 | 1441 | ||
1437 | priv->mic.jack = jack; | 1442 | priv->mic.jack = jack; |
1438 | priv->mic.report = detect_report; | 1443 | priv->mic.report = detect_report; |