Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- linux-3.18.1/drivers/input/mouse/focaltech.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/focaltech.c 2014-12-16 11:11:57.000000000 +0100
- @@ -2,6 +2,7 @@
- * Focaltech TouchPad PS/2 mouse driver
- *
- * Copyright (c) 2014 Red Hat Inc.
- + * Copyright (c) 2014 Mathias Gottschlag <mgottschlag@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- @@ -13,15 +14,14 @@
- * Hans de Goede <hdegoede@redhat.com>
- */
- -/*
- - * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with
- - * detection only, to avoid further detection attempts confusing the touchpad
- - * this way it at least works in PS/2 mouse compatibility mode.
- - */
- #include <linux/device.h>
- #include <linux/libps2.h>
- +#include <linux/input/mt.h>
- +#include <linux/serio.h>
- +#include <linux/slab.h>
- #include "psmouse.h"
- +#include "focaltech.h"
- static const char * const focaltech_pnp_ids[] = {
- "FLT0101",
- @@ -30,6 +30,12 @@
- NULL
- };
- +/*
- + * Even if the kernel is built without support for Focaltech PS/2 touchpads (or
- + * when the real driver fails to recognize the device), we still have to detect
- + * them in order to avoid further detection attempts confusing the touchpad.
- + * This way it at least works in PS/2 mouse compatibility mode.
- + */
- int focaltech_detect(struct psmouse *psmouse, bool set_properties)
- {
- if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids))
- @@ -37,16 +43,309 @@
- if (set_properties) {
- psmouse->vendor = "FocalTech";
- - psmouse->name = "FocalTech Touchpad in mouse emulation mode";
- + psmouse->name = "FocalTech Touchpad";
- }
- return 0;
- }
- -int focaltech_init(struct psmouse *psmouse)
- +static void focaltech_reset(struct psmouse *psmouse)
- {
- ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS);
- psmouse_reset(psmouse);
- +}
- +
- +#ifdef CONFIG_MOUSE_PS2_FOCALTECH
- +
- +static void focaltech_report_state(struct psmouse *psmouse)
- +{
- + int i;
- + struct focaltech_data *priv = psmouse->private;
- + struct focaltech_hw_state *state = &priv->state;
- + struct input_dev *dev = psmouse->dev;
- +
- + for (i = 0; i < FOC_MAX_FINGERS; i++) {
- + struct focaltech_finger_state *finger = &state->fingers[i];
- + bool active = finger->active && finger->valid;
- + input_mt_slot(dev, i);
- + input_mt_report_slot_state(dev, MT_TOOL_FINGER, active);
- + if (active) {
- + input_report_abs(dev, ABS_MT_POSITION_X, finger->x);
- + input_report_abs(dev, ABS_MT_POSITION_Y,
- + focaltech_invert_y(finger->y));
- + }
- + }
- + input_mt_report_pointer_emulation(dev, true);
- +
- + input_report_key(psmouse->dev, BTN_LEFT, state->pressed);
- + input_sync(psmouse->dev);
- +}
- +
- +static void process_touch_packet(struct focaltech_hw_state *state,
- + unsigned char *packet)
- +{
- + int i;
- + unsigned char fingers = packet[1];
- +
- + state->pressed = (packet[0] >> 4) & 1;
- + /* the second byte contains a bitmap of all fingers touching the pad */
- + for (i = 0; i < FOC_MAX_FINGERS; i++) {
- + state->fingers[i].active = fingers & 0x1;
- + if (!state->fingers[i].active) {
- + /* even when the finger becomes active again, we still
- + * will have to wait for the first valid position */
- + state->fingers[i].valid = false;
- + }
- + fingers >>= 1;
- + }
- +}
- +
- +static void process_abs_packet(struct psmouse *psmouse,
- + unsigned char *packet)
- +{
- + struct focaltech_data *priv = psmouse->private;
- + struct focaltech_hw_state *state = &priv->state;
- + unsigned int finger;
- +
- + finger = (packet[1] >> 4) - 1;
- + if (finger >= FOC_MAX_FINGERS) {
- + psmouse_err(psmouse, "Invalid finger in abs packet: %d",
- + finger);
- + return;
- + }
- +
- + state->pressed = (packet[0] >> 4) & 1;
- + /*
- + * packet[5] contains some kind of tool size in the most significant
- + * nibble. 0xff is a special value (latching) that signals a large
- + * contact area.
- + */
- + if (packet[5] == 0xff) {
- + state->fingers[finger].valid = false;
- + return;
- + }
- + state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2];
- + state->fingers[finger].y = (packet[3] << 8) | packet[4];
- + state->fingers[finger].valid = true;
- +}
- +
- +static void process_rel_packet(struct psmouse *psmouse,
- + unsigned char *packet)
- +{
- + struct focaltech_data *priv = psmouse->private;
- + struct focaltech_hw_state *state = &priv->state;
- + int finger1, finger2;
- +
- + state->pressed = packet[0] >> 7;
- + finger1 = ((packet[0] >> 4) & 0x7) - 1;
- + if (finger1 < FOC_MAX_FINGERS) {
- + state->fingers[finger1].x += (char)packet[1];
- + state->fingers[finger1].y += (char)packet[2];
- + } else {
- + psmouse_err(psmouse, "First finger in rel packet invalid: %d",
- + finger1);
- + }
- + /*
- + * If there is an odd number of fingers, the last relative packet only
- + * contains one finger. In this case, the second finger index in the
- + * packet is 0 (we subtract 1 in the lines above to create array
- + * indices, so the finger will overflow and be above FOC_MAX_FINGERS).
- + */
- + finger2 = ((packet[3] >> 4) & 0x7) - 1;
- + if (finger2 < FOC_MAX_FINGERS) {
- + state->fingers[finger2].x += (char)packet[4];
- + state->fingers[finger2].y += (char)packet[5];
- + }
- +}
- +
- +static void focaltech_process_packet(struct psmouse *psmouse)
- +{
- + struct focaltech_data *priv = psmouse->private;
- + unsigned char *packet = psmouse->packet;
- +
- + switch (packet[0] & 0xf) {
- + case FOC_TOUCH:
- + process_touch_packet(&priv->state, packet);
- + break;
- + case FOC_ABS:
- + process_abs_packet(psmouse, packet);
- + break;
- + case FOC_REL:
- + process_rel_packet(psmouse, packet);
- + break;
- + default:
- + psmouse_err(psmouse, "Unknown packet type: %02x", packet[0]);
- + break;
- + }
- +
- + focaltech_report_state(psmouse);
- +}
- +
- +static psmouse_ret_t focaltech_process_byte(struct psmouse *psmouse)
- +{
- + if (psmouse->pktcnt >= 6) { /* Full packet received */
- + focaltech_process_packet(psmouse);
- + return PSMOUSE_FULL_PACKET;
- + }
- + /*
- + * we might want to do some validation of the data here, but we do not
- + * know the protocoll well enough
- + */
- + return PSMOUSE_GOOD_DATA;
- +}
- +
- +static int focaltech_switch_protocol(struct psmouse *psmouse)
- +{
- + struct ps2dev *ps2dev = &psmouse->ps2dev;
- + unsigned char param[3];
- +
- + param[0] = 0;
- + if (ps2_command(ps2dev, param, 0x10f8))
- + return -EIO;
- + if (ps2_command(ps2dev, param, 0x10f8))
- + return -EIO;
- + if (ps2_command(ps2dev, param, 0x10f8))
- + return -EIO;
- + param[0] = 1;
- + if (ps2_command(ps2dev, param, 0x10f8))
- + return -EIO;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11))
- + return -EIO;
- +
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_ENABLE))
- + return -EIO;
- +
- + return 0;
- +}
- +
- +static void focaltech_disconnect(struct psmouse *psmouse)
- +{
- + focaltech_reset(psmouse);
- + kfree(psmouse->private);
- + psmouse->private = NULL;
- +}
- +
- +static int focaltech_reconnect(struct psmouse *psmouse)
- +{
- + focaltech_reset(psmouse);
- + if (focaltech_switch_protocol(psmouse)) {
- + psmouse_err(psmouse,
- + "Unable to initialize the device.");
- + return -1;
- + }
- + return 0;
- +}
- +
- +static void set_input_params(struct psmouse *psmouse)
- +{
- + struct input_dev *dev = psmouse->dev;
- + struct focaltech_data *priv = psmouse->private;
- +
- + __set_bit(EV_ABS, dev->evbit);
- + input_set_abs_params(dev, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0);
- + input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0);
- + input_mt_init_slots(dev, 5, INPUT_MT_POINTER);
- + __clear_bit(EV_REL, dev->evbit);
- + __clear_bit(REL_X, dev->relbit);
- + __clear_bit(REL_Y, dev->relbit);
- + __clear_bit(BTN_RIGHT, dev->keybit);
- + __clear_bit(BTN_MIDDLE, dev->keybit);
- + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
- +}
- +
- +static int focaltech_read_register(struct ps2dev *ps2dev, int reg,
- + unsigned char *param)
- +{
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11))
- + return -EIO;
- + param[0] = 0;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES))
- + return -EIO;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES))
- + return -EIO;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES))
- + return -EIO;
- + param[0] = reg;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES))
- + return -EIO;
- + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
- + return -EIO;
- + return 0;
- +}
- +
- +static int focaltech_read_size(struct psmouse *psmouse)
- +{
- + struct ps2dev *ps2dev = &psmouse->ps2dev;
- + struct focaltech_data *priv = psmouse->private;
- + char param[3];
- +
- + if (focaltech_read_register(ps2dev, 2, param))
- + return -EIO;
- + /* not sure whether this is 100% correct */
- + priv->x_max = (unsigned char)param[1] * 128;
- + priv->y_max = (unsigned char)param[2] * 128;
- +
- + return 0;
- +}
- +int focaltech_init(struct psmouse *psmouse)
- +{
- + struct focaltech_data *priv;
- + int err;
- +
- + psmouse->private = priv = kzalloc(sizeof(struct focaltech_data), GFP_KERNEL);
- + if (!priv)
- + return -ENOMEM;
- +
- + focaltech_reset(psmouse);
- + err = focaltech_read_size(psmouse);
- + if (err) {
- + focaltech_reset(psmouse);
- + psmouse_err(psmouse,
- + "Unable to read the size of the touchpad.");
- + goto fail;
- + }
- + if (focaltech_switch_protocol(psmouse)) {
- + focaltech_reset(psmouse);
- + psmouse_err(psmouse,
- + "Unable to initialize the device.");
- + err = -ENOSYS;
- + goto fail;
- + }
- +
- + set_input_params(psmouse);
- +
- + psmouse->protocol_handler = focaltech_process_byte;
- + psmouse->pktsize = 6;
- + psmouse->disconnect = focaltech_disconnect;
- + psmouse->reconnect = focaltech_reconnect;
- + psmouse->cleanup = focaltech_reset;
- + /* resync is not supported yet */
- + psmouse->resync_time = 0;
- return 0;
- +fail:
- + focaltech_reset(psmouse);
- + kfree(priv);
- + return err;
- +}
- +
- +bool focaltech_supported(void)
- +{
- + return true;
- }
- +
- +#else /* CONFIG_MOUSE_PS2_FOCALTECH */
- +
- +int focaltech_init(struct psmouse *psmouse)
- +{
- + focaltech_reset(psmouse);
- +
- + return 0;
- +}
- +
- +bool focaltech_supported(void)
- +{
- + return false;
- +}
- +
- +#endif /* CONFIG_MOUSE_PS2_FOCALTECH */
- diff -uNr linux-3.18.1/drivers/input/mouse/focaltech.h ubuntu-fixes-pilot6/drivers/input/mouse/focaltech.h
- --- linux-3.18.1/drivers/input/mouse/focaltech.h 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/focaltech.h 2014-12-16 11:11:57.000000000 +0100
- @@ -2,6 +2,7 @@
- * Focaltech TouchPad PS/2 mouse driver
- *
- * Copyright (c) 2014 Red Hat Inc.
- + * Copyright (c) 2014 Mathias Gottschlag <mgottschlag@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- @@ -16,7 +17,66 @@
- #ifndef _FOCALTECH_H
- #define _FOCALTECH_H
- +/*
- + * Packet types - the numbers are not consecutive, so we might be missing
- + * something here.
- + */
- +#define FOC_TOUCH 0x3 /* bitmap of active fingers */
- +#define FOC_ABS 0x6 /* absolute position of one finger */
- +#define FOC_REL 0x9 /* relative position of 1-2 fingers */
- +
- +#define FOC_MAX_FINGERS 5
- +
- +#define FOC_MAX_X 2431
- +#define FOC_MAX_Y 1663
- +
- +static inline int focaltech_invert_y(int y)
- +{
- + return FOC_MAX_Y - y;
- +}
- +
- +/*
- + * Current state of a single finger on the touchpad.
- + */
- +struct focaltech_finger_state {
- + /* the touchpad has generated a touch event for the finger */
- + bool active;
- + /*
- + * The touchpad has sent position data for the finger. The flag is 0
- + * when the finger is not active, and there is a time between the first
- + * touch event for the finger and the following absolute position
- + * packet for the finger where the touchpad has declared the finger to
- + * be valid, but we do not have any valid position yet.
- + */
- + bool valid;
- + /* absolute position (from the bottom left corner) of the finger */
- + unsigned int x;
- + unsigned int y;
- +};
- +
- +/*
- + * Description of the current state of the touchpad hardware.
- + */
- +struct focaltech_hw_state {
- + /*
- + * The touchpad tracks the positions of the fingers for us, the array
- + * indices correspond to the finger indices returned in the report
- + * packages.
- + */
- + struct focaltech_finger_state fingers[FOC_MAX_FINGERS];
- + /*
- + * True if the clickpad has been pressed.
- + */
- + bool pressed;
- +};
- +
- +struct focaltech_data {
- + unsigned int x_max, y_max;
- + struct focaltech_hw_state state;
- +};
- +
- int focaltech_detect(struct psmouse *psmouse, bool set_properties);
- int focaltech_init(struct psmouse *psmouse);
- +bool focaltech_supported(void);
- #endif
- diff -uNr linux-3.18.1/drivers/input/mouse/Kconfig ubuntu-fixes-pilot6/drivers/input/mouse/Kconfig
- --- linux-3.18.1/drivers/input/mouse/Kconfig 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/Kconfig 2014-12-16 11:11:57.000000000 +0100
- @@ -146,6 +146,17 @@
- If unsure, say N.
- +config MOUSE_PS2_FOCALTECH
- + bool "FocalTech PS/2 mouse protocol extension" if EXPERT
- + default y
- + depends on MOUSE_PS2
- + help
- + Say Y here if you have a FocalTech PS/2 TouchPad connected to
- + your system.
- +
- + If unsure, say Y.
- +
- +
- config MOUSE_SERIAL
- tristate "Serial mouse"
- select SERIO
- diff -uNr linux-3.18.1/drivers/input/mouse/psmouse-base.c ubuntu-fixes-pilot6/drivers/input/mouse/psmouse-base.c
- --- linux-3.18.1/drivers/input/mouse/psmouse-base.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/psmouse-base.c 2014-12-16 11:11:57.000000000 +0100
- @@ -685,8 +685,6 @@
- __set_bit(REL_X, input_dev->relbit);
- __set_bit(REL_Y, input_dev->relbit);
- - __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
- -
- psmouse->set_rate = psmouse_set_rate;
- psmouse->set_resolution = psmouse_set_resolution;
- psmouse->poll = psmouse_poll;
- @@ -725,16 +723,19 @@
- /* Always check for focaltech, this is safe as it uses pnp-id matching */
- if (psmouse_do_detect(focaltech_detect, psmouse, set_properties) == 0) {
- - if (!set_properties || focaltech_init(psmouse) == 0) {
- - /*
- - * Not supported yet, use bare protocol.
- - * Note that we need to also restrict
- - * psmouse_max_proto so that psmouse_initialize()
- - * does not try to reset rate and resolution,
- - * because even that upsets the device.
- - */
- - psmouse_max_proto = PSMOUSE_PS2;
- - return PSMOUSE_PS2;
- + if (max_proto > PSMOUSE_IMEX) {
- + if (!set_properties || focaltech_init(psmouse) == 0) {
- + if (focaltech_supported())
- + return PSMOUSE_FOCALTECH;
- + /*
- + * Note that we need to also restrict
- + * psmouse_max_proto so that psmouse_initialize()
- + * does not try to reset rate and resolution,
- + * because even that upsets the device.
- + */
- + psmouse_max_proto = PSMOUSE_PS2;
- + return PSMOUSE_PS2;
- + }
- }
- }
- @@ -1063,6 +1064,15 @@
- .alias = "cortps",
- .detect = cortron_detect,
- },
- +#ifdef CONFIG_MOUSE_PS2_FOCALTECH
- + {
- + .type = PSMOUSE_FOCALTECH,
- + .name = "FocalTechPS/2",
- + .alias = "focaltech",
- + .detect = focaltech_detect,
- + .init = focaltech_init,
- + },
- +#endif
- {
- .type = PSMOUSE_AUTO,
- .name = "auto",
- @@ -1536,9 +1546,16 @@
- {
- struct psmouse *psmouse = serio_get_drvdata(serio);
- struct psmouse *parent = NULL;
- + struct serio_driver *drv = serio->drv;
- unsigned char type;
- int rc = -1;
- + if (!drv || !psmouse) {
- + psmouse_dbg(psmouse,
- + "reconnect request, but serio is disconnected, ignoring...\n");
- + return -1;
- + }
- +
- mutex_lock(&psmouse_mutex);
- if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
- diff -uNr linux-3.18.1/drivers/input/mouse/psmouse.h ubuntu-fixes-pilot6/drivers/input/mouse/psmouse.h
- --- linux-3.18.1/drivers/input/mouse/psmouse.h 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/psmouse.h 2014-12-16 11:11:57.000000000 +0100
- @@ -96,6 +96,7 @@
- PSMOUSE_FSP,
- PSMOUSE_SYNAPTICS_RELATIVE,
- PSMOUSE_CYPRESS,
- + PSMOUSE_FOCALTECH,
- PSMOUSE_AUTO /* This one should always be last */
- };
- diff -uNr linux-3.18.1/drivers/input/mouse/synaptics.c ubuntu-fixes-pilot6/drivers/input/mouse/synaptics.c
- --- linux-3.18.1/drivers/input/mouse/synaptics.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/synaptics.c 2014-12-16 11:11:57.000000000 +0100
- @@ -117,9 +117,6 @@
- }
- #ifdef CONFIG_MOUSE_PS2_SYNAPTICS
- -
- -static bool cr48_profile_sensor;
- -
- struct min_max_quirk {
- const char * const *pnp_ids;
- int x_min, x_max, y_min, y_max;
- @@ -143,10 +140,6 @@
- (const char * const []){"LEN2001", NULL},
- 1024, 5022, 2508, 4832
- },
- - {
- - (const char * const []){"LEN2006", NULL},
- - 1264, 5675, 1171, 4688
- - },
- { }
- };
- @@ -190,6 +183,7 @@
- NULL
- };
- +
- /*****************************************************************************
- * Synaptics communications functions
- ****************************************************************************/
- @@ -355,8 +349,7 @@
- }
- for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
- - if (psmouse_matches_pnp_id(psmouse,
- - min_max_pnpid_table[i].pnp_ids)) {
- + if (psmouse_matches_pnp_id(psmouse, min_max_pnpid_table[i].pnp_ids)) {
- priv->x_min = min_max_pnpid_table[i].x_min;
- priv->x_max = min_max_pnpid_table[i].x_max;
- priv->y_min = min_max_pnpid_table[i].y_min;
- @@ -1187,42 +1180,6 @@
- priv->agm_pending = false;
- }
- -static void synaptics_profile_sensor_process(struct psmouse *psmouse,
- - struct synaptics_hw_state *sgm,
- - int num_fingers)
- -{
- - struct input_dev *dev = psmouse->dev;
- - struct synaptics_data *priv = psmouse->private;
- - struct synaptics_hw_state *hw[2] = { sgm, &priv->agm };
- - struct input_mt_pos pos[2];
- - int slot[2], nsemi, i;
- -
- - nsemi = clamp_val(num_fingers, 0, 2);
- -
- - for (i = 0; i < nsemi; i++) {
- - pos[i].x = hw[i]->x;
- - pos[i].y = synaptics_invert_y(hw[i]->y);
- - }
- -
- - input_mt_assign_slots(dev, slot, pos, nsemi);
- -
- - for (i = 0; i < nsemi; i++) {
- - input_mt_slot(dev, slot[i]);
- - input_mt_report_slot_state(dev, MT_TOOL_FINGER, true);
- - input_report_abs(dev, ABS_MT_POSITION_X, pos[i].x);
- - input_report_abs(dev, ABS_MT_POSITION_Y, pos[i].y);
- - input_report_abs(dev, ABS_MT_PRESSURE, hw[i]->z);
- - }
- -
- - input_mt_drop_unused(dev);
- - input_mt_report_pointer_emulation(dev, false);
- - input_mt_report_finger_count(dev, num_fingers);
- -
- - synaptics_report_buttons(psmouse, sgm);
- -
- - input_sync(dev);
- -}
- -
- /*
- * called for each full received packet from the touchpad
- */
- @@ -1286,11 +1243,6 @@
- finger_width = 0;
- }
- - if (cr48_profile_sensor) {
- - synaptics_profile_sensor_process(psmouse, &hw, num_fingers);
- - return;
- - }
- -
- if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c))
- synaptics_report_semi_mt_data(dev, &hw, &priv->agm,
- num_fingers);
- @@ -1436,9 +1388,6 @@
- set_abs_position_params(dev, priv, ABS_X, ABS_Y);
- input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
- - if (cr48_profile_sensor)
- - input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
- -
- if (SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c)) {
- set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
- ABS_MT_POSITION_Y);
- @@ -1450,16 +1399,11 @@
- __set_bit(BTN_TOOL_QUADTAP, dev->keybit);
- __set_bit(BTN_TOOL_QUINTTAP, dev->keybit);
- } else if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
- + /* Non-image sensors with AGM use semi-mt */
- + __set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
- + input_mt_init_slots(dev, 2, 0);
- set_abs_position_params(dev, priv, ABS_MT_POSITION_X,
- ABS_MT_POSITION_Y);
- - /*
- - * Profile sensor in CR-48 tracks contacts reasonably well,
- - * other non-image sensors with AGM use semi-mt.
- - */
- - input_mt_init_slots(dev, 2,
- - INPUT_MT_POINTER |
- - (cr48_profile_sensor ?
- - INPUT_MT_TRACK : INPUT_MT_SEMI_MT));
- }
- if (SYN_CAP_PALMDETECT(priv->capabilities))
- @@ -1493,7 +1437,9 @@
- /* Clickpads report only left button */
- __clear_bit(BTN_RIGHT, dev->keybit);
- __clear_bit(BTN_MIDDLE, dev->keybit);
- - }
- + } else if (SYN_CAP_CLICKPAD2BTN(priv->ext_cap_0c) ||
- + SYN_CAP_CLICKPAD2BTN2(priv->ext_cap_0c))
- + __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
- }
- static ssize_t synaptics_show_disable_gesture(struct psmouse *psmouse,
- @@ -1661,19 +1607,6 @@
- { }
- };
- -static const struct dmi_system_id __initconst cr48_dmi_table[] = {
- -#if defined(CONFIG_DMI) && defined(CONFIG_X86)
- - {
- - /* Cr-48 Chromebook (Codename Mario) */
- - .matches = {
- - DMI_MATCH(DMI_SYS_VENDOR, "IEC"),
- - DMI_MATCH(DMI_PRODUCT_NAME, "Mario"),
- - },
- - },
- -#endif
- - { }
- -};
- -
- static const struct dmi_system_id forcepad_dmi_table[] __initconst = {
- #if defined(CONFIG_DMI) && defined(CONFIG_X86)
- {
- @@ -1690,7 +1623,6 @@
- {
- impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table);
- broken_olpc_ec = dmi_check_system(olpc_dmi_table);
- - cr48_profile_sensor = dmi_check_system(cr48_dmi_table);
- /*
- * Unfortunately ForcePad capability is not exported over PS/2,
- diff -uNr linux-3.18.1/drivers/input/mouse/synaptics.h ubuntu-fixes-pilot6/drivers/input/mouse/synaptics.h
- --- linux-3.18.1/drivers/input/mouse/synaptics.h 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/synaptics.h 2014-12-16 11:11:57.000000000 +0100
- @@ -83,6 +83,7 @@
- */
- #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */
- #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */
- +#define SYN_CAP_CLICKPAD2BTN2(ex0c) ((ex0c) & 0x200000) /* 2-button ClickPad */
- #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000)
- #define SYN_CAP_MIN_DIMENSIONS(ex0c) ((ex0c) & 0x002000)
- #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000)
- diff -uNr linux-3.18.1/drivers/input/mouse/synaptics_usb.c ubuntu-fixes-pilot6/drivers/input/mouse/synaptics_usb.c
- --- linux-3.18.1/drivers/input/mouse/synaptics_usb.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/synaptics_usb.c 2014-12-16 11:11:57.000000000 +0100
- @@ -387,7 +387,6 @@
- __set_bit(EV_REL, input_dev->evbit);
- __set_bit(REL_X, input_dev->relbit);
- __set_bit(REL_Y, input_dev->relbit);
- - __set_bit(INPUT_PROP_POINTING_STICK, input_dev->propbit);
- input_set_abs_params(input_dev, ABS_PRESSURE, 0, 127, 0, 0);
- } else {
- input_set_abs_params(input_dev, ABS_X,
- @@ -402,11 +401,6 @@
- __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
- }
- - if (synusb->flags & SYNUSB_TOUCHSCREEN)
- - __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
- - else
- - __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
- -
- __set_bit(BTN_LEFT, input_dev->keybit);
- __set_bit(BTN_RIGHT, input_dev->keybit);
- __set_bit(BTN_MIDDLE, input_dev->keybit);
- diff -uNr linux-3.18.1/drivers/input/mouse/trackpoint.c ubuntu-fixes-pilot6/drivers/input/mouse/trackpoint.c
- --- linux-3.18.1/drivers/input/mouse/trackpoint.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/trackpoint.c 2014-12-16 11:11:57.000000000 +0100
- @@ -393,9 +393,6 @@
- if ((button_info & 0x0f) >= 3)
- __set_bit(BTN_MIDDLE, psmouse->dev->keybit);
- - __set_bit(INPUT_PROP_POINTER, psmouse->dev->propbit);
- - __set_bit(INPUT_PROP_POINTING_STICK, psmouse->dev->propbit);
- -
- trackpoint_defaults(psmouse->private);
- error = trackpoint_power_on_reset(&psmouse->ps2dev);
- diff -uNr linux-3.18.1/drivers/input/mouse/vsxxxaa.c ubuntu-fixes-pilot6/drivers/input/mouse/vsxxxaa.c
- --- linux-3.18.1/drivers/input/mouse/vsxxxaa.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/mouse/vsxxxaa.c 2014-12-16 11:11:57.000000000 +0100
- @@ -128,7 +128,7 @@
- if (num >= mouse->count) {
- mouse->count = 0;
- } else {
- - memmove(mouse->buf, mouse->buf + num, BUFLEN - num);
- + memmove(mouse->buf, mouse->buf + num - 1, BUFLEN - num);
- mouse->count -= num;
- }
- }
- diff -uNr linux-3.18.1/drivers/input/serio/altera_ps2.c ubuntu-fixes-pilot6/drivers/input/serio/altera_ps2.c
- --- linux-3.18.1/drivers/input/serio/altera_ps2.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/serio/altera_ps2.c 2014-12-16 11:11:57.000000000 +0100
- @@ -37,7 +37,7 @@
- {
- struct ps2if *ps2if = dev_id;
- unsigned int status;
- - irqreturn_t handled = IRQ_NONE;
- + int handled = IRQ_NONE;
- while ((status = readl(ps2if->base)) & 0xffff0000) {
- serio_interrupt(ps2if->io, status & 0xff, 0);
- @@ -74,7 +74,7 @@
- {
- struct ps2if *ps2if = io->port_data;
- - writel(0, ps2if->base + 4); /* disable rx irq */
- + writel(0, ps2if->base); /* disable rx irq */
- }
- /*
- diff -uNr linux-3.18.1/drivers/input/serio/hyperv-keyboard.c ubuntu-fixes-pilot6/drivers/input/serio/hyperv-keyboard.c
- --- linux-3.18.1/drivers/input/serio/hyperv-keyboard.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/serio/hyperv-keyboard.c 2014-12-16 11:11:57.000000000 +0100
- @@ -170,15 +170,6 @@
- serio_interrupt(kbd_dev->hv_serio, scan_code, 0);
- }
- spin_unlock_irqrestore(&kbd_dev->lock, flags);
- -
- - /*
- - * Only trigger a wakeup on key down, otherwise
- - * "echo freeze > /sys/power/state" can't really enter the
- - * state because the Enter-UP can trigger a wakeup at once.
- - */
- - if (!(info & IS_BREAK))
- - pm_wakeup_event(&hv_dev->device, 0);
- -
- break;
- default:
- @@ -385,9 +376,6 @@
- goto err_close_vmbus;
- serio_register_port(kbd_dev->hv_serio);
- -
- - device_init_wakeup(&hv_dev->device, true);
- -
- return 0;
- err_close_vmbus:
- @@ -402,7 +390,6 @@
- {
- struct hv_kbd_dev *kbd_dev = hv_get_drvdata(hv_dev);
- - device_init_wakeup(&hv_dev->device, false);
- serio_unregister_port(kbd_dev->hv_serio);
- vmbus_close(hv_dev->channel);
- kfree(kbd_dev);
- diff -uNr linux-3.18.1/drivers/input/serio/i8042-sparcio.h ubuntu-fixes-pilot6/drivers/input/serio/i8042-sparcio.h
- --- linux-3.18.1/drivers/input/serio/i8042-sparcio.h 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/serio/i8042-sparcio.h 2014-12-16 11:11:57.000000000 +0100
- @@ -17,6 +17,7 @@
- #define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
- static void __iomem *kbd_iobase;
- +static struct resource *kbd_res;
- #define I8042_COMMAND_REG (kbd_iobase + 0x64UL)
- #define I8042_DATA_REG (kbd_iobase + 0x60UL)
- @@ -43,8 +44,6 @@
- #ifdef CONFIG_PCI
- -static struct resource *kbd_res;
- -
- #define OBP_PS2KBD_NAME1 "kb_ps2"
- #define OBP_PS2KBD_NAME2 "keyboard"
- #define OBP_PS2MS_NAME1 "kdmouse"
- diff -uNr linux-3.18.1/drivers/input/serio/i8042-x86ia64io.h ubuntu-fixes-pilot6/drivers/input/serio/i8042-x86ia64io.h
- --- linux-3.18.1/drivers/input/serio/i8042-x86ia64io.h 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/serio/i8042-x86ia64io.h 2014-12-16 11:11:57.000000000 +0100
- @@ -472,13 +472,6 @@
- },
- },
- {
- - /* Asus X450LCP */
- - .matches = {
- - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
- - DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
- - },
- - },
- - {
- /* Avatar AVIU-145A6 */
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
- diff -uNr linux-3.18.1/drivers/input/serio/serio.c ubuntu-fixes-pilot6/drivers/input/serio/serio.c
- --- linux-3.18.1/drivers/input/serio/serio.c 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/serio/serio.c 2014-12-16 11:11:57.000000000 +0100
- @@ -524,8 +524,8 @@
- spin_lock_init(&serio->lock);
- mutex_init(&serio->drv_mutex);
- device_initialize(&serio->dev);
- - dev_set_name(&serio->dev, "serio%lu",
- - (unsigned long)atomic_inc_return(&serio_no) - 1);
- + dev_set_name(&serio->dev, "serio%ld",
- + (long)atomic_inc_return(&serio_no) - 1);
- serio->dev.bus = &serio_bus;
- serio->dev.release = serio_release_port;
- serio->dev.groups = serio_device_attr_groups;
- diff -uNr linux-3.18.1/drivers/input/tablet/Kconfig ubuntu-fixes-pilot6/drivers/input/tablet/Kconfig
- --- linux-3.18.1/drivers/input/tablet/Kconfig 2014-12-16 18:39:45.000000000 +0100
- +++ ubuntu-fixes-pilot6/drivers/input/tablet/Kconfig 2014-12-16 11:11:57.000000000 +0100
- @@ -73,14 +73,20 @@
- To compile this driver as a module, choose M here: the
- module will be called kbtab.
- -config TABLET_SERIAL_WACOM4
- - tristate "Wacom protocol 4 serial tablet support"
- - select SERIO
- +config TABLET_USB_WACOM
- + tristate "Wacom Intuos/Graphire tablet support (USB)"
- + depends on USB_ARCH_HAS_HCD
- + select POWER_SUPPLY
- + select USB
- + select NEW_LEDS
- + select LEDS_CLASS
- help
- - Say Y here if you want to use Wacom protocol 4 serial tablets.
- - E.g. serial versions of the Cintiq, Graphire or Penpartner.
- + Say Y here if you want to use the USB version of the Wacom Intuos
- + or Graphire tablet. Make sure to say Y to "Mouse support"
- + (CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
- + (CONFIG_INPUT_EVDEV) as well.
- To compile this driver as a module, choose M here: the
- - module will be called wacom_serial4.
- + module will be called wacom.
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement