diff --git a/temp/upower/0002-Detect-USB-Type-C-port-controller-and-other-chargers.patch b/temp/upower/0002-Detect-USB-Type-C-port-controller-and-other-chargers.patch new file mode 100644 index 000000000..cdcf8fba5 --- /dev/null +++ b/temp/upower/0002-Detect-USB-Type-C-port-controller-and-other-chargers.patch @@ -0,0 +1,31 @@ +From b07b1c6f400741df02d92fd2a8a3021f5799d587 Mon Sep 17 00:00:00 2001 +From: Clayton Craft +Date: Wed, 24 Feb 2021 23:44:15 +0000 +Subject: [PATCH] Detect USB Type C port controller and other chargers + +Based on squashing these two Purism patches: + +https://source.puri.sm/Librem5/upower/-/commit/95186bfcb306d04b4383412421942f374217f459.patch +https://source.puri.sm/Librem5/upower/-/commit/29b711f4c1db8b380605696b6e37b843a7571084.patch +--- + src/linux/up-device-supply.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c +index d7e4423..3326c96 100644 +--- a/src/linux/up-device-supply.c ++++ b/src/linux/up-device-supply.c +@@ -1066,6 +1066,10 @@ 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, "-source-psy-") != NULL) { ++ type = UP_DEVICE_KIND_LINE_POWER; ++ } else if (g_strstr_len (native_path, -1, "-charger") != NULL) { ++ type = UP_DEVICE_KIND_BATTERY; + } else { + g_warning ("did not recognise USB path %s, please report", + native_path); +-- +2.30.1 + diff --git a/temp/upower/APKBUILD b/temp/upower/APKBUILD index 0d61a8e1f..208b93cfb 100644 --- a/temp/upower/APKBUILD +++ b/temp/upower/APKBUILD @@ -4,7 +4,7 @@ pkgname=upower pkgver=9999 _pkgver=0.99.11 _distver="UPOWER_${_pkgver//./_}" -pkgrel=0 +pkgrel=1 pkgdesc="Power Management Services" url="https://upower.freedesktop.org" arch="aarch64 armv7" @@ -16,6 +16,7 @@ checkdepends="py3-dbus py3-gobject3" options="!check" # need unpackaged umockdev source="https://gitlab.freedesktop.org/upower/upower/-/archive/$_distver/upower-$_distver.tar.bz2 0001-Add-torch-support.patch + 0002-Detect-USB-Type-C-port-controller-and-other-chargers.patch " builddir="$srcdir/$pkgname-$_distver" @@ -54,4 +55,5 @@ package() { } sha512sums="918fdba13df7ba85fd276daae68228554e71df95011b48dc42b006a059cf2996f906ce08e98f6d1da07c8f2a4235bc9622992fa42eaaf05a08f1a3650f4ae4b6 upower-UPOWER_0_99_11.tar.bz2 -c6c8a557f8ca650e6e2b8b1f64f70744dc610f86f71d88602014b6c241c96821b5662f48ab63da6a2da9e52017b8d9f7a87655f8f640e87b5d17417577079b0b 0001-Add-torch-support.patch" +c6c8a557f8ca650e6e2b8b1f64f70744dc610f86f71d88602014b6c241c96821b5662f48ab63da6a2da9e52017b8d9f7a87655f8f640e87b5d17417577079b0b 0001-Add-torch-support.patch +0673d32e8c3d313e21437e7d431068b4a0c51a4d63acf414fc93430c461ab5acbcc2ae8740d6614ed9487fadb8ae2c685e02fb7ad3623b71a20ccb90c1a0bd28 0002-Detect-USB-Type-C-port-controller-and-other-chargers.patch"