linux: Don't throw away large but possible energy rates

USB PD 3.1 allows up to 240W (48V, 5A) and some proprietary supplies
already delivered more than 100W over USB-C (USB PD 3.0 limit).

Closes: #147

Reported by StefanBruens
This commit is contained in:
Bastien Nocera 2021-08-10 12:32:24 +02:00
parent a14de39241
commit 3b91711e82

View file

@ -724,8 +724,8 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply,
if (energy_rate == 0xffff)
energy_rate = 0;
/* sanity check to less than 100W */
if (energy_rate > 100)
/* Ensure less than 300W, above the 240W possible with USB Power Delivery */
if (energy_rate > 300)
energy_rate = 0;
/* the hardware reporting failed -- try to calculate this */