diff --git a/udev/80-modem-eg25.rules b/udev/80-modem-eg25.rules index 0ea9e6f..5fb6970 100644 --- a/udev/80-modem-eg25.rules +++ b/udev/80-modem-eg25.rules @@ -1 +1,5 @@ -ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{MINOR}=="0", RUN+="/usr/bin/eg25-configure-usb %p" +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{avoid_reset_quirk}="1" +ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/persist}="0" diff --git a/udev/eg25-configure-usb b/udev/eg25-configure-usb deleted file mode 100755 index 9972af7..0000000 --- a/udev/eg25-configure-usb +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -DEVPATH=/sys/$1 -USB_ID= - -[ -d ${DEVPATH} ] || exit 1 - -while [ ! "${USB_ID}" ]; do - if [ -f ${DEVPATH}/avoid_reset_quirk ]; then - USB_ID=$(basename ${DEVPATH}) - break - fi - DEVPATH=$(dirname ${DEVPATH}) -done - -# Avoid USB resets -echo "auto" > /sys/bus/usb/devices/${USB_ID}/power/control -echo "3000" > /sys/bus/usb/devices/${USB_ID}/power/autosuspend_delay_ms -echo "enabled" > /sys/bus/usb/devices/${USB_ID}/power/wakeup -echo "1" > /sys/bus/usb/devices/${USB_ID}/avoid_reset_quirk -echo "0" > /sys/bus/usb/devices/${USB_ID}/power/persist diff --git a/udev/meson.build b/udev/meson.build index fe558fc..1488660 100644 --- a/udev/meson.build +++ b/udev/meson.build @@ -4,5 +4,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -install_data ('eg25-configure-usb', install_dir: bindir) install_data ('80-modem-eg25.rules', install_dir: udevrulesdir)