summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Taube <[email protected]>2025-08-11 08:29:47 -0700
committerAnup Patel <[email protected]>2025-08-28 10:50:14 +0530
commit6a1f53bc2d91310adc44c158596dd1c3efa18080 (patch)
tree178e279cd427f5d82eebf112e5b5933cedbf01ef
parent4b687e36695edef8233bfca758b8d05a74b9a6de (diff)
dbtr: Fix sbi_dbtr_read_trig to read from CSRs
sbi_dbtr_read_trig returned the saved state of tdata{1-3}, when it should have returned the updated state read from CSRs. Update sbi_dbtr_read_trig to return updated state read from CSRs. Signed-off-by: Anup Patel <[email protected]> Signed-off-by: Jesse Taube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
-rw-r--r--lib/sbi/sbi_dbtr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
index c30c2fd6..656a6261 100644
--- a/lib/sbi/sbi_dbtr.c
+++ b/lib/sbi/sbi_dbtr.c
@@ -563,6 +563,10 @@ int sbi_dbtr_read_trig(unsigned long smode,
for_each_trig_entry(shmem_base, trig_count, typeof(*entry), entry) {
xmit = &entry->data;
trig = INDEX_TO_TRIGGER((_idx + trig_idx_base));
+ csr_write(CSR_TSELECT, trig->index);
+ trig->tdata1 = csr_read(CSR_TDATA1);
+ trig->tdata2 = csr_read(CSR_TDATA2);
+ trig->tdata3 = csr_read(CSR_TDATA3);
xmit->tstate = cpu_to_lle(trig->state);
xmit->tdata1 = cpu_to_lle(trig->tdata1);
xmit->tdata2 = cpu_to_lle(trig->tdata2);