Re: [PATCH] HID: i2c-hid: Prevent sending reports from racing with device reset

2015-12-30 Thread Jiri Kosina
On Mon, 21 Dec 2015, Mika Westerberg wrote:

> When an i2c-hid device is resumed from system sleep the driver resets
> the device to be sure it is in known state. The device is expected to
> issue an interrupt when reset is complete.
[ ... snip ... ]
> Prevent sending of feature/output reports while the device is being
> reset by adding a mutex which is held during that time.

Thanks Mika. Applied to for-4.4/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: sensor-hub: Add quirk for Lenovo Yoga 900 with ITE Chips

2015-12-28 Thread Jiri Kosina
On Fri, 18 Dec 2015, Srinivas Pandruvada wrote:

> This needs same quirk as applied to other YOGA sensor hubs.
> Refer to
> 47eeca8a48 (" HID: sensor-hub: Add in quirk for Lenovo Yogas with ITE")

Which tree is this SHA from?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: corsair: Convert to use module_hid_driver

2015-12-28 Thread Jiri Kosina
On Wed, 16 Dec 2015, Axel Lin wrote:

> Signed-off-by: Axel Lin <axel@ingics.com>
> ---
>  drivers/hid/hid-corsair.c | 13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
> index bcefb9e..5855196 100644
> --- a/drivers/hid/hid-corsair.c
> +++ b/drivers/hid/hid-corsair.c
> @@ -655,18 +655,7 @@ static struct hid_driver corsair_driver = {
>   .input_mapping = corsair_input_mapping,
>  };
>  
> -static int __init corsair_init(void)
> -{
> - return hid_register_driver(_driver);
> -}
> -
> -static void corsair_exit(void)
> -{
> - hid_unregister_driver(_driver);
> -}
> -
> -module_init(corsair_init);
> -module_exit(corsair_exit);
> +module_hid_driver(corsair_driver);
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Clement Vuchener");

Applied to for-4.5/upstream.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] HID: usbhid: use to_usb_device

2015-12-28 Thread Jiri Kosina
On Wed, 23 Dec 2015, Geliang Tang wrote:

> Use to_usb_device() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangt...@163.com>
> ---
>  drivers/hid/usbhid/usbhid.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h
> index 807922b..fa47d66 100644
> --- a/drivers/hid/usbhid/usbhid.h
> +++ b/drivers/hid/usbhid/usbhid.h
> @@ -96,7 +96,7 @@ struct usbhid_device {
>  };
>  
>  #define  hid_to_usb_dev(hid_dev) \
> - container_of(hid_dev->dev.parent->parent, struct usb_device, dev)
> + to_usb_device(hid_dev->dev.parent->parent)

Applied to hid.git#for-4.5/upstream.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] HID: move to_hid_device() to hid.h

2015-12-28 Thread Jiri Kosina
On Sun, 27 Dec 2015, Geliang Tang wrote:

> to_hid_device() macro is defined in both hid-lg4ff.c and 
> hid-logitech-hidpp.c. So I move it to include/linux/hid.h.
> 
> Signed-off-by: Geliang Tang <geliangt...@163.com>

I've applied the whole series to hid.git#for-4.5/container-of-cleanups

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: sony: Add rumble and LED support for Nyko Core Controller

2015-12-28 Thread Jiri Kosina
On Wed, 9 Dec 2015, Scott Moreau wrote:

> The Nyko Core Controller, vendor:1345 product:3008, is a usb controller 
> marketed
> as a PS3 controller. It works as an HID device for input. It has a single left
> rumble motor and no accelerometers, so it isn't a sixaxis. This patch adds 
> rumble
> and led support in the hid-sony driver.

Scott,

the patch is missing your Signoff; as such, it unfortunately can't be 
merged. Please see Documentation/SubmittingPatches for details.

Antonio, Frank, I'd like to have your Ack for this one as well is 
possible.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: sensor-hub: Add quirk for Lenovo Yoga 900 with ITE Chips

2015-12-22 Thread Jiri Kosina
On Fri, 18 Dec 2015, Srinivas Pandruvada wrote:

> This needs same quirk as applied to other YOGA sensor hubs.
> Refer to
> 47eeca8a48 (" HID: sensor-hub: Add in quirk for Lenovo Yogas with ITE")
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruv...@linux.intel.com>
> Tested-by: Nishanth Aravamudan <nish.aravamu...@gmail.com>

I got a bit lost here ... what's the status of this patch? Nishanth later 
reported that the patch actually doesn't fix the issue for him, so?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] HID: wacom: Limit touchstrip data to 13 bits

2015-12-17 Thread Jiri Kosina
I've applied the series to for-4.5/wacom.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid-input: ignore the battery in OKLICK Laser BTmouse

2015-12-17 Thread Jiri Kosina
On Mon, 14 Dec 2015, Alexander E. Patrakov wrote:

> This mouse, when asked about the battery, ceases to report movements and
> clicks. So just don't ask.
> 
> Signed-off-by: Alexander E. Patrakov <patra...@gmail.com>

Applied to for-4.5/core branch, thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch] HID: wacom: bitwise vs logical ORs

2015-12-17 Thread Jiri Kosina
On Wed, 16 Dec 2015, Jason Gerecke wrote:

> This patch looks fine to me (the 'prox' calculation /should/ be
> logical, but I suppose bitwise works too :D). Found two other bugs
> from c7f0522 while reviewing though -- I'll have patches for you
> shortly.
> 
> Reviewed-by: Jason Gerecke <jason.gere...@wacom.com>

Queued in for-4.5/wacom, thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] Support for CMedia CM6533 HID audio jack controls.

2015-12-16 Thread Jiri Kosina
 return int.

> + struct hid_input *hidinput)
> +{
> + struct input_dev *input_dev = hidinput->input;
> + struct cmhid *cm = hid_get_drvdata(hid);
> + int i;
> +
> + hid_info(hid, "cmhid_input_configured\n");
> + cm->input_dev = input_dev;
> + memcpy(cm->switch_map, jack_switch_types, sizeof(cm->switch_map));
> + input_dev->evbit[0] = BIT(EV_SW);
> + for (i = 0; i < CM6533_JD_TYPE_COUNT; i++)
> + input_set_capability(cm->input_dev,
> + EV_SW, jack_switch_types[i]);
> +}
> +
> +static int cmhid_input_mapping(struct hid_device *hid,
> + struct hid_input *hi, struct hid_field *field,
> + struct hid_usage *usage, unsigned long **bit, int *max)
> +{
> + return -1;
> +}

Why do you need this at all?

[ ... snip ... ]
> -- 
> Legal Disclaimer:
> The information contained in this message may be privileged and 
> confidential. It is intended to be read only by the individual or entity to 
> whom it is addressed or by their designee. If the reader of this message is 
> not the intended recipient, you  are not to copy,disclose,or distribute 
> this e-mail or its contents to any other person and any such actions are 
> unlawful. If you have received this message in error, please immediately 
> notify the sender and delete or destroy any copy of this message!

I would feel more comfortable if your further patch submissions do not 
contain this.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND] Lenovo Yoga 900 touchpad issues

2015-12-16 Thread Jiri Kosina
On Wed, 16 Dec 2015, Mika Westerberg wrote:

> > [Apologies for the resend, didn't realize I hadn't changed my GMail settings
> > to not use HTML.]
> > 
> > I have recently purchased a Lenovo Yoga 900 and most everything is working
> > with a slightly modified 4.4-rc5 (https://lkml.org/lkml/2015/11/30/441 
> > applied
> > to enable the touchpad itself), I am seeing two issues:
> > 
> > 1) On suspend/resume, the touchpad is non-functional. A `modprobe -r 
> > i2c-hid;
> >  modprobe i2c-hid` "fixes" it.
> > 
> > The kernel emits:
> > 
> > i2c_hid i2c-SYNA2B29:00: failed to reset device.
> > dpm_run_callback(): i2c_hid_resume+0x0/0xc0 [i2c_hid] returns -61
> > PM: Device i2c-SYNA2B29:00 failed to resume: error -61
> > 
> > During the resume. So perhaps this is a timing issue (given that once
> > resumed, the
> > module reload does work?).
> 
> Linus noticed this as well and Jiri suggested the below patch which
> seemed to fix the issue (although it increased resume time a bit).
> 
> I was supposed to get one Lenovo Yoga 900 here to debug this issue but
> I'm still waiting for it (sloow big corporation bureaucracy takes some
> time to get things purchased outside).
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 55d8f9d..52dd03a0 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1121,10 +1121,16 @@ static int i2c_hid_resume(struct device *dev)
>   struct i2c_client *client = to_i2c_client(dev);
>   struct i2c_hid *ihid = i2c_get_clientdata(client);
>   struct hid_device *hid = ihid->hid;
> - int wake_status;
> + int wake_status, tries = 3;
>  
>   enable_irq(ihid->irq);
> - ret = i2c_hid_hwreset(client);
> +
> + do {
> + ret = i2c_hid_hwreset(client);
> + if (ret)
> + msleep(1000);
> + } while (tries-- > 0 && ret);
> +
>   if (ret)
>   return ret;

As a possible alternative, please test the patch above on top of for-next 
branch of 

git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git

It contains 64bebefcf3 ("HID: enable hid device to suspend/resume 
asynchronously") and knowing whether that changes something might be 
interesting datapoint as well.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch] HID: wacom: bitwise vs logical ORs

2015-12-16 Thread Jiri Kosina
On Wed, 9 Dec 2015, Dan Carpenter wrote:

> Smatch complains that these should probably be bitwise ORs instead of
> logical.  It doesn't matter for "prox" but it makes a difference for
> "strip1" and "strip2".
> 
> Fixes: c7f0522a1ad1 ('HID: wacom: Slim down wacom_intuos_pad processing')
> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>

Jason, could you please provide your Ack for this one?

It's obviously a Correct Thing To Do(TM), but I assume you've tested on 
your devices with this patch, so some other changes might potentially be 
needed to "compensate" for the fix ... 

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 154/182] hid: cp2112: use gpiochip data pointer

2015-12-09 Thread Jiri Kosina
On Wed, 9 Dec 2015, Linus Walleij wrote:

> This makes the driver use the data pointer added to the gpio_chip
> to store a pointer to the state container instead of relying on
> container_of().
> 
> Cc: Jiri Kosina <ji...@kernel.org>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.wall...@linaro.org>

Acked-by: Jiri Kosina <jkos...@suse.cz>

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] HID: wacom: Move Intuos pad handling code into dedicated function

2015-12-02 Thread Jiri Kosina
On Wed, 2 Dec 2015, Jiri Kosina wrote:

> I know that this code (and other instances of similar spaghetti) has been 
> there before already and you are just moving it around, but isn't this the 
> proper time to clean it up a bit?
> 
> Like change it to a for-loop that'd use BTN_ as an array index to compute 
> the position in the data bitstream and call input_report_key()?

Okay, scratch that, I see now that this ugliness is being dealt with later 
in the series. Sorry for the noise.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] HID: wacom: Move Intuos pad handling code into dedicated function

