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-pci: Add Runtime PM support

Enable Runtime PM for the mipi_i3c_hci_pci driver. Introduce helpers to
allow and forbid Runtime PM during probe and remove, using pm_runtime APIs.

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

authored by

Adrian Hunter and committed by
Alexandre Belloni
95cb1935 b9a15012

+17
+17
drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
··· 18 18 #include <linux/platform_data/mipi-i3c-hci.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/pm_qos.h> 21 + #include <linux/pm_runtime.h> 21 22 22 23 /* 23 24 * There can up to 15 instances, but implementations have at most 2 at this ··· 209 208 .instance_count = 1, 210 209 }; 211 210 211 + static void mipi_i3c_hci_pci_rpm_allow(struct device *dev) 212 + { 213 + pm_runtime_put(dev); 214 + pm_runtime_allow(dev); 215 + } 216 + 217 + static void mipi_i3c_hci_pci_rpm_forbid(struct device *dev) 218 + { 219 + pm_runtime_forbid(dev); 220 + pm_runtime_get_sync(dev); 221 + } 222 + 212 223 struct mipi_i3c_hci_pci_cell_data { 213 224 struct mipi_i3c_hci_platform_data pdata; 214 225 struct resource res; ··· 298 285 299 286 pci_set_drvdata(pci, hci); 300 287 288 + mipi_i3c_hci_pci_rpm_allow(&pci->dev); 289 + 301 290 return 0; 302 291 303 292 err_exit: ··· 314 299 315 300 if (hci->info->exit) 316 301 hci->info->exit(hci); 302 + 303 + mipi_i3c_hci_pci_rpm_forbid(&pci->dev); 317 304 318 305 mfd_remove_devices(&pci->dev); 319 306 }