linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Ariana Lazar" <ariana.lazar@microchip.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: dac: adding support for Microchip MCP47FEB02
Date: Sat, 27 Dec 2025 18:05:43 +0200	[thread overview]
Message-ID: <aVAD13oSRAlj-1VF@smile.fi.intel.com> (raw)
In-Reply-To: <20251227155245.6a3f5344@jic23-huawei>

On Sat, Dec 27, 2025 at 03:52:45PM +0000, Jonathan Cameron wrote:
> On Tue, 16 Dec 2025 14:05:51 +0200
> Ariana Lazar <ariana.lazar@microchip.com> wrote:

> > This is the iio driver for Microchip MCP47F(E/V)B(0/1/2)1,
> > MCP47F(E/V)B(0/1/2)2, MCP47F(E/V)B(0/1/2)4 and MCP47F(E/V)B(0/1/2)8 series
> > of buffered voltage output Digital-to-Analog Converters with nonvolatile or
> > volatile memory and an I2C Interface.
> > 
> > The families support up to 8 output channels.
> > 
> > The devices can be 8-bit, 10-bit and 12-bit.
> > 
> > Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
> Hi Ariana,
> 
> One stale bit of documentation and I'd be surprised if the
> style of text used in Kconfig short help proves sustainable.
> We often end up over time moving to 'x and similar' to avoid
> very complex pattern matching as more and more parts end up supported
> by a given driver.
> 
> With those in mind. Applied to the togreg branch of iio.git which I'll initially
> push out as testing to let 0-day take a poke at it.
> 
> Thanks
> 
> Jonathan
> 
> > diff --git a/drivers/iio/dac/mcp47feb02.c b/drivers/iio/dac/mcp47feb02.c
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..c04f3b72b1b1fc303b1bde63c281aade8a67b2f9
> > --- /dev/null
> > +++ b/drivers/iio/dac/mcp47feb02.c
> 
> > +/**
> > + * struct mcp47feb02_data - chip configuration
> > + * @chdata: options configured for each channel on the device
> > + * @lock: prevents concurrent reads/writes to driver's state members
> > + * @chip_features: pointer to features struct
> > + * @scale_1: scales set on channels that are based on Vref1
> > + * @scale: scales set on channels that are based on Vref/Vref0
> > + * @active_channels_mask: enabled channels
> > + * @client: the i2c-client attached to the device
> 
> Not there. I'll tidy this up whilst applying if nothing else
> comes up.
> 
> > + * @regmap: regmap for directly accessing device register
> > + * @vref1_buffered: Vref1 buffer is enabled
> > + * @vref_buffered: Vref/Vref0 buffer is enabled
> > + * @phys_channels: physical channels on the device
> > + * @labels: table with channels labels
> > + * @use_vref1: vref1-supply is defined
> > + * @use_vref: vref-supply is defined
> > + */
> > +struct mcp47feb02_data {
> > +	struct mcp47feb02_channel_data chdata[MCP47FEB02_MAX_CH];
> > +	struct mutex lock; /* prevents concurrent reads/writes to driver's state members */
> > +	const struct mcp47feb02_features *chip_features;
> > +	int scale_1[2 * MCP47FEB02_MAX_SCALES_CH];
> > +	int scale[2 * MCP47FEB02_MAX_SCALES_CH];
> > +	unsigned long active_channels_mask;
> > +	struct regmap *regmap;
> > +	bool vref1_buffered;
> > +	bool vref_buffered;
> > +	u16 phys_channels;
> > +	const char *labels[MCP47FEB02_MAX_CH];
> > +	bool use_vref1;
> > +	bool use_vref;

I would group slightly different these:

	...
	const char *labels[MCP47FEB02_MAX_CH];
	bool vref1_buffered;
	bool vref_buffered;
	bool use_vref1;
	bool use_vref;
	u16 phys_channels;

With this the vref grouped together and not split. A possible variant:

	const char *labels[MCP47FEB02_MAX_CH];
	u16 phys_channels;
	bool vref1_buffered;
	bool vref_buffered;
	bool use_vref1;
	bool use_vref;

Jonathan, can you also tweak this?

And I think it's worth to add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

> > +};

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2025-12-27 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 12:05 [PATCH v4 0/2] Adding support for Microchip MCP47FEB02 Ariana Lazar
2025-12-16 12:05 ` [PATCH v4 1/2] dt-bindings: iio: dac: adding " Ariana Lazar
2025-12-16 12:05 ` [PATCH v4 2/2] " Ariana Lazar
2025-12-27 15:52   ` Jonathan Cameron
2025-12-27 16:05     ` Andy Shevchenko [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=aVAD13oSRAlj-1VF@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=ariana.lazar@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --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 NNTP newsgroup(s).