[01/12] dt-bindings: mfd: Add Cirrus Logic CS48L32 audio codec

Message ID 20221109165331.29332-2-rf@opensource.cirrus.com
State New
Headers
Series Add support for the Cirrus Logic CS48L32 audio codecs |

Commit Message

Richard Fitzgerald Nov. 9, 2022, 4:53 p.m. UTC
  The CS48L32 has multiple digital and analog audio I/O, a
high-performance low-power programmable audio DSP, and a variety of
power-efficient fixed-function audio processors, with digital
mixing and routing.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 .../bindings/mfd/cirrus,cs48l32.yaml          | 166 ++++++++++++++++++
 1 file changed, 166 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
  

Comments

Rob Herring Nov. 9, 2022, 9:09 p.m. UTC | #1
On Wed, 09 Nov 2022 16:53:20 +0000, Richard Fitzgerald wrote:
> The CS48L32 has multiple digital and analog audio I/O, a
> high-performance low-power programmable audio DSP, and a variety of
> power-efficient fixed-function audio processors, with digital
> mixing and routing.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  .../bindings/mfd/cirrus,cs48l32.yaml          | 166 ++++++++++++++++++
>  1 file changed, 166 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml:107:7: [warning] wrong indentation: expected 4 but found 6 (indentation)
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml:108:7: [warning] wrong indentation: expected 8 but found 6 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: properties:clocks: 'oneOf' conditional failed, one must be fixed:
	/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: properties:clocks: 'anyOf' conditional failed, one must be fixed:
		'minItems' is not one of ['maxItems', 'description', 'deprecated']
			hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
		'minItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
		'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
		1 is less than the minimum of 2
			hint: Arrays must be described with a combination of minItems/maxItems/items
		hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
		from schema $id: http://devicetree.org/meta-schemas/clocks.yaml#
	'minItems' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'allOf', 'anyOf', 'oneOf', '$ref']
	'maxItems' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'allOf', 'anyOf', 'oneOf', '$ref']
	'type' is a required property
		hint: DT nodes ("object" type in schemas) can only use a subset of json-schema keywords
	from schema $id: http://devicetree.org/meta-schemas/clocks.yaml#
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/pinctrl/cirrus,cs48l32.yaml
Documentation/devicetree/bindings/mfd/cirrus,cs48l32.example.dts:21:18: fatal error: dt-bindings/sound/cs48l32.h: No such file or directory
   21 |         #include <dt-bindings/sound/cs48l32.h>
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:406: Documentation/devicetree/bindings/mfd/cirrus,cs48l32.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1492: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
  
Krzysztof Kozlowski Nov. 14, 2022, 8:36 a.m. UTC | #2
On 09/11/2022 17:53, Richard Fitzgerald wrote:
> The CS48L32 has multiple digital and analog audio I/O, a
> high-performance low-power programmable audio DSP, and a variety of
> power-efficient fixed-function audio processors, with digital
> mixing and routing.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  .../bindings/mfd/cirrus,cs48l32.yaml          | 166 ++++++++++++++++++
>  1 file changed, 166 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml b/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
> new file mode 100644
> index 000000000000..d128600c0b72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
> @@ -0,0 +1,166 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/cirrus,cs48l32.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cirrus Logic CS48L32 audio CODECs Multi-Functional Device
> +
> +maintainers:
> +  - patches@opensource.cirrus.com
> +
> +description: |
> +  The CS48L32 is an audio SoC with extensive digital capabilities
> +  and a range of digital and analogue I/O.
> +
> +  See also the child driver bindings in:
> +
> +    bindings/pinctrl/cirrus,cs48l32.yaml
> +    bindings/regulator/wlf,arizona.yaml
> +    bindings/sound/cirrus,cs48l32.yaml
> +
> +allOf:
> +  - $ref: /schemas/pinctrl/cirrus,cs48l32.yaml#

