aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_hubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm_hubs.c')
-rw-r--r--sound/soc/codecs/wm_hubs.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
index c466982eed23..613df5db0b32 100644
--- a/sound/soc/codecs/wm_hubs.c
+++ b/sound/soc/codecs/wm_hubs.c
@@ -91,6 +91,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op)
91static void calibrate_dc_servo(struct snd_soc_codec *codec) 91static void calibrate_dc_servo(struct snd_soc_codec *codec)
92{ 92{
93 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); 93 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
94 s8 offset;
94 u16 reg, reg_l, reg_r, dcs_cfg; 95 u16 reg, reg_l, reg_r, dcs_cfg;
95 96
96 /* If we're using a digital only path and have a previously 97 /* If we're using a digital only path and have a previously
@@ -149,16 +150,14 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec)
149 hubs->dcs_codes); 150 hubs->dcs_codes);
150 151
151 /* HPOUT1L */ 152 /* HPOUT1L */
152 if (reg_l + hubs->dcs_codes > 0 && 153 offset = reg_l;
153 reg_l + hubs->dcs_codes < 0xff) 154 offset += hubs->dcs_codes;
154 reg_l += hubs->dcs_codes; 155 dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
155 dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
156 156
157 /* HPOUT1R */ 157 /* HPOUT1R */
158 if (reg_r + hubs->dcs_codes > 0 && 158 offset = reg_r;
159 reg_r + hubs->dcs_codes < 0xff) 159 offset += hubs->dcs_codes;
160 reg_r += hubs->dcs_codes; 160 dcs_cfg |= (u8)offset;
161 dcs_cfg |= reg_r;
162 161
163 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); 162 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg);
164 163