sonyxperiadev / device-sony-common

70 stars 139 forks source link

[S] hardware/health: Wait for adsp and `power_supply/battery` before starting health HAL #892

Closed MarijnS95 closed 2 years ago

MarijnS95 commented 2 years ago

Fixes https://github.com/sonyxperiadev/bug_tracker/issues/776

On at least our Sagami class of devices the kernel battery driver (including SoMC charger extensions) probes/registers later than the start of our health HAL, resulting in it not seeing the battery until a restart. The power supply arrives as soon as adsp is booted, which is our signal to kick-start the HAL.

Note that we could also have a wait /sys/class/power_supply/battery on another on <xxx> trigger that starts later than adspstart, but this'll block the entire trigger until a power supply arrives.

MarijnS95 commented 2 years ago

WARNING: This is untested on other devices!