Skip to content

Conversation

@pdgendt
Copy link
Contributor

@pdgendt pdgendt commented Nov 8, 2025

Allow fetching child node identifiers by reg address.

@zephyrbot zephyrbot added area: Devicetree area: Devicetree Bindings area: Boards/SoCs area: Tests Issues related to a particular existing or missing test labels Nov 8, 2025
@pdgendt pdgendt requested a review from teburd November 8, 2025 10:54
@pdgendt pdgendt force-pushed the dt-child-by-reg-addr branch from 9bf2b99 to e3c70ba Compare November 8, 2025 11:03
@zephyrbot zephyrbot added the area: ADC Analog-to-Digital Converter (ADC) label Nov 8, 2025
@zephyrbot zephyrbot requested a review from anangl November 8, 2025 11:14
@pdgendt pdgendt added this to the v4.4.0 milestone Nov 8, 2025
@pdgendt pdgendt force-pushed the dt-child-by-reg-addr branch from e51dfee to 5eac67f Compare November 8, 2025 11:26
zassert_equal(DT_PROP(DT_INST_CHILD(0, child_b), val), 1, "");
zassert_equal(DT_PROP(DT_INST_CHILD(0, child_c), val), 2, "");

zassert_equal(DT_PROP(DT_CHILD_BY_REG_ADDR(DT_NODELABEL(test_children), 0, 0xa),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that no scene with idx 1 has been added :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests for idx 1.

Fix dts formatting issues with dts-linter.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Allow fetching child node identifiers by reg address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
@pdgendt pdgendt force-pushed the dt-child-by-reg-addr branch from c5ab251 to 2da83db Compare November 9, 2025 09:02
Introduce test cases to the devicetree API test suite for
DT_CHILD_BY_REG_ADDR and DT_INST_CHILD_BY_REG_ADDR.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The macro to initialise a struct adc_dt_spec instance uses a FOREACH macro,
which can be problematic when nesting in other FOREACH macros, for example
in driver implementations.

Replace it with DT_CHILD_BY_REG_ADDR.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
@pdgendt pdgendt force-pushed the dt-child-by-reg-addr branch from 2da83db to fa20529 Compare November 9, 2025 16:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ADC Analog-to-Digital Converter (ADC) area: Boards/SoCs area: Devicetree Bindings area: Devicetree area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants