Thread (1 message) 1 message, 1 author, 2012-03-20

Re: [PATCH v4 10/10] pwm-backlight: Add rudimentary device tree support

From: Mark Brown <hidden>
Date: 2012-03-20 16:08:36
Also in: linux-arm-kernel, linux-tegra

On Tue, Mar 20, 2012 at 09:56:09AM -0600, Stephen Warren wrote:
On 03/20/2012 09:43 AM, Thierry Reding wrote:
quoted
What would be a good way to represent this in platform data?
I think most get subsystems have a get API that works for both DT and
non-DT, rather than using platform data:
Yes, please - having to have explict handling in drivers to select a
mechanism to look up stuff in the subsystem would be very sad.
# works in DT right now IIRC:
regulator_get(dev, supply_name)
Yes, that's totally transparent to the device.
For board files, this would rely on some table which mapped from the get
parameters to the returned object. IIRC, most of these tables are
indexed by (dev_name(dev), name) and probably return the dev_name() of
the providing device (or whatever internally makes sense to identify the
device) plus some subsystem-specific data (e.g. PWM index).
That's how regulator and clk do it (I think pinctrl too, and IIO also
does this though it's in staging) - the consumer works with the struct
device and the name of the thing it's requesting and the things doing
the mapping (boards, SoCs, whatever) map this onto the actual device
with a lookup table which works in terms of dev_name() for the
requesting device.  We use dev_name() because many buses don't make a
struct device available until very late in system startup.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help