2015-12-02 Thread Jiri Kosina
));
> + input_report_key(input, BTN_8, (data[8] & 0x01));
> + input_report_key(input, BTN_9, (data[8] & 0x02));
> + input_report_key(input, BTN_A, (data[8] & 0x04));
> + input_report_key(input, BTN_B, (data[8] & 0x08));
> + input_report_key(input, BTN_C, (data[8] & 0x10));
> + input_report_key(input, BTN_X, (data[8] & 0x20));
> + input_report_key(input, BTN_Y, (data[8] & 0x40));
> + input_report_key(input, BTN_Z, (data[8] & 0x80));

I know that this code (and other instances of similar spaghetti) has been 
there before already and you are just moving it around, but isn't this the 
proper time to clean it up a bit?

Like change it to a for-loop that'd use BTN_ as an array index to compute 
the position in the data bitstream and call input_report_key()?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] HID: wacom: Move Intuos pad handling code into dedicated function

2015-12-02 Thread Jiri Kosina
On Mon, 30 Nov 2015, Jason Gerecke wrote:

> Begin slimming down the body of 'wacom_intuos_irq' by moving out its
> largest block of code to a dedicated 'wacom_intuos_pad' function.
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

I really like the cleanups done by this patchset, thanks. I have applied 
it to for-4.5/wacom branch.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: lg: restrict filtering out of first interface to G29 only

2015-12-02 Thread Jiri Kosina
On Tue, 1 Dec 2015, Benjamin Tissoires wrote:

> Looks like 29fae1c85 ("HID: logitech: Add support for G29") was a little
> bit aggressive and broke other devices.
> 
> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=108121
> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
> ---
> 
> Hi Jiri,
> 
> as reported in #108121, this is 4.4-rc material. At least 2 people already
> started complaining about it on the mailing list, so it should definitively
> be fixed before 4.4 is out.

Applied to for-4.4/upstream-fixes, thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: multitouch: fix input mode switching on some Elan panels

2015-12-02 Thread Jiri Kosina
On Tue, 1 Dec 2015, Benjamin Tissoires wrote:

[ ... snip ... ]
> Not so sure if this is 4.4 material. On the one hand we have a regression
> since 4.4-rc0 for this particular panel.
> On the other hand, there is still the chance that doing so will break a
> different panel. In the list of devices I have been reported, there is only 
> one
> other elan touchpad (0x300b) that will be affected, but judging by the report
> descriptor, I think it will be in the same situation than this one (broken by
> 4.4).
> 
> All the other devices I know of have only one feature for the input mode and 
> are
> thus not affected by this change.

Thanks for detailed assessment. After considering the alternatives, I've 
now applied it to for-4.5/multitouch. If it later proves itself to be 
regression-free, we might well backport it to -stable.

Ok?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/2] USB: quirks: Apply ALWAYS_POLL to all ELAN devices

2015-12-01 Thread Jiri Kosina
On Tue, 1 Dec 2015, Adrien Vergé wrote:

> All ELAN hid devices seem to require the ALWAYS_POLL quirk. Let's use
> this quirk for all devices from this vendor, rather than maintaining a
> list of all its known product IDs.
> 
> Tested-by: Adrien Vergé <adrienve...@gmail.com>
> Signed-off-by: Adrien Vergé <adrienve...@gmail.com>

Reviewed-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
Reviewed-by: Jiri Kosina <jkos...@suse.cz>

Greg, I guess it makes sense to take both 1/2 and 2/2 together as a whole. 
Would you mind adding the tags above and taking it through usb git tree?

Alternatively I can take it through my tree if you Ack the usb part.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] hid: usbhid: hid-core: fix recursive deadlock

2015-12-01 Thread Jiri Kosina
On Fri, 20 Nov 2015, Ioan-Adrian Ratiu wrote:

> The critical section protected by usbhid->lock in hid_ctrl() is too
> big and because of this it causes a recursive deadlock. "Too big" means
> the case statement and the call to hid_input_report() do not need to be
> protected by the spinlock (no URB operations are done inside them).
> 
> The deadlock happens because in certain rare cases drivers try to grab
> the lock while handling the ctrl irq which grabs the lock before them
> as described above. For example newer wacom tablets like 056a:033c try
> to reschedule proximity reads from wacom_intuos_schedule_prox_event()
> calling hid_hw_request() -> usbhid_request() -> usbhid_submit_report()
> which tries to grab the usbhid lock already held by hid_ctrl().
> 
> There are two ways to get out of this deadlock:
> 1. Make the drivers work "around" the ctrl critical region, in the
> wacom case for ex. by delaying the scheduling of the proximity read
> request itself to a workqueue.
> 2. Shrink the critical region so the usbhid lock protects only the
> instructions which modify usbhid state, calling hid_input_report()
> with the spinlock unlocked, allowing the device driver to grab the
> lock first, finish and then grab the lock afterwards in hid_ctrl().
> 
> This patch implements the 2nd solution.
> 
> Signed-off-by: Ioan-Adrian Ratiu <a...@adirat.com>

Applied to for-4.5/core branch. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] HID: multitouch: enable palm rejection if device implements confidence usage

2015-11-26 Thread Jiri Kosina
On Fri, 20 Nov 2015, Allen Hung wrote:

> The usage Confidence is mandary to Windows Precision Touchpad devices. The
> appearance of this usage is checked in hidinput_connect but the quirk
> MT_QUIRK_VALID_IS_CONFIDENCE is not applied to device accordingly.
> Apply this quirk and also remove quirk MT_QUIRK_ALWAYS_VALID to enable palm
> rejection for the WIN 8 touchpad devices which have implemented usage
> Confidence in its input reports.
> 
> Tested on Dell XPS 13 laptop.
> 
> Signed-off-by: Allen Hung <allen_h...@dell.com>

Applied to for-4.5/multitouch. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] HID: Force feedback support for the Logitech G920 Wheel

2015-11-26 Thread Jiri Kosina
On Sat, 21 Nov 2015, Edwin Velds wrote:

> This patch implements force feedback support for the Logitech G920 Driving 
> Force
> Racing Wheel.
> 
> This patch is based on the basic G920 support patch by Simon Wood:
> http://www.spinics.net/lists/linux-input/msg42174.html

Simon, it'd be nice if I could get your Tested-by: / Reviewed-by: for 
this.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: debug: improve hid_debug_event()

2015-11-26 Thread Jiri Kosina
On Tue, 24 Nov 2015, Rasmus Villemoes wrote:

> The code in hid_debug_event() causes horrible code generation. First,
> we do a strlen() call for every byte we copy (we're doing a store to
> global memory, so gcc has no way of proving that strlen(buf) doesn't
> change). Second, since both i, list->tail and HID_DEBUG_BUFSIZE have
> signed type, the modulo computation has to take into account the
> possibility that list->tail+i is negative, so it's not just a simple
> and.
> 
> Fix the former by simply not doing strlen() at all (we have to load
> buf[i] anyway, so testing it is almost free) and the latter by
> changing i to unsigned. This cuts 29% (69 bytes) of the size of the
> function.
> 
> Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>

Agreed, this is much better. Applied to for-4.5/core, thanks Rasmus.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbhid: discarded events don't abort idleness

2015-11-23 Thread Jiri Kosina
On Thu, 5 Nov 2015, Oliver Neukum wrote:

> If an event is discarded the device stays idle.
> Just reverse the order of check and marking busy.
> 
> Signed-off-by: Oliver Neukum <oneu...@suse.com>

Applied to for-4.5/core. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: quirks: Fix another ELAN touchscreen

2015-11-23 Thread Jiri Kosina
On Sat, 21 Nov 2015, Adrien Vergé wrote:

> Like other buggy models that had their fixes [1], the touchscreen with
> id 04f3:21b8 from ELAN Microelectronics needs the device-qualifier
> quirk. Otherwise, it fails to respond, blocks the boot for a random
> amount of time and pollutes dmesg with:
> 
> [ 2887.373196] usb 1-5: new full-speed USB device number 41 using xhci_hcd
> [ 2889.502000] usb 1-5: unable to read config index 0 descriptor/start: -71
> [ 2889.502005] usb 1-5: can't read configurations, error -71
> [ 2889.654571] usb 1-5: new full-speed USB device number 42 using xhci_hcd
> [ 2891.783438] usb 1-5: unable to read config index 0 descriptor/start: -71
> [ 2891.783443] usb 1-5: can't read configurations, error -71

The drivers/hid part is

Acked-by: Jiri Kosina <jkos...@suse.cz>

Makes one wonder however whether we shouldn't be applying ALWAYS_POLL to 
all ELAN devices by default anyway.

> [1]: See commits c68929f, 876af5d, d749947, a32c99e and dc703ec.
> 
> Tested-by: Adrien Vergé <adrienve...@gmail.com>

You need signoff here as well so that the patch can be applied.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch-V3 0/6] HID: Support for the Logitech G920 Wheel

2015-11-20 Thread Jiri Kosina
On Thu, 19 Nov 2015, Simon Wood wrote:

> Patch-V3 tweaked as per Benjamin's and Dmitry's requests.
> 
> This series of patches provide input support for the Logitech G920 gaming 
> wheel.

This is now in hid.git#for-4.5/logitech.

Dmitry -- I've put the first patch into 
hid.git#for-dmitry/logitech-g920-merge-base 

which is based on v4.3, and I then branched further for-4.5/logitech from 
it in my tree.

So if you pull for-dmitry/logitech-g920-merge-base branch from my tree, 
we're both fine and there would be no hassle no matter who merges with 
Linus first.

Do you want me to send you a "proper" pull request? :)

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: core: use scnprintf in modalias_show()

2015-11-20 Thread Jiri Kosina
On Sat, 14 Nov 2015, Rasmus Villemoes wrote:

> scnprintf() exists to provide these semantics, so we might as well use
> it.
> 
> Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk>

Applied to hid.git#for-4.5/core. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbhid: discarded events don't abort idleness

2015-11-20 Thread Jiri Kosina
On Thu, 5 Nov 2015, Oliver Neukum wrote:

> If an event is discarded the device stays idle.
> Just reverse the order of check and marking busy.
> 
> Signed-off-by: Oliver Neukum <oneu...@suse.com>

Hi Oliver,

thanks for the fix. This is a real bug, so I am wondering whether you have 
seen causing it real problems (and hence it should be merged for 4.4), or 
if you found it just by code inspection (and therefore it should be fine 
to merge it for 4.5).

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] HID: add Benjamin Tissoires as designated reviewer / co-maintainer

2015-11-20 Thread Jiri Kosina
From: Jiri Kosina <jkos...@suse.cz>

Benjamin has been helping a lot over time with reviewing patches flowing 
into HID subsystem. Let's make it official.

