]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: mipi-i3c-hci: Add quirk to allow IBI while runtime suspended
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 6 Mar 2026 08:53:35 +0000 (10:53 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 12 Apr 2026 14:32:45 +0000 (16:32 +0200)
Some I3C controllers can be automatically runtime-resumed in order to
handle in-band interrupts (IBIs), meaning that runtime suspend does not
need to be blocked when IBIs are enabled.

For example, a PCI-attached controller in a low-power state may generate
a Power Management Event (PME) when the SDA line is pulled low to signal
the START condition of an IBI. The PCI subsystem will then runtime-resume
the device, allowing the IBI to be received without requiring the
controller to remain active.

Introduce a new quirk, HCI_QUIRK_RPM_IBI_ALLOWED, so that drivers can
opt-in to this capability via driver data.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260306085338.62955-3-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/mipi-i3c-hci/core.c
drivers/i3c/master/mipi-i3c-hci/hci.h

index 284f3ed7af8cb0bfd5fb7daee3eb31532797bd9d..54d5492545ef4f136ac2c79cb043ef3367604d73 100644 (file)
@@ -996,6 +996,9 @@ static int i3c_hci_probe(struct platform_device *pdev)
        if (hci->quirks & HCI_QUIRK_RPM_ALLOWED)
                i3c_hci_rpm_enable(&pdev->dev);
 
+       if (hci->quirks & HCI_QUIRK_RPM_IBI_ALLOWED)
+               hci->master.rpm_ibi_allowed = true;
+
        return i3c_master_register(&hci->master, &pdev->dev, &i3c_hci_ops, false);
 }
 
index 9ac9d0e342f4f5e96a19aaa532573528a5a738ad..02cab3b3bc6f3dc666a42518c90f764f7763fc74 100644 (file)
@@ -150,6 +150,7 @@ struct i3c_hci_dev_data {
 #define HCI_QUIRK_OD_PP_TIMING         BIT(3)  /* Set OD and PP timings for AMD platforms */
 #define HCI_QUIRK_RESP_BUF_THLD                BIT(4)  /* Set resp buf thld to 0 for AMD platforms */
 #define HCI_QUIRK_RPM_ALLOWED          BIT(5)  /* Runtime PM allowed */
+#define HCI_QUIRK_RPM_IBI_ALLOWED      BIT(6)  /* IBI and Hot-Join allowed while runtime suspended */
 
 /* global functions */
 void mipi_i3c_hci_resume(struct i3c_hci *hci);