Open pabigot opened 4 years ago
@mbolivar @galak let's discuss here rather than clutter up #23245
@pabigot collecting a list of where we want interim "LPF" style macros as discussed in #23245:
Interrupts also? Anything else?
git grep -e -cells dts/bindings/ | sed -r -e 's@^[^:]*:\s*@@' | sort | uniq
probably shows the candidates. At minimum clock
dma
gpio
interrupt
io-channel
(ADC) pinmux
pwm
may be candidates. An issue is that the number of cells and their names/roles is binding-specific.
I've renamed the issue now that we are using 'foo_dt_spec' (e.g. gpio_dt_spec, i2c_dt_spec, spi_dt_spec) for this type of thing.
A status update as we head into v3.1: we have foo_dt_spec
structures for the following cases, which overlaps somewhat with the above list.
io-channels
, but more generally related to configuring ADC channels in DT)Still not done from the above list: dmas
and clocks
properties are usuallly phandle+specifiers in DT, but have no corresponding spec structures in their zephyr APIs.
I would argue that interrupts
does not fit within the scope of this issue, as it is a plain array
, not a phandle-array
, in terms of its type in the bindings.
Hi @mbolivar-nordic,
This issue, marked as an Enhancement, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise.
Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.
@pabigot you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.
Thanks!
23245 improves the devicetree access solution significantly, but currently lacks a replacement for
phandle-array
values which are a series of phandle + specifier. Example is a GPIO device reference plus a pin and initial flags; or an ADC device and and an input channel. In the existing access solution a C initializer list is generated that captures the combined values, e.g.{ "GPIO_0", 1, 0" }
.This gap complicates conversions of drivers that use the initializer list, e.g. the following:
requires local addition of the following macro:
to initialize the local definition:
Such a definition has not been standardized because technically different GPIO controllers could use different
cells
in their specifiers.Where we have consistent
cells
for all drivers it would good to have a standard structure that can be used to store a phandle+specifier, and a way to initialize such a structure.See discussion at/around: https://github.com/zephyrproject-rtos/zephyr/pull/23245#issuecomment-602649499