Acked-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index b16bffa..ca8cff5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4981,6 +4981,7 @@ F:arch/*/include/asm/suspend*.h
 
 HID CORE LAYER
 M: Jiri Kosina <ji...@kernel.org>
+R: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
 L: linux-input@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
 S: Maintained
@@ -11081,6 +11082,7 @@ F:  include/linux/usb/gadget*
 
 USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
 M: Jiri Kosina <ji...@kernel.org>
+R: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
 L: linux-...@vger.kernel.org
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
 S: Maintained

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: usbhid: add Logitech G710+ keyboard quirk NOGET

2015-11-20 Thread Jiri Kosina
On Fri, 20 Nov 2015, Jimmy Berry wrote:

> Without quirk keyboard repeats '6' until volume control is used since it
> indicates the key is pressed without ever releasing.
> 
> Signed-off-by: Jimmy Berry <ji...@boombatower.com>

Applied to for-4.4/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/2] hid: sony: Clear and restore controller state on suspend and resume

2015-11-19 Thread Jiri Kosina
On Wed, 11 Nov 2015, Frank Praznik wrote:

> On systems with standby power for charging devices the LEDs and rumble on the
> controller can continue to function even when the system is in standby since
> the state is not cleared when the system goes to sleep.
> 
> The state on wakeup can also differ from the state when the system entered
> standby as the LEDs can be cleared when the device is reset on wakeup.
> 
> The first patch refactors the output report functions to allow sending an
> output report without going through the work queue.  This is necessary when
> clearing the state of the controller before the system is goes into standby
> since the work might not be executed before the system goes to sleep.
> 
> The second patch implements the suspend and resume callbacks which serializes
> and clears the LEDs on suspend and restores them on resume.
> 
> Force-feedback is cleared on suspend but the state is not restored on resume
> since it can potentially result in hardware damage if the device is unattended
> when the system wakes.  A new event will be required to resume force-feedback.

Applied to for-4.5/sony. Thanks Frank,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: usbhid: hid-core: fix recursive deadlock

2015-11-19 Thread Jiri Kosina
On Thu, 19 Nov 2015, Ioan-Adrian Ratiu wrote:

> First part of lockdep report:
> http://imgur.com/clLsCWe
> 
> Second part:
> http://imgur.com/Wa2PzRl
> 
> Here are some printk's of mine while reproducing + debugging the issue:
> http://imgur.com/SETOHT7

So the real problem is that Intuos driver is calling hid_hw_request() 
(which tries to grab the lock in usbhid_submit_report()) while handling 
the CTRL IRQ (lock gets acquired there).

So the proper way to fix seems to be delaying the scheduling of the 
proximity read event in wacom_intuos_inout() to workqueue.

> I'll continue to research this more in depth, but progress is slow 
> because I don't have much time, I'm doing this in my spare time because 
> it's my girlfriend's tablet.

Oh, now I understand the level of severity of this bug! :-)

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch-V2 0/6] HID: Support for the Logitech G920 Wheel

2015-11-19 Thread Jiri Kosina
On Thu, 12 Nov 2015, Simon Wood wrote:

> Patch-V2 tweaked as per Benjamin's requests.

Looking at the patches, I am happy with them, but still would like to have 
Benjamin's Ack/Reviewed-by before merging them.

Benjamin ... ?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: usbhid: hid-core: fix recursive deadlock

2015-11-19 Thread Jiri Kosina
On Wed, 18 Nov 2015, Ioan-Adrian Ratiu wrote:

> > > The critical section protected by usbhid->lock in hid_ctrl() is too
> > > big and in rare cases causes a recursive deadlock because of its call
> > > to hid_input_report().
> > > 
> > > This deadlock reproduces on newer wacom tablets like 056a:033c because
> > > the wacom driver in its irq handler ends up calling hid_hw_request()
> > > from wacom_intuos_schedule_prox_event() in wacom_wac.c. What this means
> > > is that it submits a report to reschedule a proximity read through a
> > > sync ctrl call which grabs the lock in hid_ctrl(struct urb *urb)
> > > before calling hid_input_report(). When the irq kicks in on the same
> > > cpu, it also tries to grab the lock resulting in a recursive deadlock.
> > > 
> > > The proper fix is to shrink the critical section in hid_ctrl() to
> > > protect only the instructions which modify usbhid, thus move the lock
> > > after the hid_input_report() call and the deadlock dissapears.  
> > 
> > I think the proper fix actually is to spin_lock_irqsave() in hid_ctrl(), 
> > isn't it?
> 
> That was my first attempt, yes, but the deadlock still happens with interrupts
> disabled. 

That unfortunately however directly implies that your explanation above 
isn't actually correct description of the real problem.

So we'd better first understand the problem rather than papering it over 
with more or less random fixes.

First, have you tried to run your usecase on your system with lockdep 
enabled?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: usbhid: hid-core: fix recursive deadlock

2015-11-19 Thread Jiri Kosina
On Thu, 19 Nov 2015, Ioan-Adrian Ratiu wrote:

> But please understand further my reasoning for submitting this patch. 
> Consider if this is a bug in the wacom driver or in the usbhid core? IMO 
> this is a usbhid bug: the critical region in hid_ctrl() is too big, 
> there is no reason for the call to hid_input_report() to be protected by 
> usbhid->lock.

Hmm, it's actually true that we might not need usbhid->lock during 
hid_input_report() at the end of the day, as we shouldn't be doing any 
URB-related operations there, neither iofl are being manipulated.

If you have already done the full analysis that shows that usbhid->lock is 
indeed not needed, this absolutely needs to go into changelog as proper 
justification.

Could you please reformulate the changelog in this respect and resubmit?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: Make report_descriptor available for all devices

2015-11-19 Thread Jiri Kosina
On Thu, 19 Nov 2015, Andy Lutomirski wrote:

> Currently the sysfs report_descriptor attribute is only available if
> the device is claimed.  We have the descriptor before we even create
> the device node, so just instantiate report_descriptor statically.
> 
> Signed-off-by: Andy Lutomirski <l...@kernel.org>

Agreed, that's generally useful; applied to for-4.5/core branch.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND PATCH] hid: Drop owner assignment from i2c_driver

2015-11-19 Thread Jiri Kosina
On Thu, 19 Nov 2015, Krzysztof Kozlowski wrote:

> i2c_driver does not need to set an owner because i2c_register_driver()
> will set it.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlow...@samsung.com>
> Acked-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>

Applied to for-4.5/i2c-hid. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: sony: Remove the size check for the Dualshock 4 HID Descriptor

2015-11-19 Thread Jiri Kosina
On Fri, 6 Nov 2015, Frank Praznik wrote:

> Sony has modified the HID descriptor in new revisions of the Dualshock 4 which
> causes the size check in the descriptor replacement function to fail.  Remove 
> it
> so that new revisions of the controller will work correctly.
> 
> The module is completely replacing the descriptor instead of patching it, so 
> the
> size check isn't really necessary anyways.
> 
> Signed-off-by: Frank Praznik <frank.praz...@gmail.com>

Applied to for-4.5/sony, thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: Wacom: Delete an unnecessary check before the function call "kobject_put"

2015-11-19 Thread Jiri Kosina
On Fri, 6 Nov 2015, SF Markus Elfring wrote:

> From: Markus Elfring <elfr...@users.sourceforge.net>
> Date: Fri, 6 Nov 2015 17:55:23 +0100
> 
> The kobject_put() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.

Applied to for-4.5/wacom.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch-V2 1/6] INPUT: xpad: Add minimal support for Logitech G920 Wheel

2015-11-19 Thread Jiri Kosina
On Thu, 12 Nov 2015, Simon Wood wrote:

> When plugged in the Logitech G920 wheel starts with USBID 046d:c261
> and behaviors as a vendor specific class. If a 'magic' byte sequence
> is sent the wheel will detach and reconnect as a HID device with the
> USBID 046d:c262.
> 
> Signed-off-by: Simon Wood <si...@mungewell.org>

Adding Dmitry to CC.

Dmitry, I am planning to take this through my tree together with the rest 
of the actual HID support for that device if you Ack this.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: usbhid: hid-core: fix recursive deadlock

2015-11-18 Thread Jiri Kosina
On Wed, 18 Nov 2015, Ioan-Adrian Ratiu wrote:

> The critical section protected by usbhid->lock in hid_ctrl() is too
> big and in rare cases causes a recursive deadlock because of its call
> to hid_input_report().
> 
> This deadlock reproduces on newer wacom tablets like 056a:033c because
> the wacom driver in its irq handler ends up calling hid_hw_request()
> from wacom_intuos_schedule_prox_event() in wacom_wac.c. What this means
> is that it submits a report to reschedule a proximity read through a
> sync ctrl call which grabs the lock in hid_ctrl(struct urb *urb)
> before calling hid_input_report(). When the irq kicks in on the same
> cpu, it also tries to grab the lock resulting in a recursive deadlock.
> 
> The proper fix is to shrink the critical section in hid_ctrl() to
> protect only the instructions which modify usbhid, thus move the lock
> after the hid_input_report() call and the deadlock dissapears.

I think the proper fix actually is to spin_lock_irqsave() in hid_ctrl(), 
isn't it?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-11-16 Thread Jiri Kosina
On Mon, 16 Nov 2015, Fu, Zhonghui wrote:

> 
> Hi Jiri,
> 
> Any comments about this patch?
> 
> After enabling the HID devices suspend/resume asynchronously on ASUS 
> T100TA(Baytrail-T platform), the system suspend-to-idle/resume time is 
> reduced about 20ms. Although this improvement is not very significant. 
> But, if the suspend/resume operation of HID devices is very 
> time-consuming on some other platforms, this patch can improve 
> significantly system suspend/resume speed on these platforms.

Hi,

I don't think the question I've raised at


http://lkml.kernel.org/r/alpine.lnx.2.00.1509251404130.30...@pobox.suse.cz

has ever been answered or at least discussed ... ?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: drivers/hid/wacom_wac.c:2484: bad if test ?

2015-11-16 Thread Jiri Kosina
On Mon, 16 Nov 2015, David Binderman wrote:

> Hello there,
> 
> drivers/hid/wacom_wac.c:2484:35: warning: logical ‘or’ of collectively 
> exhaustive tests is always true [-Wlogical-op]
> 
> Source code is
> 
> if (features->type>= INTUOSHT || features->type <= BAMBOO_PT)

Good catch, that code is obviously crappy.

Adding Ping, Aaron and Jason to CC.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: wacom: Add outbounding area for DTU1141

2015-11-13 Thread Jiri Kosina
On Thu, 12 Nov 2015, Ping Cheng wrote:

> DTU1141 has an extra 1 mm tablet active outbounding area on each
> side of the display, same as those recently released DTUs.
> 
> Signed-off-by: Ping Cheng <pi...@wacom.com>
> ---
>  drivers/hid/wacom_wac.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> index 9db6a8b..5d946bb 100644
> --- a/drivers/hid/wacom_wac.c
> +++ b/drivers/hid/wacom_wac.c
> @@ -3187,7 +3187,8 @@ static const struct wacom_features wacom_features_0x32F 
> =
> WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
>  static const struct wacom_features wacom_features_0x336 =
>   { "Wacom DTU1141", 23472, 13203, 1023, 0,
> -   DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
> +   DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
> +   WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
>  static const struct wacom_features wacom_features_0x57 =
>   { "Wacom DTK2241", 95640, 54060, 2047, 63,
>     DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 6,

Applied to for-4.4/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] HID: hid-logitech: Simplify wheel detection scheme

2015-11-06 Thread Jiri Kosina
On Mon, 2 Nov 2015, Simon Wood wrote:

> Simplfy how hid-logitech driver detects the native mode of the wheel,
> done by looking at the USB-ID revision and comparing bit mask.
> 
> Signed-off-by: Simon Wood <si...@mungewell.org>

I've applied both patches to for-4.4/logitech. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: wacom: Call 'wacom_query_tablet_data' only after 'hid_hw_start'

2015-11-05 Thread Jiri Kosina
On Tue, 3 Nov 2015, Jason Gerecke wrote:

> When connecting the Cintiq Companion 2 as an external tablet (i.e., using
> it in "hybrid" mode) it has been seen to cause the kernel of the machine
> it is connected to to Oops. The cause has been traced to us attempting to
> switch the tablet's mode prior to actually starting HID device (resulting
> in the eventual dereference of the uninitialized control URB).
> 
> Commit 3b164a0 moved the mode switch from occuring post-start to occurring
> pre-start. The change was not seen to cause issues largely due to the fact
> that most devices mode switch with 'hid_hw_raw_request' (which is safe to
> call prior to start) rather than 'hid_hw_request'.
> 
> Moving the call back to its original location resolves the issue, but
> causes some touch-only Bamboo tablets (e.g. 056a:00d0) to stop working.
> The affected tablets require us to perform a mode switch on their
> vestigial pen interface prior ignoring with -ENODEV, meaning that the
> code which is responsible for doing the ignoring has to move as well.
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> ---
> Jiri,
> 
> Ping clued me in to the fact that 'wacom_query_tablet_data' hasn't always 
> been in this problematic location. The offending commit mentioned in the 
> revised commit summary is queued for 4.4, so this only needs to get into 
> the next RC rather than be targeted for stable.

Queued as super-late patch into for-4.4/wacom.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: hid-gfrm: avoid warning for input_configured API change

2015-11-04 Thread Jiri Kosina
On Tue, 3 Nov 2015, Dmitry Torokhov wrote:

> > > The input_configured callback was recently changed to return
> > > an 'int', but the newly added driver uses the old API:
> > >
> > > drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible 
> > > pointer type [-Wincompatible-pointer-types]
> > >
> > > This changes the driver like the other ones.
> > >
> > > Signed-off-by: Arnd Bergmann <a...@arndb.de>
> > 
> > Acked-by: Petri Gynther <pgynt...@google.com>
> 
> Hmm, the question is how to merge this, given that one change is in
> Jiri's tree and another in mine...

In this case probably the best course of action is you cherry-picking 
b2c68a2f1bab from my tree into yours, and proceeding further. git can 
handle doubled commits (that will end up in Linus' tree eventually) 
easily.

Another option would be to create a joint merge tree that'd contain both 
branches merged together and proceed further from that, but I don't think 
it's worth the hassle for simple case like this.

Works for you?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] HID: wacom: Remove useless conditions from 'wacom_query_tablet_data'

2015-11-03 Thread Jiri Kosina
On Mon, 2 Nov 2015, Ping Cheng wrote:

> On Mon, Nov 2, 2015 at 3:41 PM, Jason Gerecke <killert...@gmail.com> wrote:
> > When support for the Cintiq Companion Hybrid and Cintiq Companion 2 was
> > added (36d3c51 and f7acb55), the 'wacom_query_tablet_data' function was
> > updated to include references to CINTIQ_HYBRID and CINTIQ_COMPANION_2
> > with the thought that they were necessary to switch the touch interface
> > into the proper mode. This is unnecessary, however, since those types
> > are only ever associated with the pen interface -- the touch interfaces
> > are either CINTIQ_24HDT or HID_GENERIC. To avoid confusion in the future,
> > we remove the unnecessary CINTIQ_HYBRID and CINTIQ_COMPANION_2 conditions.
> >
> > Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> 
> Reviewed-by: Ping Cheng <pi...@wacom.com>
> 
> for this patch and the 3/3 of this set.

This is really late in the game (the merge window is already open), but 
given the nature of the patches (we'll be sending them as -rc bugfixes 
later anyway), I've just picked those up to for-4.4/wacom.

1/1 I am sure you two will have some more discussion about :) so I am 
ignoring it for now.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: wacom: fix Intuos wireless report id issue

2015-11-02 Thread Jiri Kosina
On Mon, 26 Oct 2015, Ping Cheng wrote:

> Intuos Pen in wireless mode does not have the same report id (2) as
> when it is in USB mode (17).
> 
> This patch also moves WIRELESS next to REMOTE in type enum so we
> can group devices with similar features easily.
> 
> Reported-by: Dale Brewe <dlbr...@hotmail.com>
> Tested-by: Dale Brewe <dlbr...@hotmail.com>
> Signed-off-by: Ping Cheng <pi...@wacom.com>

Applied to hid.git#for-4.4/wacom.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: microsoft: Add support for Surface Pro 4 Type Cover

2015-10-30 Thread Jiri Kosina
On Fri, 30 Oct 2015, Andy Shevchenko wrote:

> >> Adding support for device 0x07e8 (SP4 Type Cover)
> >>
> >> Signed-off-by: savoca <alex.de...@daqri.com>
> >
> > Thanks for the patch.
> >
> > The authorship and signoffs should same real names though. Could you
> > please resend with that fixed?
> >
> 
> Have you guys noticed the patch [1] to support Surface Book along with
> Surface Pro 3?

Not really. A quick scan through my mailbox tells me that it has actually 
never submitted to me for inclusion into the kernel.

> [1] https://github.com/neoreeps/surface-pro-3/blob/master/wily_surface.patch

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 1/5] INPUT: xpad: Add minimal support for Logitech G920 Wheel

2015-10-30 Thread Jiri Kosina
On Fri, 23 Oct 2015, Simon Wood wrote:

> When plugged in the Logitech G920 wheel starts with USBID 046d:c261
> and behaviors as a vendor specific class. If a 'magic' byte sequence
> is sent the wheel will detach and reconnect as a HID device with the
> USBID 046d:c262.

[ Benjamin added to CC ]

Benjamin, before I proceed with this series, I'd like you to have review 
the HID++ bits at least, if possible. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: microsoft: Add support for Surface Pro 4 Type Cover

2015-10-30 Thread Jiri Kosina
On Tue, 27 Oct 2015, savoca wrote:

> Adding support for device 0x07e8 (SP4 Type Cover)
> 
> Signed-off-by: savoca <alex.de...@daqri.com>

Thanks for the patch.

The authorship and signoffs should same real names though. Could you 
please resend with that fixed?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid-gfrm: Google Fiber TV Box remote controls

2015-10-26 Thread Jiri Kosina
On Thu, 22 Oct 2015, Jiri Kosina wrote:

> > Add HID driver for Google Fiber TV Box remote controls
> 
> I am not particularly happy with drvdata not being actually used "the 
> usual way", i.e. to store a pointer, but apart from being unusual, I don't 
> see a real issue with it.
> 
> Dmitry, as this depends on a patch queued in your tree, would you be okay 
> with taking the patch with my signoff?

I discussed this Dmitry in person on Kernel Summit earlier today, and 
he'll be taking the driver through his tree.

For that purpose:
    
Signed-off-by: Jiri Kosina <jkos...@suse.cz>

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: usbhid: Add a quirk for Xin-Mo Dual Arcade

2015-10-24 Thread Jiri Kosina
On Sat, 24 Oct 2015, Michele Baldessari wrote:

> The Xin-Mo Dual Arcade controller (16c0:05e1) needs this quirk in order
> to have the two distinct joysticks working.
> 
> Before the change:
> $ jstest /dev/input/js0
> Joystick (Xin-Mo Xin-Mo Dual Arcade) has 2 axes (X, Y)
> ...
> $ jstest /dev/input/js1
> jstest: No such file or directory
> 
> After the change:
> $ jstest /dev/input/js0
> Joystick (Xin-Mo Xin-Mo Dual Arcade) has 2 axes (X, Y)
> ...
> $ jstest /dev/input/js1
> Joystick (Xin-Mo Xin-Mo Dual Arcade) has 2 axes (X, Y)
> ...
> 
> Signed-off-by: Michele Baldessari <mich...@acksyn.org>

Adding Oliver to CC.

Oliver, how come that you didn't need this while working on the inigial 
Xin-Mo Dual Arcade support?

Thanks.

> ---
>  drivers/hid/usbhid/hid-quirks.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
> index 1dff8f0015ba..f69049314a2c 100644
> --- a/drivers/hid/usbhid/hid-quirks.c
> +++ b/drivers/hid/usbhid/hid-quirks.c
> @@ -150,6 +150,7 @@ static const struct hid_blacklist {
>   { USB_VENDOR_ID_MULTIPLE_1781, USB_DEVICE_ID_RAPHNET_4NES4SNES_OLD, 
> HID_QUIRK_MULTI_INPUT },
>   { USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_2NES2SNES, 
> HID_QUIRK_MULTI_INPUT },
>   { USB_VENDOR_ID_DRACAL_RAPHNET, USB_DEVICE_ID_RAPHNET_4NES4SNES, 
> HID_QUIRK_MULTI_INPUT },
> + { USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE, 
> HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
>  
>   { 0, 0 }
>  };
> -- 
> 2.5.0
> 

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid-gfrm: Google Fiber TV Box remote controls

2015-10-22 Thread Jiri Kosina
On Wed, 21 Oct 2015, Petri Gynther wrote:

> Add HID driver for Google Fiber TV Box remote controls

I am not particularly happy with drvdata not being actually used "the 
usual way", i.e. to store a pointer, but apart from being unusual, I don't 
see a real issue with it.

Dmitry, as this depends on a patch queued in your tree, would you be okay 
with taking the patch with my signoff?

Thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] HID: wacom: Add support for Cintiq Companion 2

2015-10-21 Thread Jiri Kosina
On Tue, 13 Oct 2015, Jason Gerecke wrote:

> Adds support for the EMR (pen+pad) and touchscreen devices used by the
> Wacom Cintiq Companion 2. This applies both to using the device as a
> standalone system, as well as when operating in "Cintiq mode" (where
> the EMR/touchscreen are simply exposed as USB devices to the system
> its connected to).
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> Signed-off-by: Clifford Jolly <expiredpopsi...@gmail.com>
> ---
> Changes from v2:
>  * The switch in wacom_setup_pen_input_capabilities now only contains the
>first CINTIQ_COMPANION_2 case. The second case has been moved to the
>switch in wacom_setup_pad_input_capabilities where it belongs.
> 
>  * The second CINTIQ_COMPANION_2 case mentioned above no longer explicitly
>sets up the pad buttons since wacom_setup_numbered_buttons is now
>(70ee06c) in charge of this initialization.

Applied to for-4.4/wacom.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: wacom: Report full pressure range for Intuos, Cintiq 13HD Touch

2015-10-21 Thread Jiri Kosina
On Thu, 15 Oct 2015, Jason Gerecke wrote:

> The new Intuos tablets added in eda01da and the Cintiq 13HD Touch added
> in b4bf212 are capable of reporting 2048 levels of pressure. Although the
> kernel reports the correct range to userspace, an oversight has resulted
> in the driver ingoring the 11th pressure bit and only sending pressures
> of 0 through 1023.
> 
> We could fix this issue by expanding the type check to include these
> devices, but it makes much more sense to just have the driver look at
> the device's maximum pressure when determining if it should read the
> 11th bit.
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Applied to for-4.4/wacom.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes

2015-10-21 Thread Jiri Kosina
On Sat, 17 Oct 2015, Stefan Achatz wrote:

> Deprecates all Roccat sysfs attributes except the ones for the old Kone by 
> moving
> abi descriptions from testing to obsolete.
> For most devices everything can be done using the hidraw ioctls HIDIOCGFEATURE
> and HIDIOCSFEATURE, so I would suggest future removal of device specific 
> drivers.
> The userspace tools don't use these attributes for a year now.
> The first Kone is not fully HID-compliant and will still need a module.

Ok, I am queuing this in for-4.4/roccat-sysfs-deprecation, let's see how 
this goes.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] HID: wacom: Expect 'touch_max' touches if HID_DG_CONTACTCOUNT not present

2015-10-21 Thread Jiri Kosina
On Wed, 7 Oct 2015, Jason Gerecke wrote:

> When introduced in commit 1b5d514, the check 'if (hid_data->cc_index >= 0)'
> in 'wacom_wac_finger_pre_report' was intended to switch where the driver
> got the expected number of contacts from: HID_DG_CONTACTCOUNT if the usage
> was present, or 'touch_max' otherwise. Unfortunately, an oversight worthy
> of a brown paper bag (specifically, that 'cc_index' could never be negative)
> meant that the latter 'else' clause would never be entered.
> 
> The patch prior to this one introduced a way for 'cc_index' to be negative,
> but only if HID_DG_CONTACTCOUNT is present in some report _other_ than the
> one being processed. To ensure the 'else' clause is also entered for devices
> which don't have HID_DG_CONTACTCOUNT on _any_ report, we add the additional
> constraint that 'cc_report' be non-zero (which is true only if the usage is
> present in some report).
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> ---
> Jiri,
> 
> Could you please queue this patch and the prior for 4.3? They fix issues
> with the implementation of my "Ignore contacts in excess of declared
> contact count" patch which was pulled in as part of the 4.3 merge window.

Alright, I've applied this to for-4.3/upstream-fixes, but it's now very 
late in the cycle, so I am not 100% sure this patch will make it into 4.3. 
Hence I've added -stable annotation to it so that it's picked by first 
4.3-stable afterwards in such case.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] HID: fix some indenting issues

2015-10-21 Thread Jiri Kosina
On Sun, 11 Oct 2015, Jiri Slaby wrote:

> Some drivers indent some lines in a very weird manner. Fix that.
> 
> Signed-off-by: Jiri Slaby <jsl...@suse.cz>
> Cc: Josenivaldo Benito Junior <jrben...@benito.qsl.br>
> Cc: Franco Catrin <fcat...@gmail.com>
> Cc: Nikolai Kondrashov <spbn...@gmail.com>
> Cc: Don Prince <dhprince-de...@yahoo.co.uk>
> Cc: srinivas pandruvada <srinivas.pandruv...@intel.com>

Some of the are not really worth it per se, but the ones in 
aureal_report_fixup() and sensor_hub_*() are annoying enough to make the 
code harder to read, so I am applying it as a whole.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: reject input outside logical range only if null state is set

2015-10-21 Thread Jiri Kosina
On Tue, 13 Oct 2015, r...@nic.fi wrote:

> Kernel 3.19.0 one-line fix for an issue in drivers/hid/hid-input.c where USB
> HID control null state flag is not checked when rejecting inputs outside
> logical minimum-maximum range. The check should be made as per USB HID
> specification 1.11, section 6.2.2.5, p.31. I have no resources for large-scale
> testing, but this fixes problems with the game controller I have (INNEX NES
> Controller USB).
> 
> More details: https://bugzilla.kernel.org/show_bug.cgi?id=68621
> 
> 
> Signed-Off-by: Valtteri Heikkilä <r...@nic.fi>
> --- a/drivers/hid/hid-input.c 2015-05-25 09:58:49.743527141 +0800
> +++ b/drivers/hid/hid-input.c 2015-05-25 11:04:13.201191432 +0800
> @@ -1097,6 +1097,7 @@
> * don't specify logical min and max.
> */
> if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
> + (field->flags & HID_MAIN_ITEM_NULL_STATE) &&
> (field->logical_minimum < field->logical_maximum) &&
> (value < field->logical_minimum ||
> value > field->logical_maximum)) {

Your patch has been corrupted by your mailer badly. Please try to fix it 
(some hints are in Documentation/email-clients.txt) and resubmit.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: multitouch: Fetch feature reports on demand for Win8 devices

2015-10-11 Thread Jiri Kosina
On Wed, 7 Oct 2015, Mika Westerberg wrote:

> Some newer Intel Skylake based Dell laptops with Win8 precision touchpad
> fail when initial feature reports are fetched from it. Below is an example
> output with some additional debug included:
> 
>  i2c_hid i2c-DLL0704:01: Fetching the HID descriptor
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=20 00
>  i2c_hid i2c-DLL0704:01: HID Descriptor: 1e 00 00 01 99 02 21 00 24 ...
>  ...
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 38 02 23 00
>  i2c_hid i2c-DLL0704:01: report (len=4): 04 00 08 05
>  i2c_hid i2c-DLL0704:01: report id 13
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 3d 02 23 00
>  i2c_hid i2c-DLL0704:01: failed to retrieve report from device.
>  i2c_hid i2c-DLL0704:01: report id 7
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 37 02 23 00
>  i2c_hid i2c-DLL0704:01: report (len=259): 03 01 07 fc 28 fe 84 40 ...
>  i2c_hid i2c-DLL0704:01: report id 4
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 34 02 23 00
> 
> We manage to fetch few reports but then the touchpad dies:
> 
>  i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration
>  i2c_hid i2c-DLL0704:01: failed to retrieve report from device.
> 
> it eventually pulls the whole I2C bus low:
> 
>  i2c_designware i2c_designware.1: controller timed out
>  i2c_hid i2c-DLL0704:01: failed to set a report to device.
> 
> Fix this by preventing initial feature report retrieval for Win8 devices.
> Instead we fetch reports as needed in mt_feature_mapping(). This prevents
> fetching reports which might cause problems with the device in question.
> 
> Suggested-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com>
> Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>
> ---
> Added check for MT_CLS_WIN_8 so that the fix is only done for real Win8
> devices.

This is now in hid.git#for-4.4/multitouch. Thanks everybody,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: wacom: Add support for Cintiq Companion 2

2015-10-11 Thread Jiri Kosina
On Thu, 8 Oct 2015, Jason Gerecke wrote:

> Adds support for the EMR (pen+pad) and touchscreen devices used by the
> Wacom Cintiq Companion 2. This applies both to using the device as a
> standalone system, as well as when operating in "Cintiq mode" (where
> the EMR/touchscreen are simply exposed as USB devices to the system
> its connected to).
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
> Signed-off-by: Clifford Jolly <expiredpopsi...@gmail.com>
[ ... snip ... ]
> @@ -2290,6 +2311,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
> len)
>   case WACOM_27QHD:
>   case DTK:
>   case CINTIQ_HYBRID:
> + case CINTIQ_COMPANION_2:
>   sync = wacom_intuos_irq(wacom_wac);
>   break;

