If thermal sensor wrong, mute output
authorTracy Yi <tracy-yi@ti.com>
Mon, 29 Jan 2018 03:08:35 +0000 (11:08 +0800)
committerTracy Yi <tracy-yi@ti.com>
Mon, 29 Jan 2018 03:08:35 +0000 (11:08 +0800)
Signed-off-by: Tracy Yi <tracy-yi@ti.com>
tas2557-core.c

index a0d55e5e97012dabcf24b3d9aae4b3abeff975ed..233143ea099c0e7c71d42a9cedd2bacb5c0b9e6b 100755 (executable)
@@ -452,6 +452,13 @@ int tas2557_enable(struct tas2557_priv *pTAS2557, bool bEnable)
 
        dev_dbg(pTAS2557->dev, "Enable: %d\n", bEnable);
 
+       tas2557_get_die_temperature(pTAS2770, &nValue);
+       if(nValue == 0x80000000)
+       {
+               dev_err(pTAS2557->dev, "%s, thermal sensor is wrong, mute output\n", __func__);
+               goto end;
+       }
+
        if ((pTAS2557->mpFirmware->mnPrograms == 0)
                || (pTAS2557->mpFirmware->mnConfigurations == 0)) {
                dev_err(pTAS2557->dev, "%s, firmware not loaded\n", __func__);