From: Adrian Hunter <adrian.hunter@intel.com>
To: alexandre.belloni@bootlin.com
Cc: Frank.Li@nxp.com, linux-i3c@lists.infradead.org
Subject: [PATCH V3 06/11] i3c: mipi-i3c-hci-pci: Assign unique device names and IDs for Intel LPSS I3C
Date: Tue, 16 Dec 2025 18:56:37 +0200 [thread overview]
Message-ID: <20251216165642.164583-7-adrian.hunter@intel.com> (raw)
In-Reply-To: <20251216165642.164583-1-adrian.hunter@intel.com>
Simplify the code and ensure names and IDs align with device documentation.
Use explicit device names and IDs for Intel LPSS I3C controllers instead of
dynamically allocated values.
Add "intel-lpss-i3c" to the platform_device_id table in the mipi-i3c-hci
driver and use the same name for Intel I3C controllers in the
mipi_i3c_hci_pci driver. Assign hard-coded IDs to reflect the hardware
layout.
Intel SoCs include two I3C PCI devices in the Low Power Subsystem (LPSS),
each supporting up to two I3C buses. The second PCI device is assigned ID 2
(not 1) to match this topology. Additional IDs will be introduced when
Multi-Bus Instance support is implemented.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
Change in V3:
New patch
drivers/i3c/master/mipi-i3c-hci/core.c | 7 +++
.../master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 43 ++++++++++---------
2 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index 07fb91a12593..3d6544a64188 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -790,9 +790,16 @@ static const struct acpi_device_id i3c_hci_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match);
+static const struct platform_device_id i3c_hci_driver_ids[] = {
+ { .name = "intel-lpss-i3c" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, i3c_hci_driver_ids);
+
static struct platform_driver i3c_hci_driver = {
.probe = i3c_hci_probe,
.remove = i3c_hci_remove,
+ .id_table = i3c_hci_driver_ids,
.driver = {
.name = "mipi-i3c-hci",
.of_match_table = of_match_ptr(i3c_hci_of_match),
diff --git a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
index 0fd3587671e1..3b319fbf18ce 100644
--- a/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
+++ b/drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
@@ -27,10 +27,10 @@ struct mipi_i3c_hci_pci {
struct mipi_i3c_hci_pci_info {
int (*init)(struct mipi_i3c_hci_pci *hci);
void (*exit)(struct mipi_i3c_hci_pci *hci);
+ const char *name;
+ int id;
};
-static DEFINE_IDA(mipi_i3c_hci_pci_ida);
-
#define INTEL_PRIV_OFFSET 0x2b0
#define INTEL_PRIV_SIZE 0x28
#define INTEL_RESETS 0x04
@@ -179,9 +179,18 @@ static void intel_i3c_exit(struct mipi_i3c_hci_pci *hci)
intel_ltr_hide(&hci->pci->dev);
}
-static const struct mipi_i3c_hci_pci_info intel_info = {
+static const struct mipi_i3c_hci_pci_info intel_1_info = {
.init = intel_i3c_init,
.exit = intel_i3c_exit,
+ .name = "intel-lpss-i3c",
+ .id = 0,
+};
+
+static const struct mipi_i3c_hci_pci_info intel_2_info = {
+ .init = intel_i3c_init,
+ .exit = intel_i3c_exit,
+ .name = "intel-lpss-i3c",
+ .id = 2,
};
static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
@@ -189,7 +198,7 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
{
struct mipi_i3c_hci_pci *hci;
struct resource res[2];
- int dev_id, ret;
+ int ret;
hci = devm_kzalloc(&pci->dev, sizeof(*hci), GFP_KERNEL);
if (!hci)
@@ -217,11 +226,9 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
res[1].start = pci_irq_vector(hci->pci, 0);
res[1].end = res[1].start;
- dev_id = ida_alloc(&mipi_i3c_hci_pci_ida, GFP_KERNEL);
- if (dev_id < 0)
- return dev_id;
+ hci->info = (const struct mipi_i3c_hci_pci_info *)id->driver_data;
- hci->pdev = platform_device_alloc("mipi-i3c-hci", dev_id);
+ hci->pdev = platform_device_alloc(hci->info->name, hci->info->id);
if (!hci->pdev)
return -ENOMEM;
@@ -232,7 +239,6 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
if (ret)
goto err;
- hci->info = (const struct mipi_i3c_hci_pci_info *)id->driver_data;
if (hci->info->init) {
ret = hci->info->init(hci);
if (ret)
@@ -252,7 +258,6 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
hci->info->exit(hci);
err:
platform_device_put(hci->pdev);
- ida_free(&mipi_i3c_hci_pci_ida, dev_id);
return ret;
}
@@ -260,28 +265,26 @@ static void mipi_i3c_hci_pci_remove(struct pci_dev *pci)
{
struct mipi_i3c_hci_pci *hci = pci_get_drvdata(pci);
struct platform_device *pdev = hci->pdev;
- int dev_id = pdev->id;
if (hci->info->exit)
hci->info->exit(hci);
platform_device_unregister(pdev);
- ida_free(&mipi_i3c_hci_pci_ida, dev_id);
}
static const struct pci_device_id mipi_i3c_hci_pci_devices[] = {
/* Wildcat Lake-U */
- { PCI_VDEVICE(INTEL, 0x4d7c), (kernel_ulong_t)&intel_info},
- { PCI_VDEVICE(INTEL, 0x4d6f), (kernel_ulong_t)&intel_info},
+ { PCI_VDEVICE(INTEL, 0x4d7c), (kernel_ulong_t)&intel_1_info},
+ { PCI_VDEVICE(INTEL, 0x4d6f), (kernel_ulong_t)&intel_2_info},
/* Panther Lake-H */
- { PCI_VDEVICE(INTEL, 0xe37c), (kernel_ulong_t)&intel_info},
- { PCI_VDEVICE(INTEL, 0xe36f), (kernel_ulong_t)&intel_info},
+ { PCI_VDEVICE(INTEL, 0xe37c), (kernel_ulong_t)&intel_1_info},
+ { PCI_VDEVICE(INTEL, 0xe36f), (kernel_ulong_t)&intel_2_info},
/* Panther Lake-P */
- { PCI_VDEVICE(INTEL, 0xe47c), (kernel_ulong_t)&intel_info},
- { PCI_VDEVICE(INTEL, 0xe46f), (kernel_ulong_t)&intel_info},
+ { PCI_VDEVICE(INTEL, 0xe47c), (kernel_ulong_t)&intel_1_info},
+ { PCI_VDEVICE(INTEL, 0xe46f), (kernel_ulong_t)&intel_2_info},
/* Nova Lake-S */
- { PCI_VDEVICE(INTEL, 0x6e2c), (kernel_ulong_t)&intel_info},
- { PCI_VDEVICE(INTEL, 0x6e2d), (kernel_ulong_t)&intel_info},
+ { PCI_VDEVICE(INTEL, 0x6e2c), (kernel_ulong_t)&intel_1_info},
+ { PCI_VDEVICE(INTEL, 0x6e2d), (kernel_ulong_t)&intel_2_info},
{ },
};
MODULE_DEVICE_TABLE(pci, mipi_i3c_hci_pci_devices);
--
2.51.0
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2025-12-16 16:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 16:56 [PATCH V3 00/11] i3c: mipi-i3c-hci-pci: Define Multi-Bus Instances for Intel controllers Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 01/11] i3c: mipi-i3c-hci: Remove duplicate blank lines Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 02/11] i3c: mipi-i3c-hci: Stop reading Extended Capabilities if capability ID is 0 Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 03/11] i3c: mipi-i3c-hci: Quieten initialization messages Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 04/11] i3c: mipi-i3c-hci-pci: Do not repeatedly check for NULL driver_data Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 05/11] i3c: mipi-i3c-hci-pci: Enable MSI support Adrian Hunter
2025-12-16 17:03 ` Frank Li
2025-12-16 16:56 ` Adrian Hunter [this message]
2025-12-16 17:08 ` [PATCH V3 06/11] i3c: mipi-i3c-hci-pci: Assign unique device names and IDs for Intel LPSS I3C Frank Li
2025-12-16 17:14 ` Adrian Hunter
2025-12-16 18:56 ` Adrian Hunter
2025-12-17 19:24 ` Frank Li
2025-12-16 16:56 ` [PATCH V3 07/11] i3c: mipi-i3c-hci: Allow for Multi-Bus Instances Adrian Hunter
2025-12-16 17:10 ` Frank Li
2025-12-16 16:56 ` [PATCH V3 08/11] i3c: mipi-i3c-hci-pci: Pass base regs as platform data to i3c core device Adrian Hunter
2025-12-16 17:12 ` Frank Li
2025-12-16 16:56 ` [PATCH V3 09/11] i3c: mipi-i3c-hci-pci: Convert to MFD driver Adrian Hunter
2025-12-16 16:56 ` [PATCH V3 10/11] i3c: mipi-i3c-hci-pci: Add support for Multi-Bus Instances Adrian Hunter
2025-12-16 17:16 ` Frank Li
2025-12-16 16:56 ` [PATCH V3 11/11] i3c: mipi-i3c-hci-pci: Define Multi-Bus instances for supported controllers Adrian Hunter
2025-12-16 17:18 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251216165642.164583-7-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox