linux: explicitly recognize USB power supplies

Prevents a spurious warning:
"did not recognise USB path /sys/devices/platform/USBC000:00/power_supply/ucsi-source-psy-USBC000:001, please report"

This does not actually change any functionality, as the heuristic for
the attribute "online" in up_device_supply_coldplug() would have
matches id, too.

Fixes #148
This commit is contained in:
Thomas Weißschuh 2021-12-19 01:48:55 +01:00 committed by Benjamin Berg
parent 545e54713a
commit 1b1f8f375c

View file

@ -1093,6 +1093,8 @@ up_device_supply_guess_type (GUdevDevice *native,
/* use a heuristic to find the device type */
if (g_strstr_len (native_path, -1, "wacom_") != NULL) {
type = UP_DEVICE_KIND_TABLET;
} else if (g_strstr_len (native_path, -1, "ucsi-source-psy-") != NULL) {
type = UP_DEVICE_KIND_LINE_POWER;
} else {
g_warning ("did not recognise USB path %s, please report",
native_path);