summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-01-20 22:22:38 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-03 09:48:46 +0000
commitd710d248bf7be49ba20d295a3824576844cb261a (patch)
treebaba5395934dae27b233a6df2db211ea87465881 /docs
parentfa8ceb713d1cd6ef7a7c326804823b27986c1ca6 (diff)
downloadchrome-ec-d710d248bf7be49ba20d295a3824576844cb261a.tar.gz
docs: zephyr: Add Kconfig details for motionsense
Replicate the zephyr_template.md and document the Kconfig values in zephyr/Kconfig.motionsense and zephyr/Kconfig.sensor_devices BRANCH=none BUG=b:208437221 TEST=none Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I72d36687ea07a840456908a4c66db4167f0a4993 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3405646 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/zephyr/zephyr_motionsense.md119
-rw-r--r--docs/zephyr/zephyr_new_board_checklist.md2
-rw-r--r--docs/zephyr/zephyr_sensor_devices.md101
3 files changed, 221 insertions, 1 deletions
diff --git a/docs/zephyr/zephyr_motionsense.md b/docs/zephyr/zephyr_motionsense.md
new file mode 100644
index 0000000000..e140876310
--- /dev/null
+++ b/docs/zephyr/zephyr_motionsense.md
@@ -0,0 +1,119 @@
+# Zephyr EC MotionSense
+
+[TOC]
+
+## Overview
+
+Zephyr's wrapping of the EC motionsense provides a quick configuration of the
+sensor framework via Zephyr's device tree.
+
+## Kconfig Options
+
+The following are the various Kconfig options for the motionsense logic. Every
+config option depends on having `CONFIG_PLATFORM_EC_MOTIONSENSE=y`.
+
+Kconfig Option | Default | Documentation
+:----------------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_MOTIONSENSE` | n | [MOTIONSENSE]
+`CONFIG_PLATFORM_EC_ACCEL_FIFO` | n | [ACCEL FIFO]
+`CONFIG_PLATFORM_EC_SENSOR_TIGHT_TIMESTAMPS` | n | [TIGHT TIMESTAMPS]
+`CONFIG_PLATFORM_EC_ACCEL_INTERRUPTS` | n | [ACCEL INTERRUPTS]
+`CONFIG_PLATFORM_EC_ALS` | n | [ALS]
+`CONFIG_PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT` | n | [DYNAMIC SENSOR COUNT]
+`CONFIG_PLATFORM_EC_LID_ANGLE` | n | [LID ANGLE]
+`CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCELS` | n | [ACCELS CMD]
+`CONFIG_PLATFORM_EC_ACCEL_SPOOF_MODE` | n | [ACCEL SPOOF MODE]
+
+Additional Kconfig options are available at
+[Kconfig.sensor_devices](./zephyr_sensor_devices.md).
+
+### CONFIG_PLATFORM_EC_ACCEL_FIFO sub configs
+
+The following options are available only when `CONFIG_PLATFORM_EC_ACCEL_FIFO=y`.
+
+Kconfig sub-option | Default | Documentation
+:------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_ACCEL_FIFO_SIZE` | 256 | [ACCEL FIFO SIZE]
+`CONFIG_PLATFORM_EC_ACCEL_FIFO_THRES` | 85 | [ACCEL FIFO THRES]
+
+### CONFIG_PLATFORM_EC_LID_ANGLE sub configs
+
+The following options are available only when `CONFIG_PLATFORM_EC_LID_ANGLE=y`.
+
+Kconfig sub-option | Default | Documentation
+:------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_LID_ANGLE_UPDATE` | n | [LID ANGLE UPDATE]
+`CONFIG_PLATFORM_EC_TABLET_MODE` | n | [TABLET MODE]
+
+### CONFIG_PLATFORM_EC_TABLET_MODE sub configs
+
+The following options are available only when `CONFIG_PLATFORM_EC_TABLET_MODE=y`.
+
+Kconfig sub-option | Default | Documentation
+:--------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_TABLET_MODE_SWITCH` | n | [TABLET MODE SWITCH]
+`CONFIG_PLATFORM_EC_GMR_TABLET_MODE` | n | [GMR TABLET MODE]
+
+### CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCELS sub configs
+
+The following options are available only when `CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCELS=y`.
+
+Kconfig sub-option | Default | Documentation
+:------------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCEL_INFO` | n | [ACCEL INFO CMD]
+
+### CONFIG_PLATFORM_EC_ACCEL_SPOOF_MODE sub configs
+
+The following options are available only when `CONFIG_PLATFORM_EC_ACCEL_SPOOF_MODE=y`.
+
+Kconfig sub-option | Default | Documentation
+:------------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_CONSOLE_CMD_ACCEL_SPOOF` | n | [ACCEL SPOOF CMD]
+
+## Devicetree Nodes
+
+*Detail the devicetree nodes that configure the feature.*
+
+*Note - avoid documenting node properties here. Point to the relevant `.yaml`
+file instead, which contains the authoritative definition.*
+
+## Board Specific Code
+
+*Document any board specific routines that a user must create to successfully
+compile and run. For many features, this can section can be empty.*
+
+## Threads
+
+*Document any threads enabled by this feature.*
+
+## Testing and Debugging
+
+*Provide any tips for testing and debugging the EC feature.*
+
+## Example
+
+*Provide code snippets from a working board to walk the user through
+all code that must be created to enable this feature.*
+
+<!--
+The following demonstrates linking to a code search result for a Kconfig option.
+Reference this link in your text by matching the text in brackets exactly.
+-->
+[MOTIONSENSE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_MOTIONSENSE"&ss=chromiumos
+[ACCEL FIFO]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ACCEL_FIFO"&ss=chromiumos
+[TIGHT TIMESTAMPS]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_SENSOR_TIGHT_TIMESTAMPS"&ss=chromiumos
+[ACCEL INTERRUPTS]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ACCEL_INTERRUPTS"&ss=chromiumos
+[ALS]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ALS"&ss=chromiumos
+[DYNAMIC SENSOR COUNT]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT"&ss=chromiumos
+[LID ANGLE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_LID_ANGLE"&ss=chromiumos
+[ACCELS CMD]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_CONSOLE_CMD_ACCELS"&ss=chromiumos
+[ACCEL SPOOF MODE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ACCEL_SPOOF_MODE"&ss=chromiumos
+[ACCEL FIFO SIZE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ACCEL_FIFO_SIZE"&ss=chromiumos
+[ACCEL FIFO THRES]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ACCEL_FIFO_THRES"&ss=chromiumos
+[ALS COUNT]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_ALS_COUNT"&ss=chromiumos
+[LID ANGLE UPDATE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_LID_ANGLE_UPDATE"&ss=chromiumos
+[TABLET MODE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_TABLET_MODE"&ss=chromiumos
+[TABLET MODE SWITCH]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_TABLET_MODE_SWITCH"&ss=chromiumos
+[GMR TABLET MODE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_GMR_TABLET_MODE"&ss=chromiumos
+[ACCEL INFO CMD]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_CONSOLE_CMD_ACCEL_INFO"&ss=chromiumos
+[ACCEL SPOOF CMD]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.motionsense;?q="config%20PLATFORM_EC_CONSOLE_CMD_ACCEL_SPOOF"&ss=chromiumos
diff --git a/docs/zephyr/zephyr_new_board_checklist.md b/docs/zephyr/zephyr_new_board_checklist.md
index 1b87c79ed1..0a0269727f 100644
--- a/docs/zephyr/zephyr_new_board_checklist.md
+++ b/docs/zephyr/zephyr_new_board_checklist.md
@@ -62,7 +62,7 @@ EC Feature | Ne
[Configure CrOS CBI FW CONFIG](./zephyr_fw_config.md) | no
[Configure Keyboard (TODO)](./zephyr_template.md) | no
[Configure LEDs (TODO)](./zephyr_template.md) | no
-[Configure Motion Sensors (TODO)](./zephyr_template.md) | no
+[Configure Motion Sensors](./zephyr_motionsense.md) | no
[Configure BC1.2 Charger Detector (TODO)](./zephyr_template.md) | no
[Configure Battery (TODO)](./zephyr_template.md) | no
[Configure ADC](./zephyr_adc.md) | no
diff --git a/docs/zephyr/zephyr_sensor_devices.md b/docs/zephyr/zephyr_sensor_devices.md
new file mode 100644
index 0000000000..b8d65da408
--- /dev/null
+++ b/docs/zephyr/zephyr_sensor_devices.md
@@ -0,0 +1,101 @@
+# Zephyr Sensor Devices
+
+[TOC]
+
+## Overview
+
+Zephyr provides a way to enable the legacy cros-ec sensor drivers. This is done
+through both enabling Kconfig options and adding nodes to the devicetree.
+
+## Kconfig Options
+
+Kconfig Option | Default | Documentation
+:-------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI160` | n | [BMI160]
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI260` | n | [BMI260]
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI3XX` | n | [BMI3XX]
+`CONFIG_PLATFORM_EC_ACCELGYRO_ICM426XX` | n | [ICM426XX]
+`CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607` | n | [ICM42607]
+`CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSO` | n | [LSM6DSO]
+`CONFIG_PLATFORM_EC_ACCEL_BMA255` | n | [BMA255]
+`CONFIG_PLATFORM_EC_ACCEL_BMA4XX` | n | [BMA4XX]
+`CONFIG_PLATFORM_EC_ACCEL_KX022` | n | [KX022]
+`CONFIG_PLATFORM_EC_ACCEL_LIS2DW12` | n | [LIS2DW12]
+`CONFIG_PLATFORM_EC_ALS_TCS3400` | n | [TCS3400]
+
+### CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM choice
+
+The following choice is available only when one of the
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI*` configs are selected.
+
+Kconfig choice | Documentation
+:------------------------------------------ | :------------
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_SPI` | [BMI COMM SPI]
+`CONFIG_PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C` | [BMI COMM I2C]
+
+### CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM choice
+
+The following choice is available only when one of the
+`CONFIG_PLATFORM_EC_ACCELGYRO_ICM*` configs are selected.
+
+Kconfig choice | Documentation
+:------------------------------------------ | :------------
+`CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_SPI` | [ICM COMM SPI]
+`CONFIG_PLATFORM_EC_ACCELGYRO_ICM_COMM_I2C` | [ICM COMM I2C]
+
+### CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSO sub configs
+
+The following options are available only when
+`CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSO=y`.
+
+Kconfig option | Default | Documentation
+:---------------------------------------------- | :-----: | :------------
+`CONFIG_PLATFORM_EC_ACCELGYRO_LSM6DSO_AS_BASE` | n | [LSM6DSO AS BASE]
+
+## Devicetree Nodes
+
+*Detail the devicetree nodes that configure the feature.*
+
+*Note - avoid documenting node properties here. Point to the relevant `.yaml`
+file instead, which contains the authoritative definition.*
+
+## Board Specific Code
+
+*Document any board specific routines that a user must create to successfully
+compile and run. For many features, this can section can be empty.*
+
+## Threads
+
+*Document any threads enabled by this feature.*
+
+## Testing and Debugging
+
+*Provide any tips for testing and debugging the EC feature.*
+
+## Example
+
+*Provide code snippets from a working board to walk the user through
+all code that must be created to enable this feature.*
+
+[BMI160]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_BMI160%22&ss=chromiumos
+[BMI260]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_BMI260%22&ss=chromiumos
+[BMI3XX]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_BMI3XX%22&ss=chromiumos
+[BMI COMM SPI]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.accelgyro_bmi?q=%22config%20PLATFORM_EC_ACCELGYRO_BMI_COMM_SPI%22&ss=chromiumos
+[BMI COMM I2C]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.accelgyro_bmi?q=%22config%20PLATFORM_EC_ACCELGYRO_BMI_COMM_I2C%22&ss=chromiumos
+
+[ICM426XX]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_ICM426XX%22&ss=chromiumos
+[ICM42607]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_ICM42607%22&ss=chromiumos
+[ICM COMM SPI]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.accelgyro_bmi?q=%22config%20PLATFORM_EC_ACCELGYRO_ICM_COMM_SPI%22&ss=chromiumos
+[ICM COMM I2C]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.accelgyro_bmi?q=%22config%20PLATFORM_EC_ACCELGYRO_ICM_COMM_I2C%22&ss=chromiumos
+
+[LSM6DSO]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_LSM6DSO%22&ss=chromiumos
+[LSM6DSO AS BASE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCELGYRO_LSM6DSO_AS_BASE%22&ss=chromiumos
+
+[BMA255]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCEL_BMA255%22&ss=chromiumos
+[BMA4XX]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCEL_BMA4XX%22&ss=chromiumos
+
+[KX022]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCEL_KX022%22&ss=chromiumos
+
+[LIS2DW12]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ACCEL_LIS2DW12%22&ss=chromiumos
+
+[TCS3400]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.sensor_devices?q=%22config%20PLATFORM_EC_ALS_TCS3400%22&ss=chromiumos