This doesn't make any sense. You break here out after handling 
CINTIQ_COMPANION_2 in features->type switch ...

>  
> @@ -2543,6 +2565,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev 
> *input_dev,
>   case CINTIQ:
>   case WACOM_13HD:
>   case CINTIQ_HYBRID:
> + case CINTIQ_COMPANION_2:
>   input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
>   input_abs_set_res(input_dev, ABS_Z, 287);
>   __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);

... here you break out of the switch case a few lines below again.


> @@ -2595,6 +2618,12 @@ int wacom_setup_pen_input_capabilities(struct 
> input_dev *input_dev,
>   __clear_bit(ABS_MISC, input_dev->absbit);
>   /* fall through */
>  
> + case CINTIQ_COMPANION_2:
> + for (i = 0; i < 10; i++)

Where do you define this 'i'?

> + __set_bit(BTN_0 + i, input_dev->keybit);
> +     __set_bit(BTN_A, input_dev->keybit);
> + break;
> +

And here you break out of the same case again explicitly again.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: multitouch: Fetch feature reports on demand for Win8 devices

2015-10-06 Thread Jiri Kosina
On Wed, 30 Sep 2015, Mika Westerberg wrote:

> > I would be in favor of applying the patch in its current shape, but if
> > Jiri thinks we need a little bit more caution here, we would need to add
> > a test regarding the Win8 capability here.
> 
> What about adding following on top of this patch? It checks the device
> in question belongs to "win8 class".
> 
> I can send a new version of the patch if this seems reasonable.

If this actually maintains the backwards compatibility for that particular 
device Benjamin mentioned (no idea what mtclass does it have?), I'd be in 
favor of doing that.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND] [PATCH] HID: quirks: add MULTI_INPUT quirk for Dragonrise GameCube adapter

