mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
udev: use the udev rules directly to set attr
We don't need complicated script for this, we can just set required attributes using udev rules.
This commit is contained in:
@@ -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", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/control}="auto"
|
||||
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/autosuspend_delay_ms}="3000"
|
||||
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/wakeup}="enabled"
|
||||
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{avoid_reset_quirk}="1"
|
||||
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ATTR{power/persist}="0"
|
||||
|
@@ -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
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user