Linux-Hwmon Archive mirror
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>, peiyu li <579lpy@gmail.com>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] dt-bindings: hwmon: max6650: convert to dtschema
Date: Thu, 21 Mar 2024 15:18:23 +0100	[thread overview]
Message-ID: <8d809c67-8a12-4411-86dc-4918073891dd@gmail.com> (raw)
In-Reply-To: <20240321140336.GA1648289-robh@kernel.org>

On 3/21/24 15:03, Rob Herring wrote:
> On Wed, Mar 20, 2024 at 06:04:58PM +0100, Javier Carrasco wrote:
>>  Convert existing bindings to dtschema to support validation.
>>
>>  This is a straightforward conversion with no new properties.
> 
> Why the indentation?
> 

Will be fixed for v2

>>
>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>> ---
>>  .../devicetree/bindings/hwmon/max6650.txt          | 28 ---------
>>  .../devicetree/bindings/hwmon/maxim,max6650.yaml   | 68 ++++++++++++++++++++++
>>  2 files changed, 68 insertions(+), 28 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/hwmon/max6650.txt b/Documentation/devicetree/bindings/hwmon/max6650.txt
>> deleted file mode 100644
>> index f6bd87d8e284..000000000000
>> --- a/Documentation/devicetree/bindings/hwmon/max6650.txt
>> +++ /dev/null
>> @@ -1,28 +0,0 @@
>> -Bindings for MAX6651 and MAX6650 I2C fan controllers
>> -
>> -Reference:
>> -[1]	https://datasheets.maximintegrated.com/en/ds/MAX6650-MAX6651.pdf
>> -
>> -Required properties:
>> -- compatible : One of "maxim,max6650" or "maxim,max6651"
>> -- reg        : I2C address, one of 0x1b, 0x1f, 0x4b, 0x48.
>> -
>> -Optional properties, default is to retain the chip's current setting:
>> -- maxim,fan-microvolt : The supply voltage of the fan, either 5000000 uV or
>> -			12000000 uV.
>> -- maxim,fan-prescale  : Pre-scaling value, as per datasheet [1]. Lower values
>> -			allow more fine-grained control of slower fans.
>> -			Valid: 1, 2, 4, 8, 16.
>> -- maxim,fan-target-rpm: Initial requested fan rotation speed. If specified, the
>> -			driver selects closed-loop mode and the requested speed.
>> -			This ensures the fan is already running before userspace
>> -			takes over.
>> -
>> -Example:
>> -	fan-max6650: max6650@1b {
>> -		reg = <0x1b>;
>> -		compatible = "maxim,max6650";
>> -		maxim,fan-microvolt = <12000000>;
>> -		maxim,fan-prescale = <4>;
>> -		maxim,fan-target-rpm = <1200>;
>> -	};
>> diff --git a/Documentation/devicetree/bindings/hwmon/maxim,max6650.yaml b/Documentation/devicetree/bindings/hwmon/maxim,max6650.yaml
>> new file mode 100644
>> index 000000000000..1b33b5fb606d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/hwmon/maxim,max6650.yaml
>> @@ -0,0 +1,68 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +
>> +$id: http://devicetree.org/schemas/hwmon/maxim,max6650.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Maxim MAX6650 and MAX6651 I2C Fan Controllers
>> +
>> +maintainers:
>> +  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
>> +
>> +description: |
>> +  The MAX6650 and MAX6651 regulate and monitor the speed
>> +  of 5VDC/12VDC burshless fans with built-in tachometers.
>> +
>> +  Datasheets:
>> +    https://datasheets.maximintegrated.com/en/ds/MAX6650-MAX6651.pdf
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - maxim,max6650
>> +      - maxim,max6651
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  maxim,fan-microvolt:
>> +    description:
>> +      The supply voltage of the fan, either 5000000 uV or
>> +      12000000 uV.
> 
> Looks like constraints. Please add them.
> 

Will add enum: [5000000, 12000000]

>> +
>> +  maxim,fan-prescale:
>> +    description:
>> +      Pre-scaling value, as per datasheet. Lower values
>> +      allow more fine-grained control of slower fans.
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    enum: [1, 2, 4, 8, 16]
>> +
>> +  maxim,fan-target-rpm:
>> +    description:
>> +      Initial requested fan rotation speed. If specified, the
>> +      driver selects closed-loop mode and the requested speed.
>> +      This ensures the fan is already running before userspace
>> +      takes over.
>> +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> Constraints? I'm sure no fan RPM is higher than 10000 and probably much 
> less than that.
> 
> Rob

According to the datasheet (page 9, table 3. Fan Speed), the highest fan
speed that can be achieved is 30000 RPM (which does not mean that fans
actually reach that speed). I could use that as the maximum value, though.

Thanks for the review and best regards,
Javier Carrasco


      parent reply	other threads:[~2024-03-21 14:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 17:04 [PATCH 0/2] dt-bindings: hwmon: convert lm87 and max6650 to dtschema Javier Carrasco
2024-03-20 17:04 ` [PATCH 1/2] dt-bindings: hwmon: lm87: convert " Javier Carrasco
2024-03-20 17:11   ` Conor Dooley
2024-03-20 18:03   ` Guenter Roeck
2024-03-20 17:04 ` [PATCH 2/2] dt-bindings: hwmon: max6650: " Javier Carrasco
2024-03-21 14:03   ` Rob Herring
2024-03-21 14:17     ` Guenter Roeck
2024-03-21 14:18     ` Javier Carrasco [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d809c67-8a12-4411-86dc-4918073891dd@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=579lpy@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).