2015-10-06 Thread Jiri Kosina
On Tue, 6 Oct 2015, Andrew Rodland wrote:

> This device (aka Mayflash GameCube Adapter) has 4 controller ports, and
> without the quirk they all become one very large joystock device. With the
> quirk they're recognized as 4 separate joysticks.
> 
> Signed-off-by: Andrew Rodland <and...@cleverdomain.org>

Sorry, the formatting is still damaged, please fix your client and resend 
the patch.

For some common ones, there are some hints in

Documentation/email-clients.txt

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-10-05 Thread Jiri Kosina
On Sat, 3 Oct 2015, Luis de Bethencourt wrote:

> > But I am not really sure where you are seeing the bug (mapping to 
> > -EPERM) in this case? I think the only caller of hiddev_connect() 
> > should be hid_connect(), and the only thing that guy cares about 
> > whether individual callbacks succeed or fail, so that it sets 
> > hdev->clamed flags accordingly.
> > 
> > Could you please be more specific about the -EPERM mapping you are 
> > talking about?
> > 
> I agree with you. The only caller of hiddev_connect() only checks if the
> callback succeded. It checks if the return < 0.
> What I meant is that -1 means -EPERM. [0]

I still don't understand what problem you are chasing here, sorry. EPERM 
is defined to be 1, yes. So are many other completely unrelated #defines.

> This patch is purely about the correctness of using -ENOMEM. The word 
> "propagated" was not the best way to describe this problem. I could edit 
> the commit message if you would like.

You seem to imply that someone might be interpreting that -1 as a define 
from errno.h. But that's not the case.

Are you going to look at every 'return -1' occurence in the kernel and 
convert it to something else? That can keep you busy for quite some time:

$ git grep 'return -1' | wc -l
9167

The only cleanup I'd imagine at least remotely possible in this case would 
be to convert the ->connect() callbacks return bool.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: quirks: add MULTI_INPUT quirk for Dragonrise GameCube adapter

2015-10-04 Thread Jiri Kosina
On Sat, 3 Oct 2015, Andrew Rodland wrote:

> This device (aka Mayflash GameCube Adapter) has 4 controller ports, and 
> without the quirk they all become one very large joystock device. With the 
> quirk they're recognized as 4 separate joysticks.
> 
> Signed-off-by: Andrew Rodland <and...@cleverdomain.org>

