All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: "Janani Sunil" <janani.sunil@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.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>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	"Janani Sunil" <jan.sun97@gmail.com>
Subject: Re: [PATCH v3 2/2] iio: dac: Add AD5529R DAC driver support
Date: Mon, 22 Jun 2026 10:31:42 +0100	[thread overview]
Message-ID: <20260622103142.0cf5dc2d@jic23-huawei> (raw)
In-Reply-To: <9c5104eb504e390c2267e0a17762fdb6d73d75a4.camel@pengutronix.de>

On Mon, 22 Jun 2026 11:12:19 +0200
Philipp Zabel <p.zabel@pengutronix.de> wrote:

> On Di, 2026-05-19 at 17:42 +0200, Janani Sunil wrote:
> > Add support for AD5529R 16-channel, 12/16 bit Digital to Analog Converter
> > 
> > Signed-off-by: Janani Sunil <janani.sunil@analog.com>
> > ---
> >  MAINTAINERS               |   1 +
> >  drivers/iio/dac/Kconfig   |  17 ++
> >  drivers/iio/dac/Makefile  |   1 +
> >  drivers/iio/dac/ad5529r.c | 527 ++++++++++++++++++++++++++++++++++++++++++++++
> >  4 files changed, 546 insertions(+)
> >   
> [...]
> > diff --git a/drivers/iio/dac/ad5529r.c b/drivers/iio/dac/ad5529r.c
> > new file mode 100644
> > index 000000000000..9bb63030db95
> > --- /dev/null
> > +++ b/drivers/iio/dac/ad5529r.c
> > @@ -0,0 +1,527 @@  
> [...]
> > +static int ad5529r_reset(struct ad5529r_state *st)
> > +{
> > +	struct reset_control *rst;
> > +	int ret;
> > +
> > +	rst = devm_reset_control_get_optional_exclusive(&st->spi->dev, NULL);  
> 
> Consider using devm_reset_control_get_optional_exclusive_deasserted()
> to save a few lines, and to make sure the reset line is asserted again
> when the driver is unbound.

Given we can't assume it's a gpio reset at this level (it is but meh,
we shouldn't use the API that way), we can't guarantee it was ever asserted
so we probably have to do a dance of assert then deassert.

This is one of Sashiko's favourite things to complain about so
we ended up doing some digging into that path a few weeks back.

I'd really like that not to be the case so maybe that analysis is wrong.

Jonathan




> 
> > +	if (IS_ERR(rst))
> > +		return PTR_ERR(rst);
> > +
> > +	if (rst) {
> > +		ret = reset_control_deassert(rst);
> > +		if (ret)
> > +			return ret;  
> 
> This branch could then be removed.
> 
> > +	} else {
> > +		ret = regmap_write(st->regmap_8bit, AD5529R_REG_INTERFACE_CONFIG_A,
> > +				   AD5529R_INTERFACE_CONFIG_A_SW_RESET);
> > +		if (ret)
> > +			return ret;
> > +	}  
> 
> regards
> Philipp


      reply	other threads:[~2026-06-22  9:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 15:42 [PATCH v3 0/2] iio: dac: Add support for AD5529R DAC Janani Sunil
2026-05-19 15:42 ` [PATCH v3 1/2] dt-bindings: iio: dac: Add AD5529R Janani Sunil
2026-05-19 15:55   ` sashiko-bot
2026-05-22 17:02   ` Jonathan Cameron
2026-05-25 16:30     ` Conor Dooley
2026-05-26 12:35       ` Jonathan Cameron
2026-05-26 13:11   ` Rodrigo Alencar
2026-06-09 14:47     ` Janani Sunil
2026-06-14 19:44       ` Jonathan Cameron
2026-06-19 10:33         ` Janani Sunil
2026-06-19 11:31           ` Nuno Sá
2026-06-19 11:36           ` Conor Dooley
2026-06-19 11:40             ` Conor Dooley
2026-06-19 13:01               ` Nuno Sá
2026-06-19 14:12                 ` Conor Dooley
2026-06-19 15:54                   ` Nuno Sá
2026-06-21 14:33                     ` Jonathan Cameron
2026-06-21 18:35                       ` Conor Dooley
2026-06-22  9:07                         ` Nuno Sá
2026-06-22  9:27                           ` Jonathan Cameron
2026-06-22 10:17                             ` Nuno Sá
2026-06-22 11:54                               ` Janani Sunil
2026-06-22 12:14                                 ` Conor Dooley
2026-06-22 12:39                                   ` Janani Sunil
2026-06-22 12:50                                     ` Conor Dooley
2026-06-22 16:24                               ` Jonathan Cameron
2026-06-22  9:24                       ` Rodrigo Alencar
2026-06-22 10:29                         ` Nuno Sá
2026-06-22 11:51                           ` Rodrigo Alencar
2026-06-22 12:20                             ` Nuno Sá
2026-06-22 15:36                               ` David Lechner
2026-06-22 16:29                           ` Jonathan Cameron
2026-05-19 15:42 ` [PATCH v3 2/2] iio: dac: Add AD5529R DAC driver support Janani Sunil
2026-05-19 16:22   ` sashiko-bot
2026-05-22 17:24   ` Jonathan Cameron
2026-06-22  9:12   ` Philipp Zabel
2026-06-22  9:31     ` Jonathan Cameron [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=20260622103142.0cf5dc2d@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jan.sun97@gmail.com \
    --cc=janani.sunil@analog.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.