Commit aa86f26b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: ad7877 - keep dma rx buffers in seperate cache lines
  Input: psmouse - reset all types of mice before reconnecting
  Input: elantech - use all 3 bytes when checking version
  Input: iforce - fix Guillemot Jet Leader 3D entry
  Input: iforce - add Guillemot Jet Leader Force Feedback
parents be835674 3843384a
...@@ -54,6 +54,9 @@ static signed short btn_avb_wheel[] = ...@@ -54,6 +54,9 @@ static signed short btn_avb_wheel[] =
static signed short abs_joystick[] = static signed short abs_joystick[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 }; { ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 };
static signed short abs_joystick_rudder[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y, -1 };
static signed short abs_avb_pegasus[] = static signed short abs_avb_pegasus[] =
{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y, { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_HAT0X, ABS_HAT0Y,
ABS_HAT1X, ABS_HAT1Y, -1 }; ABS_HAT1X, ABS_HAT1Y, -1 };
...@@ -76,8 +79,9 @@ static struct iforce_device iforce_device[] = { ...@@ -76,8 +79,9 @@ static struct iforce_device iforce_device[] = {
{ 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //? { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce },
{ 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x06f8, 0x0001, "Guillemot Jet Leader Force Feedback", btn_joystick, abs_joystick_rudder, ff_iforce },
{ 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //?
{ 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? { 0x06f8, 0xa302, "Guillemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?
{ 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce }, { 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce },
{ 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce } { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce }
}; };
......
...@@ -212,6 +212,7 @@ static struct usb_device_id iforce_usb_ids [] = { ...@@ -212,6 +212,7 @@ static struct usb_device_id iforce_usb_ids [] = {
{ USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */ { USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */
{ USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */ { USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */
{ USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */ { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */
{ USB_DEVICE(0x06f8, 0x0003) }, /* Guillemot Jet Leader Force Feedback */
{ USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */ { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */
{ USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */ { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */
{ } /* Terminating entry */ { } /* Terminating entry */
......
...@@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) ...@@ -185,7 +185,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
int fingers; int fingers;
static int old_fingers; static int old_fingers;
if (etd->fw_version_maj == 0x01) { if (etd->fw_version < 0x020000) {
/* /*
* byte 0: D U p1 p2 1 p3 R L * byte 0: D U p1 p2 1 p3 R L
* byte 1: f 0 th tw x9 x8 y9 y8 * byte 1: f 0 th tw x9 x8 y9 y8
...@@ -227,7 +227,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) ...@@ -227,7 +227,7 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse)
input_report_key(dev, BTN_LEFT, packet[0] & 0x01); input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
if ((etd->fw_version_maj == 0x01) && if (etd->fw_version < 0x020000 &&
(etd->capabilities & ETP_CAP_HAS_ROCKER)) { (etd->capabilities & ETP_CAP_HAS_ROCKER)) {
/* rocker up */ /* rocker up */
input_report_key(dev, BTN_FORWARD, packet[0] & 0x40); input_report_key(dev, BTN_FORWARD, packet[0] & 0x40);
...@@ -321,7 +321,7 @@ static int elantech_check_parity_v1(struct psmouse *psmouse) ...@@ -321,7 +321,7 @@ static int elantech_check_parity_v1(struct psmouse *psmouse)
unsigned char p1, p2, p3; unsigned char p1, p2, p3;
/* Parity bits are placed differently */ /* Parity bits are placed differently */
if (etd->fw_version_maj == 0x01) { if (etd->fw_version < 0x020000) {
/* byte 0: D U p1 p2 1 p3 R L */ /* byte 0: D U p1 p2 1 p3 R L */
p1 = (packet[0] & 0x20) >> 5; p1 = (packet[0] & 0x20) >> 5;
p2 = (packet[0] & 0x10) >> 4; p2 = (packet[0] & 0x10) >> 4;
...@@ -457,7 +457,7 @@ static void elantech_set_input_params(struct psmouse *psmouse) ...@@ -457,7 +457,7 @@ static void elantech_set_input_params(struct psmouse *psmouse)
switch (etd->hw_version) { switch (etd->hw_version) {
case 1: case 1:
/* Rocker button */ /* Rocker button */
if ((etd->fw_version_maj == 0x01) && if (etd->fw_version < 0x020000 &&
(etd->capabilities & ETP_CAP_HAS_ROCKER)) { (etd->capabilities & ETP_CAP_HAS_ROCKER)) {
__set_bit(BTN_FORWARD, dev->keybit); __set_bit(BTN_FORWARD, dev->keybit);
__set_bit(BTN_BACK, dev->keybit); __set_bit(BTN_BACK, dev->keybit);
...@@ -686,15 +686,14 @@ int elantech_init(struct psmouse *psmouse) ...@@ -686,15 +686,14 @@ int elantech_init(struct psmouse *psmouse)
pr_err("elantech.c: failed to query firmware version.\n"); pr_err("elantech.c: failed to query firmware version.\n");
goto init_fail; goto init_fail;
} }
etd->fw_version_maj = param[0];
etd->fw_version_min = param[2]; etd->fw_version = (param[0] << 16) | (param[1] << 8) | param[2];
/* /*
* Assume every version greater than this is new EeePC style * Assume every version greater than this is new EeePC style
* hardware with 6 byte packets * hardware with 6 byte packets
*/ */
if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) || if (etd->fw_version >= 0x020030) {
etd->fw_version_maj > 0x02) {
etd->hw_version = 2; etd->hw_version = 2;
/* For now show extra debug information */ /* For now show extra debug information */
etd->debug = 1; etd->debug = 1;
...@@ -704,8 +703,9 @@ int elantech_init(struct psmouse *psmouse) ...@@ -704,8 +703,9 @@ int elantech_init(struct psmouse *psmouse)
etd->hw_version = 1; etd->hw_version = 1;
etd->paritycheck = 1; etd->paritycheck = 1;
} }
pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d\n",
etd->hw_version, etd->fw_version_maj, etd->fw_version_min); pr_info("elantech.c: assuming hardware version %d, firmware version %d.%d.%d\n",
etd->hw_version, param[0], param[1], param[2]);
if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) { if (synaptics_send_cmd(psmouse, ETP_CAPABILITIES_QUERY, param)) {
pr_err("elantech.c: failed to query capabilities.\n"); pr_err("elantech.c: failed to query capabilities.\n");
...@@ -720,8 +720,8 @@ int elantech_init(struct psmouse *psmouse) ...@@ -720,8 +720,8 @@ int elantech_init(struct psmouse *psmouse)
* a touch action starts causing the mouse cursor or scrolled page * a touch action starts causing the mouse cursor or scrolled page
* to jump. Enable a workaround. * to jump. Enable a workaround.
*/ */
if (etd->fw_version_maj == 0x02 && etd->fw_version_min == 0x22) { if (etd->fw_version == 0x020022) {
pr_info("elantech.c: firmware version 2.34 detected, " pr_info("elantech.c: firmware version 2.0.34 detected, "
"enabling jumpy cursor workaround\n"); "enabling jumpy cursor workaround\n");
etd->jumpy_cursor = 1; etd->jumpy_cursor = 1;
} }
......
...@@ -100,11 +100,10 @@ struct elantech_data { ...@@ -100,11 +100,10 @@ struct elantech_data {
unsigned char reg_26; unsigned char reg_26;
unsigned char debug; unsigned char debug;
unsigned char capabilities; unsigned char capabilities;
unsigned char fw_version_maj;
unsigned char fw_version_min;
unsigned char hw_version;
unsigned char paritycheck; unsigned char paritycheck;
unsigned char jumpy_cursor; unsigned char jumpy_cursor;
unsigned char hw_version;
unsigned int fw_version;
unsigned char parity[256]; unsigned char parity[256];
}; };
......
...@@ -1394,6 +1394,7 @@ static int psmouse_reconnect(struct serio *serio) ...@@ -1394,6 +1394,7 @@ static int psmouse_reconnect(struct serio *serio)
struct psmouse *psmouse = serio_get_drvdata(serio); struct psmouse *psmouse = serio_get_drvdata(serio);
struct psmouse *parent = NULL; struct psmouse *parent = NULL;
struct serio_driver *drv = serio->drv; struct serio_driver *drv = serio->drv;
unsigned char type;
int rc = -1; int rc = -1;
if (!drv || !psmouse) { if (!drv || !psmouse) {
...@@ -1413,9 +1414,14 @@ static int psmouse_reconnect(struct serio *serio) ...@@ -1413,9 +1414,14 @@ static int psmouse_reconnect(struct serio *serio)
if (psmouse->reconnect) { if (psmouse->reconnect) {
if (psmouse->reconnect(psmouse)) if (psmouse->reconnect(psmouse))
goto out; goto out;
} else if (psmouse_probe(psmouse) < 0 || } else {
psmouse->type != psmouse_extensions(psmouse, psmouse_reset(psmouse);
psmouse_max_proto, false)) {
if (psmouse_probe(psmouse) < 0)
goto out;
type = psmouse_extensions(psmouse, psmouse_max_proto, false);
if (psmouse->type != type)
goto out; goto out;
} }
......
...@@ -156,9 +156,14 @@ struct ser_req { ...@@ -156,9 +156,14 @@ struct ser_req {
u16 reset; u16 reset;
u16 ref_on; u16 ref_on;
u16 command; u16 command;
u16 sample;
struct spi_message msg; struct spi_message msg;
struct spi_transfer xfer[6]; struct spi_transfer xfer[6];
/*
* DMA (thus cache coherency maintenance) requires the
* transfer buffers to live in their own cache lines.
*/
u16 sample ____cacheline_aligned;
}; };
struct ad7877 { struct ad7877 {
...@@ -182,8 +187,6 @@ struct ad7877 { ...@@ -182,8 +187,6 @@ struct ad7877 {
u8 averaging; u8 averaging;
u8 pen_down_acc_interval; u8 pen_down_acc_interval;
u16 conversion_data[AD7877_NR_SENSE];
struct spi_transfer xfer[AD7877_NR_SENSE + 2]; struct spi_transfer xfer[AD7877_NR_SENSE + 2];
struct spi_message msg; struct spi_message msg;
...@@ -195,6 +198,12 @@ struct ad7877 { ...@@ -195,6 +198,12 @@ struct ad7877 {
spinlock_t lock; spinlock_t lock;
struct timer_list timer; /* P: lock */ struct timer_list timer; /* P: lock */
unsigned pending:1; /* P: lock */ unsigned pending:1; /* P: lock */
/*
* DMA (thus cache coherency maintenance) requires the
* transfer buffers to live in their own cache lines.
*/
u16 conversion_data[AD7877_NR_SENSE] ____cacheline_aligned;
}; };
static int gpio3; static int gpio3;
......
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