Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Reload firmware before power on if failed in probe (TAS2557)
Browse files Browse the repository at this point in the history
Fix for speaker problem
  • Loading branch information
robante15 committed Jul 17, 2020
1 parent 0dcafb7 commit 5c93024
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion sound/soc/codecs/sdm660_cdc/tas2557-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,31 @@ int tas2557_enable(struct tas2557_priv *pTAS2557, bool bEnable)
{
int nResult = 0;
unsigned int nValue;
const char *pFWName;
struct TProgram *pProgram;

dev_dbg(pTAS2557->dev, "Enable: %d\n", bEnable);

if ((pTAS2557->mpFirmware->mnPrograms == 0)
|| (pTAS2557->mpFirmware->mnConfigurations == 0)) {
dev_err(pTAS2557->dev, "%s, firmware not loaded\n", __func__);
goto end;
/*Load firmware*/
if (pTAS2557->mnPGID == TAS2557_PG_VERSION_2P1) {
dev_info(pTAS2557->dev, "PG2.1 Silicon found\n");
pFWName = TAS2557_FW_NAME;
} else if (pTAS2557->mnPGID == TAS2557_PG_VERSION_1P0) {
dev_info(pTAS2557->dev, "PG1.0 Silicon found\n");
pFWName = TAS2557_PG1P0_FW_NAME;
} else {
nResult = -ENOTSUPP;
dev_info(pTAS2557->dev, "unsupport Silicon 0x%x\n", pTAS2557->mnPGID);
goto end;
}
nResult = request_firmware_nowait(THIS_MODULE, 1, pFWName,
pTAS2557->dev, GFP_KERNEL, pTAS2557, tas2557_fw_ready);
if(nResult < 0)
goto end;
dev_err(pTAS2557->dev, "%s, firmware is loaded\n", __func__);
}
/* check safe guard*/
nResult = pTAS2557->read(pTAS2557, TAS2557_SAFE_GUARD_REG, &nValue);
Expand Down

0 comments on commit 5c93024

Please sign in to comment.