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 # Note2: the SUBSYSTEM and ENV{DEVTYPE} checks are to prevent bcharge from
13 # running each time a new endpoint is discovered by udev.
14 # Both SUBSYSTEM and ENV{DEVTYPE} are included so that the version
15 # of udev on your system doesn't matter.
19 # Older devices that only use 0x0001 (no USB Mass Storage)
22 BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p"
24 BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p"
27 # Newer devices with USB Mass Storage, 0x8004 + 0x0006 + 0x0004.
30 BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", RUN="/usr/sbin/bcharge"
31 BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", RUN="/usr/sbin/bcharge"
32 BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p"
34 BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", RUN="/usr/sbin/bcharge"
35 BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", RUN="/usr/sbin/bcharge"
36 BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p"