zephyr/tests/drivers/pinctrl/api/app.overlay
Gerard Marull-Paretas a578bb70b6 tests: drivers: pinctrl: add tests for API
Add a set of tests to check the API behavior. The API tests can only run
on a platform that does not have an actual pinctrl driver, e.g.
native_posix. The test itself implements a pinctrl mock driver and
provides the required "pinctrl_soc.h" header with required types/macros.
The implementation is used in the tests to verify the behavior of the
API or Devicetree macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-25 15:26:47 -05:00

93 lines
1.7 KiB
Plaintext

/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
pinctrl {
compatible = "vnd,pinctrl-test";
/* default state for device 0 */
test_device0_default: test_device0_default {
pins1 {
pins = <0>;
bias-pull-up;
};
pins2 {
pins = <1>;
bias-pull-down;
};
};
/* sleep state for device 0 */
test_device0_sleep: test_device0_sleep {
pins1 {
pins = <0>, <1>;
};
};
/* alternative default state for device 0 */
test_device0_alt_default: test_device0_alt_default {
pins1 {
pins = <2>;
bias-pull-down;
};
pins2 {
pins = <3>;
bias-pull-up;
};
};
/* alternative sleep state for device 0 */
test_device0_alt_sleep: test_device0_alt_sleep {
pins1 {
pins = <2>, <3>;
};
};
/* default state for device 1 */
test_device1_default: test_device1_default {
pins1 {
pins = <10>, <11>, <12>;
};
};
/* custom state "mystate" for device 1 */
test_device1_mystate: test_device1_mystate {
pins1 {
pins = <10>;
};
pins2 {
pins = <11>;
bias-pull-up;
};
pins3 {
pins = <12>;
bias-pull-down;
};
};
};
zephyr,user {
test_device0_alt_default = <&test_device0_alt_default>;
test_device0_alt_sleep = <&test_device0_alt_sleep>;
};
test_device0: test_device@0 {
compatible = "vnd,pinctrl-device";
reg = <0x0 0x1>;
pinctrl-0 = <&test_device0_default>;
pinctrl-1 = <&test_device0_sleep>;
pinctrl-names = "default", "sleep";
};
test_device1: test_device@1 {
compatible = "vnd,pinctrl-device";
reg = <0x1 0x1>;
pinctrl-0 = <&test_device1_default>;
pinctrl-1 = <&test_device1_mystate>;
pinctrl-names = "default", "mystate";
};
};