Skip to content

Commit dc96528

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: cs42l43: Don't enable bias sense during type detect
Alas on some headsets the bias sense can cause problems with the type detection. It can occasionally be falsely triggered by the type detect itself and as the clamp is applied when this happens, it will cause a headset to be incorrectly identified as headphones. As such it should be disabled whilst running type detect. This does mean a jack removal during type detect will cause a larger click but that is unfortunately unavoidable. Fixes: 1e4ce0d ("ASoC: cs42l43: Move headset bias sense enable earlier in process") Signed-off-by: Charles Keepax <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 02a914e commit dc96528

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

sound/soc/codecs/cs42l43-jack.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ int cs42l43_set_jack(struct snd_soc_component *component,
237237
return ret;
238238
}
239239

240-
static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool force_high)
240+
static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool type_detect)
241241
{
242242
struct cs42l43 *cs42l43 = priv->core;
243243
unsigned int val = 0x3 << CS42L43_HSBIAS_MODE_SHIFT;
@@ -247,16 +247,17 @@ static void cs42l43_start_hs_bias(struct cs42l43_codec *priv, bool force_high)
247247
regmap_update_bits(cs42l43->regmap, CS42L43_HS2,
248248
CS42L43_HS_CLAMP_DISABLE_MASK, CS42L43_HS_CLAMP_DISABLE_MASK);
249249

250-
if (!force_high && priv->bias_low)
251-
val = 0x2 << CS42L43_HSBIAS_MODE_SHIFT;
252-
253-
if (priv->bias_sense_ua) {
254-
regmap_update_bits(cs42l43->regmap,
255-
CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL,
256-
CS42L43_HSBIAS_SENSE_EN_MASK |
257-
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK,
258-
CS42L43_HSBIAS_SENSE_EN_MASK |
259-
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK);
250+
if (!type_detect) {
251+
if (priv->bias_low)
252+
val = 0x2 << CS42L43_HSBIAS_MODE_SHIFT;
253+
254+
if (priv->bias_sense_ua)
255+
regmap_update_bits(cs42l43->regmap,
256+
CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL,
257+
CS42L43_HSBIAS_SENSE_EN_MASK |
258+
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK,
259+
CS42L43_HSBIAS_SENSE_EN_MASK |
260+
CS42L43_AUTO_HSBIAS_CLAMP_EN_MASK);
260261
}
261262

262263
regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1,

0 commit comments

Comments
 (0)