devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs
       [not found] <20210427102247.822-1-fenglinw@codeaurora.org>
@ 2021-04-27 10:22 ` Fenglin Wu
  2021-04-27 12:57   ` Rob Herring
  2021-04-28 17:38   ` Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Fenglin Wu @ 2021-04-27 10:22 UTC (permalink / raw)
  To: linux-arm-msm, linux-kernel, Thierry Reding,
	Uwe Kleine-König, Lee Jones, Rob Herring, Fenglin Wu,
	linux-pwm, devicetree
  Cc: subbaram, collinsd, aghayal

Add bindings for QCOM PMIC PWM modules which are accessed through SPMI
bus.

Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
---
 .../devicetree/bindings/pwm/pwm-qcom.yaml          | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-qcom.yaml

diff --git a/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml b/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
new file mode 100644
index 0000000..e8d8ed6
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/pwm-qcom.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies, Inc. PMIC PWM bindings
+
+maintainers:
+  - Fenglin Wu <fenglinw@codeaurora.org>
+
+description:
+  PWM modules inside Qualcomm Technologies, Inc. PMICs can be accessed through
+  SPMI bus and normally one PMIC would have multiple PWM modules with adjacent
+  SPMI address space.
+
+Properties:
+  compatible:
+    const: qcom,pwm
+
+  reg:
+    description:
+      The SPMI address base of the PWM module, if there are multiple PWM
+      modules present with adjacent SPMI address space, only need to specify
+      the address base of the 1st PWM module.
+
+  "#pwm-cells":
+     # See pwm.yaml in this directory for a description of the cells format.
+     const: 2
+
+  qcom,num-channels:
+    description:
+      The number of the PWM channels (modules) with the adjacent SPMI address
+      space following the address base in "reg" property.
+
+required:
+  - compatible
+  - reg
+  - "#pwm-cells"
+  - qcom,num-channels
+
+additionalProperties: false
+
+examples:
+  - |
+    pm8350c_pwm: pwms@e800 {
+        compatible = "qcom,pwm";
+        reg = <0xe800>;
+        #pwm-cells = <2>;
+        qcom,num-channels = <4>;
+    };
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs
  2021-04-27 10:22 ` [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs Fenglin Wu
@ 2021-04-27 12:57   ` Rob Herring
  2021-04-28 10:54     ` fenglinw
  2021-04-28 17:38   ` Thierry Reding
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Herring @ 2021-04-27 12:57 UTC (permalink / raw)
  To: Fenglin Wu
  Cc: collinsd, linux-pwm, subbaram, linux-kernel,
	Uwe Kleine-König, Lee Jones, Rob Herring, linux-arm-msm,
	aghayal, devicetree, Thierry Reding

On Tue, 27 Apr 2021 18:22:09 +0800, Fenglin Wu wrote:
> Add bindings for QCOM PMIC PWM modules which are accessed through SPMI
> bus.
> 
> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
> ---
>  .../devicetree/bindings/pwm/pwm-qcom.yaml          | 51 ++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/pwm-qcom.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/pwm/pwm-qcom.yaml:29:6: [warning] wrong indentation: expected 4 but found 5 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml: Additional properties are not allowed ('Properties' was unexpected)
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml: Additional properties are not allowed ('Properties' was unexpected)
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml: 'anyOf' conditional failed, one must be fixed:
	'properties' is a required property
	'patternProperties' is a required property
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml: ignoring, error in schema: 
warning: no schema found in file: ./Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dts:21.13-28: Warning (reg_format): /example-0/pwms@e800:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: Warning (pci_device_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml: example-0: pwms@e800:reg:0: [59392] is too short
	From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml
Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:0:0: /example-0/pwms@e800: failed to match any schema with compatible: ['qcom,pwm']

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

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs
  2021-04-27 12:57   ` Rob Herring
@ 2021-04-28 10:54     ` fenglinw
  0 siblings, 0 replies; 4+ messages in thread
From: fenglinw @ 2021-04-28 10:54 UTC (permalink / raw)
  To: Rob Herring
  Cc: collinsd, linux-pwm, subbaram, linux-kernel,
	Uwe Kleine-König, Lee Jones, Rob Herring, linux-arm-msm,
	aghayal, devicetree, Thierry Reding

On 2021-04-27 20:57, Rob Herring wrote:
> On Tue, 27 Apr 2021 18:22:09 +0800, Fenglin Wu wrote:
>> Add bindings for QCOM PMIC PWM modules which are accessed through SPMI
>> bus.
>> 
>> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
>> ---
>>  .../devicetree/bindings/pwm/pwm-qcom.yaml          | 51 
>> ++++++++++++++++++++++
>>  1 file changed, 51 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/pwm/pwm-qcom.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/pwm/pwm-qcom.yaml:29:6: [warning]
> wrong indentation: expected 4 but found 5 (indentation)
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml:
> Additional properties are not allowed ('Properties' was unexpected)
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml:
> Additional properties are not allowed ('Properties' was unexpected)
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml:
> 'anyOf' conditional failed, one must be fixed:
> 	'properties' is a required property
> 	'patternProperties' is a required property
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml:
> ignoring, error in schema:
> warning: no schema found in file:
> ./Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dts:21.13-28:
> Warning (reg_format): /example-0/pwms@e800:reg: property has invalid
> length (4 bytes) (#address-cells == 1, #size-cells == 1)
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> Warning (pci_device_reg): Failed prerequisite 'reg_format'
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> Warning (simple_bus_reg): Failed prerequisite 'reg_format'
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> Warning (spi_bus_reg): Failed prerequisite 'reg_format'
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:
> example-0: pwms@e800:reg:0: [59392] is too short
> 	From schema: 
> /usr/local/lib/python3.8/dist-packages/dtschema/schemas/reg.yaml
> Documentation/devicetree/bindings/pwm/pwm-qcom.example.dt.yaml:0:0:
> /example-0/pwms@e800: failed to match any schema with compatible:
> ['qcom,pwm']
> 
> See https://patchwork.ozlabs.org/patch/1470623
> 
> 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.

Thanks for the information. It's my 1st time to write binding using yaml 
format, I hadn't noticed there was a checker can be used for sanity 
test. I will update and run the dt_binding_check at my side before 
uploading new patchset.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs
  2021-04-27 10:22 ` [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs Fenglin Wu
  2021-04-27 12:57   ` Rob Herring
@ 2021-04-28 17:38   ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2021-04-28 17:38 UTC (permalink / raw)
  To: Fenglin Wu
  Cc: linux-arm-msm, linux-kernel, Uwe Kleine-König, Lee Jones,
	Rob Herring, linux-pwm, devicetree, subbaram, collinsd, aghayal

[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]

On Tue, Apr 27, 2021 at 06:22:09PM +0800, Fenglin Wu wrote:
> Add bindings for QCOM PMIC PWM modules which are accessed through SPMI
> bus.
> 
> Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
> ---
>  .../devicetree/bindings/pwm/pwm-qcom.yaml          | 51 ++++++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml b/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
> new file mode 100644
> index 0000000..e8d8ed6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/pwm-qcom.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/pwm-qcom.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Technologies, Inc. PMIC PWM bindings
> +
> +maintainers:
> +  - Fenglin Wu <fenglinw@codeaurora.org>
> +
> +description:
> +  PWM modules inside Qualcomm Technologies, Inc. PMICs can be accessed through
> +  SPMI bus and normally one PMIC would have multiple PWM modules with adjacent
> +  SPMI address space.
> +
> +Properties:
> +  compatible:
> +    const: qcom,pwm

This seems a bit vague. What if Qualcomm ever designs a different PWM?
How are you going to tell them apart? Typically this would include some
sort of ID for the SoC family, or the first SoC that this was introduced
on. That way you can more easily distinguish between different designs
later on.

> +
> +  reg:
> +    description:
> +      The SPMI address base of the PWM module, if there are multiple PWM
> +      modules present with adjacent SPMI address space, only need to specify
> +      the address base of the 1st PWM module.

That seems like an odd way to define these. It looks like this is a bus
with #address-cells = <1> and #size-cells = <0>. Such busses are usually
assumed to have a single address per device (see for example I2C). How
does the SPMI addressing work? Is there a specification somewhere?

Actually, Documentation/devicetree/bindings/spmi/spmi.yaml says that
SPMI child devices should have two address cells, so this seesm to be at
odds with that specification.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-28 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210427102247.822-1-fenglinw@codeaurora.org>
2021-04-27 10:22 ` [PATCH 1/2] dt-bindings: pwm: add bindings for PWM modules inside QCOM PMICs Fenglin Wu
2021-04-27 12:57   ` Rob Herring
2021-04-28 10:54     ` fenglinw
2021-04-28 17:38   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).