diff options
Diffstat (limited to 'sound/soc/codecs/wm_hubs.c')
-rw-r--r-- | sound/soc/codecs/wm_hubs.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 2cb81538cd91..359ad8869349 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -92,6 +92,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op) | |||
92 | static void calibrate_dc_servo(struct snd_soc_codec *codec) | 92 | static void calibrate_dc_servo(struct snd_soc_codec *codec) |
93 | { | 93 | { |
94 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); | 94 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
95 | s8 offset; | ||
95 | u16 reg, reg_l, reg_r, dcs_cfg; | 96 | u16 reg, reg_l, reg_r, dcs_cfg; |
96 | 97 | ||
97 | /* Set for 32 series updates */ | 98 | /* Set for 32 series updates */ |
@@ -130,16 +131,14 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) | |||
130 | dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r); | 131 | dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r); |
131 | 132 | ||
132 | /* HPOUT1L */ | 133 | /* HPOUT1L */ |
133 | if (reg_l + hubs->dcs_codes > 0 && | 134 | offset = reg_l; |
134 | reg_l + hubs->dcs_codes < 0xff) | 135 | offset += hubs->dcs_codes; |
135 | reg_l += hubs->dcs_codes; | 136 | dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
136 | dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT; | ||
137 | 137 | ||
138 | /* HPOUT1R */ | 138 | /* HPOUT1R */ |
139 | if (reg_r + hubs->dcs_codes > 0 && | 139 | offset = reg_r; |
140 | reg_r + hubs->dcs_codes < 0xff) | 140 | offset += hubs->dcs_codes; |
141 | reg_r += hubs->dcs_codes; | 141 | dcs_cfg |= (u8)offset; |
142 | dcs_cfg |= reg_r; | ||
143 | 142 | ||
144 | dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); | 143 | dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); |
145 | 144 | ||
@@ -293,7 +292,7 @@ SOC_DOUBLE_R("Speaker Switch", | |||
293 | SOC_DOUBLE_R("Speaker ZC Switch", | 292 | SOC_DOUBLE_R("Speaker ZC Switch", |
294 | WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT, | 293 | WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT, |
295 | 7, 1, 0), | 294 | 7, 1, 0), |
296 | SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 0, 3, 7, 0, | 295 | SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 3, 0, 7, 0, |
297 | spkboost_tlv), | 296 | spkboost_tlv), |
298 | SOC_ENUM("Speaker Reference", speaker_ref), | 297 | SOC_ENUM("Speaker Reference", speaker_ref), |
299 | SOC_ENUM("Speaker Mode", speaker_mode), | 298 | SOC_ENUM("Speaker Mode", speaker_mode), |