aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_hubs.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-01-28 08:25:43 +0100
committerTakashi Iwai <tiwai@suse.de>2011-01-28 08:25:43 +0100
commitdcc3c4c016481de3fdb99c1f6ecb04d4229513d4 (patch)
treed3d40306e6dfe0971c6f7fca6a0e37bbe66d2215 /sound/soc/codecs/wm_hubs.c
parentded9f5238bb719737f82b0b5b957937cb0203804 (diff)
parenta3adfa00e8089aa72826c6ba04bcb18cfceaf0a9 (diff)
downloadkernel_samsung_crespo-dcc3c4c016481de3fdb99c1f6ecb04d4229513d4.zip
kernel_samsung_crespo-dcc3c4c016481de3fdb99c1f6ecb04d4229513d4.tar.gz
kernel_samsung_crespo-dcc3c4c016481de3fdb99c1f6ecb04d4229513d4.tar.bz2
Merge branch 'fix/asoc' into for-linus
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 c466982..613df5d 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)
static void calibrate_dc_servo(struct snd_soc_codec *codec)
{
struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
+ s8 offset;
u16 reg, reg_l, reg_r, dcs_cfg;
/* 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)
hubs->dcs_codes);
/* HPOUT1L */
- if (reg_l + hubs->dcs_codes > 0 &&
- reg_l + hubs->dcs_codes < 0xff)
- reg_l += hubs->dcs_codes;
- dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
+ offset = reg_l;
+ offset += hubs->dcs_codes;
+ dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
/* HPOUT1R */
- if (reg_r + hubs->dcs_codes > 0 &&
- reg_r + hubs->dcs_codes < 0xff)
- reg_r += hubs->dcs_codes;
- dcs_cfg |= reg_r;
+ offset = reg_r;
+ offset += hubs->dcs_codes;
+ dcs_cfg |= (u8)offset;
dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg);