Skip to content

Commit c9f2e3c

Browse files
Vitaly Rodionovbroonie
authored andcommitted
ASoC: cs42l42: make HSBIAS_SENSE_EN optional
HSBIAS_SENSE_EN configures HSBIAS output current sense through the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce the potential pop noise during the headset plug out slowly. But on some platforms ESD voltage will affect it causing test to fail, especially with CTIA headset type. For different hardware setups, a designer might want to tweak default behavior. Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511145220.125760-1-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9b74934 commit c9f2e3c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Documentation/devicetree/bindings/sound/cs42l42.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ Optional properties:
8181
< x1 x2 x3 x4 >
8282
Default = < 15 8 4 1>
8383

84+
- cirrus,hs-bias-sense-disable: This is boolean property. If present the
85+
HSBIAS sense is disabled. Configures HSBIAS output current sense through
86+
the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce
87+
the potential pop noise during the headset plug out slowly. But on some
88+
platforms ESD voltage will affect it causing test to fail, especially
89+
with CTIA headset type. For different hardware setups, a designer might
90+
want to tweak default behavior.
8491

8592
Example:
8693

sound/soc/codecs/cs42l42.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ static void cs42l42_process_hs_type_detect(struct cs42l42_private *cs42l42)
10331033
CS42L42_AUTO_HSBIAS_HIZ_MASK |
10341034
CS42L42_TIP_SENSE_EN_MASK |
10351035
CS42L42_HSBIAS_SENSE_TRIP_MASK,
1036-
(1 << CS42L42_HSBIAS_SENSE_EN_SHIFT) |
1036+
(cs42l42->hs_bias_sense_en << CS42L42_HSBIAS_SENSE_EN_SHIFT) |
10371037
(1 << CS42L42_AUTO_HSBIAS_HIZ_SHIFT) |
10381038
(0 << CS42L42_TIP_SENSE_EN_SHIFT) |
10391039
(3 << CS42L42_HSBIAS_SENSE_TRIP_SHIFT));
@@ -1808,6 +1808,11 @@ static int cs42l42_handle_device_data(struct device *dev,
18081808
(cs42l42->hs_bias_ramp_rate <<
18091809
CS42L42_HSBIAS_RAMP_SHIFT));
18101810

1811+
if (device_property_read_bool(dev, "cirrus,hs-bias-sense-disable"))
1812+
cs42l42->hs_bias_sense_en = 0;
1813+
else
1814+
cs42l42->hs_bias_sense_en = 1;
1815+
18111816
return 0;
18121817
}
18131818

sound/soc/codecs/cs42l42.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ struct cs42l42_private {
787787
u8 bias_thresholds[CS42L42_NUM_BIASES];
788788
u8 hs_bias_ramp_rate;
789789
u8 hs_bias_ramp_time;
790+
u8 hs_bias_sense_en;
790791
u8 stream_use;
791792
};
792793

0 commit comments

Comments
 (0)