Andrew,

your patch has been corrupted by your mailer (line wrapped). Could you 
please fix this up on your side and resend?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbhid: Fix for the WiiU adapter from Mayflash

2015-10-04 Thread Jiri Kosina
On Sat, 3 Oct 2015, Felipe Balbi wrote:

> > The WiiU adapter from Mayflash (see 
> > http://www.mayflash.com/Products/NINTENDOWiiU/W009.html) is not 
> > working correctly.
> >
> > The "XInput" mode works fine, the controller is recognized as a xbox 
> > controller. But it is only possible to connect one controller with 
> > this method.
> >
> > In "DInput" mode the device is recognized as some kind of mouse input 
> > but no joystick is created. This commit will change this behavior with 
> > HID_QUIRK_MULTI_INPUT to split the device into 4 input devices so that 
> > it will also create joysticks in /dev/input/js*.
> >
> 
> Please split your commit log so that sentences don't go over 72
> characters.
> 
> Other than that:
> 
> Reviewed-by: Felipe Balbi <ba...@ti.com>

I've fixed up the formatting and applied to hid.git#for-4.3/upstream-fixes 
(please note that this doesn't guarantee that this patch will not go to 
4.3 still, because it alone is not going to be reason for pull request, 
but might eventually piggy-back on something that'll be needed for 4.3).

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND PATCH v3 1/1] Add Corsair Vengeance K90 driver

2015-09-30 Thread Jiri Kosina
On Wed, 30 Sep 2015, Clément Vuchener wrote:

> This patch implements a HID driver for the Corsair Vengeance K90 keyboard.
> 
> It fixes the behaviour of the keys using incorrect HID usage codes and 
> exposes the macro playback mode and current profile to the user space 
> through sysfs attributes. It also adds two LED class devices controlling 
> the "record" LED and the backlight.
> 
> Signed-off-by: Clément Vuchener <clement.vuche...@gmail.com>
[ ... snip ... ]
> +struct k90_led {
> + struct led_classdev cdev;
> + int brightness;
> + struct work_struct work;
> + int removed;

This could be made bool.

Also the patch subject doesn't really follow the usual format we're using 
in hid.git.

Otherwise I like the code, thanks a lot for working on the driver. I have 
fixed the nits above and it's now queued in hid.git#for-4.4/corsair.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: hid-input: allow input_configured callback return errors

2015-09-30 Thread Jiri Kosina
On Tue, 29 Sep 2015, Dmitry Torokhov wrote:

> When configuring input device via input_configured callback we may
> encounter errors (for example input_mt_init_slots() may fail). Instead
> of continuing with half-initialized input device let's allow driver
> indicate failures.

Applied to hid.git#for-4.4/upstream, thanks Dmitry.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: hid-multitouch.c: fix formatting warnings

2015-09-30 Thread Jiri Kosina
On Tue, 29 Sep 2015, Brent Adam wrote:

> >> Fixed the following checkpatch.pl warnings:
> >> WARNING: line over 80 characters: line 163
> >> WARNING: Missing a blank line after declarations: line 359
> >> WARNING: Missing a blank line after declarations: line 572
> >> WARNING: Missing a blank line after declarations: line 708
> >> WARNING: Missing a blank line after declarations: line 926
> >> WARNING: Possible unnecessary 'out of memory' message: line 1034
> >> WARNING: Possible unnecessary 'out of memory' message: line 1048
> >> WARNING: line over 80 characters: line 1390
> >
> >For files which are already in tree I'd be taking such fixes only as a 
> >side-change if refactoring the code anyway in a substantial way. Otherwise 
> >I consider the ones below too minor to justify cluttering of git blame.
> 
> Ok, although Greg Kroah-Hartman inspires you in his video to submit patches
> to make the code checkpatch clean. https://www.youtube.com/watch?v=LLBrBBImJt4

HID is not a subsystem residing in drivers/staging playground though.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbhid: Fix lockdep unannotated irqs-off warning

2015-09-30 Thread Jiri Kosina
On Wed, 30 Sep 2015, Sedat Dilek wrote:

> > diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> > index 36712e9..aaae42e 100644
> > --- a/drivers/hid/usbhid/hid-core.c
> > +++ b/drivers/hid/usbhid/hid-core.c
> > @@ -38,6 +38,8 @@
> >  #include 
> >  #include "usbhid.h"
> >
> > +#include 
> > +
> >  /*
> >   * Version Information
> >   */
> > @@ -725,6 +727,9 @@ void usbhid_close(struct hid_device *hid)
> >
> > mutex_lock(_open_mut);
> >
> > +   if(WARN_ON(irqs_disabled()))
> > +   print_irqtrace_events(current);
> > +
> > /* protecting hid->open to make sure we don't restart
> >  * data acquistion due to a resumption we no longer
> >  * care about
> >
> > --
> 
> "-7" CLANG-compiled and "-8" GCC-compiled.

So, my warning didn't trigger in neither of the kernels. That directly 
implies that usbbhid_close() is being called with IRQs enabled, and 
therefore once it calls hid_cancel_delayed_stuff(), they are enabled 
again. That makes the previous warnings invalid, and I would dare to blame 
compiler on that.

Now, in this case, clang apparently got it right (because the original 
warning didn't trigger) in usbhid_close(), but moved the bug elsewhere 
somehow. Now the warning looks like this:

>  BUG: sleeping function called from invalid context at kernel/workqueue.c:2678
>  in_atomic(): 0, irqs_disabled(): 1, pid: 1474, name: acpid

So again, IRQs disabled.

>  3 locks held by acpid/1474:
>   #0:  (>mutex){+.+...}, at: [] 
> evdev_release+0xbc/0xf0
>   #1:  (>mutex#2){+.+...}, at: [] 
> input_close_device+0x27/0x70
>   #2:  (hid_open_mut){+.+...}, at: [] 
> usbhid_close+0x28/0xf0 [usbhid]

No spinlock held, so all _irqsave() / _irqrestore() pairs have been 
executed.

>  irq event stamp: 3332
>  hardirqs last  enabled at (3331): [] 
> _raw_spin_unlock_irq+0x32/0x60
>  hardirqs last disabled at (3332): [] 
> del_timer_sync+0x37/0x110

del_timer_sync() is being blamed to be the one leaking IRQs disabled. The 
only two things that this function does (even if you look at all functions 
that could be potentially inlined into it) wrt. IRQs are

(1)local_irq_save(flags);
   lock_map_acquire(>lockdep_map);
   lock_map_release(>lockdep_map);
   local_irq_restore(flags);

(2)lock_timer_base() calls spin_lock_irqsave() and 
   spin_unlock_irqrestore() in pairs in a loop, but it's 
   guaranteed to return with IRQs disabled, and corresponding 
   spin_unlock_irqrestore() is then perfomed in the callee 
   (try_to_del_timer_sync())

In either case, there is no IRQ state leakage. Therefore I would dare to 
blame compiler on getting it wrong here as well.

The generated assembly really needs to be inspected to see how does clang 
manage to leak the IRQ state (probably some incorrect reordering, i.e. not 
respecting the "memory" clobber while fiddling with flags).

[ ... snip a lot of stuff ... ]
> What shall I do... play with lockdep (print_irqtrace_events) in
> del_timer_sync()?

I'd suggest showing this to clang folks.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Jiri Kosina
On Wed, 30 Sep 2015, Luis de Bethencourt wrote:

> The driver is using -1 instead of the -ENOMEM defined macro to specify
> that a buffer allocation failed. Since the error number is propagated,
> the caller will get a -EPERM which is the wrong error condition.

Generally I agree that the more specific errno, the better.

But I am not really sure where you are seeing the bug (mapping to -EPERM) 
in this case? I think the only caller of hiddev_connect() should be 
hid_connect(), and the only thing that guy cares about whether individual 
callbacks succeed or fail, so that it sets hdev->clamed flags accordingly.

Could you please be more specific about the -EPERM mapping you are talking 
about?

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: hid-multitouch.c: fix formatting warnings

2015-09-29 Thread Jiri Kosina
On Mon, 28 Sep 2015, Brent Adam wrote:

> Fixed the following checkpatch.pl warnings:
> WARNING: line over 80 characters: line 163
> WARNING: Missing a blank line after declarations: line 359
> WARNING: Missing a blank line after declarations: line 572
> WARNING: Missing a blank line after declarations: line 708
> WARNING: Missing a blank line after declarations: line 926
> WARNING: Possible unnecessary 'out of memory' message: line 1034
> WARNING: Possible unnecessary 'out of memory' message: line 1048
> WARNING: line over 80 characters: line 1390

For files which are already in tree I'd be taking such fixes only as a 
side-change if refactoring the code anyway in a substantial way. Otherwise 
I consider the ones below too minor to justify cluttering of git blame.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: multitouch: Add suffix for HID_DG_TOUCHPAD

2015-09-29 Thread Jiri Kosina
On Mon, 28 Sep 2015, Mika Westerberg wrote:

> Instead of printing "UNKNOWN" as device suffix for HID_DG_TOUCHPAD call
> the device as "Touchpad".
> 
> Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>

Applied to hid.git#for-4.4/multitouch.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] HID: i2c-hid: Fill in physical device providing HID functionality

2015-09-29 Thread Jiri Kosina
On Mon, 28 Sep 2015, Mika Westerberg wrote:

> Currently hid_connect() prints out following when I2C connected HID devices
> is connected:
> 
>   hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
> 
> After "on " should read physical device name but it is left empty by the
> driver.
> 
> Make it look better and fill in the physical device name.
> 
> Signed-off-by: Mika Westerberg <mika.westerb...@linux.intel.com>

Applied to hid.git#for-4.4/i2c-hid.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbhid: Fix lockdep unannotated irqs-off warning

2015-09-28 Thread Jiri Kosina
On Mon, 28 Sep 2015, Sedat Dilek wrote:

> When compiling Linux v4.2+ and v4.3-rc2+ with a llvmlinux patchset
> and CLANG v3.7 I see a BUG line like this:
> 
> [   24.705463] BUG: sleeping function called from invalid context at 
> kernel/workqueue.c:2680
> [   24.705576] in_atomic(): 0, irqs_disabled(): 1, pid: 1447, name: acpid
> 
> After some vital help from workqueue and hid folks it turned out to be
> a problem in the hid area.
> 
> Jiri encouraged me to look into del_timer-sync()/cancel_work_sync().
> So, I disassembled kernel/time/timer.o.
> This looked good.
> 
> Both functions are called in hid_cancel_delayed_stuff().

Yeah, but we're enabling IRQs before calling hid_cancel_delayed_stuff() 
(or, to be more precise, we're restoring original flags, and I don't see 
usbhid_close() being called with IRQs off).

Therefore ...

[ ... snip ... ]
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 36712e9f56c2..188f59348ec5 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -729,16 +729,16 @@ void usbhid_close(struct hid_device *hid)
>* data acquistion due to a resumption we no longer
>* care about
>*/
> - spin_lock_irq(>lock);
> + spin_lock_bh(>lock);
>   if (!--hid->open) {
> - spin_unlock_irq(>lock);
> + spin_unlock_bh(>lock);
>   hid_cancel_delayed_stuff(usbhid);

I still don't understand how this should be improving anything. I believe 
spin_unlock_irq() should just re-enable interrupts, because we've been 
called with them enabled as well.

Now if you are able to see how usbhid_close() can be called with IRQs 
off, that would be a completely different story. But if that's not the 
case, the warning is bogus, and gcc-compiled kernels are right about not 
issuing it.

But without that, I so far fail to see how this is a correct thing to do.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: enable hid device to suspend/resume asynchronously

2015-09-25 Thread Jiri Kosina
On Thu, 24 Sep 2015, Fu, Zhonghui wrote:

> >> Enable hid device to suspend/resume asynchronously. This can improve
> >> system suspend/resume speed.
> > How well was this tested?
> >
> > Power management is notorious for not being really in excellent shape on 
> > many HID devices.
> >
> > So I'd like to be careful.
> I were on leave these days, so sorry for late reply.
> 
> This can reduce system suspend/resume time about 20ms, from 1030ms to 
> 1010ms on ASUS T100TA machine. Although the improvement is not very 
> significant, but this can let your parent/child device suspend/resume 
> more asynchronously and take advantage of multicore to improve overall 
> system suspend/resume speed.
> 
> I have resent this patch with updated commit message - "[PATCH v2] hid: 
> enable hid device to suspend/resume asynchronously".

Is there any reason why not enable this from userspace via sysfs instead, 
based on whitelist on known-to-be-well-behaved devices, from udev?

I am really careful when it comes to enabling features like this 
(especially given the state of PM support on some low-end devices) 
globally.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid-core: Avoid uninitialized buffer access

2015-09-23 Thread Jiri Kosina
On Fri, 18 Sep 2015, Darren Hart wrote:

> From: Richard Purdie <richard.pur...@linuxfoundation.org>
> 
> hid_connect adds various strings to the buffer but they're all
> conditional. You can find circumstances where nothing would be written
> to it but the kernel will still print the supposedly empty buffer with
> printk. This leads to corruption on the console/in the logs.
> 
> Ensure buf is initialized to an empty string.
> 
> Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
> [dvhart: Initialize string to "" rather than assign buf[0] = NULL;]
> Cc: Jiri Kosina <ji...@kernel.org>
> Cc: linux-input@vger.kernel.org
> Cc: sta...@vger.kernel.org
> Signed-off-by: Darren Hart <dvh...@linux.intel.com>
> ---
>  drivers/hid/hid-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 70a11ac..c0fbf4e 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1611,7 +1611,7 @@ int hid_connect(struct hid_device *hdev, unsigned int 
> connect_mask)
>   "Multi-Axis Controller"
>   };
>   const char *type, *bus;
> - char buf[64];
> + char buf[64] = "";
>   unsigned int i;
>   int len;
>   int ret;

Applied to hid.git#for-4.3/upstream-fixes.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] HID: wacom: Add four new Intuos devices

2015-09-23 Thread Jiri Kosina
On Wed, 23 Sep 2015, Ping Cheng wrote:

> Signed-off-by: Ping Cheng <pi...@wacom.com>
> Tested-By: Aaron Skomra <aaron.sko...@wacom.com>

Please insert a changelog here. At least explanation why these are not 
just a simple a device ID additions, but actual code changes are 
necessary, is needed.

Thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] HID: wacom: Cleanup unsupported device_type for BAMBOO_PT

2015-09-23 Thread Jiri Kosina
On Wed, 23 Sep 2015, Ping Cheng wrote:

> Not all Bamboo support both pen and touch. Make sure we deal with
> pen only and touch only devices properly.
> 
> Signed-off-by: Ping Cheng <pi...@wacom.com>
> Tested-By: Aaron Skomra <aaron.sko...@wacom.com>

Both patches queued in hid.git#for-4.4/wacom.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] drivers/hid: Check result of debugfs_create_dir() and debugfs_create_file()

2015-09-23 Thread Jiri Kosina
On Fri, 4 Sep 2015, Alexander Kuleshov wrote:

> The debugfs_create_dir() and debugfs_create_file() functions may return -errno
> if an error occurs. This patch adds a couple of checks of the result of the
> debufs_create_dir() and debugfs_create_file() functions execution in the
> hid_debug_register() and othre places.
> 
> Signed-off-by: Alexander Kuleshov <kuleshovm...@gmail.com>
> ---
> Changelog:
> 
> v4:
> 
>   * Syntax error fixed.
> 
> v3:
> 
>   * do not check hid_debug before the call of the hid_debug_init()
> and hid_debug_exit() from v2.
> 
> v2:
> 
>   * add check for the result of the debugfs_create_file() calls
>   * call hid_debug_init() and hid_debug_exit() only if hid_debug
>   * add check for the hid_debug_root in the hid_debug_register()
> 
>  drivers/hid/hid-core.c  |  9 ++---
>  drivers/hid/hid-debug.c | 34 +-
>  2 files changed, 39 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index e6fce23..fea2a88 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2599,8 +2599,10 @@ int hid_add_device(struct hid_device *hdev)
>   ret = device_add(>dev);
>   if (!ret)
>   hdev->status |= HID_STAT_ADDED;
> - else
> - hid_debug_unregister(hdev);
> + else {
> + if (hdev->debug)
> + hid_debug_unregister(hdev);
> + }
>  
>   return ret;
>  }
> @@ -2644,7 +2646,8 @@ static void hid_remove_device(struct hid_device *hdev)
>  {
>   if (hdev->status & HID_STAT_ADDED) {
>   device_del(>dev);
> - hid_debug_unregister(hdev);
> + if (hdev->debug)
> + hid_debug_unregister(hdev);

As we are sprinkling these checks around, and hid_debug_unregister() is a 
slow path anyway, I think I'll just rearrange the code that 
hid_debug_unregister() actually accepts NULL pointer.

Applied, thanks for the cleanup.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND v2] HID: Add new Microsoft Type Cover 3 product ID

2015-09-23 Thread Jiri Kosina
On Tue, 15 Sep 2015, Donavan Lance wrote:

> Adds support for Microsoft Type Cover 3 with 0x07e2 product ID.
> 
> Signed-off-by: Donavan Lance <s...@fedoraproject.org>

Queued in hid.git#for-4.4/microsoft. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: Make I2C a known bus in hid_connect()

2015-09-23 Thread Jiri Kosina
On Thu, 17 Sep 2015, Daniel Martin wrote:

> Just to prettify the log message. Otherwise it would be .
> 
> Signed-off-by: Daniel Martin <consume.no...@gmail.com>

Applied to hid.git#for-4.4/upstream, thanks.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] hid: enable hid device to suspend/resume asynchronously

2015-09-04 Thread Jiri Kosina
On Mon, 17 Aug 2015, Fu, Zhonghui wrote:

> Enable hid device to suspend/resume asynchronously. This can improve
> system suspend/resume speed.

How well was this tested?

Power management is notorious for not being really in excellent shape on 
many HID devices.

So I'd like to be careful.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/2] HID: logitech-hidpp: allow to disable tap to click on the K400

2015-09-04 Thread Jiri Kosina
On Thu, 3 Sep 2015, Benjamin Tissoires wrote:

> Hi guys,
> 
> This series adds a new parameter for the K400 owners. This keyboard has an
> embedded touchpad which defaults to report tap to click. It can be annoying
> given that there are physical buttons, and we can just disable that from the
> host by using the feature 0x6010.
> 
> The first patch might conflict with Simon's current work in progress, so
> that's why Simon is CC-ed to it.

Now in for-4.4/logitech. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] drivers/hid: Check result of debugfs_create_dir() and debugfs_create_file()

