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)
24 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
25 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0001", \
26 RUN="/usr/sbin/bcharge -p %p"
29 # Newer devices with USB Mass Storage:
30 # 0x8007 usually get transformed into 0x8004
31 # 0x8004 sometimes get transformed into 0x0004
32 # 0x0006 usually get transformed into 0x0004
35 # 0x0006 turns into 0x0004, so no need to fiddle with autosuspend here
36 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
37 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0006", \
38 RUN="/usr/sbin/bcharge"
40 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
41 ATTR{idVendor}=="0fca", ATTR{idProduct}=="8007", \
42 RUN="/usr/sbin/bcharge -p %p"
44 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
45 ATTR{idVendor}=="0fca", ATTR{idProduct}=="8004", \
46 RUN="/usr/sbin/bcharge -p %p"
48 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
49 ATTR{idVendor}=="0fca", ATTR{idProduct}=="0004", \
50 RUN="/usr/sbin/bcharge -p %p"