lkml.org 
[lkml]   [2012]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How about a gpio_get(device *, char *) function?
On 10/31/2012 03:04 AM, Alex Courbot wrote:
> Hi,
>
> Would anyone be opposed to having a gpio_get() function that works similarly
> to e.g. regulator_get() and clk_get()?

One major stumbling block is that with device tree, each individual
binding gets to decide on the specific naming of the propert{y,ies} that
define the GPIO(s) for the device, and so there's no way to provide a
generic implementation of that function.

Related, I've always wished that DT nodes looked like:

device {
reg = <...>;
compatible = <...>;
resources {
pwms = <...>;
regulators = <...>;
clocks = <...>;
gpios = <...>;
other-devices = <...>; /* for custom API dependencies */
};
config {
/* device-specific properties */
};
child-busses {
0 = { ... };
1 = { ... };
};
};

... specifically so that all resource allocation, and perhaps even child
bus enumeration, could be completely standardized in the DT/device core.
This could also feed into deferred probe, which could then be purely
implemented inside the DT/driver core. However, that'd require something
incompatible like "device tree 2.0"


\
 
 \ /
  Last update: 2012-10-31 17:01    [W:0.104 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site