mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support
@ 2026-03-18  5:52 Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m

Add support for microchip sama7d65 SoC I3C master only IP which is
based on mipi-i3c-hci from synopsys implementing version 1.0
specification. The platform specific changes are integrated in the
existing mipi-i3c-hci driver by introducing a quirk

I3C in master mode supports up to 12.5MHz, SDR mode data transfer in
mixed bus mode (I2C and I3C target devices on same i3c bus).

Durai Manickam KR (3):
  clk: at91: sama7d65: add peripheral clock for I3C
  ARM: dts: microchip: add I3C controller
  ARM: configs: at91: sama7: add sama7d65 i3c-hci

Manikandan Muralidharan (2):
  dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible
  i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the
    appropriate quirk

 .../devicetree/bindings/i3c/mipi-i3c-hci.yaml | 26 ++++++++++++++++---
 arch/arm/boot/dts/microchip/sama7d65.dtsi     |  8 ++++++
 arch/arm/configs/sama7_defconfig              |  2 ++
 drivers/clk/at91/sama7d65.c                   |  1 +
 drivers/i3c/master/mipi-i3c-hci/core.c        | 12 +++++++++
 drivers/i3c/master/mipi-i3c-hci/hci.h         |  1 +
 6 files changed, 46 insertions(+), 4 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible
  2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
@ 2026-03-18  5:52 ` Manikandan Muralidharan
  2026-03-19  8:25   ` Krzysztof Kozlowski
  2026-03-18  5:52 ` [PATCH v4 2/5] clk: at91: sama7d65: add peripheral clock for I3C Manikandan Muralidharan
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m

Add the microchip,sama7d65-i3c-hci compatible string to the MIPI I3C
HCI binding. The Microchip SAMA7D65 I3C controller is based on the
MIPI HCI specification but requires two clocks, so add a conditional
constraint when this compatible is present.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
---
Changes in v4:
- Define and describe the clock in the top-level properties
---
 .../devicetree/bindings/i3c/mipi-i3c-hci.yaml | 26 ++++++++++++++++---
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml b/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
index 39bb1a1784c9..a946a8920046 100644
--- a/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
+++ b/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
@@ -9,9 +9,6 @@ title: MIPI I3C HCI
 maintainers:
   - Nicolas Pitre <npitre@baylibre.com>
 
-allOf:
-  - $ref: /schemas/i3c/i3c.yaml#
-
 description: |
   MIPI I3C Host Controller Interface
 
@@ -28,7 +25,13 @@ description: |
 
 properties:
   compatible:
-    const: mipi-i3c-hci
+    enum:
+      - mipi-i3c-hci
+      - microchip,sama7d65-i3c-hci
+  clocks:
+    items:
+      - description: Peripheral bus clock
+      - description: System Generic clock
   reg:
     maxItems: 1
   interrupts:
@@ -39,6 +42,21 @@ required:
   - reg
   - interrupts
 
+allOf:
+  - $ref: /schemas/i3c/i3c.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: microchip,sama7d65-i3c-hci
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          maxItems: 2
+      required:
+        - clocks
+
 unevaluatedProperties: false
 
 examples:
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 2/5] clk: at91: sama7d65: add peripheral clock for I3C
  2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
@ 2026-03-18  5:52 ` Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk Manikandan Muralidharan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m, Durai Manickam KR

From: Durai Manickam KR <durai.manickamkr@microchip.com>

