Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i3c: mipi-i3c-hci: Introduce helper to restore DAT

Add a dedicated function to restore the Device Address Table (DAT) in
preparation for Runtime PM support. This will allow reprogramming the DAT
after the controller resumes from a low-power state.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260113072702.16268-10-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Adrian Hunter and committed by
Alexandre Belloni
f180524a a372cfac

+10
+1
drivers/i3c/master/mipi-i3c-hci/dat.h
··· 24 24 void (*set_flags)(struct i3c_hci *hci, unsigned int dat_idx, u32 w0, u32 w1); 25 25 void (*clear_flags)(struct i3c_hci *hci, unsigned int dat_idx, u32 w0, u32 w1); 26 26 int (*get_index)(struct i3c_hci *hci, u8 address); 27 + void (*restore)(struct i3c_hci *hci); 27 28 }; 28 29 29 30 extern const struct hci_dat_ops mipi_i3c_hci_dat_v1;
+9
drivers/i3c/master/mipi-i3c-hci/dat_v1.c
··· 181 181 return -ENODEV; 182 182 } 183 183 184 + static void hci_dat_v1_restore(struct i3c_hci *hci) 185 + { 186 + for (int i = 0; i < hci->DAT_entries; i++) { 187 + writel(hci->DAT[i].w0, hci->DAT_regs + i * 8); 188 + writel(hci->DAT[i].w1, hci->DAT_regs + i * 8 + 4); 189 + } 190 + } 191 + 184 192 const struct hci_dat_ops mipi_i3c_hci_dat_v1 = { 185 193 .init = hci_dat_v1_init, 186 194 .alloc_entry = hci_dat_v1_alloc_entry, ··· 198 190 .set_flags = hci_dat_v1_set_flags, 199 191 .clear_flags = hci_dat_v1_clear_flags, 200 192 .get_index = hci_dat_v1_get_index, 193 + .restore = hci_dat_v1_restore, 201 194 };