Remove HID ignore quirk for MGE UPS devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The attached patch reverts the change made four years ago here:
http://www.vg.kernel.org/pub/linux/kernel/people/gregkh/usb/2.4/usb-hid-2.4.25-pre7.patch

UPS's made by MGE can be used with usbhid just fine, and by removing the
ignore quirk allows them to be used with HAL so they just work when plugged
in, without needing to be manually configured.

With the ignore quirk in place a user would have to configure NUT before the
UPS could be used, as NUT uses it's own internal USB matching framework
to match against the USB devices, do low level control messages on the
device and then parse the HID tables all in userspace.

This is not needed, as allowing the device to be claimed as a usbhid device
allows it to be used like any other USB UPS device. The devices correctly
advertise the power device page which can be queried for the device state.

I assume the quirk was changed so that people using < libusb 0.1.8 could
still use NUT's internal HID code to manage the UPS.
libusb 0.1.8 was released quite some time ago: 2004-02-11.

This patch does not break NUT as in drivers/libusb.c the device is force
unbound from the kernel driver using usb_detach_kernel_driver_np () where
it can be controlled like normal.

Signed-off-by: Richard Hughes <rhughes@xxxxxxxxxx>

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 61e78a4..faf3f4e 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -568,8 +568,8 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_HIDDEV },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_HIDDEV },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 20, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 30, HID_QUIRK_IGNORE },


commit 0abf9c8395f83ba1396574ee4ca0efa3541b56b1
Author: Richard Hughes <richard@xxxxxxxxxxx>
Date:   Wed Aug 13 09:43:02 2008 +0100

    remove hid ignore quirk for MGE UPS devices
    
    This patch reverts the change made four years ago here:
    http://www.vg.kernel.org/pub/linux/kernel/people/gregkh/usb/2.4/usb-hid-2.4.25-pre7.patch
    
    UPS's made by MGE can be used with usbhid just fine, and by removing the
    ignore quirk allows them to be used with HAL so they just work when plugged
    in, without needing to be manually configured.
    
    With the ignore quirk in place a user would have to configure NUT before the
    UPS could be used, as NUT uses it's own internal USB matching framework
    to match against the USB devices, do low level control messages on the
    device and then parse the HID tables all in userspace.
    
    This is not needed, as allowing the device to be claimed as a usbhid device
    allows it to be used like any other USB UPS device. The devices correctly
    advertise the power device page which can be queried for the device state.
    
    I assume the quirk was changed so that people using < libusb 0.1.8 could
    still use NUT's internal HID code to manage the UPS.
    libusb 0.1.8 was released quite some time ago: 2004-02-11.
    
    This patch does not break NUT as in drivers/libusb.c the device is force
    unbound from the kernel driver using usb_detach_kernel_driver_np () where
    it can be controlled like normal.
    
    Signed-off-by: Richard Hughes <rhughes@xxxxxxxxxx>

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 61e78a4..faf3f4e 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -568,8 +568,8 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_HIDDEV },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_HIDDEV },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 20, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 30, HID_QUIRK_IGNORE },

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux