tests: drivers: build_all: regulator: add test
Add a new _test_ that is used to build all regulator drivers. SoC regulators, such as Raspberry Pi Pico core supply are excluded as they are typically built as part of the platform. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
92fb90c483
commit
52aec02e96
8 changed files with 125 additions and 0 deletions
|
@ -1133,6 +1133,7 @@ Release Notes:
|
|||
- include/zephyr/drivers/regulator.h
|
||||
- include/zephyr/dt-bindings/regulator/
|
||||
- tests/drivers/regulator/
|
||||
- tests/drivers/build_all/regulator/
|
||||
- doc/hardware/peripherals/regulators.rst
|
||||
labels:
|
||||
- "area: Regulators"
|
||||
|
|
8
tests/drivers/build_all/regulator/CMakeLists.txt
Normal file
8
tests/drivers/build_all/regulator/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(build_all)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
32
tests/drivers/build_all/regulator/app.overlay
Normal file
32
tests/drivers/build_all/regulator/app.overlay
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
test {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
test_i2c: i2c@11112222 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "vnd,i2c";
|
||||
reg = <0x11112222 0x1000>;
|
||||
status = "okay";
|
||||
clock-frequency = <100000>;
|
||||
|
||||
#include "i2c.dtsi"
|
||||
};
|
||||
|
||||
test_gpio: gpio@deadbeef {
|
||||
compatible = "vnd,gpio";
|
||||
gpio-controller;
|
||||
reg = <0xdeadbeef 0x1000>;
|
||||
#gpio-cells = <0x2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
#include "misc.dtsi"
|
||||
};
|
||||
};
|
48
tests/drivers/build_all/regulator/i2c.dtsi
Normal file
48
tests/drivers/build_all/regulator/i2c.dtsi
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/****************************************
|
||||
* PLEASE KEEP REG ADDRESSES SEQUENTIAL *
|
||||
***************************************/
|
||||
|
||||
pca9420@0 {
|
||||
compatible = "nxp,pca9420";
|
||||
reg = <0x0>;
|
||||
|
||||
BUCK1 {};
|
||||
BUCK2 {};
|
||||
LDO1 {};
|
||||
LDO2 {};
|
||||
};
|
||||
|
||||
npm6001@1 {
|
||||
compatible = "nordic,npm6001";
|
||||
reg = <0x1>;
|
||||
|
||||
regulators {
|
||||
compatible = "nordic,npm6001-regulator";
|
||||
|
||||
BUCK0 {};
|
||||
BUCK1 {};
|
||||
BUCK2 {};
|
||||
BUCK3 {};
|
||||
LDO0 {};
|
||||
LDO1 {};
|
||||
};
|
||||
};
|
||||
|
||||
npm1300@2 {
|
||||
compatible = "nordic,npm1300";
|
||||
reg = <0x2>;
|
||||
|
||||
regulators {
|
||||
compatible = "nordic,npm1300-regulator";
|
||||
|
||||
BUCK1 {};
|
||||
BUCK2 {};
|
||||
LDO1 {};
|
||||
LDO2 {};
|
||||
};
|
||||
};
|
16
tests/drivers/build_all/regulator/misc.dtsi
Normal file
16
tests/drivers/build_all/regulator/misc.dtsi
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
regulator-fixed {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "test";
|
||||
enable-gpios = <&test_gpio 0 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
npm1100 {
|
||||
compatible = "nordic,npm1100";
|
||||
|
||||
BUCK {};
|
||||
};
|
1
tests/drivers/build_all/regulator/prj.conf
Normal file
1
tests/drivers/build_all/regulator/prj.conf
Normal file
|
@ -0,0 +1 @@
|
|||
CONFIG_REGULATOR=y
|
9
tests/drivers/build_all/regulator/src/main.c
Normal file
9
tests/drivers/build_all/regulator/src/main.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
10
tests/drivers/build_all/regulator/testcase.yaml
Normal file
10
tests/drivers/build_all/regulator/testcase.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Copyright (c) 2023 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
tests:
|
||||
drivers.regulator.build:
|
||||
tags:
|
||||
- drivers
|
||||
- regulator
|
||||
build_only: true
|
||||
platform_allow: native_posix
|
Loading…
Add table
Add a link
Reference in a new issue