2 Commits
0.4.3 ... 0.4.4

Author SHA1 Message Date
Arnaud Ferraris
be6a924f8d meson.build: release version 0.4.4 2022-07-26 12:27:59 +02:00
Arnaud Ferraris
34472a5cff udev: allow different attribute values for the community firmware
When using the community-maintained firmware, some attributes need to be
set with different values than what works best with the stock firmware:
this is the case of the `power/control` attribute which should be set to
"on". Similarly, on the PPP `power/persist` should be set to "1".

This commit reworks the udev rules so we can differentiate between
firmwares and host devices.
2022-06-30 02:02:50 +02:00
2 changed files with 23 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
project (
'eg25-manager',
'c',
version : '0.4.3',
version : '0.4.4',
license : 'GPLv3+',
meson_version : '>= 0.58.0',
default_options :

View File

@@ -1,4 +1,22 @@
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/autosuspend_delay_ms}="3000"
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/wakeup}="enabled"
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/persist}="0"
ACTION!="add", GOTO="eg25_end"
SUBSYSTEM!="usb", GOTO="eg25_end"
DRIVER!="usb", GOTO="eg25_end"
ENV{DEVTYPE}!="usb_device", GOTO="eg25_end"
# Default attributes values
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/control}="auto"
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/autosuspend_delay_ms}="3000"
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/wakeup}="enabled"
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/persist}="0"
# If running the stock firmware, stop processing here
ATTRS{serial}!="community_fw", GOTO="eg25_end"
# power/control needs to be "on" for the community-maintained firmware
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/control}="on"
# Special trick for the PinePhone Pro: set power/persist to 1 *only* with the community FW
# We can identify the PPP by looking for the string "pinephone-pro" in the device tree "compatible" property
ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", PROGRAM=="/bin/grep pine64,pinephone-pro /proc/device-tree/compatible", ATTR{power/persist}="1"
LABEL="eg25_end"