summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-04-21 01:16:06 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-22 16:55:31 +0000
commit3578930d552ca166845348dac670d8a0c2d80e86 (patch)
treef8a0a26b1c18a7938308c6110428a69f64f16f95
parentd05df43def60bd1e1be060208c2df948a6ccdaee (diff)
downloadchrome-ec-3578930d552ca166845348dac670d8a0c2d80e86.tar.gz
zephyr: dts: bmi160: Add bmi160 DT bindings
Adds the bindings needed to use the bmi160 in devicetree. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I6c83adca1b6456eea34367df693d1993f6ef86eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842709 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/dts/bindings/motionsense/driver/bmi160.yaml16
-rw-r--r--zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-accel.yaml13
-rw-r--r--zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-gyro.yaml13
-rw-r--r--zephyr/dts/bindings/motionsense/drvdata/cros-ec,drvdata-bmi160.yaml18
-rw-r--r--zephyr/dts/bindings/motionsense/motionsense-sensor-base.yaml2
5 files changed, 61 insertions, 1 deletions
diff --git a/zephyr/dts/bindings/motionsense/driver/bmi160.yaml b/zephyr/dts/bindings/motionsense/driver/bmi160.yaml
new file mode 100644
index 0000000000..8f490254a3
--- /dev/null
+++ b/zephyr/dts/bindings/motionsense/driver/bmi160.yaml
@@ -0,0 +1,16 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# common fields for both BMI160 accel and BMI160 gyro
+
+# every motionsense sensor node should include motionsense-sensor-base.yaml
+include: motionsense-sensor-base.yaml
+
+properties:
+ i2c-spi-addr-flags:
+ type: string
+ description: i2c address or SPI slave logic GPIO
+ enum:
+ - "BMI160_ADDR0_FLAGS"
+ default: "BMI160_ADDR0_FLAGS"
diff --git a/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-accel.yaml b/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-accel.yaml
new file mode 100644
index 0000000000..4eabf12cd5
--- /dev/null
+++ b/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-accel.yaml
@@ -0,0 +1,13 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description: motion sense sensor node for BMI160 accel
+
+compatible: "cros-ec,bmi160-accel"
+
+include: bmi160.yaml
+
+properties:
+ default-range:
+ default: 4
diff --git a/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-gyro.yaml b/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-gyro.yaml
new file mode 100644
index 0000000000..b7a0b38290
--- /dev/null
+++ b/zephyr/dts/bindings/motionsense/driver/cros-ec,bmi160-gyro.yaml
@@ -0,0 +1,13 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description: motion sense sensor node for BMI160 gyro
+
+compatible: "cros-ec,bmi160-gyro"
+
+include: bmi160.yaml
+
+properties:
+ default-range:
+ default: 1000
diff --git a/zephyr/dts/bindings/motionsense/drvdata/cros-ec,drvdata-bmi160.yaml b/zephyr/dts/bindings/motionsense/drvdata/cros-ec,drvdata-bmi160.yaml
new file mode 100644
index 0000000000..52f5c346fc
--- /dev/null
+++ b/zephyr/dts/bindings/motionsense/drvdata/cros-ec,drvdata-bmi160.yaml
@@ -0,0 +1,18 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description: BMI160 driver data node
+
+compatible: "cros-ec,drvdata-bmi160"
+
+include: drvdata-base.yaml
+
+#
+# examples:
+#
+# bmi160_data: bmi160-drv-data {
+# compatible = "cros-ec,drvdata-bmi160";
+# status = "okay";
+# };
+#
diff --git a/zephyr/dts/bindings/motionsense/motionsense-sensor-base.yaml b/zephyr/dts/bindings/motionsense/motionsense-sensor-base.yaml
index 87d54dbbe6..e6325a3ef1 100644
--- a/zephyr/dts/bindings/motionsense/motionsense-sensor-base.yaml
+++ b/zephyr/dts/bindings/motionsense/motionsense-sensor-base.yaml
@@ -18,7 +18,6 @@ properties:
e.g) label = "Lid Accel";
active-mask:
type: string
- required: true
description: indicates system power state for sensor to be active
enum:
- "SENSOR_ACTIVE_S5"
@@ -26,6 +25,7 @@ properties:
- "SENSOR_ACTIVE_S0"
- "SENSOR_ACTIVE_S0_S3"
- "SENSOR_ACTIVE_S0_S3_S5"
+ default: "SENSOR_ACTIVE_S0_S3"
location:
type: string
required: true