4 # Note: the following rules may appear wasteful, in that bcharge is run
5 # twice: once for changing the mode, and once again after the
6 # device resets itself to enter this mode. This is required
7 # in order to support older kernels (approx. 2.6.20 to 2.6.22) with
8 # CONFIG_USB_SUSPEND enabled. The second time bcharge is run
9 # is when the -p argument comes into play, adjusting the device's
10 # autosuspend settings.
12 # Note: SUBSYSTEM=="usb_device" is not reliably available on all kernels
13 # and all versions of udev, so instead we use the very first
14 # kernel message of: SUBSYSTEM=="usb", ENV{DEVTYPE}="usb_device"
15 # (See the output of 'udevadm monitor --kernel')
16 # Since the device is likely not created at this point, we
17 # can't set permissions... so permissions are handled in the
18 # generic 99-blackberry-perms.rules file.
22 # Older devices that only use 0x0001 (no USB Mass Storage)
25 # Classic device, no Dual mode, only autosuspend adjustment
26 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
27 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0001", \
28 RUN="/usr/sbin/bcharge -p %p"
31 # Newer devices with USB Mass Storage:
32 # 0x8007 usually get transformed into 0x8004
33 # 0x8004 sometimes get transformed into 0x0004
34 # 0x0006 usually get transformed into 0x0004
37 # Pearl 0x0006 classic, force a change into 0x0004
38 # No need to fiddle with autosuspend here, since a reset is
40 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
41 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0006", \
42 RUN="/usr/sbin/bcharge -d"
44 # Storm 9530, ask bcharge to guess best setting
45 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
46 ATTR{idVendor}=="0fca", ATTR{idProduct}=="8007", \
47 RUN="/usr/sbin/bcharge -g -p %p"
49 # Pearl 8120 and Storm 9550, ask bcharge to guess best setting
50 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
51 ATTR{idVendor}=="0fca", ATTR{idProduct}=="8004", \
52 RUN="/usr/sbin/bcharge -g -p %p"
54 # Pearl Flip... bcharge guesses
55 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
56 ATTR{idVendor}=="0fca", ATTR{idProduct}=="8001", \
57 RUN="/usr/sbin/bcharge -g -p %p"
59 # Pearl Dual mode already, so just adjust autosuspend
60 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
61 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0004", \
62 RUN="/usr/sbin/bcharge -p %p"