board: librem5: tps65982: Clear the dead battery flag
When TPS65982 boots in a dead battery condition, it expects the host to send a command to clear the dead battery flag once the system is able to provide power from the battery. In dead battery mode, TPS65982 turns off several features like power role switching and operates solely on external power to ensure that the system can stay operational on USB power only.
On the Librem 5, the userspace is configured to trigger BQ25895's shipping mode after powering the system off. This means that every time a user connects a charger while the phone is off, TPS65982 detects a dead battery condition. This results in TPS65982 rebooting itself into regular mode once the charger is unplugged. To prevent that, check whether battery voltage is present and gracefully clear the dead battery flag if that's the case.
Related issues: linux#403, linux!422 (merged)