Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator
From: Mark Brown
Date: Thu Aug 20 2015 - 13:43:13 EST
On Thu, Aug 20, 2015 at 11:21:06AM +0530, Kishon Vijay Abraham I wrote:
> On Wednesday 19 August 2015 11:41 PM, Mark Brown wrote:
> > On Tue, Aug 18, 2015 at 11:23:54AM +0530, Kishon Vijay Abraham I wrote:
Please fix your mail client to word wrap within paragraphs.
> >> platform_get_resource can be used if we need the absolute address but here we
> >> need only the offset.
> > So substract this address from the start of the resource to get the
> That would mean from the offset (provided in dt) get the absolute address and
> then again from the absolute address get the offset.
Sure, that's how the Linux APIs work right now and why I'm suggesting
you might want a wrapper.
> > offset? Or provide a wrapper function in the resource code which does
> Why not use 'of_get_address' which does the same thing? Moreover it's not a
> resource we are dealing with here. It's a resource only for the syscon driver.
This is how the OF description you've done is intended to be parsed and
hence is interpreted by the generic code, it's just a detail of the
syscon implementation that you need to translate it into an offset.
> > that. What you're saying above is pretty much "this happens to work"
> > but my concern is that the solution that happens to work isn't really
> > what we want to do.
> Not just makes this work, this is also the most reasonable solution available IMHO.
In general moving to a lower level inteface is not usually a step
forward. As far as I can tell the driver already has all the
information it needs from the more generic APIs, it's just not
interpreting it in the way that the APIs it's trying to use wants. It
just needs to fix the way it interprets the data it's passing through.
> The most ideal way would have been to use something like what Grygorii
> mentioned to use syscon = <&scm_conf 0xe00> and then use the phandle to get the
> offset. But then with this we'll be breaking older dtbs.
There is no need to break older DTs, that would clearly be a bad idea.
Attachment:
signature.asc
Description: Digital signature