diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm_hubs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 486bdd21a98a..3729a12b151f 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -113,13 +113,15 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) | |||
113 | /* HPOUT1L */ | 113 | /* HPOUT1L */ |
114 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) & | 114 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) & |
115 | WM8993_DCS_INTEG_CHAN_0_MASK;; | 115 | WM8993_DCS_INTEG_CHAN_0_MASK;; |
116 | reg += hubs->dcs_codes; | 116 | if (reg + hubs->dcs_codes > 0 && reg + hubs->dcs_codes < 0xff) |
117 | reg += hubs->dcs_codes; | ||
117 | dcs_cfg = reg << WM8993_DCS_DAC_WR_VAL_1_SHIFT; | 118 | dcs_cfg = reg << WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
118 | 119 | ||
119 | /* HPOUT1R */ | 120 | /* HPOUT1R */ |
120 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) & | 121 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) & |
121 | WM8993_DCS_INTEG_CHAN_1_MASK; | 122 | WM8993_DCS_INTEG_CHAN_1_MASK; |
122 | reg += hubs->dcs_codes; | 123 | if (reg + hubs->dcs_codes > 0 && reg + hubs->dcs_codes < 0xff) |
124 | reg += hubs->dcs_codes; | ||
123 | dcs_cfg |= reg; | 125 | dcs_cfg |= reg; |
124 | 126 | ||
125 | /* Do it */ | 127 | /* Do it */ |