diff mbox series

[v1,2/3] dt-bindings: hwmon: add microchip,emc2306.yaml dt binding description.

Message ID 20220430114905.53448-3-michaelsh@nvidia.com (mailing list archive)
State Changes Requested
Headers show
Series Add support for EMC2305 Fan Speed Controller. | expand

Commit Message

Michael Shych April 30, 2022, 11:49 a.m. UTC
From: Michael Shych <michaelsh@nvidia.com>

Add basic description of emc2305 driver device tree binding.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
---
 .../bindings/hwmon/microchip,emc2305.yaml          | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml

Comments

Guenter Roeck April 30, 2022, 12:58 p.m. UTC | #1
On Sat, Apr 30, 2022 at 02:49:04PM +0300, michaelsh@nvidia.com wrote:
> From: Michael Shych <michaelsh@nvidia.com>
> 
> Add basic description of emc2305 driver device tree binding.
> 
> Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> ---
>  .../bindings/hwmon/microchip,emc2305.yaml          | 55 ++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> new file mode 100644
> index 000000000000..c873172b7268
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microcip,emc2305
> +
> +  emc2305,pwm-min:
> +    description:
> +      Min pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-max:
> +    description:
> +      Max pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-channel:
> +    description:
> +      Max number of pwm channels
> +    maxItems: 1

I think this needs to be explained further.

