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:
Gerard Marull-Paretas 2023-05-23 10:36:13 +02:00 committed by Carles Cufí
commit 52aec02e96
8 changed files with 125 additions and 0 deletions

View file

@ -1133,6 +1133,7 @@ Release Notes:
- include/zephyr/drivers/regulator.h - include/zephyr/drivers/regulator.h
- include/zephyr/dt-bindings/regulator/ - include/zephyr/dt-bindings/regulator/
- tests/drivers/regulator/ - tests/drivers/regulator/
- tests/drivers/build_all/regulator/
- doc/hardware/peripherals/regulators.rst - doc/hardware/peripherals/regulators.rst
labels: labels:
- "area: Regulators" - "area: Regulators"

View 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)

View 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"
};
};

View 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 {};
};
};

View 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 {};
};

View file

@ -0,0 +1 @@
CONFIG_REGULATOR=y

View file

@ -0,0 +1,9 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
int main(void)
{
return 0;
}

View 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