device_tree binding for "amba bus"

Grant Likely grant.likely at secretlab.ca
Wed May 18 13:13:33 EST 2011


On Tue, May 17, 2011 at 6:23 PM, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:
> On Tue, May 17, 2011 at 05:05:12PM -0700, Stephen Neuendorffer wrote:
>> In drivers/amba/bus.c:
>>
>> static int amba_get_enable_pclk(struct amba_device *pcdev)
>> {
>>       struct clk *pclk = clk_get(&pcdev->dev, "apb_pclk");
>>
>> static int amba_get_enable_vcore(struct amba_device *pcdev)
>> {
>>       struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
>>
>> So users of this bus have to have a clock and a regulator with those
>> exact names.
>> Is it your expectation that the clock/regulator names are standardized
>> across arch/arm?
>
> Let's fix one thing here.
>
> The second argument to clk_get is *not* a unique clock name.  It is a
> _connection_ name for the device, to distinguish between different
> clocks on the same device.  It does not identify _any_ particular
> clock on its own.

The draft device tree clock matching code reflects this too.  If an
"apb_pclk-clock" property (which is a phandle to a clock provider) is
provided by the device tree, then the dt clock decode logic will use
it to determine which clock source to use.  The current code is a bit
of an ugly hack, and the exact mechanics may change, but in principle
the device tree support code will continue to follow this model.
apb_pclk is the generic name, but it could be wired to any clock in
the system.

g.


More information about the devicetree-discuss mailing list