Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devicetree support for compound elements #20172

Closed
pabigot opened this issue Oct 27, 2019 · 4 comments
Closed

devicetree support for compound elements #20172

pabigot opened this issue Oct 27, 2019 · 4 comments
Assignees
Labels
area: Devicetree Enhancement Changes/Updates/Additions to existing features

Comments

@pabigot
Copy link
Collaborator

pabigot commented Oct 27, 2019

I need a devicetree property as described below (documentation detail removed):

  dpd-wakeup-sequence:
    type: compound
    required: false
    description: Specifies wakeup durations for devices without RDPD

with an example use:

dpd-wakeup-sequence = <30000 20 45000>;

The value of this is an array of three integers. binding-template.yaml specifies that compound remains the catch-all for more complex types, but when that's used all the generated macros include deprecation markers.

The documentation separately mentions type: array (which is not a listed available type) which works.

What is the appropriate type to use for this? What would be appropriate if the element types were heterogeneous (what compound used to mean)?

In either case the generation needs to produce the property value as an initializer sequence, rather than individual elements, so some tooling enhancement will be required.

@ulfalizer
Copy link
Collaborator

ulfalizer commented Oct 27, 2019

type: array not being documented together with the other types is a (bad) oversight. string and string-array should be explained too.

Will fix tomorrow.

@ulfalizer
Copy link
Collaborator

Maybe a length: field could be added to bindings for checking the length too, if needed.

Something like

properties:
    dpd-wakeup-sequence:
        type: array
        length: 3
        required: false

@pabigot
Copy link
Collaborator Author

pabigot commented Oct 28, 2019

Yeah, that could be useful, as long as its absence means any number of entries is allowed.

To be clear: array is intended to replace all uses of compound, including heterogenous structures? Or does compound still get used for that. You can answer by making it clear in the PR that improves the documentation.

@pabigot
Copy link
Collaborator Author

pabigot commented Dec 10, 2019

Closed by #20173. (The answer to the last question is that array means a list of integer values only. compound appears to be used for "not an array or a phandle-array".)

@pabigot pabigot closed this as completed Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

2 participants