[PATCH v3 1/3] dt-bindings: spi: Add binding document of Amlogic SPISG controller

Xianwei Zhao via B4 Relay posted 3 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v3 1/3] dt-bindings: spi: Add binding document of Amlogic SPISG controller
Posted by Xianwei Zhao via B4 Relay 3 months, 2 weeks ago
From: Sunny Luo <sunny.luo@amlogic.com>

The SPISG is a new communication oriented SPI controller of Amlogic, which
supports PIO, block DMA and scatter-gather DMA three operation modes.

Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
 .../devicetree/bindings/spi/amlogic,a4-spisg.yaml  | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/amlogic,a4-spisg.yaml b/Documentation/devicetree/bindings/spi/amlogic,a4-spisg.yaml
new file mode 100644
index 000000000000..8d4d4606ff48
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/amlogic,a4-spisg.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2025 Amlogic, Inc. All rights reserved
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/amlogic,a4-spisg.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic SPI Scatter-Gather Controller
+
+maintainers:
+  - Xianwei Zhao <xianwei.zhao@amlogic.com>
+  - Sunny Luo <sunny.luo@amlogic.com>
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    const: amlogic,a4-spisg
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 2
+
+  clock-names:
+    items:
+      - const: core
+      - const: pclk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi@50000 {
+        compatible = "amlogic,a4-spisg";
+        reg = <0x50000 0x38>;
+        interrupts = <0 183 4>;
+        clocks = <&clkc 37>,
+                 <&clkc 93>;
+        clock-names = "core", "pclk";
+        #address-cells = <1>;
+        #size-cells = <0>;
+    };

-- 
2.37.1
Re: [PATCH v3 1/3] dt-bindings: spi: Add binding document of Amlogic SPISG controller
Posted by Krzysztof Kozlowski 3 months, 2 weeks ago
On 23/06/2025 10:53, Xianwei Zhao via B4 Relay wrote:

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters

> +properties:
> +  compatible:
> +    const: amlogic,a4-spisg
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 2

Nope, maxItems. Look at other bindings.

> +
> +  clock-names:
> +    items:
> +      - const: core
> +      - const: pclk
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    spi@50000 {
> +        compatible = "amlogic,a4-spisg";
> +        reg = <0x50000 0x38>;
> +        interrupts = <0 183 4>;

Use proper defines



Best regards,
Krzysztof
Re: [PATCH v3 1/3] dt-bindings: spi: Add binding document of Amlogic SPISG controller
Posted by Xianwei Zhao 3 months, 2 weeks ago
Hi Krzysztof,
    Thanks for your reply.

On 2025/6/23 17:15, Krzysztof Kozlowski wrote:
> [ EXTERNAL EMAIL ]
> 
> On 23/06/2025 10:53, Xianwei Zhao via B4 Relay wrote:
> 
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
> 

Will fix subjects "spi: dt-bindings: Add binding document of Amlogic 
SPISG controller"

>> +properties:
>> +  compatible:
>> +    const: amlogic,a4-spisg
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +  clocks:
>> +    minItems: 2
> 
> Nope, maxItems. Look at other bindings.
> 

Will do.

>> +
>> +  clock-names:
>> +    items:
>> +      - const: core
>> +      - const: pclk
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +  - clocks
>> +  - clock-names
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> +  - |
>> +    spi@50000 {
>> +        compatible = "amlogic,a4-spisg";
>> +        reg = <0x50000 0x38>;
>> +        interrupts = <0 183 4>;
> 
> Use proper defines
> 
Will modify "interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>;"
> 
> 
> Best regards,
> Krzysztof