There is no such file.

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml b/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
new file mode 100644
index 000000000000..d128600c0b72
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
@@ -0,0 +1,166 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/cirrus,cs48l32.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cirrus Logic CS48L32 audio CODECs Multi-Functional Device
+
+maintainers:
+  - patches@opensource.cirrus.com
+
+description: |
+  The CS48L32 is an audio SoC with extensive digital capabilities
+  and a range of digital and analogue I/O.
+
+  See also the child driver bindings in:
+
+    bindings/pinctrl/cirrus,cs48l32.yaml
+    bindings/regulator/wlf,arizona.yaml
+    bindings/sound/cirrus,cs48l32.yaml
+
+allOf:
+  - $ref: /schemas/pinctrl/cirrus,cs48l32.yaml#
+  - $ref: /schemas/regulator/wlf,arizona.yaml#
+  - $ref: /schemas/sound/cirrus,cs48l32.yaml#
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    enum:
+      - cirrus,cs48l31
+      - cirrus,cs48l32
+      - cirrus,cs48l33
+
+  reg:
+    maxItems: 1
+
+  gpio-controller: true
+
+  '#gpio-cells':
+    description:
+      The first cell is the pin number. The second cell is reserved for
+      future use and must be zero
+    const: 2
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    description:
+      The first cell is the IRQ number.
+      The second cell is the flags, encoded as the trigger masks from
+      bindings/interrupt-controller/interrupts.txt
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    description:
+      One entry specifying the GPIO controlling /RESET.  As defined in
+      bindings/gpio.txt.  Although optional, it is strongly recommended
+      to use a hardware reset.
+    maxItems: 1
+
+  clocks:
+    description:
+      Should reference the clocks supplied on MCLK1
+    minItems: 1
+    maxItems: 1
+
+  clock-names:
+    description: |
+      Must be "mclk1"
+    const: mclk1
+
+  VDD_A-supply:
+    description:
+      Analogue power supply.
+
+  VDD_D-supply:
+    description:
+      Digital core power supply.
+
+  VDD_IO-supply:
+    description:
+      Digital buffer (I/O) supply.
+
+  VDD_CP-supply:
+    description:
+      Charge pump power supply.
+
+  VOUT_MIC-supply:
+    description:
+      Microphone power supply, normally supplied internally.
+
+  pinctrl-0:
+    description:
+      A phandle to the node containing the subnodes containing pinctrl
+      configurations.
+
+  pinctrl-1:
+    description:
+      A phandle to the node containing the subnodes containing pinctrl
+      configurations.
+
+  pinctrl-names:
+      items:
+      - const: init
+      - const: default
+
+required:
+  - compatible
+  - interrupt-parent
+  - interrupts
+  - VDD_A-supply
+  - VDD_D-supply
+  - VDD_IO-supply
+  - VDD_CP-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/sound/cs48l32.h>
+    &spi1 {
+        cs48l32: cs48l32@1 {
+            compatible = "cirrus,cs48l32";
+            reg = <0x1>;
+
+            spi-max-frequency = <25000000>;
+
+            interrupts = <56 8>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupt-parent = <&gpio0>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            #sound-dai-cells = <1>;
+
+            VDD_A-supply = <&regulator_1v8>;
+            VDD_D-supply = <&lochnagar_1v2>;
+            VDD_IO-supply = <&regulator_1v8>;
+            VDD_CP-supply = <&regulator_1v8>;
+
+            reset-gpios = <&gpio 0 0>;
+
+            pinctrl-names = "default";
+            pinctrl-0 = <&cs48l32_defaults>;
+
+            cs48l32_pinctrl: pinctrl {
+                compatible = "cirrus,cs48l32-pinctrl";
+
+                cs48l32_defaults: defaults {
+                    asp1 {
+                        groups = "asp1";
+                        function = "asp1";
+                        bias-bus-hold;
+                    };
+                    asp2 {
+                        groups = "asp2";
+                        function = "asp2";
+                        bias-bus-hold;
+                    };
+                };
+            };
+        };