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: Allow core re-initialization for Runtime PM support

Prepare i3c_hci_reset_and_init() to support runtime resume. Update it to
handle the case where the I/O mode has already been selected.

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

authored by

Adrian Hunter and committed by
Alexandre Belloni
f2b5d43c 7f91e0e6

+21 -17
+21 -17
drivers/i3c/master/mipi-i3c-hci/core.c
··· 681 681 } 682 682 } 683 683 684 - /* Try activating DMA operations first */ 685 - if (hci->RHS_regs) { 686 - ret = i3c_hci_set_io_mode(hci, true); 687 - if (!ret) { 688 - hci->io = &mipi_i3c_hci_dma; 689 - dev_dbg(&hci->master.dev, "Using DMA\n"); 684 + if (hci->io) { 685 + ret = i3c_hci_set_io_mode(hci, hci->io == &mipi_i3c_hci_dma); 686 + } else { 687 + /* Try activating DMA operations first */ 688 + if (hci->RHS_regs) { 689 + ret = i3c_hci_set_io_mode(hci, true); 690 + if (!ret) { 691 + hci->io = &mipi_i3c_hci_dma; 692 + dev_dbg(&hci->master.dev, "Using DMA\n"); 693 + } 690 694 } 691 - } 692 695 693 - /* If no DMA, try PIO */ 694 - if (!hci->io && hci->PIO_regs) { 695 - ret = i3c_hci_set_io_mode(hci, false); 696 - if (!ret) { 697 - hci->io = &mipi_i3c_hci_pio; 698 - dev_dbg(&hci->master.dev, "Using PIO\n"); 696 + /* If no DMA, try PIO */ 697 + if (!hci->io && hci->PIO_regs) { 698 + ret = i3c_hci_set_io_mode(hci, false); 699 + if (!ret) { 700 + hci->io = &mipi_i3c_hci_pio; 701 + dev_dbg(&hci->master.dev, "Using PIO\n"); 702 + } 699 703 } 700 - } 701 704 702 - if (!hci->io) { 703 - dev_err(&hci->master.dev, "neither DMA nor PIO can be used\n"); 704 - ret = ret ?: -EINVAL; 705 + if (!hci->io) { 706 + dev_err(&hci->master.dev, "neither DMA nor PIO can be used\n"); 707 + ret = ret ?: -EINVAL; 708 + } 705 709 } 706 710 if (ret) 707 711 return ret;