summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-pda/barry/files/10-blackberry.rules')
-rw-r--r--app-pda/barry/files/10-blackberry.rules51
1 files changed, 51 insertions, 0 deletions
diff --git a/app-pda/barry/files/10-blackberry.rules b/app-pda/barry/files/10-blackberry.rules
new file mode 100644
index 000000000000..c92ac684209e
--- /dev/null
+++ b/app-pda/barry/files/10-blackberry.rules
@@ -0,0 +1,51 @@
+#
+# 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)
+#
+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
+#
+
+# 0x0006 turns into 0x0004, so no need to fiddle with autosuspend here
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
+ ATTR{idVendor}=="0fca", ATTR{idProduct}=="0006", \
+ RUN="/usr/sbin/bcharge"
+
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
+ ATTR{idVendor}=="0fca", ATTR{idProduct}=="8007", \
+ RUN="/usr/sbin/bcharge -p %p"
+
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
+ ATTR{idVendor}=="0fca", ATTR{idProduct}=="8004", \
+ RUN="/usr/sbin/bcharge -p %p"
+
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \
+ ATTR{idVendor}=="0fca", ATTR{idProduct}=="0004", \
+ RUN="/usr/sbin/bcharge -p %p"
+