lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250414194227.7a49301e@jic23-huawei>
Date: Mon, 14 Apr 2025 19:42:27 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt1@...il.com>
Cc: Marcelo Schmitt <marcelo.schmitt@...log.com>, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, Ana-Maria Cusco
 <ana-maria.cusco@...log.com>, lars@...afoo.de,
 Michael.Hennerich@...log.com, dlechner@...libre.com, nuno.sa@...log.com,
 andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org
Subject: Re: [PATCH v1 2/7] iio: adc: Add basic support for AD4170


> ...
> > > +static int ad4170_regulator_setup(struct ad4170_state *st)
> > > +{
> > > +	struct device *dev = &st->spi->dev;
> > > +	int ret;
> > > +
> > > +	/* Required regulators */
> > > +	ret = devm_regulator_get_enable_read_voltage(dev, "avdd");
> > > +	if (ret < 0)
> > > +		return dev_err_probe(dev, ret, "Failed to get AVDD voltage.\n");
> > > +
> > > +	st->vrefs_uv[AD4170_AVDD_SUP] = ret;
> > > +
> > > +	ret = devm_regulator_get_enable_read_voltage(dev, "iovdd");  
> > 
> > If no channel uses this reference is it not optional?  Maybe not worth the
> > complexity of handling that.  We have sometime bothered to do so in the past
> > by first figuring out which references are in use, then trying to get the
> > appropriate regulators with small changes for cases like this where
> > it needs to be enabled but we might not need the voltage.  
> 
> We can set the channel multiplexer to use IOVDD reference as diff chan negative
> input. Similar thing can be done for the other reference supplies. I think
> the examples in dt-binding don't use IOVDD but they could. Since the driver is
> supporting other regulators, maybe support IOVDD too?

That's fine. In a few drivers where we have muxes that can use many different
regulators, we allow for regulators to not be provided if no channels use them.
It may not be worth the effort.  If anyone comes along later with a board
wired that way then we can relax the requirement at that point.

> 
> >   
> > > +	if (ret < 0)
> > > +		return dev_err_probe(dev, ret, "Failed to get IOVDD voltage.\n");
> > > +
> > > +	st->vrefs_uv[AD4170_IOVDD_SUP] = ret;
> > > +
> > > +	/* Optional regulators */
> > > +	ret = devm_regulator_get_enable_read_voltage(dev, "avss");
> > > +	if (ret < 0 && ret != -ENODEV)
> > > +		return dev_err_probe(dev, ret, "Failed to get AVSS voltage.\n");
> > > +  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