linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Hughes <rhughes@redhat.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input <linux-input@vger.kernel.org>,
	Arnaud Quette <aquette.dev@gmail.com>,
	David Zeuthen <davidz@redhat.com>,
	"kay.sievers" <kay.sievers@vrfy.org>
Subject: Remove HID ignore quirk for MGE UPS devices
Date: Fri, 15 Aug 2008 12:01:01 +0100	[thread overview]
Message-ID: <1218798061.14646.13.camel@hughsie-work> (raw)

[-- Attachment #1: Type: text/plain, Size: 2234 bytes --]

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@redhat.com>

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 },



[-- Attachment #2: 0001-remove-hid-ignore-quirk-for-mge-ups-devices.patch --]
[-- Type: text/x-patch, Size: 2510 bytes --]

commit 0abf9c8395f83ba1396574ee4ca0efa3541b56b1
Author: Richard Hughes <richard@hughsie.com>
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@redhat.com>

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 },

             reply	other threads:[~2008-08-15 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 11:01 Richard Hughes [this message]
2008-08-19 12:46 ` Remove HID ignore quirk for MGE UPS devices Jiri Kosina
     [not found] ` <ec33acbd0809010450r1a14a3e8x3ea3e1ada63c2484@mail.gmail.com>
2008-09-01 12:14   ` Richard Hughes
2008-09-03 13:33     ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1218798061.14646.13.camel@hughsie-work \
    --to=rhughes@redhat.com \
    --cc=aquette.dev@gmail.com \
    --cc=davidz@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).