diff mbox series

[1/2] sound: dt-bindings: cmx655d

Message ID 20250121230903.89808-1-nikola.jelic83@gmail.com (mailing list archive)
State New
Headers show
Series [1/2] sound: dt-bindings: cmx655d | expand

Commit Message

Nikola Jelic Jan. 21, 2025, 11:09 p.m. UTC
Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
---
 .../bindings/sound/cml,cmx655d.yaml           | 79 +++++++++++++++++++
 .../devicetree/bindings/sound/cmx655.txt      | 59 ++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 3 files changed, 140 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cml,cmx655d.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/cmx655.txt

Comments

Krzysztof Kozlowski Jan. 22, 2025, 7:39 a.m. UTC | #1
On 22/01/2025 00:09, Nikola Jelic wrote:
> Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>

Please run scripts/checkpatch.pl and fix reported warnings. After that,
run also `scripts/checkpatch.pl --strict` and (probably) fix more
warnings. Some warnings can be ignored, especially from --strict run,
but the code here looks like it needs a fix. Feel free to get in touch
if the warning is not clear.

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

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time.

Please kindly resend and include all necessary To/Cc entries.
</form letter>

> ---
>  .../bindings/sound/cml,cmx655d.yaml           | 79 +++++++++++++++++++
>  .../devicetree/bindings/sound/cmx655.txt      | 59 ++++++++++++++

No, bindings in text are not allowed anymore.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/cml,cmx655d.yaml b/Documentation/devicetree/bindings/sound/cml,cmx655d.yaml
new file mode 100644
index 000000000000..ea2cdce80ea3
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cml,cmx655d.yaml
@@ -0,0 +1,79 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/cml,cmx655d.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CML Micro CMX655D codec
+
+maintainers:
+  - Richard Walton <rwalton@cmlmicro.com>
+  - Nikola Jelic <nikola.jelic83@gmail.com>
+
+description: |
+  The CMX655D is an ultra-low power voice codec.
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - cml,cmx655d
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  reset-gpios:
+    description: GPIO used for codec reset, negative logic
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    maxItems: 1
+
+  pinctrl-names:
+    maxItems: 1
+
+  pinctr-0:
+    maxItems: 1
+
+  cmx655,classd-oc-reset-attempts:
+    description: Maximum number of times to reset CMX655 class-D
+      following a overcurrent event.
+      Default = 5, >10000 = disable limit.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 5
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        status = "okay";
+        codec: cmx655 {
+            reg = <0x54>;
+            #sound-dai-cells = <0>;
+            compatible = "cml,cmx655d";
+            reset-gpios = <&gpio 24 1>;
+            interrupt-parent = <&gpio>;
+            interrupts = <25 0x2>;
+            interrupt-names = "irq";
+            pinctrl-names = "default";
+            pinctrl-0 = <&ev6550DHAT_pins>;
+            cmx655,classd-oc-reset-attempts = <5>;
+        };
+
+    };
+...
diff --git a/Documentation/devicetree/bindings/sound/cmx655.txt b/Documentation/devicetree/bindings/sound/cmx655.txt
new file mode 100644
index 000000000000..28550c871934
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/cmx655.txt
@@ -0,0 +1,59 @@ 
+CMX655 audio CODEC
+
+Required properties: 
+    - compatible : "cml,cmx655d"
+
+    - reg : the I2C address of the device for I2C.
+
+Optional properties:
+    - cmx655,classd-oc-reset-attempts: Maximum number of times to reset CMX655
+                        class-D following a overcurrent event.
+                        default = 5, >10000 = disable limit.
+    - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
+    deasserted before communication to the codec starts.
+    - interrupt-parent: used to specify the controller for the interrupt
+    - interrupts: arguments given to interrupt controller
+        see devicetree/bindings/interrupt-controller/interrupts.txt for 
+            more details on interrupt-parent and interrupts
+    - interrupt-names: Used by i2c driver to specify interrupt's use.
+        see devicetree/bindings/i2c/i2c.txt
+        and devicetree/bindings/resource-names.txt
+            for more details.
+    - pinctrl-names: see devicetree/bindings/pinctrl/pinctrl-bindings.txt
+    - pinctrl-0: see devicetree/bindings/pinctrl/pinctrl-bindings.txt
+
+Example:
+
+fragment@1 { 
+    target = <&i2c>;                   
+    __overlay__ {                      
+        #address-cells = <1>;          
+        #size-cells = <0>;             
+        status = "okay";               
+        codec: cmx655 {                
+            reg = <0x54>;              
+            #sound-dai-cells = <0>;    
+            compatible = "cml,cmx655D"; 
+            reset-gpios = <&gpio 24 1>;
+            interrupt-parent = <&gpio>;
+            interrupts = <25 0x2>; /* falling edge */
+            interrupt-names = "irq";
+            pinctrl-names = "default";
+            pinctrl-0 = <&ev6550DHAT_pins>;
+            cmx655,classd-oc-reset-attempts = <5>;
+        };
+    };
+};
+fragment@2 {
+    target = <&gpio>;
+    __overlay__ {
+        ev6550DHAT_pins: cmx655_pins {
+            // Pins resetN, IRQn
+            brcm,pins = <24 25>;
+            // Out, In
+            brcm,function = <1 0>; 
+            // No pull, pull up
+            brcm,pull = <0 2>; 
+        };
+    };
+};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 5079ca6ce1d1..c471a4b905cf 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -308,6 +308,8 @@  patternProperties:
     description: Carl Cloos Schweisstechnik GmbH.
   "^cloudengines,.*":
     description: Cloud Engines, Inc.
+  "^cml,.*":
+    description: CML Micro, Ltd.
   "^cnm,.*":
     description: Chips&Media, Inc.
   "^cnxt,.*":