Add peripheral clock description for I3C.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
---
changes in v3:
- Fixed indentation issues
---
 drivers/clk/at91/sama7d65.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index 7dee2b160ffb..ba8ff413fa2c 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -677,6 +677,7 @@ static struct {
 	{ .n = "uhphs_clk",	.p = PCK_PARENT_HW_MCK5, .id = 101, },
 	{ .n = "dsi_clk",	.p = PCK_PARENT_HW_MCK3, .id = 103, },
 	{ .n = "lvdsc_clk",	.p = PCK_PARENT_HW_MCK3, .id = 104, },
+	{ .n = "i3cc_clk",	.p = PCK_PARENT_HW_MCK8, .id = 105, },
 };
 
 /*
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk
  2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 2/5] clk: at91: sama7d65: add peripheral clock for I3C Manikandan Muralidharan
@ 2026-03-18  5:52 ` Manikandan Muralidharan
  2026-03-20 11:42   ` Adrian Hunter
  2026-03-18  5:52 ` [PATCH v4 4/5] ARM: dts: microchip: add I3C controller Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci Manikandan Muralidharan
  4 siblings, 1 reply; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m

Add support for microchip sama7d65 SoC I3C HCI master only IP
with additional clock support to enable bulk clock acquisition
for Microchip platforms using HCI_QUIRK_CLK_SUPPORT quirk.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
---
Changes in v4:
- Remove the clock index variable MCHP_I3C_CLK_IDX

Changes in v3:
- Make use of existing HCI_QUIRK_* code base
- Introduce HCI_QUIRK_CLK_SUPPORT to handle/enable the required Peripheral
and system generic clk in bulk

Changes in v2:
- Platform specific changes are integrated in the existing mipi-i3c-hci
driver by introducing separate MCHP_HCI_QUIRK_* quirks and vendor
specific quirk files
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 12 ++++++++++++
 drivers/i3c/master/mipi-i3c-hci/hci.h  |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index 284f3ed7af8c..41b7737d22ac 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/bitfield.h>
+#include <linux/clk.h>
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/i3c/master.h>
@@ -950,6 +951,7 @@ static int i3c_hci_probe(struct platform_device *pdev)
 {
 	const struct mipi_i3c_hci_platform_data *pdata = pdev->dev.platform_data;
 	struct i3c_hci *hci;
+	struct clk_bulk_data *clks;
 	int irq, ret;
 
 	hci = devm_kzalloc(&pdev->dev, sizeof(*hci), GFP_KERNEL);
@@ -981,6 +983,13 @@ static int i3c_hci_probe(struct platform_device *pdev)
 	if (!hci->quirks && platform_get_device_id(pdev))
 		hci->quirks = platform_get_device_id(pdev)->driver_data;
 
+	if (hci->quirks & HCI_QUIRK_CLK_SUPPORT) {
+		ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);
+		if (ret < 0)
+			return dev_err_probe(&pdev->dev, ret,
+					     "Failed to get clocks\n");
+	}
+
 	ret = i3c_hci_init(hci);
 	if (ret)
 		return ret;
@@ -1008,6 +1017,9 @@ static void i3c_hci_remove(struct platform_device *pdev)
 
 static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
 	{ .compatible = "mipi-i3c-hci", },
+	{ .compatible = "microchip,sama7d65-i3c-hci",
+	  .data = (void *)(HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING |
+			   HCI_QUIRK_RESP_BUF_THLD | HCI_QUIRK_CLK_SUPPORT) },
 	{},
 };
 MODULE_DEVICE_TABLE(of, i3c_hci_of_match);
diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h
index 9ac9d0e342f4..f01b959a28d9 100644
--- a/drivers/i3c/master/mipi-i3c-hci/hci.h
+++ b/drivers/i3c/master/mipi-i3c-hci/hci.h
@@ -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_CLK_SUPPORT		BIT(6)  /* Enable Clocks for Microchip platforms*/
 
 /* global functions */
 void mipi_i3c_hci_resume(struct i3c_hci *hci);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 4/5] ARM: dts: microchip: add I3C controller
  2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
                   ` (2 preceding siblings ...)
  2026-03-18  5:52 ` [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk Manikandan Muralidharan
@ 2026-03-18  5:52 ` Manikandan Muralidharan
  2026-03-18  5:52 ` [PATCH v4 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci Manikandan Muralidharan
  4 siblings, 0 replies; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m, Durai Manickam KR

From: Durai Manickam KR <durai.manickamkr@microchip.com>

Add I3C controller for sama7d65 SoC.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
---
Changes in v3:
- Remove clock-names property as driver enables the clk in bulk
---
 arch/arm/boot/dts/microchip/sama7d65.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/sama7d65.dtsi b/arch/arm/boot/dts/microchip/sama7d65.dtsi
index e21556f46384..f358aae3ec59 100644
--- a/arch/arm/boot/dts/microchip/sama7d65.dtsi
+++ b/arch/arm/boot/dts/microchip/sama7d65.dtsi
@@ -1015,5 +1015,13 @@ gic: interrupt-controller@e8c11000 {
 			#address-cells = <0>;
 			interrupt-controller;
 		};
+
+		i3c: i3c@e9000000 {
+			compatible = "microchip,sama7d65-i3c-hci";
+			reg = <0xe9000000 0x300>;
+			interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 105>, <&pmc PMC_TYPE_GCK 105>;
+			status = "disabled";
+		};
 	};
 };
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci
  2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
                   ` (3 preceding siblings ...)
  2026-03-18  5:52 ` [PATCH v4 4/5] ARM: dts: microchip: add I3C controller Manikandan Muralidharan
