summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.motionsense
blob: 04903b361b4bb762c8995f8b80cead2b1053e042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# 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.

menuconfig PLATFORM_EC_MOTIONSENSE
    bool "Motion Sense"
    select HAS_TASK_MOTIONSENSE
    help
      Enable motion sense task. The task collects data from available sensors
      and report them to AP. Besides the task reports the sensor data to AP.
      Based on the data, it also does other things like calculating lid angle
      and detect tablet mode.

config PLATFORM_EC_ACCEL_FIFO
    bool "Sensor FIFO"
    help
      Enable this to add the sensor FIFO used by sensor device drivers to fill.
      Using FIFO reduces power consumption since it reduces the number of
      AP wake-ups.

if PLATFORM_EC_ACCEL_FIFO

config PLATFORM_EC_ACCEL_FIFO_SIZE
    int "Motion Sense FIFO Size"
    default 256
    help
      This sets the size of the sensor FIFO, must be a power of 2.

config PLATFORM_EC_ACCEL_FIFO_THRES
    int "FIFO Threshold"
    default 85      # (PLATFORM_EC_ACCEL_FIFO_SIZE / 3)
    help
      This sets the amount of free entries that trigger an interrupt to the AP.

endif # PLATFORM_EC_ACCEL_FIFO

config PLATFORM_EC_SENSOR_TIGHT_TIMESTAMPS
    bool "Extra Sensor Timestamp"
    help
      If this is defined, motion_sense sends
      sensor events to the AP in the format
      +-----------+
      | Timestamp |
      |  Payload  |
      | Timestamp |
      |  Payload  |
      |    ...    |
      +-----------+
      If this is not defined, the events will be sent in the format
      +-----------+
      |  Payload  |
      |  Payload  |
      |  Payload  |
      |    ...    |
      | Timestamp |
      +-----------+
      The former format enables improved filtering of sensor event
      timestamps on the AP, but comes with stricter jitter requirements.

config PLATFORM_EC_ACCEL_INTERRUPTS
    bool "Accelerometer Interrupts"
    help
      Enable this to allow a sensor driver to send an event to motion task when
      the sensor gets the data ready interrupt. On the event, motion task calls
      the driver's irq_handler to collect data.

# TODO(b/173507858) config PLATFORM_EC_MOTION_FILL_LPC_SENSE_DATA
# if PLATFORM_EC_MOTION_FILL_LPC_SENSE_DATA
#endif # PLATFORM_EC_MOTION_FILL_LPC_SENSE_DATA

config PLATFORM_EC_ALS
    bool "Ambient Light Sensor(ALS)"
    default y if HAS_TASK_ALS
    help
      Enable this to indicate there's at least one or more ALS devices available.
      If PLATFORM_EC_MOTION_FILL_LPC_SENSE_DATA is set, then motion task updates
      the designated part of EC memmap with the ALS data. The updating EC memmap
      can be also done by the dedicated ALS task with HAS_ALS_TASK set.
      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
      Enable this to allow changing motion sensor count dynamically.

config PLATFORM_EC_LID_ANGLE
    bool "Lid Angle Sensor"
    help
      Enable this to detect lid angle with two accelerometers. The andgle
      calculation requires the information about which sensor is on the lid
      and which one is on the base. The calculated lid angle is used to
      decide start/stop other peripherals like stop/start keyboard scanning.
      # TODO(b/173507858): add more detail after .dts change

if PLATFORM_EC_LID_ANGLE

config PLATFORM_EC_TABLET_MODE
    bool "Tablet Mode"
    help
      Enable this for a device which can be a tablet as well as a clamshell.
      Tablet mode detection is done with current lid angle.

config PLATFORM_EC_GMR_TABLET_MODE
    bool "Giant Magnetoresistance(GMR) Tablet Mode"
    help
      Enable this to use GMR sensor to detect tablet mode.
      It requires to set GMR_TABLET_MODE_GPIO_L to map the interrupt from
      the sensor and direct its mapping to gmr_tablet_switch_isr
      in common/tablet_mode.c.

endif # PLATFORM_EC_LID_ANGLE

rsource "Kconfig.sensor_devices"