2015-09-04 Thread Jiri Kosina
On Thu, 20 Aug 2015, Alexander Kuleshov wrote:

> The debugfs_create_dir() and debugfs_create_file() functions may return -errno
> if an error occurs. This patch adds a couple of checks of the result of the
> debufs_create_dir() and debugfs_create_file() functions execution in the
> hid_debug_register() and othre places.
> 
> Changelog:
> 
> v3:
> 
>   * do not check hid_debug before the call of the hid_debug_init()
> and hid_debug_exit() from v2
> 
> v2:
> 
>   * add check for the result of the debugfs_create_file() calls
>   * call hid_debug_init() and hid_debug_exit() only if hid_debug
>   * add check for the hid_debug_root in the hid_debug_register()
> 
> Signed-off-by: Alexander Kuleshov <kuleshovm...@gmail.com>

Did you try to even compile-test your patch?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4.2] hid_dr: Fixed HID Descriptor

2015-09-04 Thread Jiri Kosina
On Thu, 3 Sep 2015, Maciej Zuk wrote:

> From: Maciej Zuk <gzm...@gmail.com>
> 
> Fixed HID descriptor for DragonRise Joystick.
> Replaced default descriptor which doubles Z axis 
> and causes mixing values of X and Z axes.

Applied to for-4.4/dragonrise.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] Corsair Vengeance K90 driver

2015-09-04 Thread Jiri Kosina
pe(usbdev, 0),
> +   K90_REQUEST_STATUS,
> +   USB_DIR_IN | USB_TYPE_VENDOR |
> +   USB_RECIP_DEVICE, 0, 0, data, 8,
> +   USB_CTRL_SET_TIMEOUT);

So you apparently also depend on USB ...

> + if (ret < 0) {
> + hid_warn(dev, "Failed to get K90 initial state (error %d).\n",
> +  ret);
> + drvdata->backlight.brightness = 0;
> + drvdata->current_profile = 1;
> + } else {
> + drvdata->backlight.brightness = data[4];
> + drvdata->current_profile = data[7];
> + }
> + /* Get current mode */
> + ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
> +   K90_REQUEST_GET_MODE,
> +   USB_DIR_IN | USB_TYPE_VENDOR |
> +   USB_RECIP_DEVICE, 0, 0, data, 2,
> +   USB_CTRL_SET_TIMEOUT);
> + if (ret < 0)
> + hid_warn(dev, "Failed to get K90 initial mode (error %d).\n",
> +  ret);
> + else {
> + switch (data[0]) {
> + case K90_MACRO_MODE_HW:
> + drvdata->macro_mode = 1;
> + break;
> + case K90_MACRO_MODE_SW:
> + drvdata->macro_mode = 0;
> + break;
> + default:
> + hid_warn(dev, "K90 in unknown mode: %02x.\n",
> +  data[0]);
> + }
> + }
> +
> + /* Init LED device for backlight */
> + name_sz =
> + strlen(dev_name(>dev)) + sizeof(K90_BACKLIGHT_LED_SUFFIX);
> + name = devm_kzalloc(>dev, name_sz, GFP_KERNEL);
> + if (!name) {
> + ret = -ENOMEM;
> + goto fail_backlight;
> + }
> + snprintf(name, name_sz, "%s" K90_BACKLIGHT_LED_SUFFIX,
> +  dev_name(>dev));
> + led = >backlight;
> + led->cdev.name = name;
> + led->cdev.max_brightness = 3;
> + led->cdev.brightness_set = k90_brightness_set;
> + led->cdev.brightness_get = k90_brightness_get;
> + INIT_WORK(>work, k90_backlight_work);
> + ret = led_classdev_register(>dev, >cdev);

