History log of /linux-master/sound/soc/codecs/cs42l43-jack.c
Revision Date Author Comments
# 96c71688 25-Jan-2024 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Use USEC_PER_MSEC rather than hard coding

Use USEC_PER_MSEC rather than the hard coded value of 1000.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240125103117.2622095-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a2e7cf55 25-Jan-2024 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Check error from device_property_read_u32_array()

Whilst reading cirrus,buttons-ohms the error from
device_property_read_u32_array() is not checked, whilst there is a
preceding device_property_count_u32() which is checked the property
read can still fail. Add the missing check.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240125103117.2622095-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 40f6281c 25-Jan-2024 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Minor code tidy ups

Add some missing commas, refactor a couple small bits of code.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240125103117.2622095-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# fb430b06 25-Jan-2024 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Tidy up header includes

Use more forward declarations, move header guards to cover other
includes, and rely less on including headers through other headers.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://msgid.link/r/20240125103117.2622095-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# bbbc18d8 11-Dec-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Allow HP amp to cool off after current limit

Whilst occasional current limiting is fine, constant current limiting
should be avoided. Add a back off system that will disable the
headphone amp, if a lot of current limiting is seen in a short window
of time.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20231211160019.2034442-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# dc96528b 11-Dec-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

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: 1e4ce0d5c023 ("ASoC: cs42l43: Move headset bias sense enable earlier in process")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20231211160019.2034442-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6388a061 19-Sep-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Extend timeout on bias sense timeout

For very slow removals the current bias sense timeout is sometimes too
short and unclamps the mic bias before the jack removal is properly
detected by the tip detect, causing a pop. As bias sense should be
tuned to deliver very few false positives, increase the timeout fairly
dramatically to cover all but the most exaggerated removals.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1e4ce0d5 19-Sep-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Move headset bias sense enable earlier in process

Currently the bias sense is enabled along with the button detect, but
this has two problems. Firstly, the detections themselves arn't covered
by the bias sense, potentially resulting in pops and secondly, the
sequence of enabling/disabling looks like:

enable bias
enable bias sense
disable bias sense
disable bias

When the bias sense is disabled but the bias is still on the clamp is
removed and a pop results. Fix both of these issues by moving the bias
sense enable/disable to be along with the bias itself. With a resulting
sequence of:

enable bias sense
enable bias
disable bias
disable bias sense

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-5-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 9c0ccc9f 19-Sep-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Enable bias sense by default

Improve the default pop performance on jack removal by enabling bias
sense on the least sensitive level by default.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 686b8f71 19-Sep-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Lower default type detect time

The current default is a little excessive, reduce the pop on insertion
by reducing the time a little. The new value of 1000uS is still pretty
conservative.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230919103116.580305-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# 99d426c6 10-Oct-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Update values for bias sense

Due to an error in the datasheet the bias sense values currently don't
match the hardware. Whilst this is a change to the binding no devices
have yet shipped so updating the binding will not cause any issues.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231010102425.3662364-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# fc918cbe 04-Aug-2023 Charles Keepax <ckeepax@opensource.cirrus.com>

ASoC: cs42l43: Add support for the cs42l43

The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
(Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
for portable applications. It provides a high dynamic range, stereo
DAC for headphone output, two integrated Class D amplifiers for
loudspeakers, and two ADCs for wired headset microphone input or
stereo line input. PDM inputs are provided for digital microphones.

The ASoC component provides the majority of the functionality of the
device, all the audio functions.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230804104602.395892-7-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>