linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM
@ 2015-07-27 19:17 Reilly Grant
  2015-08-02  7:13 ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Reilly Grant @ 2015-07-27 19:17 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-kernel, Reilly Grant

In commit 30ba2fbde1840db44 an LED class driver for this device was
added and at the same time it was blacklisted by the hid-generic
driver. This patch removes the device from the hid-generic driver's
blacklist if the LED class driver is not enabled.

Signed-off-by: Reilly Grant <reillyg@chromium.org>
---
 drivers/hid/hid-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d9c7cd9..afa744f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1978,7 +1978,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
+#if IS_ENABLED(CONFIG_HID_THINGM)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },
+#endif
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },
-- 
2.5.0.rc2.392.g76e840b


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM
  2015-07-27 19:17 [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM Reilly Grant
@ 2015-08-02  7:13 ` Pavel Machek
       [not found]   ` <CAEmk=MYatwhrgMv5XC2V-NDwioBeoGC=PgYCh6bc8TtBBUwPAQ@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2015-08-02  7:13 UTC (permalink / raw)
  To: Reilly Grant; +Cc: Jiri Kosina, linux-input, linux-kernel

On Mon 2015-07-27 12:17:06, Reilly Grant wrote:
> In commit 30ba2fbde1840db44 an LED class driver for this device was
> added and at the same time it was blacklisted by the hid-generic
> driver. This patch removes the device from the hid-generic driver's
> blacklist if the LED class driver is not enabled.
> 
> Signed-off-by: Reilly Grant <reillyg@chromium.org>

I'd not do it.

Either special driver for this is not needed, and should be
removed. Or we should ask users to always use the special driver. We
should not have two drivers for same hardware.

								Pavel

>  drivers/hid/hid-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index d9c7cd9..afa744f 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1978,7 +1978,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
> +#if IS_ENABLED(CONFIG_HID_THINGM)
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },
> +#endif
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM
       [not found]   ` <CAEmk=MYatwhrgMv5XC2V-NDwioBeoGC=PgYCh6bc8TtBBUwPAQ@mail.gmail.com>
@ 2015-08-03  9:25     ` Jiri Kosina
  2015-08-03 16:52       ` Reilly Grant
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2015-08-03  9:25 UTC (permalink / raw)
  To: Reilly Grant; +Cc: Pavel Machek, linux-input, linux-kernel

On Sun, 2 Aug 2015, Reilly Grant wrote:

> There is existing user space software (not just mine, also from the
> manufacturer) that does not use the special driver and instead uses hidraw
> or usbdevice_fs to control the device. LED class driver support for this
> device is useful but should be optional.

Is there any problem for the userspace software to unbind the kernel 
driver first?

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM
  2015-08-03  9:25     ` Jiri Kosina
@ 2015-08-03 16:52       ` Reilly Grant
  0 siblings, 0 replies; 4+ messages in thread
From: Reilly Grant @ 2015-08-03 16:52 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Pavel Machek, linux-input, linux-kernel

If the software is using usbdevice_fs, no, it can simply detach the
kernel driver. If the software is using hidraw then this blacklist
becomes the issue because even if you unload the special driver the
generic HID driver won't load. Is there a mechanism in the HID
subsystem for drivers to build on top of the generic one instead of
replacing it?


On Mon, Aug 3, 2015, 2:25 AM Jiri Kosina <jkosina@suse.com> wrote:
>
> On Sun, 2 Aug 2015, Reilly Grant wrote:
>
> > There is existing user space software (not just mine, also from the
> > manufacturer) that does not use the special driver and instead uses hidraw
> > or usbdevice_fs to control the device. LED class driver support for this
> > device is useful but should be optional.
>
> Is there any problem for the userspace software to unbind the kernel
> driver first?
>
> --
> Jiri Kosina
> SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-03 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 19:17 [PATCH] HID: use generic driver for ThingM blink(1) if !CONFIG_HID_THINGM Reilly Grant
2015-08-02  7:13 ` Pavel Machek
     [not found]   ` <CAEmk=MYatwhrgMv5XC2V-NDwioBeoGC=PgYCh6bc8TtBBUwPAQ@mail.gmail.com>
2015-08-03  9:25     ` Jiri Kosina
2015-08-03 16:52       ` Reilly Grant

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).