mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Tinaco, Mariel" <Mariel.Tinaco@analog.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Marcelo Schmitt" <marcelo.schmitt1@gmail.com>,
	"Dimitri Fedrau" <dima.fedrau@gmail.com>,
	"Nuno Sá" <noname.nuno@gmail.com>
Subject: Re: [PATCH v3 2/2] iio: dac: support the ad8460 Waveform DAC
Date: Mon, 9 Sep 2024 09:41:51 -0500	[thread overview]
Message-ID: <35b927a2-aef4-4d9f-9d8c-b12ad0f600a5@baylibre.com> (raw)
In-Reply-To: <SJ0PR03MB62241B8DAC3C45C192819ED391992@SJ0PR03MB6224.namprd03.prod.outlook.com>

On 9/9/24 3:22 AM, Tinaco, Mariel wrote:
> 
> 

...

>>> +	if (IS_ERR(state->regmap))
>>> +		return dev_err_probe(dev, PTR_ERR(state->regmap),
>>> +				     "Failed to initialize regmap");
>>> +
>>> +	state->sync_clk = devm_clk_get_enabled(dev, NULL);
>>> +	if (IS_ERR(state->sync_clk))
>>> +		return dev_err_probe(dev, PTR_ERR(state->sync_clk),
>>> +				     "Failed to get sync clk\n");
>>> +
>>> +	state->tmp_adc_channel = devm_iio_channel_get(dev, "ad8460-
>> tmp");
>>> +	if (IS_ERR_OR_NULL(state->tmp_adc_channel)) {
>>> +		indio_dev->channels = ad8460_channels;
>>> +		indio_dev->num_channels = ARRAY_SIZE(ad8460_channels);
>>> +	} else {
>>> +		indio_dev->channels = ad8460_channels_with_tmp_adc;
>>> +		indio_dev->num_channels =
>> ARRAY_SIZE(ad8460_channels_with_tmp_adc);
>>> +	}
>>> +
>> Add and enable the various other supplies. They are probably always on in
>> which case the regulator framework will work it's magic to avoid use having to
>> care that they aren't in the dts.
> 
> If the other supplies are added, do they need to be tied up as well to the
> Private structure just like ref_1p2v? Or do I just apply the 
> devm_regulator_get_enable_read_voltage to it?
> 
> ret = devm_regulator_get_enable_read_voltage(&client->dev, "vdd");
> If (ret < 0 && ret != -ENODEV)
> 	return dev_err_probe(ltc2309->dev, ret,
> 				"failed to get vref voltage\n");
> 

For supplies that just supply power, we usually don't worry
about the voltage, so just use devm_regulator_get_enable().
Or if there are lots of supplies, you can use
devm_regulator_bulk_get_enable() to do them all at once.

They don't need to be added to the private structure.

Also, lots of chips have to have supplies turned on in a
certain order. This one is no exception, so be sure to
have a look at the "POWER SUPPLY SEQUENCING" section in
the datasheet to make sure the driver turns things on in
the right order.

  reply	other threads:[~2024-09-09 14:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  2:30 [PATCH v3 0/2] Add support to AD8460 Waveform Generator DAC Mariel Tinaco
2024-09-04  2:30 ` [PATCH v3 1/2] dt-bindings: iio: dac: add docs for ad8460 Mariel Tinaco
2024-09-04  6:20   ` Krzysztof Kozlowski
2024-09-07 17:01     ` Jonathan Cameron
2024-09-09  6:22       ` Tinaco, Mariel
2024-09-09  6:41         ` Krzysztof Kozlowski
2024-09-04  2:30 ` [PATCH v3 2/2] iio: dac: support the ad8460 Waveform DAC Mariel Tinaco
2024-09-04 15:50   ` kernel test robot
2024-09-04 17:23   ` kernel test robot
2024-09-06  0:50   ` David Lechner
2024-09-09  9:47     ` Tinaco, Mariel
2024-09-09 14:51       ` David Lechner
2024-09-09 19:09         ` Jonathan Cameron
2024-09-10  1:44     ` Tinaco, Mariel
2024-09-14 11:45       ` Jonathan Cameron
2024-09-07 17:14   ` Jonathan Cameron
2024-09-09  8:22     ` Tinaco, Mariel
2024-09-09 14:41       ` David Lechner [this message]
2024-09-04  6:16 ` [PATCH v3 0/2] Add support to AD8460 Waveform Generator DAC Krzysztof Kozlowski
2024-09-05  1:10   ` Tinaco, Mariel

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=35b927a2-aef4-4d9f-9d8c-b12ad0f600a5@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Mariel.Tinaco@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dima.fedrau@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=noname.nuno@gmail.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

all inboxes | Powered by JetHome®