Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1115bb6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input updates from Dmitry Torokhov:
 "A new driver for FT5x06 based EDT displays and a couple of other
  driver changes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics - handle out of bounds values from the hardware
  Input: wacom - add support to Cintiq 22HD
  Input: add driver for FT5x06 based EDT displays
parents 76c97e6c cf45b5a2
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
EDT ft5x06 based Polytouch devices
----------------------------------

The edt-ft5x06 driver is useful for the EDT "Polytouch" family of capacitive
touch screens. Note that it is *not* suitable for other devices based on the
focaltec ft5x06 devices, since they contain vendor-specific firmware. In
particular this driver is not suitable for the Nook tablet.

It has been tested with the following devices:
  * EP0350M06
  * EP0430M06
  * EP0570M06
  * EP0700M06

The driver allows configuration of the touch screen via a set of sysfs files:

/sys/class/input/eventX/device/device/threshold:
    allows setting the "click"-threshold in the range from 20 to 80.

/sys/class/input/eventX/device/device/gain:
    allows setting the sensitivity in the range from 0 to 31. Note that
    lower values indicate higher sensitivity.

/sys/class/input/eventX/device/device/offset:
    allows setting the edge compensation in the range from 0 to 31.

/sys/class/input/eventX/device/device/report_rate:
    allows setting the report rate in the range from 3 to 14.


For debugging purposes the driver provides a few files in the debug
filesystem (if available in the kernel). In /sys/kernel/debug/edt_ft5x06
you'll find the following files:

num_x, num_y:
    (readonly) contains the number of sensor fields in X- and
    Y-direction.

mode:
    allows switching the sensor between "factory mode" and "operation
    mode" by writing "1" or "0" to it. In factory mode (1) it is
    possible to get the raw data from the sensor. Note that in factory
    mode regular events don't get delivered and the options described
    above are unavailable.

raw_data:
    contains num_x * num_y big endian 16 bit values describing the raw
    values for each sensor field. Note that each read() call on this
    files triggers a new readout. It is recommended to provide a buffer
    big enough to contain num_x * num_y * 2 bytes.

Note that reading raw_data gives a I/O error when the device is not in factory
mode. The same happens when reading/writing to the parameter files when the
device is not in regular operation mode.
+22 −0
Original line number Diff line number Diff line
@@ -40,11 +40,27 @@
 * Note that newer firmware allows querying device for maximum useable
 * coordinates.
 */
#define XMIN 0
#define XMAX 6143
#define YMIN 0
#define YMAX 6143
#define XMIN_NOMINAL 1472
#define XMAX_NOMINAL 5472
#define YMIN_NOMINAL 1408
#define YMAX_NOMINAL 4448

/* Size in bits of absolute position values reported by the hardware */
#define ABS_POS_BITS 13

/*
 * Any position values from the hardware above the following limits are
 * treated as "wrapped around negative" values that have been truncated to
 * the 13-bit reporting range of the hardware. These are just reasonable
 * guesses and can be adjusted if hardware is found that operates outside
 * of these parameters.
 */
#define X_MAX_POSITIVE (((1 << ABS_POS_BITS) + XMAX) / 2)
#define Y_MAX_POSITIVE (((1 << ABS_POS_BITS) + YMAX) / 2)

/*****************************************************************************
 *	Stuff we need even when we do not want native Synaptics support
@@ -588,6 +604,12 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
		hw->right = (buf[0] & 0x02) ? 1 : 0;
	}

	/* Convert wrap-around values to negative */
	if (hw->x > X_MAX_POSITIVE)
		hw->x -= 1 << ABS_POS_BITS;
	if (hw->y > Y_MAX_POSITIVE)
		hw->y -= 1 << ABS_POS_BITS;

	return 0;
}

+19 −2
Original line number Diff line number Diff line
@@ -464,7 +464,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
		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) {
		    (features->type >= WACOM_21UX2 && features->type <= WACOM_24HD)) {
			t = (t << 1) | (data[1] & 1);
		}
		input_report_abs(input, ABS_PRESSURE, t);