@ 2026-03-18  5:52 ` Manikandan Muralidharan
  4 siblings, 0 replies; 8+ messages in thread
From: Manikandan Muralidharan @ 2026-03-18  5:52 UTC (permalink / raw)
  To: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk
  Cc: manikandan.m, Durai Manickam KR

From: Durai Manickam KR <durai.manickamkr@microchip.com>

Enable the configs needed for I3C framework and microchip
sama7d65 i3c-hci driver.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
---
 arch/arm/configs/sama7_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/sama7_defconfig b/arch/arm/configs/sama7_defconfig
index e2ad9a05566f..a59b262e48e1 100644
--- a/arch/arm/configs/sama7_defconfig
+++ b/arch/arm/configs/sama7_defconfig
@@ -115,6 +115,8 @@ CONFIG_HW_RANDOM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_AT91=y
+CONFIG_I3C=y
+CONFIG_MIPI_I3C_HCI=y
 CONFIG_SPI=y
 CONFIG_SPI_ATMEL=y
 CONFIG_SPI_ATMEL_QUADSPI=y
-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible
  2026-03-18  5:52 ` [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
@ 2026-03-19  8:25   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-19  8:25 UTC (permalink / raw)
  To: Manikandan Muralidharan
  Cc: alexandre.belloni, Frank.Li, robh, krzk+dt, conor+dt,
	nicolas.ferre, claudiu.beznea, linux, mturquette, sboyd, ardb,
	martin.petersen, ebiggers, tytso, cristian.birsan, adrian.hunter,
	jarkko.nikula, kees, npitre, linux-i3c, devicetree, linux-kernel,
	linux-arm-kernel, linux-clk

On Wed, Mar 18, 2026 at 11:22:26AM +0530, Manikandan Muralidharan wrote:
> Add the microchip,sama7d65-i3c-hci compatible string to the MIPI I3C
> HCI binding. The Microchip SAMA7D65 I3C controller is based on the
> MIPI HCI specification but requires two clocks, so add a conditional
> constraint when this compatible is present.
> 
> Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
> ---
> Changes in v4:
> - Define and describe the clock in the top-level properties
> ---
>  .../devicetree/bindings/i3c/mipi-i3c-hci.yaml | 26 ++++++++++++++++---
>  1 file changed, 22 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml b/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
> index 39bb1a1784c9..a946a8920046 100644
> --- a/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
> +++ b/Documentation/devicetree/bindings/i3c/mipi-i3c-hci.yaml
> @@ -9,9 +9,6 @@ title: MIPI I3C HCI
>  maintainers:
>    - Nicolas Pitre <npitre@baylibre.com>
>  
> -allOf:
> -  - $ref: /schemas/i3c/i3c.yaml#
> -
>  description: |
>    MIPI I3C Host Controller Interface
>  
> @@ -28,7 +25,13 @@ description: |
>  
>  properties:
>    compatible:
> -    const: mipi-i3c-hci
> +    enum:
> +      - mipi-i3c-hci
> +      - microchip,sama7d65-i3c-hci
> +  clocks:
> +    items:
> +      - description: Peripheral bus clock
> +      - description: System Generic clock

Missing blank lines. Also, clocks go after reg.


>    reg:
>      maxItems: 1
>    interrupts:
> @@ -39,6 +42,21 @@ required:
>    - reg
>    - interrupts
>  
> +allOf:
> +  - $ref: /schemas/i3c/i3c.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: microchip,sama7d65-i3c-hci
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          maxItems: 2

Drop, pointless. You already said in top-level they are exactly two
items.

> +      required:
> +        - clocks

else - clocks: false. See example schema. Or explain in the commit msg
why existing compatible gets clocks now.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk
  2026-03-18  5:52 ` [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk Manikandan Muralidharan
@ 2026-03-20 11:42   ` Adrian Hunter
  0 siblings, 0 replies; 8+ messages in thread
From: Adrian Hunter @ 2026-03-20 11:42 UTC (permalink / raw)
  To: Manikandan Muralidharan, alexandre.belloni, Frank.Li, robh,
	krzk+dt, conor+dt, nicolas.ferre, claudiu.beznea, linux,
	mturquette, sboyd, ardb, martin.petersen, ebiggers, tytso,
	cristian.birsan, kees, npitre, linux-i3c, devicetree,
	linux-kernel, linux-arm-kernel, linux-clk

On 18/03/2026 07:52, Manikandan Muralidharan wrote:
> Add support for microchip sama7d65 SoC I3C HCI master only IP
> with additional clock support to enable bulk clock acquisition
> for Microchip platforms using HCI_QUIRK_CLK_SUPPORT quirk.
> 
> Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
> ---
> Changes in v4:
> - Remove the clock index variable MCHP_I3C_CLK_IDX
> 
> Changes in v3:
> - Make use of existing HCI_QUIRK_* code base
> - Introduce HCI_QUIRK_CLK_SUPPORT to handle/enable the required Peripheral
> and system generic clk in bulk
> 
> Changes in v2:
> - Platform specific changes are integrated in the existing mipi-i3c-hci
> driver by introducing separate MCHP_HCI_QUIRK_* quirks and vendor
> specific quirk files
> ---
>  drivers/i3c/master/mipi-i3c-hci/core.c | 12 ++++++++++++
>  drivers/i3c/master/mipi-i3c-hci/hci.h  |  1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index 284f3ed7af8c..41b7737d22ac 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/bitfield.h>
> +#include <linux/clk.h>
>  #include <linux/device.h>
>  #include <linux/errno.h>
>  #include <linux/i3c/master.h>
> @@ -950,6 +951,7 @@ static int i3c_hci_probe(struct platform_device *pdev)
>  {
>  	const struct mipi_i3c_hci_platform_data *pdata = pdev->dev.platform_data;
>  	struct i3c_hci *hci;
> +	struct clk_bulk_data *clks;
>  	int irq, ret;
>  
>  	hci = devm_kzalloc(&pdev->dev, sizeof(*hci), GFP_KERNEL);
> @@ -981,6 +983,13 @@ static int i3c_hci_probe(struct platform_device *pdev)
>  	if (!hci->quirks && platform_get_device_id(pdev))
>  		hci->quirks = platform_get_device_id(pdev)->driver_data;
>  
> +	if (hci->quirks & HCI_QUIRK_CLK_SUPPORT) {
> +		ret = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);

AFAICT, devm_clk_bulk_get_all_enabled() could be called
unconditionally since it returns 0 if there are no clocks.
That would save introducing the quirk at all.

> +		if (ret < 0)
> +			return dev_err_probe(&pdev->dev, ret,
> +					     "Failed to get clocks\n");
> +	}
> +
>  	ret = i3c_hci_init(hci);
>  	if (ret)
>  		return ret;
> @@ -1008,6 +1017,9 @@ static void i3c_hci_remove(struct platform_device *pdev)
>  
>  static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
>  	{ .compatible = "mipi-i3c-hci", },
> +	{ .compatible = "microchip,sama7d65-i3c-hci",
> +	  .data = (void *)(HCI_QUIRK_PIO_MODE | HCI_QUIRK_OD_PP_TIMING |
> +			   HCI_QUIRK_RESP_BUF_THLD | HCI_QUIRK_CLK_SUPPORT) },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, i3c_hci_of_match);
> diff --git a/drivers/i3c/master/mipi-i3c-hci/hci.h b/drivers/i3c/master/mipi-i3c-hci/hci.h
> index 9ac9d0e342f4..f01b959a28d9 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/hci.h
> +++ b/drivers/i3c/master/mipi-i3c-hci/hci.h
> @@ -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_CLK_SUPPORT		BIT(6)  /* Enable Clocks for Microchip platforms*/
>  
>  /* global functions */
>  void mipi_i3c_hci_resume(struct i3c_hci *hci);


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-20 11:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-18  5:52 [PATCH v4 0/5] Add microchip sama7d65 SoC I3C support Manikandan Muralidharan
2026-03-18  5:52 ` [PATCH v4 1/5] dt-bindings: i3c: mipi-i3c-hci: add Microchip SAMA7D65 compatible Manikandan Muralidharan
2026-03-19  8:25   ` Krzysztof Kozlowski
2026-03-18  5:52 ` [PATCH v4 2/5] clk: at91: sama7d65: add peripheral clock for I3C Manikandan Muralidharan
2026-03-18  5:52 ` [PATCH v4 3/5] i3c: mipi-i3c-hci: add microchip sama7d65 SoC compatible with the appropriate quirk Manikandan Muralidharan
2026-03-20 11:42   ` Adrian Hunter
2026-03-18  5:52 ` [PATCH v4 4/5] ARM: dts: microchip: add I3C controller Manikandan Muralidharan
2026-03-18  5:52 ` [PATCH v4 5/5] ARM: configs: at91: sama7: add sama7d65 i3c-hci Manikandan Muralidharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®