linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Mark Brown <broonie@kernel.org>, Lee Jones <lee.jones@linar>,
	Arnd Bergmann <arnd@arndb.de>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	lgirdwood@gmail.com, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, nsekhar@ti.com,
	Tero Kristo <t-kristo@ti.com>
Subject: Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator
Date: Tue, 1 Sep 2015 07:17:21 -0700	[thread overview]
Message-ID: <20150901141720.GD4215@atomide.com> (raw)
In-Reply-To: <55E5727E.1040103@ti.com>

Hi,

I think the fix is rather easy here.. See below.

* Kishon Vijay Abraham I <kishon@ti.com> [150901 02:43]:
> 
> Before commit d919501feffa8715147582c3ffce96fad0c7016f ARM: dts: dra7:
> add minimal l4 bus layout with control module support, the dt was like
> 
> ocp {
> 	dra7_ctrl_general: tisyscon@4a002e00 {
> 		compatible = "syscon";
> 		reg = <0x4a002e00 0x7c>;
> 	};
> 
> 	pbias_regulator: pbias_regulator {
> 		compatible = "ti,pbias-omap";
> 		reg = <0 0x4>;
> 		syscon = <&dra7_ctrl_general>;
> 	};
> };

Yes the reg = <0 0x4> above is wrong, it's not an offset from the
ocp but from the syscon base.
 
> But after commit d919501fef, the dt became like this (after a couple of
> fixes)
> 
> ocp {
> 	l4_cfg: l4@4a000000 {
> 		compatible = "ti,dra7-l4-cfg", "simple-bus";
> 		ranges = <0 0x4a000000 0x22c000>;
> 
> 		scm: scm@2000 {
> 			compatible = "ti,dra7-scm-core", "simple-bus";
> 			reg = <0x2000 0x2000>;
> 			ranges = <0 0x2000 0x2000>;
> 
> 			scm_conf: scm_conf@0 {
> 				compatible = "syscon", "simple-bus";
> 				reg = <0x0 0x1400>;
> 				ranges = <0 0x0 0x1400>;
> 
> 				pbias_regulator: pbias_regulator {
> 					compatible = "ti,pbias-omap";
> 					reg = <0xe00 0x4>;
> 					syscon = <&scm_conf>;
>                                 };
> 			};
> 		};
> 	};
> };

And here we properly describe the hardware interconnect layout and
of_ioremap and friends do the right thing. And reg = <0xxe00 0x4>
is correct offset from the scm_conf base.

Why don't you just make reg unused for pbias_regulator since
we already use regmap for this driver?

Then in the pbias driver just define the register offset from
the syscon base? You may need to set it based on the compatible
value, but it's not like it's going to change for SoC.

If we eventually add some API to calculate reg base offset
from the syscon base it's easy to update the driver to use
that.

Cheers,

Tony

  parent reply	other threads:[~2015-09-01 14:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 11:24 [PATCH 0/2] pbias regulator fixes Kishon Vijay Abraham I
2015-07-27 11:24 ` [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I
2015-07-29  8:57   ` Grygorii Strashko
2015-08-05  9:47   ` Tony Lindgren
2015-08-05 14:56     ` Kishon Vijay Abraham I
2015-08-06  6:26       ` Tony Lindgren
2015-08-06  9:58         ` Grygorii Strashko
2015-08-14 18:00   ` Mark Brown
2015-08-18  5:53     ` Kishon Vijay Abraham I
2015-08-19 18:11       ` Mark Brown
2015-08-20  5:51         ` Kishon Vijay Abraham I
2015-08-20 17:42           ` Mark Brown
2015-08-25 10:03         ` Grygorii Strashko
2015-08-25 13:50           ` Mark Brown
2015-08-31 10:44             ` Kishon Vijay Abraham I
2015-08-31 14:52               ` Mark Brown
2015-09-01  9:40                 ` Kishon Vijay Abraham I
2015-09-01 11:31                   ` Kishon Vijay Abraham I
2015-09-01 14:17                   ` Tony Lindgren [this message]
2015-09-01 18:36                     ` Mark Brown
2015-09-01 18:56                       ` Tony Lindgren
2015-09-02 11:15                         ` Mark Brown
2015-07-27 11:24 ` [PATCH 2/2] regulator: pbias: Fix broken pbias disable functionality Kishon Vijay Abraham I

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=20150901141720.GD4215@atomide.com \
    --to=tony@atomide.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=kishon@ti.com \
    --cc=lee.jones@linar \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=t-kristo@ti.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).