diff options
Diffstat (limited to 'zephyr/test/drivers/overlay.dts')
-rw-r--r-- | zephyr/test/drivers/overlay.dts | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/zephyr/test/drivers/overlay.dts b/zephyr/test/drivers/overlay.dts index 924a223628..cdbe4b3662 100644 --- a/zephyr/test/drivers/overlay.dts +++ b/zephyr/test/drivers/overlay.dts @@ -6,6 +6,9 @@ #include <dt-bindings/gpio_defines.h> / { + aliases { + bmi260-int = &ms_bmi260_accel; + }; named-gpios { compatible = "named-gpios"; @@ -63,7 +66,7 @@ enum-name = "I2C_PORT_EEPROM"; label = "EEPROM"; }; - accel { + i2c_accel: accel { i2c-port = <&i2c0>; enum-name = "I2C_PORT_ACCEL"; label = "ACCEL"; @@ -158,6 +161,64 @@ adc = <&adc_fan>; }; }; + + /* + * Declare mutexes used by sensor drivers. + * A mutex node is used to create an instance of mutex_t. + * A mutex node is referenced by a sensor node if the + * corresponding sensor driver needs to use the + * instance of the mutex. + */ + motionsense-mutex { + compatible = "cros-ec,motionsense-mutex"; + mutex_bmi260: bmi260-mutex { + label = "BMI260_MUTEX"; + }; + }; + + /* + * Driver specific data. A driver-specific data can be shared with + * different motion sensors while they are using the same driver. + */ + motionsense-sensor-data { + bmi260_data: bmi260-drv-data { + compatible = "cros-ec,drvdata-bmi260"; + status = "okay"; + }; + }; + + /* + * List of motion sensors that creates motion_sensors array. + * The label "lid_accel" and "base_accel" are used to indicate + * motion sensor IDs for lid angle calculation. + */ + motionsense-sensor { + ms_bmi260_accel: ms-bmi260-accel { + compatible = "cros-ec,bmi260-accel"; + status = "okay"; + + label = "BMI260 emul accel"; + location = "MOTIONSENSE_LOC_BASE"; + mutex = <&mutex_bmi260>; + port = <&i2c_accel>; + drv-data = <&bmi260_data>; + default-range = <4>; + i2c-spi-addr-flags = "BMI260_ADDR0_FLAGS"; + }; + + ms_bmi260_gyro: ms-bmi260-gyro { + compatible = "cros-ec,bmi260-gyro"; + status = "okay"; + + label = "BMI260 emul gyro"; + location = "MOTIONSENSE_LOC_BASE"; + mutex = <&mutex_bmi260>; + port = <&i2c_accel>; + drv-data = <&bmi260_data>; + default-range = <1000>; /* dps */ + i2c-spi-addr-flags = "BMI260_ADDR0_FLAGS"; + }; + }; }; &gpio0 { @@ -205,4 +266,15 @@ reg = <0x41>; label = "SYV682X_EMUL"; }; + + accel_bmi260: bmi260@68 { + compatible = "zephyr,bmi"; + reg = <0x68>; + label = "BMI260"; + device-model = "BMI_EMUL_260"; + error-on-ro-write; + error-on-wo-read; + error-on-reserved-bit-write; + simulate-command-exec-time; + }; }; |