diff options
-rw-r--r-- | zephyr/Kconfig.motionsense | 12 | ||||
-rw-r--r-- | zephyr/projects/volteer/volteer/prj.conf | 1 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 8 | ||||
-rw-r--r-- | zephyr/shim/include/motionsense_sensors_defs.h | 4 |
4 files changed, 7 insertions, 18 deletions
diff --git a/zephyr/Kconfig.motionsense b/zephyr/Kconfig.motionsense index 96f69d4848..1e935d859e 100644 --- a/zephyr/Kconfig.motionsense +++ b/zephyr/Kconfig.motionsense @@ -79,18 +79,6 @@ config PLATFORM_EC_ALS Number of ALS entries reserved in EC memmap are defined by EC_ALS_ENTRIES in ec_commands.h. -if PLATFORM_EC_ALS - -config PLATFORM_EC_ALS_COUNT - int "Number of ALS devices" - default 1 - help - This sets the number of ALS devices. This should be less than or equal to - EC_ALS_ENTRIES in ec_commands.h - TODO(b/173507858) move this to device tree - -endif # PLATFORM_EC_ALS - config PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT bool "Dynamic Motion Sensor Count" help diff --git a/zephyr/projects/volteer/volteer/prj.conf b/zephyr/projects/volteer/volteer/prj.conf index 77f39a20e6..2e8e56faab 100644 --- a/zephyr/projects/volteer/volteer/prj.conf +++ b/zephyr/projects/volteer/volteer/prj.conf @@ -77,7 +77,6 @@ CONFIG_PLATFORM_EC_MOTIONSENSE=y CONFIG_PLATFORM_EC_ACCEL_FIFO=y CONFIG_PLATFORM_EC_ACCEL_INTERRUPTS=y CONFIG_PLATFORM_EC_ALS=y -CONFIG_PLATFORM_EC_ALS_COUNT=1 CONFIG_PLATFORM_EC_DYNAMIC_MOTION_SENSOR_COUNT=y CONFIG_PLATFORM_EC_GMR_TABLET_MODE=y CONFIG_PLATFORM_EC_LID_ANGLE=y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 4721772b35..a10c27e887 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -9,6 +9,10 @@ #include <devicetree.h> #include <autoconf.h> +#define SENSOR_NODE DT_PATH(motionsense_sensor) +#define SENSOR_INFO_NODE DT_PATH(motionsense_sensor_info) +#define SENSOR_ALT_NODE DT_PATH(motionsense_sensor_alt) + /* * The battery enum is used in various drivers and these assume that it is * always available (defined in board.h). With Zephyr we don't include board.h @@ -1606,9 +1610,9 @@ #undef CONFIG_ALS #undef CONFIG_ALS_COUNT -#ifdef CONFIG_PLATFORM_EC_ALS +#if DT_NODE_HAS_PROP(SENSOR_INFO_NODE, als_sensors) #define CONFIG_ALS -#define ALS_COUNT CONFIG_PLATFORM_EC_ALS_COUNT +#define ALS_COUNT DT_PROP_LEN(SENSOR_INFO_NODE, als_sensors) #else #define ALS_COUNT 0 #endif diff --git a/zephyr/shim/include/motionsense_sensors_defs.h b/zephyr/shim/include/motionsense_sensors_defs.h index ec2180566e..5c11a5240b 100644 --- a/zephyr/shim/include/motionsense_sensors_defs.h +++ b/zephyr/shim/include/motionsense_sensors_defs.h @@ -8,9 +8,7 @@ #include <devicetree.h> -#define SENSOR_NODE DT_PATH(motionsense_sensor) -#define SENSOR_INFO_NODE DT_PATH(motionsense_sensor_info) -#define SENSOR_ALT_NODE DT_PATH(motionsense_sensor_alt) +#include "common.h" #define SENSOR_ID(id) DT_CAT(SENSOR_, id) |