[2008.12]ompower not suspend if usb connected
bytestore
bytestore at yandex.ru
Fri Jan 9 23:09:56 CET 2009
im try this
insert in /etc/udev/rules.d/udev.rules
this line subsystem=="power_supply", RUN+="/etc/udev/scripts/usb.sh"
create file /etc/udev/scripts/usb.sh
code:
#!/bin/sh
# when USB is plugged/unplugged in device mode, udev triggers this script
# on power change
# udevd does clearenv(). Export shell PATH to children.
export PATH
if [[ $(cat /sys/devices/platform/s3c2410-ohci/usb_mode) = "device" ]]
then
if [[ $(cat
/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/chgmode) =
"play-only" ]]
then
echo usb disconnect >> /var/log/messages
dbus-send --system --dest=org.openmoko.Power /
org.openmoko.Power.Core.RemoveRequestedResourceState? string:cpu string:usb
else
echo usb connect >> /var/log/messages
dbus-send --system --dest=org.openmoko.Power /
org.openmoko.Power.Core.RequestResourceState? string:cpu string:usb
string:on
sleep 3
fi
fi
and then restart udev
/etc/init.d/udev restart
if plug or unplug usb cable im see usb connect or usb disconect in
/var/log/messages but ompower don`t react and my FR is suspend if usb cable
is plugged
--
View this message in context: http://n2.nabble.com/-2008.12-ompower-not-suspend-if-usb-connected-tp2135559p2135559.html
Sent from the Openmoko Community mailing list archive at Nabble.com.
More information about the community
mailing list