On Fri, Sep 28, 2018 at 3:51 PM Ping Cheng <pingli...@gmail.com> wrote:
>
> Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
Nit: The patch title says 2.6.30 but we've moved to 2.6.32.

It will be challenging to use this device on these older kernels given
the fact that
DisplayLink's driver starts support at 3.14. However, I can see the
kernel events
coming from the device.

Tested-by: Aaron Armstrong Skomra <sko...@gmail.com>

> ---
>  2.6.32/wacom_wac.c | 31 ++++++++++++++++++++++++++-----
>  2.6.32/wacom_wac.h |  1 +
>  2.6.38/wacom_wac.c | 31 ++++++++++++++++++++++++++-----
>  2.6.38/wacom_wac.h |  1 +
>  3.7/wacom_wac.c    | 31 ++++++++++++++++++++++++++-----
>  3.7/wacom_wac.h    |  1 +
>  6 files changed, 81 insertions(+), 15 deletions(-)
>
> diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c
> index c29c75c..c4705f8 100644
> --- a/2.6.32/wacom_wac.c
> +++ b/2.6.32/wacom_wac.c
> @@ -303,6 +303,20 @@ static int wacom_dth1152_irq(struct wacom_wac *wacom)
>         unsigned short prox, pressure = 0;
>
>         if (data[0] != WACOM_REPORT_DTUS) {
> +               if (data[0] == WACOM_REPORT_DTUSPAD) {
> +                       input_report_key(input, BTN_0, (data[1] & 0x01));
> +                       input_report_key(input, BTN_1, (data[1] & 0x02));
> +                       input_report_key(input, BTN_2, (data[1] & 0x04));
> +                       input_report_key(input, BTN_3, (data[1] & 0x08));
> +                       input_report_abs(input, ABS_MISC,
> +                                data[1] & 0x0f ? PAD_DEVICE_ID : 0);
> +                       /*
> +                        * Serial number is required when expresskeys are
> +                        * reported through pen interface.
> +                        */
> +                       input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
> +                       return 1;
> +               }
>                 dev_dbg(input->dev.parent,
>                         "%s: received unknown report #%d", __func__, data[0]);
>                 return 0;
> @@ -1896,6 +1910,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
> len)
>                 sync = wacom_dtus_irq(wacom_wac);
>                 break;
>
> +       case DTUS2:
>         case DTH1152:
>                 sync = wacom_dth1152_irq(wacom_wac);
>                 break;
> @@ -2382,14 +2397,16 @@ void wacom_setup_input_capabilities(struct input_dev 
> *input_dev,
>                 /* fall through */
>
>         case DTUS:
> -       case DTUSX:
> +       case DTUS2:
>         case DTK2451:
> +               input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +
> +       case DTUSX:
>         case PL:
>         case DTU:
> -               __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> -               __set_bit(BTN_STYLUS2, input_dev->keybit);
> -               if (features->type == DTUS || features->type == DTK2451) {
> -                       input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +               if (features->type != DTUS2) {
> +                       __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> +                       __set_bit(BTN_STYLUS2, input_dev->keybit);
>                 }
>                 /* fall through */
>
> @@ -2991,6 +3008,9 @@ static const struct wacom_features wacom_features_0x357 
> =
>  static const struct wacom_features wacom_features_0x358 =
>         { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191, 63,
>           INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 
> };
> +static const struct wacom_features wacom_features_0x359 =
> +       { "Wacom DTU-1141B", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
> +         DTUS2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
>  static const struct wacom_features wacom_features_0x35A =
>         { "Wacom DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
>           DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
> @@ -3205,6 +3225,7 @@ const struct usb_device_id wacom_ids[] = {
>         { USB_DEVICE_WACOM(0x356) },
>         { USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
>         { USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
> +       { USB_DEVICE_WACOM(0x359) },
>         { USB_DEVICE_WACOM(0x35A) },
>         { USB_DEVICE_WACOM(0x368) },
>         { USB_DEVICE_WACOM(0x374) },
> diff --git a/2.6.32/wacom_wac.h b/2.6.32/wacom_wac.h
> index bdefbc1..56dcea3 100755
> --- a/2.6.32/wacom_wac.h
> +++ b/2.6.32/wacom_wac.h
> @@ -92,6 +92,7 @@ enum {
>         PL,
>         DTU,
>         DTUS,
> +       DTUS2,
>         DTUSX,
>         DTH1152,
>         DTK2451,
> diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
> index ebff932..2e090cf 100644
> --- a/2.6.38/wacom_wac.c
> +++ b/2.6.38/wacom_wac.c
> @@ -339,6 +339,20 @@ static int wacom_dth1152_irq(struct wacom_wac *wacom)
>         unsigned short prox, pressure = 0;
>
>         if (data[0] != WACOM_REPORT_DTUS) {
> +               if (data[0] == WACOM_REPORT_DTUSPAD) {
> +                       input_report_key(input, BTN_0, (data[1] & 0x01));
> +                       input_report_key(input, BTN_1, (data[1] & 0x02));
> +                       input_report_key(input, BTN_2, (data[1] & 0x04));
> +                       input_report_key(input, BTN_3, (data[1] & 0x08));
> +                       input_report_abs(input, ABS_MISC,
> +                                data[1] & 0x0f ? PAD_DEVICE_ID : 0);
> +                       /*
> +                        * Serial number is required when expresskeys are
> +                        * reported through pen interface.
> +                        */
> +                       input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
> +                       return 1;
> +               }
>                 dev_dbg(input->dev.parent,
>                         "%s: received unknown report #%d", __func__, data[0]);
>                 return 0;
> @@ -2098,6 +2112,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
> len)
>                 sync = wacom_dtus_irq(wacom_wac);
>                 break;
>
> +       case DTUS2:
>         case DTH1152:
>                 sync = wacom_dth1152_irq(wacom_wac);
>                 break;
> @@ -2668,14 +2683,16 @@ int wacom_setup_input_capabilities(struct input_dev 
> *input_dev,
>                 /* fall through */
>
>         case DTUS:
> -       case DTUSX:
> +       case DTUS2:
>         case DTK2451:
> +               input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +
> +       case DTUSX:
>         case PL:
>         case DTU:
> -               __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> -               __set_bit(BTN_STYLUS2, input_dev->keybit);
> -               if (features->type == DTUS || features->type == DTK2451) {
> -                       input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +               if (features->type != DTUS2) {
> +                       __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> +                       __set_bit(BTN_STYLUS2, input_dev->keybit);
>                 }
>                 /* fall through */
>
> @@ -3344,6 +3361,9 @@ static const struct wacom_features wacom_features_0x357 
> =
>  static const struct wacom_features wacom_features_0x358 =
>         { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191, 63,
>           INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 
> };
> +static const struct wacom_features wacom_features_0x359 =
> +       { "Wacom DTU-1141B", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
> +         DTUS2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
>  static const struct wacom_features wacom_features_0x35A =
>         { "Wacom DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
>           DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
> @@ -3566,6 +3586,7 @@ const struct usb_device_id wacom_ids[] = {
>         { USB_DEVICE_WACOM(0x356) },
>         { USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
>         { USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
> +       { USB_DEVICE_WACOM(0x359) },
>         { USB_DEVICE_WACOM(0x35A) },
>         { USB_DEVICE_WACOM(0x368) },
>         { USB_DEVICE_WACOM(0x374) },
> diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h
> index bfe0253..08e8261 100644
> --- a/2.6.38/wacom_wac.h
> +++ b/2.6.38/wacom_wac.h
> @@ -105,6 +105,7 @@ enum {
>         PL,
>         DTU,
>         DTUS,
> +       DTUS2,
>         DTUSX,
>         DTH1152,
>         DTK2451,
> diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
> index c544343..f255f8c 100644
> --- a/3.7/wacom_wac.c
> +++ b/3.7/wacom_wac.c
> @@ -339,6 +339,20 @@ static int wacom_dth1152_irq(struct wacom_wac *wacom)
>         unsigned short prox, pressure = 0;
>
>         if (data[0] != WACOM_REPORT_DTUS) {
> +               if (data[0] == WACOM_REPORT_DTUSPAD) {
> +                       input_report_key(input, BTN_0, (data[1] & 0x01));
> +                       input_report_key(input, BTN_1, (data[1] & 0x02));
> +                       input_report_key(input, BTN_2, (data[1] & 0x04));
> +                       input_report_key(input, BTN_3, (data[1] & 0x08));
> +                       input_report_abs(input, ABS_MISC,
> +                                data[1] & 0x0f ? PAD_DEVICE_ID : 0);
> +                       /*
> +                        * Serial number is required when expresskeys are
> +                        * reported through pen interface.
> +                        */
> +                       input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
> +                       return 1;
> +               }
>                 dev_dbg(input->dev.parent,
>                         "%s: received unknown report #%d", __func__, data[0]);
>                 return 0;
> @@ -2080,6 +2094,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
> len)
>                 sync = wacom_dtus_irq(wacom_wac);
>                 break;
>
> +       case DTUS2:
>         case DTH1152:
>                 sync = wacom_dth1152_irq(wacom_wac);
>                 break;
> @@ -2613,14 +2628,16 @@ int wacom_setup_input_capabilities(struct input_dev 
> *input_dev,
>                 /* fall through */
>
>         case DTUS:
> -       case DTUSX:
> +       case DTUS2:
>         case DTK2451:
> +               input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +
> +       case DTUSX:
>         case PL:
>         case DTU:
> -               __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> -               __set_bit(BTN_STYLUS2, input_dev->keybit);
> -               if (features->type == DTUS || features->type == DTK2451) {
> -                       input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
> +               if (features->type != DTUS2) {
> +                       __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
> +                       __set_bit(BTN_STYLUS2, input_dev->keybit);
>                 }
>                 /* fall through */
>
> @@ -3274,6 +3291,9 @@ static const struct wacom_features wacom_features_0x357 
> =
>  static const struct wacom_features wacom_features_0x358 =
>         { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191, 63,
>           INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 
> };
> +static const struct wacom_features wacom_features_0x359 =
> +       { "Wacom DTU-1141B", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
> +         DTUS2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
>  static const struct wacom_features wacom_features_0x35A =
>         { "Wacom DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1023, 0,
>           DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
> @@ -3496,6 +3516,7 @@ const struct usb_device_id wacom_ids[] = {
>         { USB_DEVICE_WACOM(0x356) },
>         { USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
>         { USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
> +       { USB_DEVICE_WACOM(0x359) },
>         { USB_DEVICE_WACOM(0x35A) },
>         { USB_DEVICE_WACOM(0x368) },
>         { USB_DEVICE_WACOM(0x374) },
> diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h
> index 5f3fe74..1a8714f 100644
> --- a/3.7/wacom_wac.h
> +++ b/3.7/wacom_wac.h
> @@ -105,6 +105,7 @@ enum {
>         PL,
>         DTU,
>         DTUS,
> +       DTUS2,
>         DTUSX,
>         DTH1152,
>         DTK2451,
> --
> 2.7.4
>
>
>
> _______________________________________________
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to