Re: [PATCH 3/4] input: wacom - Add support for Bamboo Pen

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

 



Ping would you be able to comment on question at end?

On Thu, Sep 9, 2010 at 4:46 PM, Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
> On Thu, Sep 09, 2010 at 04:34:35PM -0500, Chris Bagwell wrote:
>> On Wed, Sep 8, 2010 at 11:14 PM, Dmitry Torokhov
>> <dmitry.torokhov@xxxxxxxxx> wrote:
>> > On Wed, Sep 08, 2010 at 11:02:31PM -0500, chris@xxxxxxxxxxxxxx wrote:
>> >> From: Chris Bagwell <chris@xxxxxxxxxxxxxx>
>> >>
>> >> This adds support for Pen on Bamboo Pen and Bamboo Pen&Touch
>> >> devices.  Touchpad is handled by previous Bamboo Touch
>> >> logic.
>> >>
>> >> Signed-off-by: Chris Bagwell <chris@xxxxxxxxxxxxxx>
>> >> ---
>> >>  drivers/input/tablet/wacom_wac.c |   75 ++++++++++++++++++++++++++++++++++++++
>> >>  1 files changed, 75 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
>> >> index 2f7ed9a..9cc0cf0 100644
>> >> --- a/drivers/input/tablet/wacom_wac.c
>> >> +++ b/drivers/input/tablet/wacom_wac.c
>> >> @@ -904,10 +904,71 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
>> >>       return 0;
>> >>  }
>> >>
>> >> +static int wacom_bpt_pen(struct wacom_wac *wacom)
>> >> +{
>> >> +     struct input_dev *input = wacom->input;
>> >> +     unsigned char *data = wacom->data;
>> >> +     int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
>> >> +
>> >> +     prox = (data[1] & 0x10) && (data[1] & 0x20);
>> >
>> >        prox = (data[1] & 0x30) == 0x30;
>> >
>> > ?
>> >
>> > --
>> > Dmitry
>> >
>>
>>
>> Agree thats faster to understand.  I'll update patch and resend soon.
>>
>
> I am just curious - why is it that _both_ bits should be set for the tools
> to be considered "in proximity"?..
>

Below is my guess and these values ultimately came from Ping's driver.

The Bamboo Pen protocol seems to be derived from Graphire protocol.
Based on that, they also use 3 bits from data[1] in this area.  1 bit
for in-proximity and 2 bits for a tool ID of what's being reported
(pen vs. eraser vs mouse).

Although these 3 bits order are slightly different between two
protocols, it looks roughly the same to me.  0x20 for in proximity and
0x10 for pen ID and 0x11 for eraser ID.

The 0x30 check would boil down to simplest safety check for unknown ID's.

Ping, if you could confirm this I would be happy to document bit
meaning in patch update.

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


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

  Powered by Linux