aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2018-08-31 11:14:05 -0400
committerMark Brown <broonie@kernel.org>2018-08-31 11:23:25 -0400
commitd40e3e9e44db4b3c8777f3b515ba6097ba26e3b2 (patch)
tree3d23248a0db2eb3d0e48d9b34799b50d1eb30dca
parent5ea752c6efdf5aa8a57aed816d453a8f479f1b0a (diff)
ASoC: tas6424: Save last fault register even when clear
When there is no fault bit set in a fault register we skip the fault reporting section for that register. This also skips over saving that registers value. We save the value so we will not double report an error, but if an error clears then returns we will also not report it as we did not save the all cleared register value. Fix this by saving the fault register value in the all clear path. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-rw-r--r--sound/soc/codecs/tas6424.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c
index 14999b999fd3..0d6145549a98 100644
--- a/sound/soc/codecs/tas6424.c
+++ b/sound/soc/codecs/tas6424.c
@@ -424,8 +424,10 @@ static void tas6424_fault_check_work(struct work_struct *work)
424 TAS6424_FAULT_PVDD_UV | 424 TAS6424_FAULT_PVDD_UV |
425 TAS6424_FAULT_VBAT_UV; 425 TAS6424_FAULT_VBAT_UV;
426 426
427 if (reg) 427 if (!reg) {
428 tas6424->last_fault1 = reg;
428 goto check_global_fault2_reg; 429 goto check_global_fault2_reg;
430 }
429 431
430 /* 432 /*
431 * Only flag errors once for a given occurrence. This is needed as 433 * Only flag errors once for a given occurrence. This is needed as
@@ -461,8 +463,10 @@ check_global_fault2_reg:
461 TAS6424_FAULT_OTSD_CH3 | 463 TAS6424_FAULT_OTSD_CH3 |
462 TAS6424_FAULT_OTSD_CH4; 464 TAS6424_FAULT_OTSD_CH4;
463 465
464 if (!reg) 466 if (!reg) {
467 tas6424->last_fault2 = reg;
465 goto check_warn_reg; 468 goto check_warn_reg;
469 }
466 470
467 if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD)) 471 if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD))
468 dev_crit(dev, "experienced a global overtemp shutdown\n"); 472 dev_crit(dev, "experienced a global overtemp shutdown\n");
@@ -497,8 +501,10 @@ check_warn_reg:
497 TAS6424_WARN_VDD_OTW_CH3 | 501 TAS6424_WARN_VDD_OTW_CH3 |
498 TAS6424_WARN_VDD_OTW_CH4; 502 TAS6424_WARN_VDD_OTW_CH4;
499 503
500 if (!reg) 504 if (!reg) {
505 tas6424->last_warn = reg;
501 goto out; 506 goto out;
507 }
502 508
503 if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV)) 509 if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV))
504 dev_warn(dev, "experienced a VDD under voltage condition\n"); 510 dev_warn(dev, "experienced a VDD under voltage condition\n");