From a1d45298c13d236697ba721df45ae41ac9ee537e Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Thu, 25 Jan 2024 10:31:15 +0000 Subject: [PATCH] UPSTREAM: 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 Reviewed-by: Andy Shevchenko Signed-off-by: Charles Keepax Link: https://msgid.link/r/20240125103117.2622095-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown (cherry picked from commit 96c716887c1a918d4cb4610f5cf111280fda48f0) BUG=b:326869955 TEST=Test Audio use cases. Change-Id: I5f0f58be4f460e76fd125624159d94af0eca3e9e Signed-off-by: Debi sahoo --- sound/soc/codecs/cs42l43-jack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 67ccdc8bab6f..901b9dbcf585 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -647,7 +648,7 @@ static int cs42l43_run_load_detect(struct cs42l43_codec *priv, bool mic) static int cs42l43_run_type_detect(struct cs42l43_codec *priv) { struct cs42l43 *cs42l43 = priv->core; - int timeout_ms = ((2 * priv->detect_us) / 1000) + 200; + int timeout_ms = ((2 * priv->detect_us) / USEC_PER_MSEC) + 200; unsigned int type = 0xff; unsigned long time_left;