summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings/emul
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2021-07-20 12:28:40 +0200
committerCommit Bot <commit-bot@chromium.org>2021-07-27 18:32:39 +0000
commitf4047a0646f11dee2f9c33a78c6dd2009affd81f (patch)
tree9f092b100c93e756633dd5240a3f8402fcdbab68 /zephyr/dts/bindings/emul
parent07ecd26158f67190ff36dd550220160e684aaa33 (diff)
downloadchrome-ec-f4047a0646f11dee2f9c33a78c6dd2009affd81f.tar.gz
zephyr: Add TCS3400 emulator
Add TCS3400 emulator which is emulated device on i2c bus. Emulator properties can be defined using device tree or runtime TCS emulator API. It allows to set custom handlers for write and read messages. Emulator is able to convert internal values to register values that can be obtained by driver through i2c interface. Conversion takes current state set by driver into account (gain and data acquisition time). BUG=b:184856080 BRANCH=none TEST=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I16f25de43e047df39f84ce86044736d50c9a49c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3048094 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/dts/bindings/emul')
-rw-r--r--zephyr/dts/bindings/emul/zephyr,tcs3400.yaml44
1 files changed, 44 insertions, 0 deletions
diff --git a/zephyr/dts/bindings/emul/zephyr,tcs3400.yaml b/zephyr/dts/bindings/emul/zephyr,tcs3400.yaml
new file mode 100644
index 0000000000..a4474ec279
--- /dev/null
+++ b/zephyr/dts/bindings/emul/zephyr,tcs3400.yaml
@@ -0,0 +1,44 @@
+# 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: Zephyr ALS TCS3400 light sensor i2c emulator
+
+compatible: "zephyr,tcs3400"
+
+include: base.yaml
+
+properties:
+ device-id:
+ type: string
+ required: false
+ enum:
+ - TCS340015_DEVICE_ID
+ - TCS340037_DEVICE_ID
+ default: TCS340015_DEVICE_ID
+ description: Device ID that is set in the register.
+
+ revision:
+ type: int
+ required: false
+ default: 0
+ description: Wafer die revision level that is set in the register.
+
+ error-on-ro-write:
+ type: boolean
+ description:
+ Flag indicating if error should be generated when read only register
+ is being written.
+
+ error-on-reserved-bit-write:
+ type: boolean
+ description:
+ Flag indicating if error should be generated when reserved bit
+ is being written.
+
+ error-on-msb-first-access:
+ type: boolean
+ description:
+ Flag indicating if error should be generated when MSB register of
+ accelerometer value is accessed before LSB and shadowing is enabled
+ at the same time.