Skip to content

Commit

Permalink
UPSTREAM: ASoC: cs42l43: Use USEC_PER_MSEC rather than hard coding
Browse files Browse the repository at this point in the history
Use USEC_PER_MSEC rather than the hard coded value of 1000.

Suggested-by: Andy Shevchenko <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Charles Keepax <[email protected]>
Link: https://msgid.link/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 96c716887c1a918d4cb4610f5cf111280fda48f0)

BUG=b:326869955
TEST=Test Audio use cases.

Change-Id: I5f0f58be4f460e76fd125624159d94af0eca3e9e
Signed-off-by: Debi sahoo <[email protected]>
  • Loading branch information
charleskeepax authored and terry182 committed Aug 20, 2024
1 parent 6e4e56c commit a1d4529
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/codecs/cs42l43-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/time.h>
#include <linux/workqueue.h>
#include <sound/control.h>
#include <sound/jack.h>
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit a1d4529

Please sign in to comment.