How to handle named resources with DT?

Grant Likely grant.likely at secretlab.ca
Wed Aug 10 16:12:06 EDT 2011


On Wed, Aug 10, 2011 at 1:57 PM, David Brown <davidb at codeaurora.org> wrote:
> On Wed, Aug 10, 2011 at 01:22:16PM -0600, Grant Likely wrote:
>
>> Please, stick with the established convention and explicitly order
>> 'reg' and 'interrupts' properties.  If there is a specific use case
>> where this doesn't work, then bring it up, but I haven't seen any yet.
>>  The current users of _byname that I've looked seem to only use it for
>> convenience, not because a register range may be optional.  ie. they
>> all fail out if a reg resource isn't present.
>
> The msm_serial driver uses the presence of one of it's _byname reg
> regions to distinguish between two different types of the controller.
> Fortunately, it is the last register range that has this.
>
> It's probably best to make the DT code depend on compatible (or some
> attribute) to determine if this functionality is available, or in this
> case, even make it a separate memory region.  I'm not sure what the
> cleanest way is to implement this, and still have the driver work with
> non-DT systems.

You can use the .data field in the match table to add in
compatible-specific configuration data.

g.



More information about the linux-arm-kernel mailing list