Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > c25a909f0e1e4cbdb76b0c51ab9f128d > files > 2

barry-libs-0.18.0-1.fc15.i686.rpm

#
# Blackberry devices
#
# Note: the following rules may appear wasteful, in that bcharge is run
#       twice: once for changing the mode, and once again after the
#       device resets itself to enter this mode.  This is required
#       in order to support older kernels (approx. 2.6.20 to 2.6.22) with
#       CONFIG_USB_SUSPEND enabled.  The second time bcharge is run
#       is when the -p argument comes into play, adjusting the device's
#       autosuspend settings.
#
# Note: SUBSYSTEM=="usb_device" is not reliably available on all kernels
#       and all versions of udev, so instead we use the very first
#       kernel message of: SUBSYSTEM=="usb", ENV{DEVTYPE}="usb_device"
#       (See the output of 'udevadm monitor --kernel')
#       Since the device is likely not created at this point, we
#       can't set permissions... so permissions are handled in the
#       generic 99-blackberry-perms.rules file.
#

#
# Older devices that only use 0x0001 (no USB Mass Storage)
#

# Classic device, no Dual mode, only autosuspend adjustment
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="0001", \
	RUN="/usr/sbin/bcharge -p %p"

#
# Newer devices with USB Mass Storage:
#     0x8007 usually get transformed into 0x8004
#     0x8004 sometimes get transformed into 0x0004
#     0x0006 usually get transformed into 0x0004
#

# Pearl 0x0006 classic, force a change into 0x0004
# No need to fiddle with autosuspend here, since a reset is
# nearly guaranteed
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="0006", \
	RUN="/usr/sbin/bcharge -d"

# Storm 9530, ask bcharge to guess best setting
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="8007", \
	RUN="/usr/sbin/bcharge -g -p %p"

# Pearl 8120 and Storm 9550, ask bcharge to guess best setting
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="8004", \
	RUN="/usr/sbin/bcharge -g -p %p"

# Pearl Flip... bcharge guesses
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="8001", \
	RUN="/usr/sbin/bcharge -g -p %p"

# Pearl Dual mode already, so just adjust autosuspend
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
	ATTR{idVendor}=="0fca", ATTR{idProduct}=="0004", \
	RUN="/usr/sbin/bcharge -p %p"