#!/bin/sh
TMPLIST_E=/tmp/echi-dev-list
TMPLIST_X=/tmp/xhci-dev-list
E_DIR=/sys/bus/pci/drivers/ehci_hcd
X_DIR=/sys/bus/pci/drivers/xhci_hcd
unbind() {
echo -n "" > $1
for i in `ls $2 | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
echo -n "$i" | tee $3
echo "$i" >> $1
done
}
bind() {
[ -f $1 ] || return
for i in `cat $1`; do
echo -n "$1" | tee $2
done
rm $1
}
case "$1" in
hibernate|suspend)
unbind $TMPLIST_E $E_DIR $E_DIR/unbind
unbind $TMPLIST_X $X_DIR $X_DIR/unbind
modprobe -r ehci-hcd
;;
resume|thaw)
bind $TMPLIST_E $E_DIR/bind
bind $TMPLIST_X $X_DIR/bind
modprobe ehci-hcd
;;
esac
Webcam and lsusb work after suspend again.
]]>Props to: http://thecodecentral.com/2011/01/18/fi … orking-bug
After installing pm-tools, create
/etc/pm/sleep.d/20_ehci_hcd
and dump the following into it
#!/bin/sh
TMPLIST_E=/tmp/echi-dev-list
TMPLIST_X=/tmp/xhci-dev-list
E_DIR=/sys/bus/pci/drivers/ehci_hcd
X_DIR=/sys/bus/pci/drivers/xhci_hcd
unbind() {
echo -n "" > $1
for i in `ls $2 | egrep '[0-9a-z]+\:[0-9a-z]+\:.*$'`; do
echo -n "$i" | tee $3
echo "$i" >> $1
done
}
bind() {
[ -f $1 ] || return
for i in `cat $1`; do
echo -n "$1" | tee $2
done
rm $1
}
case "$1" in
hibernate|suspend)
unbind $TMPLIST_E $E_DIR $E_DIR/unbind
unbind $TMPLIST_X $X_DIR $X_DIR/unbind
;;
resume|thaw)
bind $TMPLIST_E $E_DIR/bind
bind $TMPLIST_X $X_DIR/bind
;;
esac
Make it executable. Done.
I'm still testing the results, but so far it looks good.
EDIT: It should be noted that I initially tried the solution contained in the Asus N53JN wiki article here: https://wiki.archlinux.org/index.php/ASUS_N53JN and overall the article applies to the N53SV.
]]>