ASoC: wcd9335: fix mute issue on headphone during concurrency
Currently class-H controller is not enabled when lineout is enabled first and then headphone is enabled. Because of this mute is observed on headphone during lineout and headphone concurrent scenarios. Fix mute on headphone by enabling class H block during concurrency. Change-Id: Ibed962eaacf87c3eb55c569d2ae9c6363a63cace Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org> CRs-Fixed: 957405
This commit is contained in:
parent
8b04e6988c
commit
2263eb03e8
1 changed files with 47 additions and 8 deletions
|
@ -133,6 +133,8 @@ wcd_enable_clsh_block(struct snd_soc_codec *codec,
|
||||||
(!enable && --clsh_d->clsh_users == 0))
|
(!enable && --clsh_d->clsh_users == 0))
|
||||||
snd_soc_update_bits(codec, WCD9XXX_A_CDC_CLSH_CRC, 0x01,
|
snd_soc_update_bits(codec, WCD9XXX_A_CDC_CLSH_CRC, 0x01,
|
||||||
(u8) enable);
|
(u8) enable);
|
||||||
|
if (clsh_d->clsh_users < 0)
|
||||||
|
clsh_d->clsh_users = 0;
|
||||||
dev_dbg(codec->dev, "%s: clsh_users %d, enable %d", __func__,
|
dev_dbg(codec->dev, "%s: clsh_users %d, enable %d", __func__,
|
||||||
clsh_d->clsh_users, enable);
|
clsh_d->clsh_users, enable);
|
||||||
}
|
}
|
||||||
|
@ -545,22 +547,53 @@ static void wcd_clsh_state_hph_lo(struct snd_soc_codec *codec,
|
||||||
if (req_state == WCD_CLSH_STATE_LO)
|
if (req_state == WCD_CLSH_STATE_LO)
|
||||||
wcd_clsh_set_buck_regulator_mode(codec, CLS_AB);
|
wcd_clsh_set_buck_regulator_mode(codec, CLS_AB);
|
||||||
else {
|
else {
|
||||||
|
if (!wcd_clsh_enable_status(codec)) {
|
||||||
|
wcd_enable_clsh_block(codec, clsh_d, true);
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_CLSH_K1_MSB,
|
||||||
|
0x0F, 0x00);
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_CLSH_K1_LSB,
|
||||||
|
0xFF, 0xC0);
|
||||||
wcd_clsh_set_flyback_mode(codec, mode);
|
wcd_clsh_set_flyback_mode(codec, mode);
|
||||||
wcd_clsh_set_buck_mode(codec, mode);
|
wcd_clsh_set_buck_mode(codec, mode);
|
||||||
if ((req_state == WCD_CLSH_STATE_HPHL) ||
|
wcd_clsh_set_hph_mode(codec, mode);
|
||||||
(req_state == WCD_CLSH_STATE_HPHR))
|
|
||||||
wcd_clsh_set_gain_path(codec, mode);
|
wcd_clsh_set_gain_path(codec, mode);
|
||||||
|
} else {
|
||||||
|
dev_dbg(codec->dev, "%s:clsh is already enabled\n",
|
||||||
|
__func__);
|
||||||
|
}
|
||||||
|
if (req_state == WCD_CLSH_STATE_HPHL)
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_RX1_RX_PATH_CFG0,
|
||||||
|
0x40, 0x40);
|
||||||
|
if (req_state == WCD_CLSH_STATE_HPHR)
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_RX2_RX_PATH_CFG0,
|
||||||
|
0x40, 0x40);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((req_state == WCD_CLSH_STATE_HPHL) ||
|
if ((req_state == WCD_CLSH_STATE_HPHL) ||
|
||||||
(req_state == WCD_CLSH_STATE_HPHR)) {
|
(req_state == WCD_CLSH_STATE_HPHR)) {
|
||||||
|
if (req_state == WCD_CLSH_STATE_HPHL)
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_RX1_RX_PATH_CFG0,
|
||||||
|
0x40, 0x00);
|
||||||
|
if (req_state == WCD_CLSH_STATE_HPHR)
|
||||||
|
snd_soc_update_bits(codec,
|
||||||
|
WCD9XXX_A_CDC_RX2_RX_PATH_CFG0,
|
||||||
|
0x40, 0x00);
|
||||||
/*
|
/*
|
||||||
* If HPH is powering down first, then set the
|
* If HPH is powering down first, then disable clsh,
|
||||||
* buck/flyback mode to default and keep the
|
* set the buck/flyback mode to default and keep the
|
||||||
* regulator at Class-AB
|
* regulator at Class-AB
|
||||||
*/
|
*/
|
||||||
|
if ((clsh_d->state & WCD_CLSH_STATE_HPH_ST)
|
||||||
|
!= WCD_CLSH_STATE_HPH_ST) {
|
||||||
|
wcd_enable_clsh_block(codec, clsh_d, false);
|
||||||
wcd_clsh_set_flyback_mode(codec, CLS_H_NORMAL);
|
wcd_clsh_set_flyback_mode(codec, CLS_H_NORMAL);
|
||||||
wcd_clsh_set_buck_mode(codec, CLS_H_NORMAL);
|
wcd_clsh_set_buck_mode(codec, CLS_H_NORMAL);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* LO powerdown.
|
/* LO powerdown.
|
||||||
* If HPH mode also is CLS-AB, no need
|
* If HPH mode also is CLS-AB, no need
|
||||||
|
@ -573,6 +606,9 @@ static void wcd_clsh_state_hph_lo(struct snd_soc_codec *codec,
|
||||||
else if (clsh_d->state & WCD_CLSH_STATE_HPHR)
|
else if (clsh_d->state & WCD_CLSH_STATE_HPHR)
|
||||||
hph_mode = wcd_clsh_get_int_mode(clsh_d,
|
hph_mode = wcd_clsh_get_int_mode(clsh_d,
|
||||||
WCD_CLSH_STATE_HPHR);
|
WCD_CLSH_STATE_HPHR);
|
||||||
|
dev_dbg(codec->dev, "%s: hph_mode = %d\n", __func__,
|
||||||
|
hph_mode);
|
||||||
|
|
||||||
if ((hph_mode == CLS_AB) ||
|
if ((hph_mode == CLS_AB) ||
|
||||||
(hph_mode == CLS_NONE))
|
(hph_mode == CLS_NONE))
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -586,6 +622,9 @@ static void wcd_clsh_state_hph_lo(struct snd_soc_codec *codec,
|
||||||
wcd_clsh_set_buck_regulator_mode(codec,
|
wcd_clsh_set_buck_regulator_mode(codec,
|
||||||
hph_mode);
|
hph_mode);
|
||||||
goto end;
|
goto end;
|
||||||
|
} else {
|
||||||
|
dev_dbg(codec->dev, "%s: clsh is not enabled\n",
|
||||||
|
__func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
wcd_enable_clsh_block(codec, clsh_d, true);
|
wcd_enable_clsh_block(codec, clsh_d, true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue