mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
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 <david.rhodes@cirrus.com> Signed-off-by: Ravi Vembu <raviv@motorola.com> 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
This commit is contained in:
parent
191c7d0a88
commit
6224ece969
1 changed files with 19 additions and 19 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue