zephyr/tests/drivers/build_all/sensor/app.overlay
Tristan Honscheid 613c32b03f tests: Clean up sensor driver build_all test
This PR performs a few cleanup actions for the build-all sensor driver
test:

  1. Remove many non-sensors from the test's device tree, including
     wireless radios, LED strips, flash memory, and displays. These
     devices don't belong in this test and in most cases were not being
     compiled anyways due to missing config flags and not being
     status-okay.
  2. For the remaining devices, enable them in the device tree so the
     sensors build and get instantiated. A handful of device nodes that
     caused linker errors due to the driver not instantiating are left
     disabled.
  3. Convert the test I2C and SPI buses into emulated buses to support
     upcoming live testing over these sensor devices.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-18 11:09:08 +00:00

155 lines
3.3 KiB
Plaintext

/*
* Copyright (c) 2020, Linaro Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*
* Application overlay for testing driver builds
*
* Names in this file should be chosen in a way that won't conflict
* with real-world devicetree nodes, to allow these tests to run on
* (and be extended to test) real hardware.
*/
/ {
test {
#address-cells = <1>;
#size-cells = <1>;
test_adc: adc@adc0adc0 {
compatible = "vnd,adc";
reg = <0xadc0adc0 0x1000>;
#io-channel-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_VDD_1";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,input-positive = <0>;
zephyr,resolution = <12>;
};
#include "adc.dtsi"
};
test_gpio: gpio@deadbeef {
compatible = "vnd,gpio";
gpio-controller;
reg = <0xdeadbeef 0x1000>;
#gpio-cells = <0x2>;
status = "okay";
#include "gpio.dtsi"
};
test_i2c: i2c@11112222 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "zephyr,i2c-emul-controller";
reg = <0x11112222 0x1000>;
status = "okay";
clock-frequency = <100000>;
#include "i2c.dtsi"
};
test_spi: spi@33334444 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "zephyr,spi-emul-controller";
reg = <0x33334444 0x1000>;
status = "okay";
clock-frequency = <2000000>;
/* one entry for every devices at spi.dtsi */
cs-gpios = <&test_gpio 0 0>, /* 0x00 */
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>, /* 0x10 */
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>, /* 0x20 */
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>,
<&test_gpio 0 0>; /* 0x24 */
#include "spi.dtsi"
};
test_uart: uart@55556666 {
compatible = "vnd,serial";
reg = <0x55556666 0x1000>;
status = "okay";
#include "uart.dtsi"
};
test_w1: w1@66660000 {
compatible = "vnd,w1";
reg = <0x66660000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
#include "w1.dtsi"
};
dht22 {
compatible = "aosong,dht";
status = "okay";
dio-gpios = <&test_gpio 0 0>;
/* dht22; */
};
};
};
/* Put device specific modifications to properties or disabling of devices
* here to keep the bus specific dtsi files (i2c.dtsi, spi.dtsi, etc..)
* pristine
*/
/* disable device to conflict with i2c version */
&test_i2c_ism330dhcx {
status = "disabled";
};
/* disable device to conflict with i2c version */
&test_spi_bme280 {
status = "disabled";
};
/* disable device to conflict with i2c version */
&test_spi_iis2dh {
status = "disabled";
};