@@ -614,7 +614,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
				input_report_abs(input, ABS_MISC, 0);
			}
		} else {
			if (features->type == WACOM_21UX2) {
			if (features->type == WACOM_21UX2 || features->type == WACOM_22HD) {
				input_report_key(input, BTN_0, (data[5] & 0x01));
				input_report_key(input, BTN_1, (data[6] & 0x01));
				input_report_key(input, BTN_2, (data[6] & 0x02));
@@ -633,6 +633,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
				input_report_key(input, BTN_Z, (data[8] & 0x20));
				input_report_key(input, BTN_BASE, (data[8] & 0x40));
				input_report_key(input, BTN_BASE2, (data[8] & 0x80));

				if (features->type == WACOM_22HD) {
					input_report_key(input, KEY_PROG1, data[9] & 0x01);
					input_report_key(input, KEY_PROG2, data[9] & 0x02);
					input_report_key(input, KEY_PROG3, data[9] & 0x04);
				}
			} else {
				input_report_key(input, BTN_0, (data[5] & 0x01));
				input_report_key(input, BTN_1, (data[5] & 0x02));
@@ -1231,6 +1237,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
	case CINTIQ:
	case WACOM_BEE:
	case WACOM_21UX2:
	case WACOM_22HD:
	case WACOM_24HD:
		sync = wacom_intuos_irq(wacom_wac);
		break;
@@ -1432,6 +1439,12 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
		wacom_setup_cintiq(wacom_wac);
		break;

	case WACOM_22HD:
		__set_bit(KEY_PROG1, input_dev->keybit);
		__set_bit(KEY_PROG2, input_dev->keybit);
		__set_bit(KEY_PROG3, input_dev->keybit);
		/* fall through */

	case WACOM_21UX2:
		__set_bit(BTN_A, input_dev->keybit);
		__set_bit(BTN_B, input_dev->keybit);
@@ -1858,6 +1871,9 @@ static const struct wacom_features wacom_features_0xF0 =
static const struct wacom_features wacom_features_0xCC =
	{ "Wacom Cintiq 21UX2",   WACOM_PKGLEN_INTUOS,    87200, 65600, 2047,
	  63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
static const struct wacom_features wacom_features_0xFA =
	{ "Wacom Cintiq 22HD",    WACOM_PKGLEN_INTUOS,    95840, 54260, 2047,
	  63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
static const struct wacom_features wacom_features_0x90 =
	{ "Wacom ISDv4 90",       WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,
	  0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2075,6 +2091,7 @@ const struct usb_device_id wacom_ids[] = {
	{ USB_DEVICE_WACOM(0xEF) },
	{ USB_DEVICE_WACOM(0x47) },
	{ USB_DEVICE_WACOM(0xF4) },
	{ USB_DEVICE_WACOM(0xFA) },
	{ USB_DEVICE_LENOVO(0x6004) },
	{ }
};
+2 −1
Original line number Diff line number Diff line
@@ -73,8 +73,9 @@ enum {
	INTUOS5S,
	INTUOS5,
	INTUOS5L,
	WACOM_24HD,
	WACOM_21UX2,
	WACOM_22HD,
	WACOM_24HD,
	CINTIQ,
	WACOM_BEE,
	WACOM_MO,
+13 −0
Original line number Diff line number Diff line
@@ -472,6 +472,19 @@ config TOUCHSCREEN_PENMOUNT
	  To compile this driver as a module, choose M here: the
	  module will be called penmount.

config TOUCHSCREEN_EDT_FT5X06
	tristate "EDT FocalTech FT5x06 I2C Touchscreen support"
	depends on I2C
	help
	  Say Y here if you have an EDT "Polytouch" touchscreen based
	  on the FocalTech FT5x06 family of controllers connected to
	  your system.

	  If unsure, say N.

	  To compile this driver as a module, choose M here: the
	  module will be called edt-ft5x06.

config TOUCHSCREEN_MIGOR
	tristate "Renesas MIGO-R touchscreen"
	depends on SH_MIGOR && I2C
Loading