diff options
Diffstat (limited to 'sound/soc/codecs/wm_hubs.c')
-rw-r--r-- | sound/soc/codecs/wm_hubs.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index e1f225a3ac46..16f1a57da08a 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -91,7 +91,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op) | |||
91 | */ | 91 | */ |
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 = codec->private_data; | 94 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
95 | u16 reg, reg_l, reg_r, dcs_cfg; | 95 | u16 reg, reg_l, reg_r, dcs_cfg; |
96 | 96 | ||
97 | /* Set for 32 series updates */ | 97 | /* Set for 32 series updates */ |
@@ -127,6 +127,8 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) | |||
127 | break; | 127 | break; |
128 | } | 128 | } |
129 | 129 | ||
130 | dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r); | ||
131 | |||
130 | /* HPOUT1L */ | 132 | /* HPOUT1L */ |
131 | if (reg_l + hubs->dcs_codes > 0 && | 133 | if (reg_l + hubs->dcs_codes > 0 && |
132 | reg_l + hubs->dcs_codes < 0xff) | 134 | reg_l + hubs->dcs_codes < 0xff) |
@@ -139,6 +141,8 @@ static void calibrate_dc_servo(struct snd_soc_codec *codec) | |||
139 | reg_r += hubs->dcs_codes; | 141 | reg_r += hubs->dcs_codes; |
140 | dcs_cfg |= reg_r; | 142 | dcs_cfg |= reg_r; |
141 | 143 | ||
144 | dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); | ||
145 | |||
142 | /* Do it */ | 146 | /* Do it */ |
143 | snd_soc_write(codec, WM8993_DC_SERVO_3, dcs_cfg); | 147 | snd_soc_write(codec, WM8993_DC_SERVO_3, dcs_cfg); |
144 | wait_for_dc_servo(codec, | 148 | wait_for_dc_servo(codec, |
@@ -154,7 +158,7 @@ static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol, | |||
154 | struct snd_ctl_elem_value *ucontrol) | 158 | struct snd_ctl_elem_value *ucontrol) |
155 | { | 159 | { |
156 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 160 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
157 | struct wm_hubs_data *hubs = codec->private_data; | 161 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
158 | int ret; | 162 | int ret; |
159 | 163 | ||
160 | ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); | 164 | ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); |
@@ -327,7 +331,7 @@ static int hp_supply_event(struct snd_soc_dapm_widget *w, | |||
327 | struct snd_kcontrol *kcontrol, int event) | 331 | struct snd_kcontrol *kcontrol, int event) |
328 | { | 332 | { |
329 | struct snd_soc_codec *codec = w->codec; | 333 | struct snd_soc_codec *codec = w->codec; |
330 | struct wm_hubs_data *hubs = codec->private_data; | 334 | struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
331 | 335 | ||
332 | switch (event) { | 336 | switch (event) { |
333 | case SND_SOC_DAPM_PRE_PMU: | 337 | case SND_SOC_DAPM_PRE_PMU: |
@@ -397,14 +401,14 @@ static int hp_event(struct snd_soc_dapm_widget *w, | |||
397 | 401 | ||
398 | case SND_SOC_DAPM_PRE_PMD: | 402 | case SND_SOC_DAPM_PRE_PMD: |
399 | snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0, | 403 | snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0, |
400 | WM8993_HPOUT1L_DLY | | 404 | WM8993_HPOUT1L_OUTP | |
401 | WM8993_HPOUT1R_DLY | | 405 | WM8993_HPOUT1R_OUTP | |
402 | WM8993_HPOUT1L_RMV_SHORT | | 406 | WM8993_HPOUT1L_RMV_SHORT | |
403 | WM8993_HPOUT1R_RMV_SHORT, 0); | 407 | WM8993_HPOUT1R_RMV_SHORT, 0); |
404 | 408 | ||
405 | snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0, | 409 | snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0, |
406 | WM8993_HPOUT1L_OUTP | | 410 | WM8993_HPOUT1L_DLY | |
407 | WM8993_HPOUT1R_OUTP, 0); | 411 | WM8993_HPOUT1R_DLY, 0); |
408 | 412 | ||
409 | snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_1, | 413 | snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_1, |
410 | WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA, | 414 | WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA, |