Re: [Linuxwacom-devel] Tilt value meaning

2012-03-09 Thread Alexia Death
On Thu, Mar 8, 2012 at 11:03 PM, Nikolai Kondrashov spbn...@gmail.com wrote:
 On 03/08/2012 08:42 PM, Chris Bagwell wrote:
 I believe tilt support is also in 2.6 but does seem to only work with
 certain tools.  The Ink Pen mentions setting tilt sensitivity.

 http://docs.gimp.org/en/gimp-tool-ink.html

 Thanks, Chris! I have gimp 2.6 and will try the ink pen.

With the ink pen the effect isnt directly obvious. its a continuos and
tricky tool and  rather lousy for tesing. For your purposes, even the
dev relase before last is fine. Last dev release had a huge dependency
bump and is pain to install on most current distros. In 2.7 series you
have the new dynamics system available for all paint tools. That lets
you do some fun things with tilt on all paint tools, including clearly
seenig the fect on a stamp.


-- 
--Alexia

--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/2] HID: wacom: Reset stylus buttons - Intuos4 WL

2012-03-09 Thread Przemo Firszt
Stylus buttons have to be resetted when going out-of-prox.

Signed-off-by: Przemo Firszt prz...@firszt.eu
---
 drivers/hid/hid-wacom.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 2a440a6..5c25036 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -352,6 +352,8 @@ static void wacom_i4_parse_pen_report(struct wacom_data 
*wdata,
case 0x80: /* Out of proximity report */
input_report_key(input, BTN_TOUCH, 0);
input_report_abs(input, ABS_PRESSURE, 0);
+   input_report_key(input, BTN_STYLUS, 0);
+   input_report_key(input, BTN_STYLUS2, 0);
input_report_key(input, wdata-tool, 0);
input_report_abs(input, ABS_MISC, 0);
input_event(input, EV_MSC, MSC_SERIAL, wdata-serial);
-- 
1.7.6.4


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 2/2] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Przemo Firszt
This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
and are related to absolute location of the finger on the wheel.

