From 746ece631bcf39ed3da62d739226ddaa70de96bf Mon Sep 17 00:00:00 2001 From: Tom Burdick Date: Mon, 27 Nov 2023 14:02:34 -0600 Subject: [PATCH] devicetree: Add a first sensor to dts Each sensor would be expected to describe some common attributes in an include file like this and be included in the board/soc dts where the sensor is used. In this way common sensor channels and descriptions would be available. Signed-off-by: Tom Burdick --- .../ti_bp_bassensorsmkii.overlay | 2 +- dts/sensor/bosch/bosch_bmi160.dtsi | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 dts/sensor/bosch/bosch_bmi160.dtsi diff --git a/boards/shields/ti_bp_bassensorsmkii/ti_bp_bassensorsmkii.overlay b/boards/shields/ti_bp_bassensorsmkii/ti_bp_bassensorsmkii.overlay index fa4f11bbc7405da..b522698f4f10c5d 100644 --- a/boards/shields/ti_bp_bassensorsmkii/ti_bp_bassensorsmkii.overlay +++ b/boards/shields/ti_bp_bassensorsmkii/ti_bp_bassensorsmkii.overlay @@ -14,9 +14,9 @@ &arduino_i2c { bmi160_ti_bp_bassensorsmkii: bmi160@69 { - compatible = "bosch,bmi160"; reg = <0x69>; int-gpios = <&arduino_header 8 GPIO_ACTIVE_HIGH>; + #include }; opt3001_ti_bp_bassensorsmkii: opt3001@44 { diff --git a/dts/sensor/bosch/bosch_bmi160.dtsi b/dts/sensor/bosch/bosch_bmi160.dtsi new file mode 100644 index 000000000000000..e40101ea9ec7c55 --- /dev/null +++ b/dts/sensor/bosch/bosch_bmi160.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +compatible = "bosch,bmi160"; + +accel@0 { + compatible = "zephyr,sensor-channel"; + channel-type = SENSOR_CHANNEL_ACCELERATION; + channel-index = 0; + channel-fields = ; +} +