Commit eb083ba2 authored by Roy Yin's avatar Roy Yin Committed by Dmitry Torokhov

Input: usbtouchscreen - extend coordinate range for Generaltouch devices

Generaltouch protocol allows for coordinates in [0, 0xffff] range and
there are devices reporting coordinates as high as 0x7fff so let's update
the driver to reflect that.
Signed-off-by: default avatarRoy Yin <yhch@generaltouch.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent d9c4f846
...@@ -618,8 +618,8 @@ static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt) ...@@ -618,8 +618,8 @@ static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH #ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
static int general_touch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) static int general_touch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{ {
dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1] ; dev->x = (pkt[2] << 8) | pkt[1];
dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3] ; dev->y = (pkt[4] << 8) | pkt[3];
dev->press = pkt[5] & 0xff; dev->press = pkt[5] & 0xff;
dev->touch = pkt[0] & 0x01; dev->touch = pkt[0] & 0x01;
...@@ -809,9 +809,9 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { ...@@ -809,9 +809,9 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH #ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
[DEVTYPE_GENERAL_TOUCH] = { [DEVTYPE_GENERAL_TOUCH] = {
.min_xc = 0x0, .min_xc = 0x0,
.max_xc = 0x0500, .max_xc = 0x7fff,
.min_yc = 0x0, .min_yc = 0x0,
.max_yc = 0x0500, .max_yc = 0x7fff,
.rept_size = 7, .rept_size = 7,
.read_data = general_touch_read_data, .read_data = general_touch_read_data,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment