devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Naresh Solanki <naresh.solanki@9elements.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	Marcello Sylvester Bauer <sylv@sylv.io>
Subject: Re: [PATCH v8 2/2] mfd: max597x: Add support for MAX5970 and MAX5978
Date: Mon, 14 Nov 2022 09:11:35 +0000	[thread overview]
Message-ID: <Y3IGR887iuyP2SoL@google.com> (raw)
In-Reply-To: <f5e5a2d3-d985-f351-78e0-8a479a6d896a@9elements.com>

On Fri, 11 Nov 2022, Naresh Solanki wrote:
> On 07-11-2022 03:06 pm, Lee Jones wrote:
> > On Thu, 03 Nov 2022, Naresh Solanki wrote:
> > 
> > > From: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > 
> > > Implement a regulator driver with IRQ support for fault management.
> > 
> > This is not a "regulator driver".
> > 
> > > Written against documentation [1] and [2] and tested on real hardware.
> > > 
> > > Every channel has its own regulator supplies nammed 'vss1-supply' and
> > > 'vss2-supply'. The regulator supply is used to determine the output
> > > voltage, as the smart switch provides no output regulation.
> > > The driver requires the 'shunt-resistor-micro-ohms' property to be
> > > present in Device Tree to properly calculate current related
> > > values.
> > > 
> > > Datasheet links:
> > > 1: https://datasheets.maximintegrated.com/en/ds/MAX5970.pdf
> > > 2: https://datasheets.maximintegrated.com/en/ds/MAX5978.pdf
> > > 
> > > Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> > > Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
> > > Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>

[...]

> > > +static const struct of_device_id max597x_of_match[] = {
> > > +	{ .compatible = "maxim,max5970", .data = (void *)MAX597x_TYPE_MAX5970 },
> > > +	{ .compatible = "maxim,max5978", .data = (void *)MAX597x_TYPE_MAX5978 },
> > 
> > Where is .data used?
> The .data isn't used.

Then why add it?

[...]

> > > +#include <linux/device.h>
> > > +#include <linux/regmap.h>
> > > +
> > > +/* Number of switch based on chip variant */
> > 
> > This comment is superfluous.
> You mean this comment should be removed ?

I do.

> > > +#define MAX5970_NUM_SWITCHES 2
> > > +#define MAX5978_NUM_SWITCHES 1
> > > +/* Both chip variant have 4 indication LEDs used by LED cell */
> > 
> > Here too I think.
> > 
> > > +#define MAX597X_NUM_LEDS     4
> > > +
> > > +enum max597x_chip_type {
> > > +	MAX597x_TYPE_MAX5978 = 1,
> > 
> > Why 1?
> MAX5978 & single power switch wheres MAX5970 has two.

That's not what this enum means.

You are just describing the type to be matched on.

The value should be arbitrary, no?

[...]

> > > +#define  OC_STATUS_WARN(ch)				BIT(ch)
> > > +
> > > +#define MAX5970_REG_CHXEN				0x3b
> > > +#define  CHXEN(ch)						(3 << (ch * 2))
> > > +
> > > +#define MAX5970_REG_LED_FLASH			0x43
> > 
> > Do these all need to be shared?
> > 
> > Or can they be isolated into, say, the Regulator driver?
> > 
> Shared reg.

Where else are they used?

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2022-11-14  9:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 21:34 [PATCH v8 0/2] mfd: max597x: Add support for max597x Naresh Solanki
2022-11-03 21:34 ` [PATCH v8 1/2] dt-bindings: mfd: Add bindings for MAX5970 and MAX5978 Naresh Solanki
2022-11-03 21:49   ` Krzysztof Kozlowski
2022-11-11  8:27     ` Naresh Solanki
2022-11-03 21:34 ` [PATCH v8 2/2] mfd: max597x: Add support " Naresh Solanki
2022-11-07  9:36   ` Lee Jones
2022-11-11  9:14     ` Naresh Solanki
2022-11-14  9:11       ` Lee Jones [this message]
2022-11-14 18:20         ` Naresh Solanki

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=Y3IGR887iuyP2SoL@google.com \
    --to=lee@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naresh.solanki@9elements.com \
    --cc=patrick.rudolph@9elements.com \
    --cc=sylv@sylv.io \
    /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).