diff mbox series

[1/2] dt-bindings: misc: rohm,bm92txx: Add BM92Txx support

Message ID 20230824153059.212244-2-linkmauve@linkmauve.fr
State Changes Requested, archived
Headers show
Series Add a driver for the ROHM BM92Txx USB-C Power Delivery controller | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Emmanuel Gil Peyrot Aug. 24, 2023, 3:30 p.m. UTC
The BM92T36 is used in the Nintendo Switch as its USB-C Power Delivery
controller.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
---
 .../bindings/misc/rohm,bm92txx.yaml           | 67 +++++++++++++++++++
 MAINTAINERS                                   |  5 ++
 2 files changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml

Comments

Krzysztof Kozlowski Aug. 24, 2023, 4:16 p.m. UTC | #1
On 24/08/2023 17:30, Emmanuel Gil Peyrot wrote:
> The BM92T36 is used in the Nintendo Switch as its USB-C Power Delivery
> controller.
> 
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> ---
>  .../bindings/misc/rohm,bm92txx.yaml           | 67 +++++++++++++++++++
>  MAINTAINERS                                   |  5 ++
>  2 files changed, 72 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml

That's not misc device but usb, so please put it in usb.

> 
> diff --git a/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml b/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
> new file mode 100644
> index 000000000000..0322a7f096f0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright (C) 2023 Emmanuel Gil Peyrot
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/misc/rohm,bm92txx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BM92Txx USB-C Power Delivery Controller
> +
> +maintainers:
> +  - Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - rohm,bm92t10
> +      - rohm,bm92t20
> +      - rohm,bm92t30
> +      - rohm,bm92t36
> +      - rohm,bm92t50

Your driver suggests they are fully compatible.

> +
> +  reg:
> +    maxItems: 1
> +
> +  rohm,dp-signal-toggle-on-resume:
> +    type: boolean
> +    description: |
> +      Do a toggle on resume instead of disable in suspend and enable in resume,
> +      because this also disables the LED effects.

That's OS policy, not suitable for DT. Drop the property.

> +
> +  rohm,led-static-on-suspend:
> +    type: boolean
> +    description: Dim or breathing dock LED.

Ditto

> +
> +  rohm,dock-power-limit-disable:
> +    type: boolean
> +    description: Disable the power limit in dock mode.

Your description copies property name, so it is not much useful. Why
this is board-configurable?

> +
> +  rohm,dp-alerts-enable:
> +    type: boolean
> +    description: Enable DisplayPort alerts.

Same questions.

> +
> +  rohm,pd-5v-current-limit-ma:
> +    $ref: /schemas/types.yaml#/definitions/uint32

Use common property units.

> +    default: 2000
> +    description: Current limit in mA when voltage is 5V.
> +

You miss connector, so binding is incomplete. All these properties look
duplicating connector properties.


> +  rohm,pd-9v-current-limit-ma:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 2000
> +    description: Current limit in mA when voltage is 9V.
> +
> +  rohm,pd-12v-current-limit-ma:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 1500
> +    description: Current limit in mA when voltage is 12V.
> +
> +  rohm,pd-15v-current-limit-ma:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    default: 1200
> +    description: Current limit in mA when voltage is 15V.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false

Missing example. You must have and it must be complete.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml b/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
new file mode 100644
index 000000000000..0322a7f096f0
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
@@ -0,0 +1,67 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) 2023 Emmanuel Gil Peyrot
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/rohm,bm92txx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BM92Txx USB-C Power Delivery Controller
+
+maintainers:
+  - Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
+
+properties:
+  compatible:
+    enum:
+      - rohm,bm92t10
+      - rohm,bm92t20
+      - rohm,bm92t30
+      - rohm,bm92t36
+      - rohm,bm92t50
+
+  reg:
+    maxItems: 1
+
+  rohm,dp-signal-toggle-on-resume:
+    type: boolean
+    description: |
+      Do a toggle on resume instead of disable in suspend and enable in resume,
+      because this also disables the LED effects.
+
+  rohm,led-static-on-suspend:
+    type: boolean
+    description: Dim or breathing dock LED.
+
+  rohm,dock-power-limit-disable:
+    type: boolean
+    description: Disable the power limit in dock mode.
+
+  rohm,dp-alerts-enable:
+    type: boolean
+    description: Enable DisplayPort alerts.
+
+  rohm,pd-5v-current-limit-ma:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 2000
+    description: Current limit in mA when voltage is 5V.
+
+  rohm,pd-9v-current-limit-ma:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 2000
+    description: Current limit in mA when voltage is 9V.
+
+  rohm,pd-12v-current-limit-ma:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 1500
+    description: Current limit in mA when voltage is 12V.
+
+  rohm,pd-15v-current-limit-ma:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 1200
+    description: Current limit in mA when voltage is 15V.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
diff --git a/MAINTAINERS b/MAINTAINERS
index d590ce31aa72..cc100a02fa7b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -18453,6 +18453,11 @@  F:	include/linux/mfd/rohm-bd957x.h
 F:	include/linux/mfd/rohm-generic.h
 F:	include/linux/mfd/rohm-shared.h
 
+ROHM USB-C POWER DELIVERY CONTROLLERS
+M:	Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
+S:	Supported
+F:	Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
+
 ROSE NETWORK LAYER
 M:	Ralf Baechle <ralf@linux-mips.org>
 L:	linux-hams@vger.kernel.org