[PATCH V2 11/13] i3c: mipi-i3c-hci-pci: Allocate a structure for Intel controller information
Frank Li
Frank.li at nxp.com
Fri Nov 14 12:11:44 PST 2025
On Fri, Nov 14, 2025 at 08:13:54PM +0200, Adrian Hunter wrote:
> Allocate a structure for Intel controller information, in preparation
> additional changes that need to store Intel device-specific information.
>
> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
> ---
I think this patch help less, you can direct squash to next one.
Frank
>
>
> Changes in V2:
>
> Re-based
>
>
> drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> 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 b962d3c2d510..3f391b0854ae 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
> @@ -18,6 +18,7 @@ struct mipi_i3c_hci_pci {
> struct pci_dev *pci;
> struct platform_device *pdev;
> const struct mipi_i3c_hci_pci_info *info;
> + void *private;
> };
>
> struct mipi_i3c_hci_pci_info {
> @@ -34,6 +35,10 @@ static DEFINE_IDA(mipi_i3c_hci_pci_ida);
> #define INTEL_RESETS_RESET_DONE BIT(1)
> #define INTEL_RESETS_TIMEOUT_US (10 * USEC_PER_MSEC)
>
> +struct intel_host {
> + void __iomem *priv;
> +};
> +
> static void intel_reset(void __iomem *priv)
> {
> u32 reg;
> @@ -55,13 +60,17 @@ static void __iomem *intel_priv(struct pci_dev *pci)
>
> static int intel_i3c_init(struct mipi_i3c_hci_pci *hci)
> {
> + struct intel_host *host = devm_kzalloc(&hci->pci->dev, sizeof(*host), GFP_KERNEL);
> void __iomem *priv = intel_priv(hci->pci);
>
> - if (!priv)
> + if (!host || !priv)
> return -ENOMEM;
>
> dma_set_mask_and_coherent(&hci->pci->dev, DMA_BIT_MASK(64));
>
> + hci->private = host;
> + host->priv = priv;
> +
> intel_reset(priv);
>
> return 0;
> --
> 2.51.0
>
>
> --
> linux-i3c mailing list
> linux-i3c at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-i3c
More information about the linux-i3c
mailing list