... and also on LED subsystem, but this dependency is not expressed in 
Kconfig.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: mode button quirk for Mad Catz R.A.T.5

2015-09-04 Thread Jiri Kosina
On Thu, 3 Sep 2015, Harald Brinkmann wrote:

> Hi all,
> 
> this patch applies to Linux 4.2.0.
> 
> It enables the Saitek HID quirk for the mode button
> of the Mad Catz R.A.T.5 gaming mouse.
> 
> Signed-off-by: Harald Brinkmann <hbrinkm...@braincalibration.de>

Applied to for-4.4/upstream. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1] HID: sensor-hub: Fixup for Lenovo ThinkPad Helix 2 sensor hub report

2015-09-04 Thread Jiri Kosina
On Thu, 3 Sep 2015, Srinivas Pandruvada wrote:

> On Thu, 2015-09-03 at 12:56 -0300, Fernando D S Lima wrote:
> > There is an error in the report descriptor of the Thinkpad Helix 2 
> > where
> > logical minimum value (557376) is greater than logical maximum 
> > (491200)
> > for all of the magnetic flux axis data fields. This error results in 
> > a
> > report descriptor parsing failure that causes the sensors attached to 
> > the
> > hub not to be detected.
> > 
> > dmesg excerpt:
> > [   19.866905] drivers/hid/hid-core.c: logical range invalid 0x88140 
> > 0x77ec0
> > [   19.866914] hid-sensor-hub 0018:2047:0855.0007: item 0 1 0 8 
> > parsing failed
> > [   19.866926] hid-sensor-hub 0018:2047:0855.0007: parse failed
> > [   19.866933] hid-sensor-hub: probe of 0018:2047:0855.0007 failed 
> > with error -22
> > 
> > Add a report fixup to change magnetic flux logical minimums to 
> > -557376
> > for the parsing to succeed and the sensors to get detected.
> > After applying the fix the sensors get detected, with corresponding 
> > drivers
> > (hid-accel-3d,hid-gyro-3d,etc) loaded, and its possible to read their 
> > values.
> > 
> > Signed-off-by: Fernando D S Lima <fernando...@gmail.com>
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruv...@linux.intel.com>

Applied to for-4.3/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] HID: wacom: Set button bits based on a new numbered_buttons

2015-08-28 Thread Jiri Kosina
On Thu, 20 Aug 2015, Aaron Skomra wrote:

 Prior to this commit, numbered button bit setting was done separately
 for each device type in wacom_setup_pad_capabilities(). Here we add a
 numbered_buttons property to the wacom_features struct and extract the
 repeated bit setting code to a new function:
 wacom_settup_numbered_buttons().
 
 Signed-off-by: Aaron Skomra aaron.sko...@wacom.com
 Reviewed-by: Jason Gerecke jason.gere...@wacom.com
 ---
  drivers/hid/wacom_wac.c | 175 
 +---
  drivers/hid/wacom_wac.h |   1 +
  2 files changed, 61 insertions(+), 115 deletions(-)
 
 diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
 index baba9a0..a19aeae 100644
 --- a/drivers/hid/wacom_wac.c
 +++ b/drivers/hid/wacom_wac.c
 @@ -2513,11 +2513,23 @@ int wacom_setup_touch_input_capabilities(struct 
 input_dev *input_dev,
   return 0;
  }
  
 +void wacom_setup_numbered_buttons(struct input_dev *input_dev,

I made this static, and applied both patches. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: quirks: add QUIRK_NOGET for an other TPV touchscreen

2015-08-24 Thread Jiri Kosina
On Fri, 21 Aug 2015, Benjamin Tissoires wrote:

 Looks like 0x8882 needs the same quirk than 0x8883.
 Given that both devices claim they are TPV OpticalTouchScreen rename
 the 0x8883 to add its PID in the #define.
 
 Reported-by: Blaine Lee blaine.j@medtronic.com
 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@redhat.com

Applied to for-4.3/upstream. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] drivers/hid: Check result of debugfs_create_dir() and debugfs_create_file()

2015-08-19 Thread Jiri Kosina
On Wed, 19 Aug 2015, Alexander Kuleshov wrote:

 The debugfs_create_dir() and debugfs_create_file() functions may return -errno
 if an error occurs. This patch adds a couple of checks of the result of the
 debufs_create_dir() and debugfs_create_file() functions execution in the
 hid_debug_register() and othre places.
 
 Changelog:
 
 v2:
 
   * add check for the result of the debugfs_create_file() calls
   * call hid_debug_init() and hid_debug_exit() only if hid_debug
   * add check for the hid_debug_root in the hid_debug_register()
 
 Signed-off-by: Alexander Kuleshov kuleshovm...@gmail.com
 ---
  drivers/hid/hid-core.c  | 15 ++-
  drivers/hid/hid-debug.c | 38 ++
  2 files changed, 44 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
 index e6fce23..8aa2c20 100644
 --- a/drivers/hid/hid-core.c
 +++ b/drivers/hid/hid-core.c
 @@ -2599,8 +2599,10 @@ int hid_add_device(struct hid_device *hdev)
   ret = device_add(hdev-dev);
   if (!ret)
   hdev-status |= HID_STAT_ADDED;
 - else
 - hid_debug_unregister(hdev);
 + else {
 + if (hdev-debug)
 + hid_debug_unregister(hdev);
 + }
  
   return ret;
  }
 @@ -2644,7 +2646,8 @@ static void hid_remove_device(struct hid_device *hdev)
  {
   if (hdev-status  HID_STAT_ADDED) {
   device_del(hdev-dev);
 - hid_debug_unregister(hdev);
 + if (hdev-debug)
 + hid_debug_unregister(hdev);
   hdev-status = ~HID_STAT_ADDED;
   }
   kfree(hdev-dev_rdesc);
 @@ -2737,7 +2740,8 @@ static int __init hid_init(void)
   if (ret)
   goto err_bus;
  
 - hid_debug_init();
 + if (hid_debug)
 + hid_debug_init();

How is this change related to the rest of the patch?

It's wrong anyway, because hid_debug is independent of the debugfs HID 
debugging facility. Please see for example the printk() a few lines above 
in this very function, which is emited in case hid_debug is enabled.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: gembird: add new driver to fix Gembird JPD-DualForce 2

2015-08-18 Thread Jiri Kosina
On Thu, 13 Aug 2015, Benjamin Tissoires wrote:

 This gamepad advertise 5 absolute axis while 4 are actually used.
 The second Z axis shows some garbage, so it has to be ignored by HID.
 The first Z axis and the Rz one are actually Rx and Ry. Remap them.
 
 We could also just remap and ignore the axis in .input_mapping(). I
 went ahead with .report_fixup() first, so here it is.
 
 Reported-by: Orivej Desh ori...@gmx.fr
 Tested-by: Orivej Desh ori...@gmx.fr
 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@redhat.com

Applied to for-4.3/gembird.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drivers/hid: Fix debugfs_create_dir's error checking method for hid-core

2015-08-18 Thread Jiri Kosina
On Sat, 15 Aug 2015, Alexander Kuleshov wrote:

 The debugfs_create_dir() function returns NULL if an error occurs. This patch
 adds check of the result of the debufs_create_dir() execution in the
 hid_debug_register().
 
 Signed-off-by: Alexander Kuleshov kuleshovm...@gmail.com
 ---
  drivers/hid/hid-core.c  | 6 --
  drivers/hid/hid-debug.c | 3 +++
  2 files changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
 index e6fce23..315a980 100644
 --- a/drivers/hid/hid-core.c
 +++ b/drivers/hid/hid-core.c
 @@ -2599,8 +2599,10 @@ int hid_add_device(struct hid_device *hdev)
   ret = device_add(hdev-dev);
   if (!ret)
   hdev-status |= HID_STAT_ADDED;
 - else
 - hid_debug_unregister(hdev);
 + else {
 + if (hdev-debug_dir)
 + hid_debug_unregister(hdev);
 + }
  
   return ret;
  }
 diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
 index 2886b64..80fa03d 100644
 --- a/drivers/hid/hid-debug.c
 +++ b/drivers/hid/hid-debug.c
 @@ -1223,6 +1223,9 @@ static const struct file_operations 
 hid_debug_events_fops = {
  void hid_debug_register(struct hid_device *hdev, const char *name)
  {
   hdev-debug_dir = debugfs_create_dir(name, hid_debug_root);
 + if (!hdev-debug_dir)
 + return -ENOMEM;
 +

What sense does it make to return -ENOMEM from void function?

   hdev-debug_rdesc = debugfs_create_file(rdesc, 0400,
   hdev-debug_dir, hdev, hid_debug_rdesc_fops);
   hdev-debug_events = debugfs_create_file(events, 0400,

Fixing this is ultimately a good thing, but why did you just pick 
debugfs_create_dir() and left the other, with the same issue 
(debugfs_create_file()) intact?

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: wacom: Use tablet-provided touch height/width values for INTUOSHT

2015-08-18 Thread Jiri Kosina
On Mon, 17 Aug 2015, Jason Gerecke wrote:

 The current generation of Intuos tablets (i.e. INTUOSHT) report touch
 width and height data just like the Intuos Pro do. This commit changes
 the code to allow these tablets to use the appropriate codepath instead
 of the one intended for Intuos5/Bamboo.
 
 Signed-off-by: Jason Gerecke jason.gere...@wacom.com

Applied to for-4.3/wacom.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] HID: i2c-hid: Only disable irq wake if it was successfully enabled during suspend

2015-08-18 Thread Jiri Kosina
On Thu, 30 Jul 2015, Andrew Duggan wrote:

 Enabling irq wake could potentially fail and calling disable_irq_wake
 after a failed call to enable_irq_wake could result in an unbalanced irq
 warning. This patch warns if enable_irq_wake fails and avoids other
 potential issues caused by calling disable_irq_wake on resume after
 enable_irq_wake failed during suspend.
 
 Signed-off-by: Andrew Duggan adug...@synaptics.com
 ---
 This patch is based on Jiri's for-4.3/i2c-hid and needs Gabriele Mazzotta's
 patch which moves where the HID driver's suspend callback call to apply
 cleanly.

Applied to for-4.3/i2c-hid. Thanks,

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] HID: lenovo: Improve wheel emulation

2015-08-12 Thread Jiri Kosina
On Tue, 11 Aug 2015, Jamie Lentin wrote:

 A collection of unrelated patches to improve support for the Thinkpad
 compact keyboards. The first 2 are just cleanup patches.
 
 The final patch alters the behaviour of the middle button so userspace
 either gets wheel events or a button click, not both. This stops
 browsers opening a link in a new tab as well as scrolling, for example.
 
 This means you can no longer long-middle-click, but I don't think this
 is likely to upset users as much as the current behaviour.

Makes sense. Let's see whether we receive any complaints about it (I don't 
expect that).

Applied to for-4.3/lenovo.

-- 
Jiri Kosina
SUSE Labs

--
To unsubscribe from this list: send the line unsubscribe linux-input in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   5   6   7   8   9   10   >