summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Lee <lerobert@google.com>2022-09-08 05:50:05 +0000
committerRobert Lee <lerobert@google.com>2022-09-22 03:33:15 +0000
commit75b11b77e05c409a4b5b57002e111fcf60d3a666 (patch)
treef910648d06c19035a27990f6f618c87133a70239
parent762e32c4035bf018bd806e61d4b2e1b6e390ff2b (diff)
downloadamplifiers-75b11b77e05c409a4b5b57002e111fcf60d3a666.tar.gz
Bug: 231382694 Test: builds Change-Id: Ia59bdbca00e7167a08fddcb61d4cb551bb1a9fe0 Signed-off-by: Robert Lee <lerobert@google.com>
-rw-r--r--cs35l41/cs35l41.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cs35l41/cs35l41.c b/cs35l41/cs35l41.c
index c29230b..8c570e0 100644
--- a/cs35l41/cs35l41.c
+++ b/cs35l41/cs35l41.c
@@ -953,6 +953,30 @@ static bool cs35l41_is_csplmboxsts_correct(enum cs35l41_cspl_mboxcmd cmd,
}
}
+static void cs35l41_dump_debug_info(struct cs35l41_private *cs35l41)
+{
+ /* Vendor suggest to dump those registers for debugging
+ from b/237030499#comment12 */
+ static const unsigned int dump_regs[] = {
+ CS35L41_PLL_CLK_CTRL, /* 0x2c04 */
+ CS35L41_DSP_CLK_CTRL, /* 0x2c08 */
+ CS35L41_SP_RATE_CTRL, /* 0x4804 */
+ CS35L41_SP_FORMAT, /* 0x4808 */
+ CS35L41_SP_RX_WL, /* 0x4840 */
+ CS35L41_IRQ1_RAW_STATUS1, /* 0x10090 */
+ CS35L41_IRQ1_RAW_STATUS2, /* 0x10094 */
+ CS35L41_IRQ1_RAW_STATUS3, /* 0x10098 */
+ CS35L41_IRQ1_RAW_STATUS4, /* 0x1009c */
+ };
+ unsigned int reg_value;
+ int i;
+
+ for (i = 0;i < ARRAY_SIZE(dump_regs); i++) {
+ regmap_read(cs35l41->regmap, dump_regs[i], &reg_value);
+ dev_warn(cs35l41->dev, "Reg(%#x)=%#x\n", dump_regs[i], reg_value);
+ }
+}
+
static int cs35l41_set_csplmboxcmd(struct cs35l41_private *cs35l41,
enum cs35l41_cspl_mboxcmd cmd)
{
@@ -1018,6 +1042,7 @@ static int cs35l41_set_csplmboxcmd(struct cs35l41_private *cs35l41,
dev_err(cs35l41->dev,
"Failed to set mailbox(cmd: %u, sts: %u)\n", cmd, sts);
ret = -ENOMSG;
+ cs35l41_dump_debug_info(cs35l41);
}
return ret;