> +  emcs205,max-state:
> +    description:
> +    maxItems: 1
> +  emc2305,cooling-levels:
> +    description:
> +      Quantity of cooling level state.
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +
> +optional:
> +  - emc2305,min-pwm
> +  - emc2305,max-pwm
> +  - emc2305,pwm-channels
> +  - emc2305,cooling-levels
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    fan {
> +        emc2305,compatible = "microchip,emc2305";
> +        emc2305,pwm-min = <0>;
> +        emc2305,pwm-max = <255>;
> +        emc2305,pwm-channel = <5>
> +        emc2305,cooling-levels = <10>;
> +    };
> +
> -- 
> 2.14.1
>
Rob Herring (Arm) May 2, 2022, 3:33 p.m. UTC | #2
On Sat, 30 Apr 2022 14:49:04 +0300, michaelsh@nvidia.com wrote:
> From: Michael Shych <michaelsh@nvidia.com>
> 
> Add basic description of emc2305 driver device tree binding.
> 
> Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> ---
>  .../bindings/hwmon/microchip,emc2305.yaml          | 55 ++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/microchip,emc2305.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/hwmon/microchip,emc2305.yaml:28:17: [error] empty value in block mapping (empty-values)

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emcs205,max-state:description: None is not of type 'string'
	from schema $id: http://json-schema.org/draft-07/schema#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: 'optional' is not one of ['$id', '$schema', 'title', 'description', 'examples', 'required', 'allOf', 'anyOf', 'oneOf', 'definitions', '$defs', 'additionalProperties', 'dependencies', 'dependentRequired', 'dependentSchemas', 'patternProperties', 'properties', 'if', 'then', 'else', 'unevaluatedProperties', 'deprecated', 'maintainers', 'select', '$ref']
	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: 'maintainers' is a required property
	hint: Metaschema for devicetree binding documentation
	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-channel: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('maxItems' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-channel: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-channel: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emcs205,max-state: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('maxItems' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emcs205,max-state: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emcs205,max-state: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,cooling-levels: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('maxItems' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,cooling-levels: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,cooling-levels: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-max: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('maxItems' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-max: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-max: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-min: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('maxItems' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-min: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: properties:emc2305,pwm-min: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
./Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: $id: relative path/filename doesn't match actual path or filename
	expected: http://devicetree.org/schemas/hwmon/microchip,emc2305.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml: ignoring, error in schema: properties: emcs205,max-state: description
Error: Documentation/devicetree/bindings/hwmon/microchip,emc2305.example.dts:25.13-14 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:364: Documentation/devicetree/bindings/hwmon/microchip,emc2305.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1401: 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.
Rob Herring (Arm) May 2, 2022, 6:17 p.m. UTC | #3
On Sat, Apr 30, 2022 at 02:49:04PM +0300, michaelsh@nvidia.com wrote:
> From: Michael Shych <michaelsh@nvidia.com>
> 
> Add basic description of emc2305 driver device tree binding.
> 
> Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> ---
>  .../bindings/hwmon/microchip,emc2305.yaml          | 55 ++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> new file mode 100644
> index 000000000000..c873172b7268
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microcip,emc2305
> +
> +  emc2305,pwm-min:
> +    description:
> +      Min pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-max:
> +    description:
> +      Max pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-channel:
> +    description:
> +      Max number of pwm channels
> +    maxItems: 1
> +  emcs205,max-state:
> +    description:
> +    maxItems: 1
> +  emc2305,cooling-levels:
> +    description:
> +      Quantity of cooling level state.
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +
> +optional:
> +  - emc2305,min-pwm
> +  - emc2305,max-pwm
> +  - emc2305,pwm-channels
> +  - emc2305,cooling-levels
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    fan {
> +        emc2305,compatible = "microchip,emc2305";

Err, what?

> +        emc2305,pwm-min = <0>;
> +        emc2305,pwm-max = <255>;
> +        emc2305,pwm-channel = <5>
> +        emc2305,cooling-levels = <10>;

All possible fans attached to this controller are the same and don't 
have anything that needs to be described? Based on other fan 
controllers, I don't think so. As I've said multiple times, there's a 
need for a common fan and fan-controller binding. Until that happens, 
I'm not inclined to accept fan controller bindings with custom 
properties.

Rob
Rob Herring (Arm) May 2, 2022, 6:19 p.m. UTC | #4
On Sat, Apr 30, 2022 at 02:49:04PM +0300, michaelsh@nvidia.com wrote:
> From: Michael Shych <michaelsh@nvidia.com>

Also, for the subject no need for 'dt binding description.', you 
already said that with 'dt-bindings'. So:

dt-bindings: hwmon: Add Microchip EMC2305 fan controller

> 
> Add basic description of emc2305 driver device tree binding.
> 
> Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> ---
>  .../bindings/hwmon/microchip,emc2305.yaml          | 55 ++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> new file mode 100644
> index 000000000000..c873172b7268
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
> +
> +properties:
> +  compatible:
> +    enum:
> +      - microcip,emc2305
> +
> +  emc2305,pwm-min:
> +    description:
> +      Min pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-max:
> +    description:
> +      Max pwm of emc2305
> +    maxItems: 1
> +  emc2305,pwm-channel:
> +    description:
> +      Max number of pwm channels
> +    maxItems: 1
> +  emcs205,max-state:
> +    description:
> +    maxItems: 1
> +  emc2305,cooling-levels:
> +    description:
> +      Quantity of cooling level state.
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +
> +optional:
> +  - emc2305,min-pwm
> +  - emc2305,max-pwm
> +  - emc2305,pwm-channels
> +  - emc2305,cooling-levels
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    fan {
> +        emc2305,compatible = "microchip,emc2305";
> +        emc2305,pwm-min = <0>;
> +        emc2305,pwm-max = <255>;
> +        emc2305,pwm-channel = <5>
> +        emc2305,cooling-levels = <10>;
> +    };
> +
> -- 
> 2.14.1
> 
>
Michael Shych May 15, 2022, 5:14 p.m. UTC | #5
Hi Rob,

I fixed all dt binding check errors and changed the patch subject name
that you pointed out.
However, it's not clear completely your comment in this reply.
emc2305 device support 5 pwms.
The intention was to specify a simple configuration per pwm{n} - to allow setting per pwm{n} 
minimum and maximum duty cycle, cooling level stepping (10%, 5%, 1%).

Is there some way to provide such a configuration?
Do you think that the following example is OK?

fan {
    microchip,compatible = "microchip,emc2305";
    microchip,pwm-channel = <5>;
    microchip,cooling-levels = <10>;
	pwm1 {
		microchip,pwm-min = <0>;
		microchip,pwm-max = <255>;
	};
	pwm2 {
		microchip,pwm-min = <0>;
		microchip,pwm-max = <255>;
	};
	...
};

Regards,
    Michael.



> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Monday, May 2, 2022 9:17 PM
> To: Michael Shych <michaelsh@nvidia.com>
> Cc: linux@roeck-us.net; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org; Vadim Pasternak <vadimp@nvidia.com>
> Subject: Re: [PATCH v1 2/3] dt-bindings: hwmon: add
> microchip,emc2306.yaml dt binding description.
> 
> On Sat, Apr 30, 2022 at 02:49:04PM +0300, michaelsh@nvidia.com wrote:
> > From: Michael Shych <michaelsh@nvidia.com>
> >
> > Add basic description of emc2305 driver device tree binding.
> >
> > Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> > Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> > ---
> >  .../bindings/hwmon/microchip,emc2305.yaml          | 55
> ++++++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> >
> > diff --git
> > a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > new file mode 100644
> > index 000000000000..c873172b7268
> > --- /dev/null
> > +++
> b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
> > +---
> > +
> > +$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - microcip,emc2305
> > +
> > +  emc2305,pwm-min:
> > +    description:
> > +      Min pwm of emc2305
> > +    maxItems: 1
> > +  emc2305,pwm-max:
> > +    description:
> > +      Max pwm of emc2305
> > +    maxItems: 1
> > +  emc2305,pwm-channel:
> > +    description:
> > +      Max number of pwm channels
> > +    maxItems: 1
> > +  emcs205,max-state:
> > +    description:
> > +    maxItems: 1
> > +  emc2305,cooling-levels:
> > +    description:
> > +      Quantity of cooling level state.
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +
> > +optional:
> > +  - emc2305,min-pwm
> > +  - emc2305,max-pwm
> > +  - emc2305,pwm-channels
> > +  - emc2305,cooling-levels
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    fan {
> > +        emc2305,compatible = "microchip,emc2305";
> 
> Err, what?
> 
> > +        emc2305,pwm-min = <0>;
> > +        emc2305,pwm-max = <255>;
> > +        emc2305,pwm-channel = <5>
> > +        emc2305,cooling-levels = <10>;
> 
> All possible fans attached to this controller are the same and don't have
> anything that needs to be described? Based on other fan controllers, I don't
> think so. As I've said multiple times, there's a need for a common fan and
> fan-controller binding. Until that happens, I'm not inclined to accept fan
> controller bindings with custom properties.
> 
> Rob
Michael Shych May 24, 2022, 4:17 p.m. UTC | #6
Hi Rob,

I'm resending v2 patch set with mentioned below changes.

Thank you,
    Michael.


> -----Original Message-----
> From: Michael Shych
> Sent: Sunday, May 15, 2022 8:15 PM
> To: Rob Herring <robh@kernel.org>
> Cc: linux@roeck-us.net; linux-hwmon@vger.kernel.org;
> devicetree@vger.kernel.org; Vadim Pasternak <vadimp@nvidia.com>
> Subject: RE: [PATCH v1 2/3] dt-bindings: hwmon: add
> microchip,emc2306.yaml dt binding description.
> 
> Hi Rob,
> 
> I fixed all dt binding check errors and changed the patch subject name that
> you pointed out.
> However, it's not clear completely your comment in this reply.
> emc2305 device support 5 pwms.
> The intention was to specify a simple configuration per pwm{n} - to allow
> setting per pwm{n} minimum and maximum duty cycle, cooling level stepping
> (10%, 5%, 1%).
> 
> Is there some way to provide such a configuration?
> Do you think that the following example is OK?
> 
> fan {
>     microchip,compatible = "microchip,emc2305";
>     microchip,pwm-channel = <5>;
>     microchip,cooling-levels = <10>;
> 	pwm1 {
> 		microchip,pwm-min = <0>;
> 		microchip,pwm-max = <255>;
> 	};
> 	pwm2 {
> 		microchip,pwm-min = <0>;
> 		microchip,pwm-max = <255>;
> 	};
> 	...
> };
> 
> Regards,
>     Michael.
> 
> 
> 
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: Monday, May 2, 2022 9:17 PM
> > To: Michael Shych <michaelsh@nvidia.com>
> > Cc: linux@roeck-us.net; linux-hwmon@vger.kernel.org;
> > devicetree@vger.kernel.org; Vadim Pasternak <vadimp@nvidia.com>
> > Subject: Re: [PATCH v1 2/3] dt-bindings: hwmon: add
> > microchip,emc2306.yaml dt binding description.
> >
> > On Sat, Apr 30, 2022 at 02:49:04PM +0300, michaelsh@nvidia.com wrote:
> > > From: Michael Shych <michaelsh@nvidia.com>
> > >
> > > Add basic description of emc2305 driver device tree binding.
> > >
> > > Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> > > Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> > > ---
> > >  .../bindings/hwmon/microchip,emc2305.yaml          | 55
> > ++++++++++++++++++++++
> > >  1 file changed, 55 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > > b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > > new file mode 100644
> > > index 000000000000..c873172b7268
> > > --- /dev/null
> > > +++
> > b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
> > > @@ -0,0 +1,55 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2
> > > +---
> > > +
> > > +$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - microcip,emc2305
> > > +
> > > +  emc2305,pwm-min:
> > > +    description:
> > > +      Min pwm of emc2305
> > > +    maxItems: 1
> > > +  emc2305,pwm-max:
> > > +    description:
> > > +      Max pwm of emc2305
> > > +    maxItems: 1
> > > +  emc2305,pwm-channel:
> > > +    description:
> > > +      Max number of pwm channels
> > > +    maxItems: 1
> > > +  emcs205,max-state:
> > > +    description:
> > > +    maxItems: 1
> > > +  emc2305,cooling-levels:
> > > +    description:
> > > +      Quantity of cooling level state.
> > > +    maxItems: 1
> > > +
> > > +required:
> > > +  - compatible
> > > +
> > > +optional:
> > > +  - emc2305,min-pwm
> > > +  - emc2305,max-pwm
> > > +  - emc2305,pwm-channels
> > > +  - emc2305,cooling-levels
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > +  - |
> > > +    fan {
> > > +        emc2305,compatible = "microchip,emc2305";
> >
> > Err, what?
> >
> > > +        emc2305,pwm-min = <0>;
> > > +        emc2305,pwm-max = <255>;
> > > +        emc2305,pwm-channel = <5>
> > > +        emc2305,cooling-levels = <10>;
> >
> > All possible fans attached to this controller are the same and don't
> > have anything that needs to be described? Based on other fan
> > controllers, I don't think so. As I've said multiple times, there's a
> > need for a common fan and fan-controller binding. Until that happens,
> > I'm not inclined to accept fan controller bindings with custom properties.
> >
> > Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
new file mode 100644
index 000000000000..c873172b7268
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/microchip,emc2305.yaml
@@ -0,0 +1,55 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/emc2305.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip EMC2305 RPM-based PWM Fan Speed Controller
+
+properties:
+  compatible:
+    enum:
+      - microcip,emc2305
+
+  emc2305,pwm-min:
+    description:
+      Min pwm of emc2305
+    maxItems: 1
+  emc2305,pwm-max:
+    description:
+      Max pwm of emc2305
+    maxItems: 1
+  emc2305,pwm-channel:
+    description:
+      Max number of pwm channels
+    maxItems: 1
+  emcs205,max-state:
+    description:
+    maxItems: 1
+  emc2305,cooling-levels:
+    description:
+      Quantity of cooling level state.
+    maxItems: 1
+
+required:
+  - compatible
+
+optional:
+  - emc2305,min-pwm
+  - emc2305,max-pwm
+  - emc2305,pwm-channels
+  - emc2305,cooling-levels
+
+additionalProperties: false
+
+examples:
+  - |
+    fan {
+        emc2305,compatible = "microchip,emc2305";
+        emc2305,pwm-min = <0>;
+        emc2305,pwm-max = <255>;
+        emc2305,pwm-channel = <5>
+        emc2305,cooling-levels = <10>;
+    };
+