devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Conor Dooley <conor@kernel.org>, Nuno Sa <nuno.sa@analog.com>
Cc: linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	 devicetree@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl>,
	Jonathan Corbet <corbet@lwn.net>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	 Linus Walleij <linus.walleij@linaro.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Rob Herring <robh+dt@kernel.org>,
	 Andy Shevchenko <andy@kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	Conor Dooley <conor+dt@kernel.org>
Subject: Re: [PATCH 1/2] dt-bindings: hwmon: Add LTC4282 bindings
Date: Mon, 13 Nov 2023 10:32:17 +0100	[thread overview]
Message-ID: <65060d844b4cdab02079a05286b506740623ed53.camel@gmail.com> (raw)
In-Reply-To: <20231110-astronomy-nicotine-02c798d42910@roley>

On Fri, 2023-11-10 at 18:42 +0000, Conor Dooley wrote:
> Yo,
> 
> On Fri, Nov 10, 2023 at 04:18:45PM +0100, Nuno Sa wrote:
> > Add bindings for the LTC4282 High Current Hot Swap Controller with I2C
> > Compatible Monitoring.
> > 
> > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > ---
> >  .../bindings/hwmon/adi,ltc4282.yaml           | 228 ++++++++++++++++++
> >  MAINTAINERS                                   |   6 +
> >  2 files changed, 234 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/hwmon/adi,ltc4282.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc4282.yaml
> > b/Documentation/devicetree/bindings/hwmon/adi,ltc4282.yaml
> > new file mode 100644
> > index 000000000000..0a5d540f014e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc4282.yaml
> > @@ -0,0 +1,228 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/hwmon/adi,ltc4282.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices LTC4282 I2C High Current Hot Swap Controller over I2C
> > +
> > +maintainers:
> > +  - Nuno Sa <nuno.sa@analog.com>
> > +
> > +description: |
> > +  Analog Devices LTC4282 I2C High Current Hot Swap Controller over I2C.
> > +
> > + 
> > https://www.analog.com/media/en/technical-documentation/data-sheets/ltc4282.pdf
> > +
> > +
> 
> Extra blank line here FYI.
> 

Right...

> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,ltc4282
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  vdd-supply: true
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  adi,clkout-mode:
> > +    description: |
> > +      Controls in which mode the CLKOUT PIN should work:
> > +        0 - Configures the CLKOUT pin to output the internal system clock
> > +        1 - Configures the CLKOUT pin to output the internal conversion
> > time
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum: [0, 1]
> 
> I really am not a fan of these types of properties. Part of me says that
> if you're outputting clocks from this device, then you should be a clock
> controller. How do consumers of this @clkout@ pin get the rate of the
> clock?

I explained it to Guenter as he also argued about this. I'll wait for more
feedback but it's likely this will just turn into a clock provider, yes.

> I'd kinda be expecting to see a clocks property with a maxItems of 1 and
> clock-names with two, mutually exclusive, options.
> 
> The other part says, and it applies in multiple places here, that having
> integer properties with non-integer meanings is a poor ABI. I'd be vastly
> happier if the various instances in this file became enums of strings,
> or $re┤evant-unit so that a dts containing these properties is
> immediately understandable.

Well, I think you're mentioning the 'gpio-mode' 'and under/over-voltage-
dividers'. I think for both it's clear that having the relevant units is not
feasible (at least I'm not seeing a way of properly do it). As for the strings,
well, I don't have any much to argue other than:

1) It's pattern seen in a lot of bindings - yes, that's not an excuse to copy
bad/wrong things over new bindings - but, honestly, it's the first time I have
someone complaining about it so I never thought it was wrong.

2) It makes much more easier to handle the properties in the driver (yeah, I
know that, as far as you're concerned, this does not matter to you :))

So yeah, if you insist on it, no strong reasons on my side to not do it. As long
as I see some consistency down the road :)).


- Nuno Sá

  reply	other threads:[~2023-11-13  9:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 15:18 [PATCH 0/2] Add support for LTC4282 Nuno Sa
2023-11-10 15:18 ` [PATCH 1/2] dt-bindings: hwmon: Add LTC4282 bindings Nuno Sa
2023-11-10 18:42   ` Conor Dooley
2023-11-13  9:32     ` Nuno Sá [this message]
2023-11-13 20:12       ` Conor Dooley
2023-11-20 15:03       ` Guenter Roeck
2023-11-10 15:18 ` [PATCH 2/2] hwmon: ltc4282: add support for the LTC4282 chip Nuno Sa
2023-11-10 16:50   ` Andy Shevchenko
2023-11-13 10:13     ` Nuno Sá
2023-11-13 16:31       ` Andy Shevchenko
2023-11-14  8:36         ` Nuno Sá
2023-11-20 15:00       ` Guenter Roeck
2023-11-11  1:04   ` kernel test robot
2023-11-11 17:22   ` Guenter Roeck
2023-11-13  9:24     ` Nuno Sá
2023-11-20 12:10   ` Dan Carpenter
2023-11-20 14:52     ` Guenter Roeck

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=65060d844b4cdab02079a05286b506740623ed53.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nuno.sa@analog.com \
    --cc=robh+dt@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 NNTP newsgroup(s).