From: Jason Gerecke <killertofu@gmail.com>
To: Ping Cheng <pinglinux@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
linux-input <linux-input@vger.kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH 1/7] HID: wacom: Move handling of Intuos status packets to seperate function
Date: Tue, 10 Mar 2015 09:22:46 -0700 [thread overview]
Message-ID: <54FF1A56.5000809@gmail.com> (raw)
In-Reply-To: <CAF8JNh+GiqBTWZsPsPi9QgQiVJs5EO0f0ADCL_qEn3O4SwutbQ@mail.gmail.com>
On 3/9/2015 6:31 PM, Ping Cheng wrote:
> On Fri, Mar 6, 2015 at 11:47 AM, Jason Gerecke <killertofu@gmail.com> wrote:
>> In addition to the touchswitch state for "Intuos", these packets are
>> also sent by the Intuos Pro, Intuos5, and last-generation Bamboo
>> tablets when using a wired connection. They contain, among other
>> things, information about the optional wireless module and battery
>> charge state (to be supported in subsuquent patches).
>>
>> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
>> ---
>> drivers/hid/wacom_wac.c | 36 +++++++++++++++++++++++-------------
>> drivers/hid/wacom_wac.h | 1 +
>> 2 files changed, 24 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
>> index bbf72f9..cb308c5 100644
>> --- a/drivers/hid/wacom_wac.c
>> +++ b/drivers/hid/wacom_wac.c
>> @@ -1740,20 +1740,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
>> unsigned char *data = wacom->data;
>> int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
>>
>> - if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
>> + if (data[0] != WACOM_REPORT_PENABLED)
>> return 0;
>>
>> - if (data[0] == WACOM_REPORT_USB) {
>> - if (features->type == INTUOSHT &&
>> - wacom->shared->touch_input &&
>> - features->touch_max) {
>> - input_report_switch(wacom->shared->touch_input,
>> - SW_MUTE_DEVICE, data[8] & 0x40);
>> - input_sync(wacom->shared->touch_input);
>> - }
>> - return 0;
>> - }
>> -
>> prox = (data[1] & 0x20) == 0x20;
>>
>> /*
>> @@ -1960,6 +1949,24 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
>> return 0;
>> }
>>
>> +static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
>> +{
>> + struct wacom_features *features = &wacom_wac->features;
>> + unsigned char *data = wacom_wac->data;
>> +
>> + if (data[0] != WACOM_REPORT_USB)
>> + return 0;
>> +
>> + if (features->type == INTUOSHT &&
>> + wacom_wac->shared->touch_input &&
>> + features->touch_max) {
>> + input_report_switch(wacom_wac->shared->touch_input,
>> + SW_MUTE_DEVICE, data[8] & 0x40);
>> + input_sync(wacom_wac->shared->touch_input);
>> + }
>> + return 0;
>> +}
>> +
>> void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
>> {
>> bool sync;
>> @@ -2044,7 +2051,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
>>
>> case BAMBOO_PT:
>> case INTUOSHT:
>> - sync = wacom_bpt_irq(wacom_wac, len);
>> + if (wacom_wac->data[0] == WACOM_REPORT_USB)
>> + sync = wacom_status_irq(wacom_wac, len);
>> + else
>> + sync = wacom_bpt_irq(wacom_wac, len);
>> break;
>>
>> case BAMBOO_PAD:
>> diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
>> index a3d0828..ee6a545 100644
>> --- a/drivers/hid/wacom_wac.h
>> +++ b/drivers/hid/wacom_wac.h
>> @@ -71,6 +71,7 @@
>> #define WACOM_REPORT_USB 192
>> #define WACOM_REPORT_BPAD_PEN 3
>> #define WACOM_REPORT_BPAD_TOUCH 16
>> +#define WACOM_PKGLEN_STATUS 10
>
> I don't see anywhere else WACOM_PKGLEN_STATUS is used. Do I miss something?
>
Good catch. That's leftover cruft from an earlier revision which is not
necessary anymore. I'll resubmit this patch with the hunk removed.
> Except that, the patchset looks good.
>
> Acked-by: Ping Cheng <pinbgc@wacom.com>
>
> Ping
>
Speaking of small mistakes... s/pinbgc/pingc/ :)
--
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
>> /* device quirks */
>> #define WACOM_QUIRK_MULTI_INPUT 0x0001
>> --
>> 2.3.0
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-10 16:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 19:47 [PATCH 1/7] HID: wacom: Move handling of Intuos status packets to seperate function Jason Gerecke
2015-03-06 19:47 ` [PATCH 2/7] HID: wacom: Centralize updating of wacom_wac battery status Jason Gerecke
2015-03-06 19:47 ` [PATCH 3/7] HID: wacom: Allow dynamic battery creation/destruction Jason Gerecke
2015-03-06 19:47 ` [PATCH 4/7] HID: wacom: Provide battery charge state to system over USB if available Jason Gerecke
2015-03-06 19:47 ` [PATCH 5/7] HID: wacom: Report battery status for Intuos Pro and Intuos5 Jason Gerecke
2015-03-06 19:47 ` [PATCH 6/7] HID: wacom: Status packet provides 'charging', not 'powered' bit Jason Gerecke
2015-03-06 19:47 ` [PATCH 7/7] HID: wacom: Add battery presence indicator to wireless tablets Jason Gerecke
2015-03-06 19:47 ` [PATCH 1/7] HID: wacom: Move handling of Intuos status packets to seperate function Jason Gerecke
2015-03-06 19:47 ` [PATCH 2/7] HID: wacom: Centralize updating of wacom_wac battery status Jason Gerecke
2015-03-06 19:47 ` [PATCH 3/7] HID: wacom: Allow dynamic battery creation/destruction Jason Gerecke
2015-03-06 19:47 ` [PATCH 4/7] HID: wacom: Provide battery charge state to system over USB if available Jason Gerecke
2015-03-06 19:47 ` [PATCH 5/7] HID: wacom: Report battery status for Intuos Pro and Intuos5 Jason Gerecke
2015-03-06 19:47 ` [PATCH 6/7] HID: wacom: Status packet provides 'charging', not 'powered' bit Jason Gerecke
2015-03-06 19:47 ` [PATCH 7/7] HID: wacom: Add battery presence indicator to wireless tablets Jason Gerecke
2015-03-11 15:50 ` Jiri Kosina
2015-03-11 17:25 ` [PATCH v2 " Jason Gerecke
2015-03-11 17:53 ` Jiri Kosina
2015-03-10 1:31 ` [PATCH 1/7] HID: wacom: Move handling of Intuos status packets to seperate function Ping Cheng
2015-03-10 16:22 ` Jason Gerecke [this message]
2015-03-11 15:49 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54FF1A56.5000809@gmail.com \
--to=killertofu@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=pinglinux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.