mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
i3c: mipi-i3c-hci: Add DMA suspend and resume support
Introduce helper functions to suspend and resume DMA operations. These are required to prepare for upcoming Runtime PM support, ensuring that DMA state is properly managed during power transitions. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260113072702.16268-12-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
f5401c973e
commit
8169587204
|
|
@ -275,6 +275,29 @@ static void hci_dma_init_rings(struct i3c_hci *hci)
|
|||
hci_dma_init_rh(hci, &rings->headers[i], i);
|
||||
}
|
||||
|
||||
static void hci_dma_suspend(struct i3c_hci *hci)
|
||||
{
|
||||
struct hci_rings_data *rings = hci->io_data;
|
||||
int n = rings ? rings->total : 0;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
struct hci_rh_data *rh = &rings->headers[i];
|
||||
|
||||
rh_reg_write(INTR_SIGNAL_ENABLE, 0);
|
||||
rh_reg_write(RING_CONTROL, 0);
|
||||
}
|
||||
|
||||
i3c_hci_sync_irq_inactive(hci);
|
||||
}
|
||||
|
||||
static void hci_dma_resume(struct i3c_hci *hci)
|
||||
{
|
||||
struct hci_rings_data *rings = hci->io_data;
|
||||
|
||||
if (rings)
|
||||
hci_dma_init_rings(hci);
|
||||
}
|
||||
|
||||
static int hci_dma_init(struct i3c_hci *hci)
|
||||
{
|
||||
struct hci_rings_data *rings;
|
||||
|
|
@ -865,4 +888,6 @@ const struct hci_io_ops mipi_i3c_hci_dma = {
|
|||
.request_ibi = hci_dma_request_ibi,
|
||||
.free_ibi = hci_dma_free_ibi,
|
||||
.recycle_ibi_slot = hci_dma_recycle_ibi_slot,
|
||||
.suspend = hci_dma_suspend,
|
||||
.resume = hci_dma_resume,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ struct hci_io_ops {
|
|||
struct i3c_ibi_slot *slot);
|
||||
int (*init)(struct i3c_hci *hci);
|
||||
void (*cleanup)(struct i3c_hci *hci);
|
||||
void (*suspend)(struct i3c_hci *hci);
|
||||
void (*resume)(struct i3c_hci *hci);
|
||||
};
|
||||
|
||||
extern const struct hci_io_ops mipi_i3c_hci_pio;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user