devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Peter De Schrijver <pdeschrijver@nvidia.com>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/8] regulator: core: Don't attach generic coupler to Tegra SoC regulators
Date: Tue, 18 Jun 2019 19:47:32 +0300	[thread overview]
Message-ID: <a4ccd5af-ce71-bc24-cdb9-d480380d15d4@gmail.com> (raw)
In-Reply-To: <20190617154455.GA5316@sirena.org.uk>

17.06.2019 18:44, Mark Brown пишет:
> On Tue, Jun 04, 2019 at 02:59:02AM +0300, Dmitry Osipenko wrote:
> 
>>  static int generic_coupler_attach(struct regulator_coupler *coupler,
>>  				  struct regulator_dev *rdev)
>>  {
>> +	/*
>> +	 * Generic coupler isn't suitable for NVIVIA Tegra SoC's, at least
>> +	 * for now. Hence filter out the unwanted regulators as they shall be
>> +	 * managed by a platform-specific coupler.
>> +	 */
>> +	if (of_property_read_bool(rdev->dev.of_node, "tegra-core-regulator") ||
>> +	    of_property_read_bool(rdev->dev.of_node, "tegra-rtc-regulator") ||
>> +	    of_property_read_bool(rdev->dev.of_node, "tegra-cpu-regulator"))
>> +		return -EPERM;
>> +
> 
> I'm having a hard time loving this as it requires explicit DT changes
> for implementation.  I'm thinking that since the couplers are going to
> need to be built in it'd be better to make sure that any custom ones get
> registered first and then only bind the generic coupler to anything they
> reject.
> 

Actually, the current implementation at first tries all the custom couplers and then
falls back to the generic.

What's currently missing is that any error code of the attach_regulator() callback is
treated as "go try next coupler", but we probably need a special error code for the
"skip me" case to differentiate from a error that should abort the coupler's lookup
process.

I'll re-work this in v3.

  reply	other threads:[~2019-06-18 16:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 23:58 [PATCH v2 0/8] Introduce customized regulators coupling Dmitry Osipenko
2019-06-03 23:58 ` [PATCH v2 1/8] regulator: core: Introduce API for regulators coupling customization Dmitry Osipenko
2019-06-17 15:23   ` Mark Brown
2019-06-18 16:25     ` Dmitry Osipenko
2019-06-03 23:58 ` [PATCH v2 2/8] regulator: core: Parse max-spread value per regulator couple Dmitry Osipenko
2019-06-17 15:25   ` Mark Brown
2019-06-18 16:27     ` Dmitry Osipenko
2019-06-03 23:58 ` [PATCH v2 3/8] regulator: core: Expose some of core functions Dmitry Osipenko
2019-06-17 15:32   ` Mark Brown
2019-06-18 16:29     ` Dmitry Osipenko
2019-06-03 23:59 ` [PATCH v2 4/8] regulator: core Bump MAX_COUPLED to 3 Dmitry Osipenko
2019-06-03 23:59 ` [PATCH v2 5/8] dt-bindings: regulator: Document regulators coupling of NVIDIA Tegra20/30 SoC's Dmitry Osipenko
2019-06-03 23:59 ` [PATCH v2 6/8] regulator: core: Don't attach generic coupler to Tegra SoC regulators Dmitry Osipenko
2019-06-17 15:44   ` Mark Brown
2019-06-18 16:47     ` Dmitry Osipenko [this message]
2019-06-03 23:59 ` [PATCH v2 7/8] soc/tegra: regulators: Add regulators coupler for Tegra20 Dmitry Osipenko
2019-06-17 15:46   ` Mark Brown
2019-06-18 16:52     ` Dmitry Osipenko
2019-06-18 17:14       ` Mark Brown
2019-06-18 17:19         ` Dmitry Osipenko
2019-06-03 23:59 ` [PATCH v2 8/8] soc/tegra: regulators: Add regulators coupler for Tegra30 Dmitry Osipenko

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=a4ccd5af-ce71-bc24-cdb9-d480380d15d4@gmail.com \
    --to=digetx@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pdeschrijver@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    /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).