Skip to content

Dynamically connect to EC#20

Merged
JohnAZoidberg merged 8 commits intomainfrom
no-ec
Mar 3, 2026
Merged

Dynamically connect to EC#20
JohnAZoidberg merged 8 commits intomainfrom
no-ec

Conversation

@JohnAZoidberg
Copy link
Member

Solves #19

It would say CreateFileW failed STATUS_SUCCESS.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
If the EC driver is not installed or runinng when the sensor driver
starts, need to fail gracefully instead of preventing driver start and
yellow bang.

So instead we keep checking and connect to the EC at the first chance.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg
Copy link
Member Author

Running HLK now

@JohnAZoidberg
Copy link
Member Author

"DF - Sleep with IO during (Reliability)" keeps failing, even after running it three times.

When suspending (D0 exit) close the handle to the EC driver so that we
open it again after resume and get a fresh one. Because if the EC driver
restarts during sleep, we cannot keep using the old handle pointing to
the unloaded driver. This change just closes it, re-opening is already
handled in OnTimerExpire when the device wakes.

This fixes the HLK "DF - Sleep with IO during (Reliability)" test
failure.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
…ction

If the EC driver wasn't available during Initialize(), the sensor
indices would still be the default values (lid=0, base=1) and never be
updated. This would cause the driver to read from the wrong sensor.

Add a flag to keep track of whether the indeces were checked already and
initialize them if they weren't when reading sensor data.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg
Copy link
Member Author

Seems to work fine

Check the boolean return directly and use GetLastError() on failure for
proper error reporting.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
@JohnAZoidberg JohnAZoidberg merged commit 4e15675 into main Mar 3, 2026
2 checks passed
@JohnAZoidberg JohnAZoidberg deleted the no-ec branch March 10, 2026 16:31
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