asoc: wcd939x: Disable legacy surge protection

Disable legacy HPH surge protection
for certain platforms. Enable HPH over-current
protection for all platforms.

Change-Id: I147321417ad2152530a71b3990a7cbf064c9299f
Signed-off-by: Sam Rainey <quic_rainey@quicinc.com>
This commit is contained in:
Sam Rainey
2023-02-07 19:36:03 -08:00
부모 4e4aec5874
커밋 742849e4e9

파일 보기

@@ -474,10 +474,23 @@ static int wcd939x_init_reg(struct snd_soc_component *component)
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(TEST_BLK_EN2, TXFE2_MBHC_CLKRST_EN, 0x00));
snd_soc_component_update_bits(component,
if (of_find_property(component->card->dev->of_node, "qcom,wcd-disable-legacy-surge", NULL)) {
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPHLR_SURGE_EN, EN_SURGE_PROTECTION_HPHL, 0x00));
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPHLR_SURGE_EN, EN_SURGE_PROTECTION_HPHR, 0x00));
}
else {
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPHLR_SURGE_EN, EN_SURGE_PROTECTION_HPHL, 0x01));
snd_soc_component_update_bits(component,
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPHLR_SURGE_EN, EN_SURGE_PROTECTION_HPHR, 0x01));
}
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPH_OCP_CTL, OCP_FSM_EN, 0x01));
snd_soc_component_update_bits(component,
REG_FIELD_VALUE(HPH_OCP_CTL, SCD_OP_EN, 0x01));
snd_soc_component_write(component, WCD939X_CFG0, 0x05);