Skip to content

Sensor autodetect and add hinge angle sensor#22

Draft
JohnAZoidberg wants to merge 2 commits intomainfrom
sensor-autodetect
Draft

Sensor autodetect and add hinge angle sensor#22
JohnAZoidberg wants to merge 2 commits intomainfrom
sensor-autodetect

Conversation

@JohnAZoidberg
Copy link
Member

No description provided.

@JohnAZoidberg JohnAZoidberg changed the title Sensor autodetect Sensor autodetect and add hinge angle sensor Mar 1, 2026
Query the EC at driver startup to determine which sensors are present
instead of using #define ENABLE_* flags. Accelerometers are detected
via EC_MEMMAP_ACC_STATUS presence bit and MOTIONSENSE_CMD_INFO. ALS
is detected by enumerating motion sensors for MOTIONSENSE_TYPE_LIGHT,
with a fallback to reading EC_MEMMAP_ALS. This allows a single driver
binary to work across hardware configurations.

Also fixes the ENABLE_ORIENTATIONACCEL_SENSOR typo in the old code.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
Expose the EC-calculated lid hinge angle (0-360 degrees) to Windows
via GUID_SensorType_HingeAngle / PKEY_SensorData_HingeAngle. The EC
already computes this from base+lid accelerometers and stores it at
EC_MEMMAP_ACC_DATA. The sensor is auto-detected when both base and
lid accelerometers are present.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant