Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1210160 > unrolled thread
| Started by | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| First post | 2015-08-20 08:00 +0200 |
| Last post | 2015-08-20 19:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Kishon Vijay Abraham I <kishon@ti.com> - 2015-08-20 08:00 +0200
Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator Mark Brown <broonie@kernel.org> - 2015-08-20 19:50 +0200
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2015-08-20 08:00 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <pZr3k-4jD-13@gated-at.bofh.it> |
Hi Mark Brown, 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: >> On Friday 14 August 2015 11:30 PM, Mark Brown wrote: >>> On Mon, Jul 27, 2015 at 04:54:09PM +0530, Kishon Vijay Abraham I wrote: > >>>> is moved as a child node of syscon, vsel_reg and enable_reg has the >>>> absolute address because of the address translation that happens while >>>> creating device from device tree node. >>>> So avoid using platform_get_resource and use of_get_address in order to >>>> get only the offset (untranslated address) and populate these in >>>> vsel_reg and enable_reg. > >>> This sounds like we're going in the wrong direction, we're moving from a >>> more generic API to a firmware specific one. Why is this a good fix? > >> 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. > 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. > 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. 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. Thanks Kishon -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2015-08-20 19:50 +0200 |
| Subject | Re: [PATCH 1/2] regulator: pbias: use untranslated address to program pbias regulator |
| Message-ID | <pZC8r-3uB-15@gated-at.bofh.it> |
| In reply to | #1210160 |
[Multipart message — attachments visible in raw view] — view raw
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.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web