From 6224ece9693bcfca161ed05137d4099090786407 Mon Sep 17 00:00:00 2001 From: David Rhodes Date: Tue, 5 Jun 2018 13:27:30 -0500 Subject: [PATCH] ASoC: cs35l41: Move OTP_BOOT_DONE wait Wait for OTP_BOOT_DONE as the first operation out of reset. This is to facilitate B0 parts that may have DEVID programmed by OTP. SQA-856 Change-Id: I43484188c74aa0ae3bebcfdafe6f87e5cbe8bd25 Signed-off-by: David Rhodes Signed-off-by: Ravi Vembu Mot-CRs-Fixed: (CR) Reviewed-on: https://gerrit.mot.com/1202252 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Submit-Approved: Jira Key --- sound/soc/codecs/cs35l41.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 16db7b67ffd6..75f08314c432 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -1603,6 +1603,25 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, usleep_range(2000, 2100); + do { + if (timeout == 0) { + dev_err(cs35l41->dev, + "Timeout waiting for OTP_BOOT_DONE\n"); + ret = -EBUSY; + goto err; + } + usleep_range(1000, 1100); + regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS4, &int_status); + timeout--; + } while (!(int_status & CS35L41_OTP_BOOT_DONE)); + + regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS3, &int_status); + if (int_status & CS35L41_OTP_BOOT_ERR) { + dev_err(cs35l41->dev, "OTP Boot error\n"); + ret = -EINVAL; + goto err; + } + ret = regmap_read(cs35l41->regmap, CS35L41_DEVID, ®id); if (ret < 0) { dev_err(cs35l41->dev, "Get Device ID failed\n"); @@ -1659,25 +1678,6 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, } } - do { - if (timeout == 0) { - dev_err(cs35l41->dev, - "Timeout waiting for OTP_BOOT_DONE\n"); - ret = -EBUSY; - goto err; - } - usleep_range(1000, 1100); - regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS4, &int_status); - timeout--; - } while (!(int_status & CS35L41_OTP_BOOT_DONE)); - - regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS3, &int_status); - if (int_status & CS35L41_OTP_BOOT_ERR) { - dev_err(cs35l41->dev, "OTP Boot error\n"); - ret = -EINVAL; - goto err; - } - ret = cs35l41_otp_unpack(cs35l41); if (ret < 0) { dev_err(cs35l41->dev, "OTP Unpack failed\n");