Signed-off-by: Przemo Firszt prz...@firszt.eu
---
 drivers/hid/hid-wacom.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 5c25036..6f65514 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -36,6 +36,7 @@
 struct wacom_data {
__u16 tool;
__u16 butstate;
+   __u8 whlstate;
__u8 features;
__u32 id;
__u32 serial;
@@ -322,6 +323,16 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
struct input_dev *input, unsigned char *data)
 {
__u16 new_butstate;
+   __u8 new_whlstate;
+   __u8 sync = 0;
+
+   new_whlstate = data[1]  0x7f;
+   if (new_whlstate != wdata-whlstate) {
+   wdata-whlstate = new_whlstate;
+   input_report_key(input, BTN_TOUCH, 1);
+   input_report_abs(input, ABS_WHEEL, new_whlstate);
+   sync = 1;
+   }
 
new_butstate = (data[3]  1) | (data[2]  0x01);
if (new_butstate != wdata-butstate) {
@@ -335,6 +346,10 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
input_report_key(input, BTN_6, new_butstate  0x040);
input_report_key(input, BTN_7, new_butstate  0x080);
input_report_key(input, BTN_8, new_butstate  0x100);
+   sync = 1;
+   }
+
+   if (sync) {
input_report_key(input, BTN_TOOL_FINGER, 1);
input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
input_event(input, EV_MSC, MSC_SERIAL, 0x);
@@ -354,6 +369,7 @@ static void wacom_i4_parse_pen_report(struct wacom_data 
*wdata,
input_report_abs(input, ABS_PRESSURE, 0);
input_report_key(input, BTN_STYLUS, 0);
input_report_key(input, BTN_STYLUS2, 0);
+   input_report_abs(input, ABS_WHEEL, 0);
input_report_key(input, wdata-tool, 0);
input_report_abs(input, ABS_MISC, 0);
input_event(input, EV_MSC, MSC_SERIAL, wdata-serial);
@@ -512,6 +528,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
struct hid_input *hi,
input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
break;
case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
+   __set_bit(ABS_WHEEL, input-absbit);
+   input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
+   input_set_capability(input, EV_MSC, MSC_SERIAL);
__set_bit(ABS_MISC, input-absbit);
__set_bit(BTN_2, input-keybit);
__set_bit(BTN_3, input-keybit);
-- 
1.7.6.4


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/2] HID: wacom: Reset stylus buttons - Intuos4 WL

2012-03-09 Thread Jason Gerecke
On Fri, Mar 9, 2012 at 5:20 AM, Przemo Firszt prz...@firszt.eu wrote:
 Stylus buttons have to be resetted when going out-of-prox.

 Signed-off-by: Przemo Firszt prz...@firszt.eu
 ---
  drivers/hid/hid-wacom.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

 diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
 index 2a440a6..5c25036 100644
 --- a/drivers/hid/hid-wacom.c
 +++ b/drivers/hid/hid-wacom.c
 @@ -352,6 +352,8 @@ static void wacom_i4_parse_pen_report(struct wacom_data 
 *wdata,
        case 0x80: /* Out of proximity report */
                input_report_key(input, BTN_TOUCH, 0);
                input_report_abs(input, ABS_PRESSURE, 0);
 +               input_report_key(input, BTN_STYLUS, 0);
 +               input_report_key(input, BTN_STYLUS2, 0);
                input_report_key(input, wdata-tool, 0);
                input_report_abs(input, ABS_MISC, 0);
                input_event(input, EV_MSC, MSC_SERIAL, wdata-serial);
 --
 1.7.6.4

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

Reviewed-by: Jason Gerecke killert...@gmail.com

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 2/2] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Jason Gerecke
On Fri, Mar 9, 2012 at 5:20 AM, Przemo Firszt prz...@firszt.eu wrote:
 This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
 and are related to absolute location of the finger on the wheel.

 Signed-off-by: Przemo Firszt prz...@firszt.eu
 ---
  drivers/hid/hid-wacom.c |   19 +++
  1 files changed, 19 insertions(+), 0 deletions(-)

 diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
 index 5c25036..6f65514 100644
 --- a/drivers/hid/hid-wacom.c
 +++ b/drivers/hid/hid-wacom.c
 @@ -36,6 +36,7 @@
  struct wacom_data {
        __u16 tool;
        __u16 butstate;
 +       __u8 whlstate;
        __u8 features;
        __u32 id;
        __u32 serial;
 @@ -322,6 +323,16 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                        struct input_dev *input, unsigned char *data)
  {
        __u16 new_butstate;
 +       __u8 new_whlstate;
 +       __u8 sync = 0;
 +
 +       new_whlstate = data[1]  0x7f;
 +       if (new_whlstate != wdata-whlstate) {
 +               wdata-whlstate = new_whlstate;
 +               input_report_key(input, BTN_TOUCH, 1);
 +               input_report_abs(input, ABS_WHEEL, new_whlstate);
 +               sync = 1;
 +       }

The highest bit of data[1] is a touched flag that you'll want to
check to determine if the wheel is being used. If its unset, you'll
want to reset ABS_WHEEL and BTN_TOUCH to zero here.

        new_butstate = (data[3]  1) | (data[2]  0x01);
        if (new_butstate != wdata-butstate) {
 @@ -335,6 +346,10 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                input_report_key(input, BTN_6, new_butstate  0x040);
                input_report_key(input, BTN_7, new_butstate  0x080);
                input_report_key(input, BTN_8, new_butstate  0x100);
 +               sync = 1;
 +       }
 +
 +       if (sync) {
                input_report_key(input, BTN_TOOL_FINGER, 1);
                input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
                input_event(input, EV_MSC, MSC_SERIAL, 0x);
 @@ -354,6 +369,7 @@ static void wacom_i4_parse_pen_report(struct wacom_data 
 *wdata,
                input_report_abs(input, ABS_PRESSURE, 0);
                input_report_key(input, BTN_STYLUS, 0);
                input_report_key(input, BTN_STYLUS2, 0);
 +               input_report_abs(input, ABS_WHEEL, 0);
                input_report_key(input, wdata-tool, 0);
                input_report_abs(input, ABS_MISC, 0);
                input_event(input, EV_MSC, MSC_SERIAL, wdata-serial);
As mentioned above, this should be in wacom_i4_parse_button_report.
The pen's loss of proximity has no bearing on the wheel's state.

 @@ -512,6 +528,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
 struct hid_input *hi,
                input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
                break;
        case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
 +               __set_bit(ABS_WHEEL, input-absbit);
 +               input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
 +               input_set_capability(input, EV_MSC, MSC_SERIAL);
                __set_bit(ABS_MISC, input-absbit);
                __set_bit(BTN_2, input-keybit);
                __set_bit(BTN_3, input-keybit);
 --
 1.7.6.4


 --
 Virtualization  Cloud Management Using Capacity Planning
 Cloud computing makes use of virtualization - but cloud computing
 also focuses on allowing computing to be delivered as a service.
 http://www.accelacomm.com/jaw/sfnl/114/51521223/
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 2/2] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Przemo Firszt
Dnia 2012-03-09, pią o godzinie 09:37 -0800, Jason Gerecke pisze:
 On Fri, Mar 9, 2012 at 5:20 AM, Przemo Firszt prz...@firszt.eu wrote:
  This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
  and are related to absolute location of the finger on the wheel.
 
  Signed-off-by: Przemo Firszt prz...@firszt.eu
  ---
   drivers/hid/hid-wacom.c |   19 +++
   1 files changed, 19 insertions(+), 0 deletions(-)
 
  diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
  index 5c25036..6f65514 100644
  --- a/drivers/hid/hid-wacom.c
  +++ b/drivers/hid/hid-wacom.c
  @@ -36,6 +36,7 @@
   struct wacom_data {
 __u16 tool;
 __u16 butstate;
  +   __u8 whlstate;
 __u8 features;
 __u32 id;
 __u32 serial;
  @@ -322,6 +323,16 @@ static void wacom_i4_parse_button_report(struct 
  wacom_data *wdata,
 struct input_dev *input, unsigned char *data)
   {
 __u16 new_butstate;
  +   __u8 new_whlstate;
  +   __u8 sync = 0;
  +
  +   new_whlstate = data[1]  0x7f;
  +   if (new_whlstate != wdata-whlstate) {
  +   wdata-whlstate = new_whlstate;
  +   input_report_key(input, BTN_TOUCH, 1);
  +   input_report_abs(input, ABS_WHEEL, new_whlstate);
  +   sync = 1;
  +   }
 
 The highest bit of data[1] is a touched flag that you'll want to
 check to determine if the wheel is being used. If its unset, you'll
 want to reset ABS_WHEEL and BTN_TOUCH to zero here.
 
Thanks!
A new patch is on the way...
-- 
Przemo


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Jason Gerecke
On Fri, Mar 9, 2012 at 10:16 AM, Przemo Firszt prz...@firszt.eu wrote:
 This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
 and are related to absolute location of the finger on the wheel.

 Signed-off-by: Przemo Firszt prz...@firszt.eu
 ---
  drivers/hid/hid-wacom.c |   25 +
  1 files changed, 25 insertions(+), 0 deletions(-)

 diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
 index 5c25036..925d4a7 100644
 --- a/drivers/hid/hid-wacom.c
 +++ b/drivers/hid/hid-wacom.c
 @@ -36,6 +36,7 @@
  struct wacom_data {
        __u16 tool;
        __u16 butstate;
 +       __u8 whlstate;
        __u8 features;
        __u32 id;
        __u32 serial;
 @@ -322,6 +323,23 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                        struct input_dev *input, unsigned char *data)
  {
        __u16 new_butstate;
 +       __u8 new_whlstate;
 +       __u8 sync = 0;
 +
 +       new_whlstate = data[1];
 +       if (new_whlstate != wdata-whlstate) {
 +               wdata-whlstate = new_whlstate;
 +               if (new_whlstate  0x10) {
Should be 0x80 to get the highest bit. Aside from that issue though:

Reviewed-by: Jason Gerecke killert...@gmail.com

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

 +                       input_report_key(input, BTN_TOUCH, 1);
 +                       input_report_abs(input, ABS_WHEEL, (new_whlstate  
 0x7f));
 +                       input_report_key(input, BTN_TOOL_FINGER, 1);
 +               } else {
 +                       input_report_key(input, BTN_TOUCH, 0);
 +                       input_report_abs(input, ABS_WHEEL, 0);
 +                       input_report_key(input, BTN_TOOL_FINGER, 0);
 +               }
 +               sync = 1;
 +       }

        new_butstate = (data[3]  1) | (data[2]  0x01);
        if (new_butstate != wdata-butstate) {
 @@ -336,6 +354,10 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                input_report_key(input, BTN_7, new_butstate  0x080);
                input_report_key(input, BTN_8, new_butstate  0x100);
                input_report_key(input, BTN_TOOL_FINGER, 1);
 +               sync = 1;
 +       }
 +
 +       if (sync) {
                input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
                input_event(input, EV_MSC, MSC_SERIAL, 0x);
                input_sync(input);
 @@ -512,6 +534,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
 struct hid_input *hi,
                input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
                break;
        case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
 +               __set_bit(ABS_WHEEL, input-absbit);
 +               input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
 +               input_set_capability(input, EV_MSC, MSC_SERIAL);
                __set_bit(ABS_MISC, input-absbit);
                __set_bit(BTN_2, input-keybit);
                __set_bit(BTN_3, input-keybit);
 --
 1.7.6.4


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Przemo Firszt
This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
and are related to absolute location of the finger on the wheel.

Signed-off-by: Przemo Firszt prz...@firszt.eu
Reviewed-by: Jason Gerecke killert...@gmail.com
---
 drivers/hid/hid-wacom.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 5c25036..dab7588 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -36,6 +36,7 @@
 struct wacom_data {
__u16 tool;
__u16 butstate;
+   __u8 whlstate;
__u8 features;
__u32 id;
__u32 serial;
@@ -322,6 +323,23 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
struct input_dev *input, unsigned char *data)
 {
__u16 new_butstate;
+   __u8 new_whlstate;
+   __u8 sync = 0;
+
+   new_whlstate = data[1];
+   if (new_whlstate != wdata-whlstate) {
+   wdata-whlstate = new_whlstate;
+   if (new_whlstate  0x80) {
+   input_report_key(input, BTN_TOUCH, 1);
+   input_report_abs(input, ABS_WHEEL, (new_whlstate  
0x7f));
+   input_report_key(input, BTN_TOOL_FINGER, 1);
+   } else {
+   input_report_key(input, BTN_TOUCH, 0);
+   input_report_abs(input, ABS_WHEEL, 0);
+   input_report_key(input, BTN_TOOL_FINGER, 0);
+   }
+   sync = 1;
+   }
 
new_butstate = (data[3]  1) | (data[2]  0x01);
if (new_butstate != wdata-butstate) {
@@ -336,6 +354,10 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
input_report_key(input, BTN_7, new_butstate  0x080);
input_report_key(input, BTN_8, new_butstate  0x100);
input_report_key(input, BTN_TOOL_FINGER, 1);
+   sync = 1;
+   }
+
+   if (sync) {
input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
input_event(input, EV_MSC, MSC_SERIAL, 0x);
input_sync(input);
@@ -512,6 +534,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
struct hid_input *hi,
input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
break;
case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
+   __set_bit(ABS_WHEEL, input-absbit);
+   input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
+   input_set_capability(input, EV_MSC, MSC_SERIAL);
__set_bit(ABS_MISC, input-absbit);
__set_bit(BTN_2, input-keybit);
__set_bit(BTN_3, input-keybit);
-- 
1.7.6.4


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Przemo Firszt
This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
and are related to absolute location of the finger on the wheel.

Signed-off-by: Przemo Firszt prz...@firszt.eu
---
 drivers/hid/hid-wacom.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 5c25036..925d4a7 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -36,6 +36,7 @@
 struct wacom_data {
__u16 tool;
__u16 butstate;
+   __u8 whlstate;
__u8 features;
__u32 id;
__u32 serial;
@@ -322,6 +323,23 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
struct input_dev *input, unsigned char *data)
 {
__u16 new_butstate;
+   __u8 new_whlstate;
+   __u8 sync = 0;
+
+   new_whlstate = data[1];
+   if (new_whlstate != wdata-whlstate) {
+   wdata-whlstate = new_whlstate;
+   if (new_whlstate  0x10) {
+   input_report_key(input, BTN_TOUCH, 1);
+   input_report_abs(input, ABS_WHEEL, (new_whlstate  
0x7f));
+   input_report_key(input, BTN_TOOL_FINGER, 1);
+   } else {
+   input_report_key(input, BTN_TOUCH, 0);
+   input_report_abs(input, ABS_WHEEL, 0);
+   input_report_key(input, BTN_TOOL_FINGER, 0);
+   }
+   sync = 1;
+   }
 
new_butstate = (data[3]  1) | (data[2]  0x01);
if (new_butstate != wdata-butstate) {
@@ -336,6 +354,10 @@ static void wacom_i4_parse_button_report(struct wacom_data 
*wdata,
input_report_key(input, BTN_7, new_butstate  0x080);
input_report_key(input, BTN_8, new_butstate  0x100);
input_report_key(input, BTN_TOOL_FINGER, 1);
+   sync = 1;
+   }
+
+   if (sync) {
input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
input_event(input, EV_MSC, MSC_SERIAL, 0x);
input_sync(input);
@@ -512,6 +534,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
struct hid_input *hi,
input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
break;
case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
+   __set_bit(ABS_WHEEL, input-absbit);
+   input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
+   input_set_capability(input, EV_MSC, MSC_SERIAL);
__set_bit(ABS_MISC, input-absbit);
__set_bit(BTN_2, input-keybit);
__set_bit(BTN_3, input-keybit);
-- 
1.7.6.4


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Add reporting of wheel for Intuos4 WL

2012-03-09 Thread Chris Bagwell
On Fri, Mar 9, 2012 at 2:27 PM, Przemo Firszt prz...@firszt.eu wrote:
 This patch adds reporting of ABS_WHEEL event. Raported walues are 0..71
 and are related to absolute location of the finger on the wheel.

 Signed-off-by: Przemo Firszt prz...@firszt.eu
 Reviewed-by: Jason Gerecke killert...@gmail.com
 ---
  drivers/hid/hid-wacom.c |   25 +
  1 files changed, 25 insertions(+), 0 deletions(-)

 diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
 index 5c25036..dab7588 100644
 --- a/drivers/hid/hid-wacom.c
 +++ b/drivers/hid/hid-wacom.c
 @@ -36,6 +36,7 @@
  struct wacom_data {
        __u16 tool;
        __u16 butstate;
 +       __u8 whlstate;
        __u8 features;
        __u32 id;
        __u32 serial;
 @@ -322,6 +323,23 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                        struct input_dev *input, unsigned char *data)
  {
        __u16 new_butstate;
 +       __u8 new_whlstate;
 +       __u8 sync = 0;
 +
 +       new_whlstate = data[1];
 +       if (new_whlstate != wdata-whlstate) {
 +               wdata-whlstate = new_whlstate;
 +               if (new_whlstate  0x80) {
 +                       input_report_key(input, BTN_TOUCH, 1);
 +                       input_report_abs(input, ABS_WHEEL, (new_whlstate  
 0x7f));
 +                       input_report_key(input, BTN_TOOL_FINGER, 1);
 +               } else {
 +                       input_report_key(input, BTN_TOUCH, 0);
 +                       input_report_abs(input, ABS_WHEEL, 0);
 +                       input_report_key(input, BTN_TOOL_FINGER, 0);
 +               }
 +               sync = 1;
 +       }

        new_butstate = (data[3]  1) | (data[2]  0x01);
        if (new_butstate != wdata-butstate) {
 @@ -336,6 +354,10 @@ static void wacom_i4_parse_button_report(struct 
 wacom_data *wdata,
                input_report_key(input, BTN_7, new_butstate  0x080);
                input_report_key(input, BTN_8, new_butstate  0x100);
                input_report_key(input, BTN_TOOL_FINGER, 1);
 +               sync = 1;
 +       }
 +
 +       if (sync) {
                input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
                input_event(input, EV_MSC, MSC_SERIAL, 0x);
                input_sync(input);
 @@ -512,6 +534,9 @@ static int wacom_input_mapped(struct hid_device *hdev, 
 struct hid_input *hi,
                input_set_abs_params(input, ABS_DISTANCE, 0, 32, 0, 0);
                break;
        case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
 +               __set_bit(ABS_WHEEL, input-absbit);
 +               input_set_abs_params(input, ABS_WHEEL, 0, 71, 0, 0);
 +               input_set_capability(input, EV_MSC, MSC_SERIAL);

Is this input_set_capability MSC_SERIAL line to fix the next line
thats above case statement?

 __set_bit(MSC_SERIAL, input-mscbit);

Should the original line be deleted/replaced?

Chris

                __set_bit(ABS_MISC, input-absbit);
                __set_bit(BTN_2, input-keybit);
                __set_bit(BTN_3, input-keybit);
 --
 1.7.6.4

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

--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/4] input: wacom: Intuos5 basic support

2012-03-09 Thread Jason Gerecke
This patch adds support for the basic pen functions of Intuos5
tablets.
---
 drivers/input/tablet/wacom_wac.c |   36 +---
 drivers/input/tablet/wacom_wac.h |3 +++
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 9283507..35efc64 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -452,6 +452,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
if ((data[1]  0xb8) == 0xa0) {
t = (data[6]  2) | ((data[7]  6)  3);
if ((features-type = INTUOS4S  features-type = INTUOS4L) 
||
+(features-type = INTUOS5S  features-type = INTUOS5L) 
||
features-type == WACOM_21UX2 || features-type == 
WACOM_24HD) {
t = (t  1) | (data[1]  1);
}
@@ -632,7 +633,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
(features-type == INTUOS3 ||
 features-type == INTUOS3S ||
 features-type == INTUOS4 ||
-features-type == INTUOS4S)) {
+features-type == INTUOS4S ||
+features-type == INTUOS5 ||
+features-type == INTUOS5S)) {
 
return 0;
}
@@ -685,7 +688,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 
} else if (wacom-tool[idx] == BTN_TOOL_MOUSE) {
/* I4 mouse */
-   if (features-type = INTUOS4S  features-type = 
INTUOS4L) {
+   if ((features-type = INTUOS4S  features-type = 
INTUOS4L) ||
+   (features-type = INTUOS5S  features-type = 
INTUOS5L)) {
input_report_key(input, BTN_LEFT,   data[6]  
0x01);
input_report_key(input, BTN_MIDDLE, data[6]  
0x02);
input_report_key(input, BTN_RIGHT,  data[6]  
0x04);
@@ -712,7 +716,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
}
}
} else if ((features-type  INTUOS3S || features-type == 
INTUOS3L ||
-   features-type == INTUOS4L) 
+   features-type == INTUOS4L || features-type == 
INTUOS5L) 
   wacom-tool[idx] == BTN_TOOL_LENS) {
/* Lens cursor packets */
input_report_key(input, BTN_LEFT,   data[8]  0x01);
@@ -1078,6 +1082,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
case INTUOS4S:
case INTUOS4:
case INTUOS4L:
+   case INTUOS5S:
+   case INTUOS5:
+   case INTUOS5L:
case CINTIQ:
case WACOM_BEE:
case WACOM_21UX2:
@@ -1312,12 +1319,15 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
wacom_setup_intuos(wacom_wac);
break;
 
+   case INTUOS5:
+   case INTUOS5L:
case INTUOS4:
case INTUOS4L:
__set_bit(BTN_7, input_dev-keybit);
__set_bit(BTN_8, input_dev-keybit);
/* fall through */
 
+   case INTUOS5S:
case INTUOS4S:
for (i = 0; i  7; i++)
__set_bit(BTN_0 + i, input_dev-keybit);
@@ -1586,6 +1596,21 @@ static const struct wacom_features wacom_features_0xBB =
 static const struct wacom_features wacom_features_0xBC =
{ Wacom Intuos4 WL, WACOM_PKGLEN_INTUOS,40840, 25400, 2047,
  63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x26 =
+{ Wacom Intuos5 touch S, WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
+  63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x27 =
+{ Wacom Intuos5 touch M, WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
+  63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x28 =
+{ Wacom Intuos5 touch L, WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
+  63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x29 =
+{ Wacom Intuos5 S, WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
+  63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x2A =
+{ Wacom Intuos5 M, WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
+  63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 static const struct wacom_features wacom_features_0xF4 =
{ Wacom Cintiq 24HD,WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
  63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -1752,6 +1777,11 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0xBA) },
{ USB_DEVICE_WACOM(0xBB) },
  

[Linuxwacom-devel] [PATCH 2/4] input: wacom: Intuos5 Touch Ring/ExpressKey support

2012-03-09 Thread Jason Gerecke
Intuos5 uses a new report type for Touch Ring and ExpressKey data.
Note that data from the capacitive sensors present on the ExpressKeys
will be ignored until a proper way is found to expose it.
---
 drivers/input/tablet/wacom_wac.c |   33 +++--
 drivers/input/tablet/wacom_wac.h |1 +
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 35efc64..86827c7 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -484,7 +484,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
int idx = 0, result;
 
if (data[0] != WACOM_REPORT_PENABLED  data[0] != 
WACOM_REPORT_INTUOSREAD
-data[0] != WACOM_REPORT_INTUOSWRITE  data[0] != 
WACOM_REPORT_INTUOSPAD) {
+data[0] != WACOM_REPORT_INTUOSWRITE  data[0] != 
WACOM_REPORT_INTUOSPAD
+ data[0] != WACOM_REPORT_INTUOS5PAD) {
dbg(wacom_intuos_irq: received unknown report #%d, data[0]);
 return 0;
}
@@ -494,7 +495,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
idx = data[1]  0x01;
 
/* pad packets. Works as a second tool and is always in prox */
-   if (data[0] == WACOM_REPORT_INTUOSPAD) {
+   if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == 
WACOM_REPORT_INTUOS5PAD) {
if (features-type = INTUOS4S  features-type = INTUOS4L) {
input_report_key(input, BTN_0, (data[2]  0x01));
input_report_key(input, BTN_1, (data[3]  0x01));
@@ -570,6 +571,34 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
input_report_key(input, wacom-tool[1], 0);
input_report_abs(input, ABS_MISC, 0);
}
+   } else if (features-type = INTUOS5S  features-type = 
INTUOS5L) {
+   int i;
+
+   /* Touch ring mode switch has no capacitive sensor */
+   input_report_key(input, BTN_0, (data[3]  0x01));
+
+   /* ExpressKeys on Intuos5 have a capacitive sensor in
+* addition to the mechanical switch. Switch data is
+* stored in data[4], capacitive data in data[5].
+*/
+   for (i = 0; i  8; i++) {
+   input_report_key(input, BTN_1 + i, data[4]  (1 
 i));
+   }
+
+   if (data[2]  0x80) {
+   input_report_abs(input, ABS_WHEEL, (data[2]  
0x7f));
+   } else {
+   /* Out of proximity, clear wheel value. */
+   input_report_abs(input, ABS_WHEEL, 0);
+   }
+
+   if (data[2] | (data[3]  0x01) | data[4]) {
+   input_report_key(input, wacom-tool[1], 1);
+   input_report_abs(input, ABS_MISC, 
PAD_DEVICE_ID);
+   } else {
+   input_report_key(input, wacom-tool[1], 0);
+   input_report_abs(input, ABS_MISC, 0);
+   }
} else {
if (features-type == WACOM_21UX2) {
input_report_key(input, BTN_0, (data[5]  
0x01));
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 5eb10c5..99efc10 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -37,6 +37,7 @@
 #define WACOM_REPORT_INTUOSREAD5
 #define WACOM_REPORT_INTUOSWRITE   6
 #define WACOM_REPORT_INTUOSPAD 12
+#define WACOM_REPORT_INTUOS5PAD 3
 #define WACOM_REPORT_TPC1FG6
 #define WACOM_REPORT_TPC2FG13
 #define WACOM_REPORT_TPCHID15
-- 
1.7.9.1


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 3/4] input: wacom: Intous5 Touch Ring LED support

2012-03-09 Thread Jason Gerecke
The Touch Ring LEDs on Intuos5 tablets use a different report
format which supports only 4 levels of brightness. We remap
the 7-bit value obtained from sysfs to an appropriate value
for the tablet. Control of the crop mark LEDs (new to the I5)
is left for a later patch.
---
 Documentation/ABI/testing/sysfs-driver-wacom |   15 +++---
 drivers/input/tablet/wacom_sys.c |   68 +
 2 files changed, 65 insertions(+), 18 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-driver-wacom 
b/Documentation/ABI/testing/sysfs-driver-wacom
index 0130d66..5e9cbdc 100644
--- a/Documentation/ABI/testing/sysfs-driver-wacom
+++ b/Documentation/ABI/testing/sysfs-driver-wacom
@@ -15,9 +15,10 @@ Contact: linux-in...@vger.kernel.org
 Description:
Attribute group for control of the status LEDs and the OLEDs.
This attribute group is only available for Intuos 4 M, L,
-   and XL (with LEDs and OLEDs) and Cintiq 21UX2 and Cintiq 24HD
-   (LEDs only). Therefore its presence implicitly signifies the
-   presence of said LEDs and OLEDs on the tablet device.
+   and XL (with LEDs and OLEDs), Intuos 5 (LEDs only), and Cintiq
+   21UX2 and Cintiq 24HD (LEDs only). Therefore its presence
+   implicitly signifies the presence of said LEDs and OLEDs on the
+   tablet device.
 
 What:  
/sys/bus/usb/devices/busnum-devnum:cfg.intf/wacom_led/status0_luminance
 Date:  August 2011
@@ -40,10 +41,10 @@ What:   
/sys/bus/usb/devices/busnum-devnum:cfg.intf/wacom_led/status_led0
 Date:  August 2011
 Contact:   linux-in...@vger.kernel.org
 Description:
-   Writing to this file sets which one of the four (for Intuos 4)
-   or of the right four (for Cintiq 21UX2 and Cintiq 24HD) status
-   LEDs is active (0..3). The other three LEDs on the same side are
-   always inactive.
+   Writing to this file sets which one of the four (for Intuos 4
+   and Intuos 5) or of the right four (for Cintiq 21UX2 and Cintiq
+   24HD) status LEDs is active (0..3). The other three LEDs on the
+   same side are always inactive.
 
 What:  
/sys/bus/usb/devices/busnum-devnum:cfg.intf/wacom_led/status_led1_select
 Date:  September 2011
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index c9588ee..11b4c05 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -553,23 +553,38 @@ static void wacom_remove_shared_data(struct wacom_wac 
*wacom)
 static int wacom_led_control(struct wacom *wacom)
 {
unsigned char *buf;
-   int retval, led = 0;
+   int retval;
 
buf = kzalloc(9, GFP_KERNEL);
if (!buf)
return -ENOMEM;
 
-   if (wacom-wacom_wac.features.type == WACOM_21UX2 ||
-   wacom-wacom_wac.features.type == WACOM_24HD)
-   led = (wacom-led.select[1]  4) | 0x40;
-
-   led |=  wacom-led.select[0] | 0x4;
+   if (wacom-wacom_wac.features.type = INTUOS5S 
+   wacom-wacom_wac.features.type = INTUOS5L) {
+   /* Touch Ring and crop mark LED luminance may take on
+* one of four values:
+*0 = Low; 1 = Medium; 2 = High; 3 = Off
+*/
+   int ring_led = wacom-led.select[0]  0x03;
+   int ring_lum = (((wacom-led.llv  0x60)  5) - 1)  0x03;
+   int crop_lum = 0;
 
-   buf[0] = WAC_CMD_LED_CONTROL;
-   buf[1] = led;
-   buf[2] = wacom-led.llv;
-   buf[3] = wacom-led.hlv;
-   buf[4] = wacom-led.img_lum;
+   buf[0] = WAC_CMD_LED_CONTROL;
+   buf[1] = (crop_lum  4) | (ring_lum  2) | (ring_led);
+   }
+   else {
+   int led = wacom-led.select[0] | 0x4;
+
+   if (wacom-wacom_wac.features.type == WACOM_21UX2 ||
+   wacom-wacom_wac.features.type == WACOM_24HD)
+   led |= (wacom-led.select[1]  4) | 0x40;
+
+   buf[0] = WAC_CMD_LED_CONTROL;
+   buf[1] = led;
+   buf[2] = wacom-led.llv;
+   buf[3] = wacom-led.hlv;
+   buf[4] = wacom-led.img_lum;
+   }
 
retval = wacom_set_report(wacom-intf, 0x03, WAC_CMD_LED_CONTROL,
  buf, 9, WAC_CMD_RETRIES);
@@ -762,6 +777,17 @@ static struct attribute_group intuos4_led_attr_group = {
.attrs = intuos4_led_attrs,
 };
 
+static struct attribute *intuos5_led_attrs[] = {
+   dev_attr_status0_luminance.attr,
+   dev_attr_status_led0_select.attr,
+   NULL
+};
+
+static struct attribute_group intuos5_led_attr_group = {
+   .name = wacom_led,
+   .attrs = intuos5_led_attrs,
+};
+
 static int wacom_initialize_leds(struct wacom *wacom)
 {
int error;
@@ -791,6 +817,19 @@ static int 

[Linuxwacom-devel] [PATCH 4/4] input: wacom: Intuos5 multitouch sensor support

2012-03-09 Thread Jason Gerecke
Intuos5 tablets with PTH-* model numbers include a multitouch sensor
which use the same touch reports as the 3rd-generation Bamboo. No
useful information is in the HID descriptor for the touch interface
so hardcoded values are used during setup.
---
 drivers/input/tablet/wacom_sys.c |   24 ++
 drivers/input/tablet/wacom_wac.c |   63 +++---
 2 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 11b4c05..b1af6c2 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -228,6 +228,9 @@ static int wacom_parse_logical_collection(unsigned char 
*report,
  * 3rd gen Bamboo Touch no longer define a Digitizer-Finger Pysical
  * Collection. Instead they define a Logical Collection with a single
  * Logical Maximum for both X and Y.
+ *
+ * Intuos5 touch interface does not contain useful data. We deal with
+ * this after returning from this function.
  */
 static int wacom_parse_hid(struct usb_interface *intf,
   struct hid_descriptor *hid_desc,
@@ -924,6 +927,27 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
if (error)
goto fail3;
 
+   /* Intuos5 has no useful data about its touch interface in its
+* HID descriptor. If this is the touch interface (wMaxPacketSize
+* of WACOM_PKGLEN_BBTOUCH3), override the table values.
+*/
+   if (features-type = INTUOS5S  features-type = INTUOS5L) {
+   if (endpoint-wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
+   features-device_type = BTN_TOOL_FINGER;
+   features-pktlen = WACOM_PKGLEN_BBTOUCH3;
+
+   features-x_phy =
+   (features-x_max * features-x_resolution) / 
100;
+   features-y_phy =
+   (features-y_max * features-y_resolution) / 
100;
+
+   features-x_max = 4096;
+   features-y_max = 4096;
+   } else {
+   features-device_type = BTN_TOOL_PEN;
+   }
+   }
+
wacom_setup_device_quirks(features);
 
strlcpy(wacom_wac-name, features-name, sizeof(wacom_wac-name));
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 86827c7..30067ae 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -321,6 +321,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 
/* Enter report */
if ((data[1]  0xfc) == 0xc0) {
+   if (features-type = INTUOS5S  features-type = INTUOS5L)
+   wacom-shared-stylus_in_proximity = true;
+
/* serial number of the tool */
wacom-serial[idx] = ((data[3]  0x0f)  28) +
(data[4]  20) + (data[5]  12) +
@@ -406,6 +409,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 
/* Exit report */
if ((data[1]  0xfe) == 0x80) {
+   if (features-type = INTUOS5S  features-type = INTUOS5L)
+   wacom-shared-stylus_in_proximity = false;
+
/*
 * Reset all states otherwise we lose the initial states
 * when in-prox next time
@@ -,9 +1117,6 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
case INTUOS4S:
case INTUOS4:
case INTUOS4L:
-   case INTUOS5S:
-   case INTUOS5:
-   case INTUOS5L:
case CINTIQ:
case WACOM_BEE:
case WACOM_21UX2:
@@ -1121,6 +1124,15 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
sync = wacom_intuos_irq(wacom_wac);
break;
 
+   case INTUOS5S:
+   case INTUOS5:
+   case INTUOS5L:
+   if (len == WACOM_PKGLEN_BBTOUCH3)
+   sync = wacom_bpt3_touch(wacom_wac);
+   else
+   sync = wacom_intuos_irq(wacom_wac);
+   break;
+
case TABLETPC:
case TABLETPC2FG:
sync = wacom_tpc_irq(wacom_wac, len);
@@ -1191,7 +1203,7 @@ void wacom_setup_device_quirks(struct wacom_features 
*features)
 
/* these device have multiple inputs */
if (features-type == TABLETPC || features-type == TABLETPC2FG ||
-   features-type == BAMBOO_PT)
+   features-type == BAMBOO_PT || (features-type = INTUOS5S  
features-type = INTUOS5L))
features-quirks |= WACOM_QUIRK_MULTI_INPUT;
 
/* quirk for bamboo touch with 2 low res touches */
@@ -1350,13 +1362,54 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
 
case INTUOS5:
case INTUOS5L:
+   if (features-device_type == BTN_TOOL_PEN) {
+   __set_bit(BTN_7, input_dev-keybit);
+