diff mbox series

[v3,1/4] dt-bindings: pinctrl: spacemit: add support for K1 SoC

Message ID 20240828-02-k1-pinctrl-v3-1-1fed6a22be98@gentoo.org (mailing list archive)
State Superseded
Delegated to: Conor Dooley
Headers show
Series riscv: spacemit: add pinctrl support to K1 SoC | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict

Commit Message

Yixun Lan Aug. 28, 2024, 11:30 a.m. UTC
Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC.

Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
Changes in v3:
- drop spacemit,slew-rate-{enable,disable} property
- use drive-strength instead of drive-strength-microamp
- fold strong-pull-up into bias-pull-up
- format fixed
- title fixed
---
 .../bindings/pinctrl/spacemit,k1-pinctrl.yaml      | 127 +++++++++++++++++++++
 1 file changed, 127 insertions(+)

Comments

Rob Herring Aug. 29, 2024, 6:36 p.m. UTC | #1
On Wed, 28 Aug 2024 11:30:23 +0000, Yixun Lan wrote:
> Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC.
> 
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> ---
> Changes in v3:
> - drop spacemit,slew-rate-{enable,disable} property
> - use drive-strength instead of drive-strength-microamp
> - fold strong-pull-up into bias-pull-up
> - format fixed
> - title fixed
> ---
>  .../bindings/pinctrl/spacemit,k1-pinctrl.yaml      | 127 +++++++++++++++++++++
>  1 file changed, 127 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Chen Wang Aug. 29, 2024, 11:48 p.m. UTC | #2
On 2024/8/28 19:30, Yixun Lan wrote:
> Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC.
>
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
> ---
> Changes in v3:
> - drop spacemit,slew-rate-{enable,disable} property
> - use drive-strength instead of drive-strength-microamp
> - fold strong-pull-up into bias-pull-up
> - format fixed
> - title fixed

Drop this change history here, you can add this in the cover letter.

[......]
Conor Dooley Aug. 30, 2024, 7:06 a.m. UTC | #3
On Fri, Aug 30, 2024 at 07:48:17AM +0800, Chen Wang wrote:
> 
> On 2024/8/28 19:30, Yixun Lan wrote:
> > Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC.
> > 
> > Signed-off-by: Yixun Lan <dlan@gentoo.org>
> > ---
> > Changes in v3:
> > - drop spacemit,slew-rate-{enable,disable} property
> > - use drive-strength instead of drive-strength-microamp
> > - fold strong-pull-up into bias-pull-up
> > - format fixed
> > - title fixed
> 
> Drop this change history here, you can add this in the cover letter.
> 
> [......]

It's perfectly fine to provide per-patch changelogs fyi, rather than in
the cover letter.

Cheers,
Conor.
Krzysztof Kozlowski Sept. 2, 2024, 8:03 a.m. UTC | #4
On 30/08/2024 09:06, Conor Dooley wrote:
> On Fri, Aug 30, 2024 at 07:48:17AM +0800, Chen Wang wrote:
>>
>> On 2024/8/28 19:30, Yixun Lan wrote:
>>> Add dt-bindings for the pinctrl driver of SpacemiT's K1 SoC.
>>>
>>> Signed-off-by: Yixun Lan <dlan@gentoo.org>
>>> ---
>>> Changes in v3:
>>> - drop spacemit,slew-rate-{enable,disable} property
>>> - use drive-strength instead of drive-strength-microamp
>>> - fold strong-pull-up into bias-pull-up
>>> - format fixed
>>> - title fixed
>>
>> Drop this change history here, you can add this in the cover letter.
>>
>> [......]
> 
> It's perfectly fine to provide per-patch changelogs fyi, rather than in
> the cover letter.
> 

And honestly, since some time I prefer it much more. Much, much easier
to spot which patch changed instead of something in cover letter like:
1. Patch #1: changed foo
2. Patch #3: dropped
3. Patch #4 (so patch #5 or #4?): changed bar


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml
new file mode 100644
index 0000000000000..166e529b54b27
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml
@@ -0,0 +1,127 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SpacemiT K1 SoC Pin Controller
+
+maintainers:
+  - Yixun Lan <dlan@gentoo.org>
+
+properties:
+  compatible:
+    const: spacemit,k1-pinctrl
+
+  reg:
+    items:
+      - description: pinctrl io memory base
+
+patternProperties:
+  '-cfg$':
+    type: object
+    additionalProperties: false
+
+    description:
+      A pinctrl node should contain at least one subnode representing the
+      pinctrl groups available on the machine.
+
+    patternProperties:
+      '-pins$':
+        type: object
+        additionalProperties: false
+
+        description:
+          Each subnode will list the pins it needs, and how they should
+          be configured, with regard to muxer configuration, bias pull,
+          drive strength, input schmitt trigger, slew rate, power source.
+
+        allOf:
+          - $ref: pincfg-node.yaml#
+          - $ref: pinmux-node.yaml#
+
+        properties:
+          pinmux:
+            description:
+              The list of GPIOs and their mux settings that properties in the
+              node apply to. This should be set using the K1_PADCONF macro to
+              construct the value.
+
+          bias-disable: true
+
+          bias-pull-down: true
+
+          bias-pull-up:
+            description: |
+              typical value for selecting bias pull up or strong pull up.
+              0: normal bias pull up
+              1: strong bias pull up
+            enum: [ 0, 1 ]
+
+          drive-strength:
+            description: |
+              typical current when output high level.
+              1.8V output: 11, 21, 32, 42 (mA)
+              3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA)
+
+          input-schmitt:
+            description: |
+              typical threshold for schmitt trigger.
+              0: buffer mode
+              1: trigger mode
+              2, 3: trigger mode
+            $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [ 0, 1, 2, 3 ]
+
+          power-source:
+            description: external power supplies at 1.8v or 3.3v.
+            enum: [ 1800, 3300 ]
+
+          slew-rate:
+            description: |
+              slew rate for output buffer.
+              0: disable it
+              1: enable it (via bundled value from drive strength)
+              2: slow speed 0
+              3: slow speed 1
+              4: medium speed
+              5: fast speed
+            enum: [ 0, 1, 2, 3, 4, 5 ]
+
+        required:
+          - pinmux
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #define GPIO_68 69
+    #define GPIO_69 70
+
+    #define K1_PADCONF(pin, func) (((pin) << 16) | (func))
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        pinctrl@d401e000 {
+            compatible = "spacemit,k1-pinctrl";
+            reg = <0x0 0xd401e000 0x0 0x400>;
+
+            uart0_2_cfg: uart0-2-cfg {
+                uart0-2-pins {
+                    pinmux = <K1_PADCONF(GPIO_68, 2)>,
+                             <K1_PADCONF(GPIO_69, 2)>;
+
+                    bias-pull-up = <0>;
+                    drive-strength = <32>;
+                };
+            };
+        };
+    };
+
+...