diff --git a/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch b/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch deleted file mode 100644 index a15d00b6a..000000000 --- a/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 017de1136ff304ab401dbfee4eca2e796c61797f Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Tue, 19 Feb 2013 11:54:16 -0500 -Subject: [PATCH] Bluetooth: Add support for atheros 04ca:3004 device to ath3k - -Yet another version of the atheros bluetooth chipset - -T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 -D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 -P: Vendor=04ca ProdID=3004 Rev=00.01 -S: Manufacturer=Atheros Communications -S: Product=Bluetooth USB Host Controller -S: SerialNumber=Alaska Day 2006 -C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA -I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb - -This resolves https://bugzilla.redhat.com/show_bug.cgi?id=844750 - -Reported-by: niktr@mail.ru -Signed-off-by: Josh Boyer -Signed-off-by: Gustavo Padovan ---- - drivers/bluetooth/ath3k.c | 2 ++ - drivers/bluetooth/btusb.c | 1 + - 2 files changed, 3 insertions(+) - -diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c -index 33c9a44..b9908dd 100644 ---- a/drivers/bluetooth/ath3k.c -+++ b/drivers/bluetooth/ath3k.c -@@ -76,6 +76,7 @@ static struct usb_device_id ath3k_table[] = { - { USB_DEVICE(0x0CF3, 0x311D) }, - { USB_DEVICE(0x0CF3, 0x817a) }, - { USB_DEVICE(0x13d3, 0x3375) }, -+ { USB_DEVICE(0x04CA, 0x3004) }, - { USB_DEVICE(0x04CA, 0x3005) }, - { USB_DEVICE(0x04CA, 0x3006) }, - { USB_DEVICE(0x04CA, 0x3008) }, -@@ -108,6 +109,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { - { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, -+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 7e351e3..59cde8e 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -134,6 +134,7 @@ static struct usb_device_id blacklist_table[] = { - { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, -+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, --- -1.8.1.4 - diff --git a/Input-add-support-for-Cypress-PS2-Trackpads.patch b/Input-add-support-for-Cypress-PS2-Trackpads.patch deleted file mode 100644 index 8c5e569f9..000000000 --- a/Input-add-support-for-Cypress-PS2-Trackpads.patch +++ /dev/null @@ -1,1063 +0,0 @@ -From 0799a924bc93ba46a23e8e7e6b1431ab585fd2ea Mon Sep 17 00:00:00 2001 -From: Dudley Du -Date: Sat, 5 Jan 2013 00:14:22 -0800 -Subject: [PATCH] Input: add support for Cypress PS/2 Trackpads - -This driver, submitted on behalf of Cypress Semiconductor Corporation and -additional contributors, provides support for the Cypress PS/2 Trackpad. - -Original code contributed by Dudley Du (Cypress Semiconductor Corporation), -modified by Kamal Mostafa and Kyle Fazzari. - -BugLink: http://launchpad.net/bugs/978807 - -Signed-off-by: Dudley Du -Signed-off-by: Kamal Mostafa -Signed-off-by: Kyle Fazzari -Signed-off-by: Mario Limonciello -Signed-off-by: Tim Gardner -Acked-by: Herton Krzesinski -Reviewed-by: Henrik Rydberg -Reviewed-by: Dudley Du -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/Kconfig | 10 + - drivers/input/mouse/Makefile | 1 + - drivers/input/mouse/cypress_ps2.c | 725 ++++++++++++++++++++++++++++++++++++ - drivers/input/mouse/cypress_ps2.h | 191 ++++++++++ - drivers/input/mouse/psmouse-base.c | 32 ++ - drivers/input/mouse/psmouse.h | 1 + - 6 files changed, 960 insertions(+), 0 deletions(-) - create mode 100644 drivers/input/mouse/cypress_ps2.c - create mode 100644 drivers/input/mouse/cypress_ps2.h - -diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig -index cd6268c..88954dd 100644 ---- a/drivers/input/mouse/Kconfig -+++ b/drivers/input/mouse/Kconfig -@@ -68,6 +68,16 @@ config MOUSE_PS2_SYNAPTICS - - If unsure, say Y. - -+config MOUSE_PS2_CYPRESS -+ bool "Cypress PS/2 mouse protocol extension" if EXPERT -+ default y -+ depends on MOUSE_PS2 -+ help -+ Say Y here if you have a Cypress PS/2 Trackpad connected to -+ your system. -+ -+ If unsure, say Y. -+ - config MOUSE_PS2_LIFEBOOK - bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT - default y -diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile -index 46ba755..323e352 100644 ---- a/drivers/input/mouse/Makefile -+++ b/drivers/input/mouse/Makefile -@@ -32,3 +32,4 @@ psmouse-$(CONFIG_MOUSE_PS2_LIFEBOOK) += lifebook.o - psmouse-$(CONFIG_MOUSE_PS2_SENTELIC) += sentelic.o - psmouse-$(CONFIG_MOUSE_PS2_TRACKPOINT) += trackpoint.o - psmouse-$(CONFIG_MOUSE_PS2_TOUCHKIT) += touchkit_ps2.o -+psmouse-$(CONFIG_MOUSE_PS2_CYPRESS) += cypress_ps2.o -diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c -new file mode 100644 -index 0000000..1673dc6 ---- /dev/null -+++ b/drivers/input/mouse/cypress_ps2.c -@@ -0,0 +1,725 @@ -+/* -+ * Cypress Trackpad PS/2 mouse driver -+ * -+ * Copyright (c) 2012 Cypress Semiconductor Corporation. -+ * -+ * Author: -+ * Dudley Du -+ * -+ * Additional contributors include: -+ * Kamal Mostafa -+ * Kyle Fazzari -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published by -+ * the Free Software Foundation. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "cypress_ps2.h" -+ -+#undef CYTP_DEBUG_VERBOSE /* define this and DEBUG for more verbose dump */ -+ -+static void cypress_set_packet_size(struct psmouse *psmouse, unsigned int n) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ cytp->pkt_size = n; -+} -+ -+static const unsigned char cytp_rate[] = {10, 20, 40, 60, 100, 200}; -+static const unsigned char cytp_resolution[] = {0x00, 0x01, 0x02, 0x03}; -+ -+static int cypress_ps2_sendbyte(struct psmouse *psmouse, int value) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ -+ if (ps2_sendbyte(ps2dev, value & 0xff, CYTP_CMD_TIMEOUT) < 0) { -+ psmouse_dbg(psmouse, -+ "sending command 0x%02x failed, resp 0x%02x\n", -+ value & 0xff, ps2dev->nak); -+ if (ps2dev->nak == CYTP_PS2_RETRY) -+ return CYTP_PS2_RETRY; -+ else -+ return CYTP_PS2_ERROR; -+ } -+ -+#ifdef CYTP_DEBUG_VERBOSE -+ psmouse_dbg(psmouse, "sending command 0x%02x succeeded, resp 0xfa\n", -+ value & 0xff); -+#endif -+ -+ return 0; -+} -+ -+static int cypress_ps2_ext_cmd(struct psmouse *psmouse, unsigned short cmd, -+ unsigned char data) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ int tries = CYTP_PS2_CMD_TRIES; -+ int rc; -+ -+ ps2_begin_command(ps2dev); -+ -+ do { -+ /* -+ * Send extension command byte (0xE8 or 0xF3). -+ * If sending the command fails, send recovery command -+ * to make the device return to the ready state. -+ */ -+ rc = cypress_ps2_sendbyte(psmouse, cmd & 0xff); -+ if (rc == CYTP_PS2_RETRY) { -+ rc = cypress_ps2_sendbyte(psmouse, 0x00); -+ if (rc == CYTP_PS2_RETRY) -+ rc = cypress_ps2_sendbyte(psmouse, 0x0a); -+ } -+ if (rc == CYTP_PS2_ERROR) -+ continue; -+ -+ rc = cypress_ps2_sendbyte(psmouse, data); -+ if (rc == CYTP_PS2_RETRY) -+ rc = cypress_ps2_sendbyte(psmouse, data); -+ if (rc == CYTP_PS2_ERROR) -+ continue; -+ else -+ break; -+ } while (--tries > 0); -+ -+ ps2_end_command(ps2dev); -+ -+ return rc; -+} -+ -+static int cypress_ps2_read_cmd_status(struct psmouse *psmouse, -+ unsigned char cmd, -+ unsigned char *param) -+{ -+ int rc; -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ enum psmouse_state old_state; -+ int pktsize; -+ -+ ps2_begin_command(&psmouse->ps2dev); -+ -+ old_state = psmouse->state; -+ psmouse->state = PSMOUSE_CMD_MODE; -+ psmouse->pktcnt = 0; -+ -+ pktsize = (cmd == CYTP_CMD_READ_TP_METRICS) ? 8 : 3; -+ memset(param, 0, pktsize); -+ -+ rc = cypress_ps2_sendbyte(psmouse, 0xe9); -+ if (rc < 0) -+ goto out; -+ -+ wait_event_timeout(ps2dev->wait, -+ (psmouse->pktcnt >= pktsize), -+ msecs_to_jiffies(CYTP_CMD_TIMEOUT)); -+ -+ memcpy(param, psmouse->packet, pktsize); -+ -+ psmouse_dbg(psmouse, "Command 0x%02x response data (0x): %*ph\n", -+ cmd, pktsize, param); -+ -+out: -+ psmouse->state = old_state; -+ psmouse->pktcnt = 0; -+ -+ ps2_end_command(&psmouse->ps2dev); -+ -+ return rc; -+} -+ -+static bool cypress_verify_cmd_state(struct psmouse *psmouse, -+ unsigned char cmd, unsigned char *param) -+{ -+ bool rate_match = false; -+ bool resolution_match = false; -+ int i; -+ -+ /* callers will do further checking. */ -+ if (cmd == CYTP_CMD_READ_CYPRESS_ID || -+ cmd == CYTP_CMD_STANDARD_MODE || -+ cmd == CYTP_CMD_READ_TP_METRICS) -+ return true; -+ -+ if ((~param[0] & DFLT_RESP_BITS_VALID) == DFLT_RESP_BITS_VALID && -+ (param[0] & DFLT_RESP_BIT_MODE) == DFLT_RESP_STREAM_MODE) { -+ for (i = 0; i < sizeof(cytp_resolution); i++) -+ if (cytp_resolution[i] == param[1]) -+ resolution_match = true; -+ -+ for (i = 0; i < sizeof(cytp_rate); i++) -+ if (cytp_rate[i] == param[2]) -+ rate_match = true; -+ -+ if (resolution_match && rate_match) -+ return true; -+ } -+ -+ psmouse_dbg(psmouse, "verify cmd state failed.\n"); -+ return false; -+} -+ -+static int cypress_send_ext_cmd(struct psmouse *psmouse, unsigned char cmd, -+ unsigned char *param) -+{ -+ int tries = CYTP_PS2_CMD_TRIES; -+ int rc; -+ -+ psmouse_dbg(psmouse, "send extension cmd 0x%02x, [%d %d %d %d]\n", -+ cmd, DECODE_CMD_AA(cmd), DECODE_CMD_BB(cmd), -+ DECODE_CMD_CC(cmd), DECODE_CMD_DD(cmd)); -+ -+ do { -+ cypress_ps2_ext_cmd(psmouse, -+ PSMOUSE_CMD_SETRES, DECODE_CMD_DD(cmd)); -+ cypress_ps2_ext_cmd(psmouse, -+ PSMOUSE_CMD_SETRES, DECODE_CMD_CC(cmd)); -+ cypress_ps2_ext_cmd(psmouse, -+ PSMOUSE_CMD_SETRES, DECODE_CMD_BB(cmd)); -+ cypress_ps2_ext_cmd(psmouse, -+ PSMOUSE_CMD_SETRES, DECODE_CMD_AA(cmd)); -+ -+ rc = cypress_ps2_read_cmd_status(psmouse, cmd, param); -+ if (rc) -+ continue; -+ -+ if (cypress_verify_cmd_state(psmouse, cmd, param)) -+ return 0; -+ -+ } while (--tries > 0); -+ -+ return -EIO; -+} -+ -+int cypress_detect(struct psmouse *psmouse, bool set_properties) -+{ -+ unsigned char param[3]; -+ -+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_CYPRESS_ID, param)) -+ return -ENODEV; -+ -+ /* Check for Cypress Trackpad signature bytes: 0x33 0xCC */ -+ if (param[0] != 0x33 || param[1] != 0xCC) -+ return -ENODEV; -+ -+ if (set_properties) { -+ psmouse->vendor = "Cypress"; -+ psmouse->name = "Trackpad"; -+ } -+ -+ return 0; -+} -+ -+static int cypress_read_fw_version(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ unsigned char param[3]; -+ -+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_CYPRESS_ID, param)) -+ return -ENODEV; -+ -+ /* Check for Cypress Trackpad signature bytes: 0x33 0xCC */ -+ if (param[0] != 0x33 || param[1] != 0xCC) -+ return -ENODEV; -+ -+ cytp->fw_version = param[2] & FW_VERSION_MASX; -+ cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; -+ -+ psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); -+ psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", -+ cytp->tp_metrics_supported); -+ -+ return 0; -+} -+ -+static int cypress_read_tp_metrics(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ unsigned char param[8]; -+ -+ /* set default values for tp metrics. */ -+ cytp->tp_width = CYTP_DEFAULT_WIDTH; -+ cytp->tp_high = CYTP_DEFAULT_HIGH; -+ cytp->tp_max_abs_x = CYTP_ABS_MAX_X; -+ cytp->tp_max_abs_y = CYTP_ABS_MAX_Y; -+ cytp->tp_min_pressure = CYTP_MIN_PRESSURE; -+ cytp->tp_max_pressure = CYTP_MAX_PRESSURE; -+ cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; -+ cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; -+ -+ memset(param, 0, sizeof(param)); -+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { -+ /* Update trackpad parameters. */ -+ cytp->tp_max_abs_x = (param[1] << 8) | param[0]; -+ cytp->tp_max_abs_y = (param[3] << 8) | param[2]; -+ cytp->tp_min_pressure = param[4]; -+ cytp->tp_max_pressure = param[5]; -+ } -+ -+ if (!cytp->tp_max_pressure || -+ cytp->tp_max_pressure < cytp->tp_min_pressure || -+ !cytp->tp_width || !cytp->tp_high || -+ !cytp->tp_max_abs_x || -+ cytp->tp_max_abs_x < cytp->tp_width || -+ !cytp->tp_max_abs_y || -+ cytp->tp_max_abs_y < cytp->tp_high) -+ return -EINVAL; -+ -+ cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; -+ cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; -+ -+#ifdef CYTP_DEBUG_VERBOSE -+ psmouse_dbg(psmouse, "Dump trackpad hardware configuration as below:\n"); -+ psmouse_dbg(psmouse, "cytp->tp_width = %d\n", cytp->tp_width); -+ psmouse_dbg(psmouse, "cytp->tp_high = %d\n", cytp->tp_high); -+ psmouse_dbg(psmouse, "cytp->tp_max_abs_x = %d\n", cytp->tp_max_abs_x); -+ psmouse_dbg(psmouse, "cytp->tp_max_abs_y = %d\n", cytp->tp_max_abs_y); -+ psmouse_dbg(psmouse, "cytp->tp_min_pressure = %d\n", cytp->tp_min_pressure); -+ psmouse_dbg(psmouse, "cytp->tp_max_pressure = %d\n", cytp->tp_max_pressure); -+ psmouse_dbg(psmouse, "cytp->tp_res_x = %d\n", cytp->tp_res_x); -+ psmouse_dbg(psmouse, "cytp->tp_res_y = %d\n", cytp->tp_res_y); -+ -+ psmouse_dbg(psmouse, "tp_type_APA = %d\n", -+ (param[6] & TP_METRICS_BIT_APA) ? 1 : 0); -+ psmouse_dbg(psmouse, "tp_type_MTG = %d\n", -+ (param[6] & TP_METRICS_BIT_MTG) ? 1 : 0); -+ psmouse_dbg(psmouse, "tp_palm = %d\n", -+ (param[6] & TP_METRICS_BIT_PALM) ? 1 : 0); -+ psmouse_dbg(psmouse, "tp_stubborn = %d\n", -+ (param[6] & TP_METRICS_BIT_STUBBORN) ? 1 : 0); -+ psmouse_dbg(psmouse, "tp_1f_jitter = %d\n", -+ (param[6] & TP_METRICS_BIT_1F_JITTER) >> 2); -+ psmouse_dbg(psmouse, "tp_2f_jitter = %d\n", -+ (param[6] & TP_METRICS_BIT_2F_JITTER) >> 4); -+ psmouse_dbg(psmouse, "tp_1f_spike = %d\n", -+ param[7] & TP_METRICS_BIT_1F_SPIKE); -+ psmouse_dbg(psmouse, "tp_2f_spike = %d\n", -+ (param[7] & TP_METRICS_BIT_2F_SPIKE) >> 2); -+ psmouse_dbg(psmouse, "tp_abs_packet_format_set = %d\n", -+ (param[7] & TP_METRICS_BIT_ABS_PKT_FORMAT_SET) >> 4); -+#endif -+ -+ return 0; -+} -+ -+static int cypress_query_hardware(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ int ret; -+ -+ ret = cypress_read_fw_version(psmouse); -+ if (ret) -+ return ret; -+ -+ if (cytp->tp_metrics_supported) { -+ ret = cypress_read_tp_metrics(psmouse); -+ if (ret) -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int cypress_set_absolute_mode(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ unsigned char param[3]; -+ -+ if (cypress_send_ext_cmd(psmouse, CYTP_CMD_ABS_WITH_PRESSURE_MODE, param) < 0) -+ return -1; -+ -+ cytp->mode = (cytp->mode & ~CYTP_BIT_ABS_REL_MASK) -+ | CYTP_BIT_ABS_PRESSURE; -+ cypress_set_packet_size(psmouse, 5); -+ -+ return 0; -+} -+ -+/* -+ * Reset trackpad device. -+ * This is also the default mode when trackpad powered on. -+ */ -+static void cypress_reset(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ -+ cytp->mode = 0; -+ -+ psmouse_reset(psmouse); -+} -+ -+static int cypress_set_input_params(struct input_dev *input, -+ struct cytp_data *cytp) -+{ -+ int ret; -+ -+ if (!cytp->tp_res_x || !cytp->tp_res_y) -+ return -EINVAL; -+ -+ __set_bit(EV_ABS, input->evbit); -+ input_set_abs_params(input, ABS_X, 0, cytp->tp_max_abs_x, 0, 0); -+ input_set_abs_params(input, ABS_Y, 0, cytp->tp_max_abs_y, 0, 0); -+ input_set_abs_params(input, ABS_PRESSURE, -+ cytp->tp_min_pressure, cytp->tp_max_pressure, 0, 0); -+ input_set_abs_params(input, ABS_TOOL_WIDTH, 0, 255, 0, 0); -+ -+ /* finger position */ -+ input_set_abs_params(input, ABS_MT_POSITION_X, 0, cytp->tp_max_abs_x, 0, 0); -+ input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cytp->tp_max_abs_y, 0, 0); -+ input_set_abs_params(input, ABS_MT_PRESSURE, 0, 255, 0, 0); -+ -+ ret = input_mt_init_slots(input, CYTP_MAX_MT_SLOTS, -+ INPUT_MT_DROP_UNUSED|INPUT_MT_TRACK); -+ if (ret < 0) -+ return ret; -+ -+ __set_bit(INPUT_PROP_SEMI_MT, input->propbit); -+ -+ input_abs_set_res(input, ABS_X, cytp->tp_res_x); -+ input_abs_set_res(input, ABS_Y, cytp->tp_res_y); -+ -+ input_abs_set_res(input, ABS_MT_POSITION_X, cytp->tp_res_x); -+ input_abs_set_res(input, ABS_MT_POSITION_Y, cytp->tp_res_y); -+ -+ __set_bit(BTN_TOUCH, input->keybit); -+ __set_bit(BTN_TOOL_FINGER, input->keybit); -+ __set_bit(BTN_TOOL_DOUBLETAP, input->keybit); -+ __set_bit(BTN_TOOL_TRIPLETAP, input->keybit); -+ __set_bit(BTN_TOOL_QUADTAP, input->keybit); -+ __set_bit(BTN_TOOL_QUINTTAP, input->keybit); -+ -+ __clear_bit(EV_REL, input->evbit); -+ __clear_bit(REL_X, input->relbit); -+ __clear_bit(REL_Y, input->relbit); -+ -+ __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); -+ __set_bit(EV_KEY, input->evbit); -+ __set_bit(BTN_LEFT, input->keybit); -+ __set_bit(BTN_RIGHT, input->keybit); -+ __set_bit(BTN_MIDDLE, input->keybit); -+ -+ input_set_drvdata(input, cytp); -+ -+ return 0; -+} -+ -+static int cypress_get_finger_count(unsigned char header_byte) -+{ -+ unsigned char bits6_7; -+ int finger_count; -+ -+ bits6_7 = header_byte >> 6; -+ finger_count = bits6_7 & 0x03; -+ -+ if (finger_count == 1) -+ return 1; -+ -+ if (header_byte & ABS_HSCROLL_BIT) { -+ /* HSCROLL gets added on to 0 finger count. */ -+ switch (finger_count) { -+ case 0: return 4; -+ case 2: return 5; -+ default: -+ /* Invalid contact (e.g. palm). Ignore it. */ -+ return -1; -+ } -+ } -+ -+ return finger_count; -+} -+ -+ -+static int cypress_parse_packet(struct psmouse *psmouse, -+ struct cytp_data *cytp, struct cytp_report_data *report_data) -+{ -+ unsigned char *packet = psmouse->packet; -+ unsigned char header_byte = packet[0]; -+ int contact_cnt; -+ -+ memset(report_data, 0, sizeof(struct cytp_report_data)); -+ -+ contact_cnt = cypress_get_finger_count(header_byte); -+ -+ if (contact_cnt < 0) /* e.g. palm detect */ -+ return -EINVAL; -+ -+ report_data->contact_cnt = contact_cnt; -+ -+ report_data->tap = (header_byte & ABS_MULTIFINGER_TAP) ? 1 : 0; -+ -+ if (report_data->contact_cnt == 1) { -+ report_data->contacts[0].x = -+ ((packet[1] & 0x70) << 4) | packet[2]; -+ report_data->contacts[0].y = -+ ((packet[1] & 0x07) << 8) | packet[3]; -+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE) -+ report_data->contacts[0].z = packet[4]; -+ -+ } else if (report_data->contact_cnt >= 2) { -+ report_data->contacts[0].x = -+ ((packet[1] & 0x70) << 4) | packet[2]; -+ report_data->contacts[0].y = -+ ((packet[1] & 0x07) << 8) | packet[3]; -+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE) -+ report_data->contacts[0].z = packet[4]; -+ -+ report_data->contacts[1].x = -+ ((packet[5] & 0xf0) << 4) | packet[6]; -+ report_data->contacts[1].y = -+ ((packet[5] & 0x0f) << 8) | packet[7]; -+ if (cytp->mode & CYTP_BIT_ABS_PRESSURE) -+ report_data->contacts[1].z = report_data->contacts[0].z; -+ } -+ -+ report_data->left = (header_byte & BTN_LEFT_BIT) ? 1 : 0; -+ report_data->right = (header_byte & BTN_RIGHT_BIT) ? 1 : 0; -+ -+ /* -+ * This is only true if one of the mouse buttons were tapped. Make -+ * sure it doesn't turn into a click. The regular tap-to-click -+ * functionality will handle that on its own. If we don't do this, -+ * disabling tap-to-click won't affect the mouse button zones. -+ */ -+ if (report_data->tap) -+ report_data->left = 0; -+ -+#ifdef CYTP_DEBUG_VERBOSE -+ { -+ int i; -+ int n = report_data->contact_cnt; -+ psmouse_dbg(psmouse, "Dump parsed report data as below:\n"); -+ psmouse_dbg(psmouse, "contact_cnt = %d\n", -+ report_data->contact_cnt); -+ if (n > CYTP_MAX_MT_SLOTS) -+ n = CYTP_MAX_MT_SLOTS; -+ for (i = 0; i < n; i++) -+ psmouse_dbg(psmouse, "contacts[%d] = {%d, %d, %d}\n", i, -+ report_data->contacts[i].x, -+ report_data->contacts[i].y, -+ report_data->contacts[i].z); -+ psmouse_dbg(psmouse, "left = %d\n", report_data->left); -+ psmouse_dbg(psmouse, "right = %d\n", report_data->right); -+ psmouse_dbg(psmouse, "middle = %d\n", report_data->middle); -+ } -+#endif -+ -+ return 0; -+} -+ -+static void cypress_process_packet(struct psmouse *psmouse, bool zero_pkt) -+{ -+ int i; -+ struct input_dev *input = psmouse->dev; -+ struct cytp_data *cytp = psmouse->private; -+ struct cytp_report_data report_data; -+ struct cytp_contact *contact; -+ struct input_mt_pos pos[CYTP_MAX_MT_SLOTS]; -+ int slots[CYTP_MAX_MT_SLOTS]; -+ int n; -+ -+ if (cypress_parse_packet(psmouse, cytp, &report_data)) -+ return; -+ -+ n = report_data.contact_cnt; -+ -+ if (n > CYTP_MAX_MT_SLOTS) -+ n = CYTP_MAX_MT_SLOTS; -+ -+ for (i = 0; i < n; i++) { -+ contact = &report_data.contacts[i]; -+ pos[i].x = contact->x; -+ pos[i].y = contact->y; -+ } -+ -+ input_mt_assign_slots(input, slots, pos, n); -+ -+ for (i = 0; i < n; i++) { -+ contact = &report_data.contacts[i]; -+ input_mt_slot(input, slots[i]); -+ input_mt_report_slot_state(input, MT_TOOL_FINGER, true); -+ input_report_abs(input, ABS_MT_POSITION_X, contact->x); -+ input_report_abs(input, ABS_MT_POSITION_Y, contact->y); -+ input_report_abs(input, ABS_MT_PRESSURE, contact->z); -+ } -+ -+ input_mt_sync_frame(input); -+ -+ input_mt_report_finger_count(input, report_data.contact_cnt); -+ -+ input_report_key(input, BTN_LEFT, report_data.left); -+ input_report_key(input, BTN_RIGHT, report_data.right); -+ input_report_key(input, BTN_MIDDLE, report_data.middle); -+ -+ input_sync(input); -+} -+ -+static psmouse_ret_t cypress_validate_byte(struct psmouse *psmouse) -+{ -+ int contact_cnt; -+ int index = psmouse->pktcnt - 1; -+ unsigned char *packet = psmouse->packet; -+ struct cytp_data *cytp = psmouse->private; -+ -+ if (index < 0 || index > cytp->pkt_size) -+ return PSMOUSE_BAD_DATA; -+ -+ if (index == 0 && (packet[0] & 0xfc) == 0) { -+ /* call packet process for reporting finger leave. */ -+ cypress_process_packet(psmouse, 1); -+ return PSMOUSE_FULL_PACKET; -+ } -+ -+ /* -+ * Perform validation (and adjust packet size) based only on the -+ * first byte; allow all further bytes through. -+ */ -+ if (index != 0) -+ return PSMOUSE_GOOD_DATA; -+ -+ /* -+ * If absolute/relative mode bit has not been set yet, just pass -+ * the byte through. -+ */ -+ if ((cytp->mode & CYTP_BIT_ABS_REL_MASK) == 0) -+ return PSMOUSE_GOOD_DATA; -+ -+ if ((packet[0] & 0x08) == 0x08) -+ return PSMOUSE_BAD_DATA; -+ -+ contact_cnt = cypress_get_finger_count(packet[0]); -+ -+ if (contact_cnt < 0) -+ return PSMOUSE_BAD_DATA; -+ -+ if (cytp->mode & CYTP_BIT_ABS_NO_PRESSURE) -+ cypress_set_packet_size(psmouse, contact_cnt == 2 ? 7 : 4); -+ else -+ cypress_set_packet_size(psmouse, contact_cnt == 2 ? 8 : 5); -+ -+ return PSMOUSE_GOOD_DATA; -+} -+ -+static psmouse_ret_t cypress_protocol_handler(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ -+ if (psmouse->pktcnt >= cytp->pkt_size) { -+ cypress_process_packet(psmouse, 0); -+ return PSMOUSE_FULL_PACKET; -+ } -+ -+ return cypress_validate_byte(psmouse); -+} -+ -+static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate) -+{ -+ struct cytp_data *cytp = psmouse->private; -+ -+ if (rate >= 80) { -+ psmouse->rate = 80; -+ cytp->mode |= CYTP_BIT_HIGH_RATE; -+ } else { -+ psmouse->rate = 40; -+ cytp->mode &= ~CYTP_BIT_HIGH_RATE; -+ } -+ -+ ps2_command(&psmouse->ps2dev, (unsigned char *)&psmouse->rate, -+ PSMOUSE_CMD_SETRATE); -+} -+ -+static void cypress_disconnect(struct psmouse *psmouse) -+{ -+ cypress_reset(psmouse); -+ kfree(psmouse->private); -+ psmouse->private = NULL; -+} -+ -+static int cypress_reconnect(struct psmouse *psmouse) -+{ -+ int tries = CYTP_PS2_CMD_TRIES; -+ int rc; -+ -+ do { -+ cypress_reset(psmouse); -+ rc = cypress_detect(psmouse, false); -+ } while (rc && (--tries > 0)); -+ -+ if (rc) { -+ psmouse_err(psmouse, "Reconnect: unable to detect trackpad.\n"); -+ return -1; -+ } -+ -+ if (cypress_set_absolute_mode(psmouse)) { -+ psmouse_err(psmouse, "Reconnect: Unable to initialize Cypress absolute mode.\n"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+int cypress_init(struct psmouse *psmouse) -+{ -+ struct cytp_data *cytp; -+ -+ cytp = (struct cytp_data *)kzalloc(sizeof(struct cytp_data), GFP_KERNEL); -+ psmouse->private = (void *)cytp; -+ if (cytp == NULL) -+ return -ENOMEM; -+ -+ cypress_reset(psmouse); -+ -+ psmouse->pktsize = 8; -+ -+ if (cypress_query_hardware(psmouse)) { -+ psmouse_err(psmouse, "Unable to query Trackpad hardware.\n"); -+ goto err_exit; -+ } -+ -+ if (cypress_set_absolute_mode(psmouse)) { -+ psmouse_err(psmouse, "init: Unable to initialize Cypress absolute mode.\n"); -+ goto err_exit; -+ } -+ -+ if (cypress_set_input_params(psmouse->dev, cytp) < 0) { -+ psmouse_err(psmouse, "init: Unable to set input params.\n"); -+ goto err_exit; -+ } -+ -+ psmouse->model = 1; -+ psmouse->protocol_handler = cypress_protocol_handler; -+ psmouse->set_rate = cypress_set_rate; -+ psmouse->disconnect = cypress_disconnect; -+ psmouse->reconnect = cypress_reconnect; -+ psmouse->cleanup = cypress_reset; -+ psmouse->resync_time = 0; -+ -+ return 0; -+ -+err_exit: -+ /* -+ * Reset Cypress Trackpad as a standard mouse. Then -+ * let psmouse driver commmunicating with it as default PS2 mouse. -+ */ -+ cypress_reset(psmouse); -+ -+ psmouse->private = NULL; -+ kfree(cytp); -+ -+ return -1; -+} -+ -+bool cypress_supported(void) -+{ -+ return true; -+} -diff --git a/drivers/input/mouse/cypress_ps2.h b/drivers/input/mouse/cypress_ps2.h -new file mode 100644 -index 0000000..4720f21 ---- /dev/null -+++ b/drivers/input/mouse/cypress_ps2.h -@@ -0,0 +1,191 @@ -+#ifndef _CYPRESS_PS2_H -+#define _CYPRESS_PS2_H -+ -+#include "psmouse.h" -+ -+#define CMD_BITS_MASK 0x03 -+#define COMPOSIT(x, s) (((x) & CMD_BITS_MASK) << (s)) -+ -+#define ENCODE_CMD(aa, bb, cc, dd) \ -+ (COMPOSIT((aa), 6) | COMPOSIT((bb), 4) | COMPOSIT((cc), 2) | COMPOSIT((dd), 0)) -+#define CYTP_CMD_ABS_NO_PRESSURE_MODE ENCODE_CMD(0, 1, 0, 0) -+#define CYTP_CMD_ABS_WITH_PRESSURE_MODE ENCODE_CMD(0, 1, 0, 1) -+#define CYTP_CMD_SMBUS_MODE ENCODE_CMD(0, 1, 1, 0) -+#define CYTP_CMD_STANDARD_MODE ENCODE_CMD(0, 2, 0, 0) /* not implemented yet. */ -+#define CYTP_CMD_CYPRESS_REL_MODE ENCODE_CMD(1, 1, 1, 1) /* not implemented yet. */ -+#define CYTP_CMD_READ_CYPRESS_ID ENCODE_CMD(0, 0, 0, 0) -+#define CYTP_CMD_READ_TP_METRICS ENCODE_CMD(0, 0, 0, 1) -+#define CYTP_CMD_SET_HSCROLL_WIDTH(w) ENCODE_CMD(1, 1, 0, (w)) -+#define CYTP_CMD_SET_HSCROLL_MASK ENCODE_CMD(1, 1, 0, 0) -+#define CYTP_CMD_SET_VSCROLL_WIDTH(w) ENCODE_CMD(1, 2, 0, (w)) -+#define CYTP_CMD_SET_VSCROLL_MASK ENCODE_CMD(1, 2, 0, 0) -+#define CYTP_CMD_SET_PALM_GEOMETRY(e) ENCODE_CMD(1, 2, 1, (e)) -+#define CYTP_CMD_PALM_GEMMETRY_MASK ENCODE_CMD(1, 2, 1, 0) -+#define CYTP_CMD_SET_PALM_SENSITIVITY(s) ENCODE_CMD(1, 2, 2, (s)) -+#define CYTP_CMD_PALM_SENSITIVITY_MASK ENCODE_CMD(1, 2, 2, 0) -+#define CYTP_CMD_SET_MOUSE_SENSITIVITY(s) ENCODE_CMD(1, 3, ((s) >> 2), (s)) -+#define CYTP_CMD_MOUSE_SENSITIVITY_MASK ENCODE_CMD(1, 3, 0, 0) -+#define CYTP_CMD_REQUEST_BASELINE_STATUS ENCODE_CMD(2, 0, 0, 1) -+#define CYTP_CMD_REQUEST_RECALIBRATION ENCODE_CMD(2, 0, 0, 3) -+ -+#define DECODE_CMD_AA(x) (((x) >> 6) & CMD_BITS_MASK) -+#define DECODE_CMD_BB(x) (((x) >> 4) & CMD_BITS_MASK) -+#define DECODE_CMD_CC(x) (((x) >> 2) & CMD_BITS_MASK) -+#define DECODE_CMD_DD(x) ((x) & CMD_BITS_MASK) -+ -+/* Cypress trackpad working mode. */ -+#define CYTP_BIT_ABS_PRESSURE (1 << 3) -+#define CYTP_BIT_ABS_NO_PRESSURE (1 << 2) -+#define CYTP_BIT_CYPRESS_REL (1 << 1) -+#define CYTP_BIT_STANDARD_REL (1 << 0) -+#define CYTP_BIT_REL_MASK (CYTP_BIT_CYPRESS_REL | CYTP_BIT_STANDARD_REL) -+#define CYTP_BIT_ABS_MASK (CYTP_BIT_ABS_PRESSURE | CYTP_BIT_ABS_NO_PRESSURE) -+#define CYTP_BIT_ABS_REL_MASK (CYTP_BIT_ABS_MASK | CYTP_BIT_REL_MASK) -+ -+#define CYTP_BIT_HIGH_RATE (1 << 4) -+/* -+ * report mode bit is set, firmware working in Remote Mode. -+ * report mode bit is cleared, firmware working in Stream Mode. -+ */ -+#define CYTP_BIT_REPORT_MODE (1 << 5) -+ -+/* scrolling width values for set HSCROLL and VSCROLL width command. */ -+#define SCROLL_WIDTH_NARROW 1 -+#define SCROLL_WIDTH_NORMAL 2 -+#define SCROLL_WIDTH_WIDE 3 -+ -+#define PALM_GEOMETRY_ENABLE 1 -+#define PALM_GEOMETRY_DISABLE 0 -+ -+#define TP_METRICS_MASK 0x80 -+#define FW_VERSION_MASX 0x7f -+#define FW_VER_HIGH_MASK 0x70 -+#define FW_VER_LOW_MASK 0x0f -+ -+/* Times to retry a ps2_command and millisecond delay between tries. */ -+#define CYTP_PS2_CMD_TRIES 3 -+#define CYTP_PS2_CMD_DELAY 500 -+ -+/* time out for PS/2 command only in milliseconds. */ -+#define CYTP_CMD_TIMEOUT 200 -+#define CYTP_DATA_TIMEOUT 30 -+ -+#define CYTP_EXT_CMD 0xe8 -+#define CYTP_PS2_RETRY 0xfe -+#define CYTP_PS2_ERROR 0xfc -+ -+#define CYTP_RESP_RETRY 0x01 -+#define CYTP_RESP_ERROR 0xfe -+ -+ -+#define CYTP_105001_WIDTH 97 /* Dell XPS 13 */ -+#define CYTP_105001_HIGH 59 -+#define CYTP_DEFAULT_WIDTH (CYTP_105001_WIDTH) -+#define CYTP_DEFAULT_HIGH (CYTP_105001_HIGH) -+ -+#define CYTP_ABS_MAX_X 1600 -+#define CYTP_ABS_MAX_Y 900 -+#define CYTP_MAX_PRESSURE 255 -+#define CYTP_MIN_PRESSURE 0 -+ -+/* header byte bits of relative package. */ -+#define BTN_LEFT_BIT 0x01 -+#define BTN_RIGHT_BIT 0x02 -+#define BTN_MIDDLE_BIT 0x04 -+#define REL_X_SIGN_BIT 0x10 -+#define REL_Y_SIGN_BIT 0x20 -+ -+/* header byte bits of absolute package. */ -+#define ABS_VSCROLL_BIT 0x10 -+#define ABS_HSCROLL_BIT 0x20 -+#define ABS_MULTIFINGER_TAP 0x04 -+#define ABS_EDGE_MOTION_MASK 0x80 -+ -+#define DFLT_RESP_BITS_VALID 0x88 /* SMBus bit should not be set. */ -+#define DFLT_RESP_SMBUS_BIT 0x80 -+#define DFLT_SMBUS_MODE 0x80 -+#define DFLT_PS2_MODE 0x00 -+#define DFLT_RESP_BIT_MODE 0x40 -+#define DFLT_RESP_REMOTE_MODE 0x40 -+#define DFLT_RESP_STREAM_MODE 0x00 -+#define DFLT_RESP_BIT_REPORTING 0x20 -+#define DFLT_RESP_BIT_SCALING 0x10 -+ -+#define TP_METRICS_BIT_PALM 0x80 -+#define TP_METRICS_BIT_STUBBORN 0x40 -+#define TP_METRICS_BIT_2F_JITTER 0x30 -+#define TP_METRICS_BIT_1F_JITTER 0x0c -+#define TP_METRICS_BIT_APA 0x02 -+#define TP_METRICS_BIT_MTG 0x01 -+#define TP_METRICS_BIT_ABS_PKT_FORMAT_SET 0xf0 -+#define TP_METRICS_BIT_2F_SPIKE 0x0c -+#define TP_METRICS_BIT_1F_SPIKE 0x03 -+ -+/* bits of first byte response of E9h-Status Request command. */ -+#define RESP_BTN_RIGHT_BIT 0x01 -+#define RESP_BTN_MIDDLE_BIT 0x02 -+#define RESP_BTN_LEFT_BIT 0x04 -+#define RESP_SCALING_BIT 0x10 -+#define RESP_ENABLE_BIT 0x20 -+#define RESP_REMOTE_BIT 0x40 -+#define RESP_SMBUS_BIT 0x80 -+ -+#define CYTP_MAX_MT_SLOTS 2 -+ -+struct cytp_contact { -+ int x; -+ int y; -+ int z; /* also named as touch pressure. */ -+}; -+ -+/* The structure of Cypress Trackpad event data. */ -+struct cytp_report_data { -+ int contact_cnt; -+ struct cytp_contact contacts[CYTP_MAX_MT_SLOTS]; -+ unsigned int left:1; -+ unsigned int right:1; -+ unsigned int middle:1; -+ unsigned int tap:1; /* multi-finger tap detected. */ -+}; -+ -+/* The structure of Cypress Trackpad device private data. */ -+struct cytp_data { -+ int fw_version; -+ -+ int pkt_size; -+ int mode; -+ -+ int tp_min_pressure; -+ int tp_max_pressure; -+ int tp_width; /* X direction physical size in mm. */ -+ int tp_high; /* Y direction physical size in mm. */ -+ int tp_max_abs_x; /* Max X absolute units that can be reported. */ -+ int tp_max_abs_y; /* Max Y absolute units that can be reported. */ -+ -+ int tp_res_x; /* X resolution in units/mm. */ -+ int tp_res_y; /* Y resolution in units/mm. */ -+ -+ int tp_metrics_supported; -+}; -+ -+ -+#ifdef CONFIG_MOUSE_PS2_CYPRESS -+int cypress_detect(struct psmouse *psmouse, bool set_properties); -+int cypress_init(struct psmouse *psmouse); -+bool cypress_supported(void); -+#else -+inline int cypress_detect(struct psmouse *psmouse, bool set_properties) -+{ -+ return -ENOSYS; -+} -+inline int cypress_init(struct psmouse *psmouse) -+{ -+ return -ENOSYS; -+} -+inline bool cypress_supported(void) -+{ -+ return 0; -+} -+#endif /* CONFIG_MOUSE_PS2_CYPRESS */ -+ -+#endif /* _CYPRESS_PS2_H */ -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index 22fe254..cff065f 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -34,6 +34,7 @@ - #include "touchkit_ps2.h" - #include "elantech.h" - #include "sentelic.h" -+#include "cypress_ps2.h" - - #define DRIVER_DESC "PS/2 mouse driver" - -@@ -759,6 +760,28 @@ static int psmouse_extensions(struct psmouse *psmouse, - } - - /* -+ * Try Cypress Trackpad. -+ * Must try it before Finger Sensing Pad because Finger Sensing Pad probe -+ * upsets some modules of Cypress Trackpads. -+ */ -+ if (max_proto > PSMOUSE_IMEX && -+ cypress_detect(psmouse, set_properties) == 0) { -+ if (cypress_supported()) { -+ if (cypress_init(psmouse) == 0) -+ return PSMOUSE_CYPRESS; -+ -+ /* -+ * Finger Sensing Pad probe upsets some modules of -+ * Cypress Trackpad, must avoid Finger Sensing Pad -+ * probe if Cypress Trackpad device detected. -+ */ -+ return PSMOUSE_PS2; -+ } -+ -+ max_proto = PSMOUSE_IMEX; -+ } -+ -+/* - * Try ALPS TouchPad - */ - if (max_proto > PSMOUSE_IMEX) { -@@ -896,6 +919,15 @@ static const struct psmouse_protocol psmouse_protocols[] = { - .alias = "thinkps", - .detect = thinking_detect, - }, -+#ifdef CONFIG_MOUSE_PS2_CYPRESS -+ { -+ .type = PSMOUSE_CYPRESS, -+ .name = "CyPS/2", -+ .alias = "cypress", -+ .detect = cypress_detect, -+ .init = cypress_init, -+ }, -+#endif - { - .type = PSMOUSE_GENPS, - .name = "GenPS/2", -diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h -index fe1df23..2f0b39d 100644 ---- a/drivers/input/mouse/psmouse.h -+++ b/drivers/input/mouse/psmouse.h -@@ -95,6 +95,7 @@ enum psmouse_type { - PSMOUSE_ELANTECH, - PSMOUSE_FSP, - PSMOUSE_SYNAPTICS_RELATIVE, -+ PSMOUSE_CYPRESS, - PSMOUSE_AUTO /* This one should always be last */ - }; - --- -1.7.7.6 - diff --git a/Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch b/Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch deleted file mode 100644 index 15abce521..000000000 --- a/Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 81bb5d31fbf3893a8e041c649dea704dd11d5272 Mon Sep 17 00:00:00 2001 -From: Kamal Mostafa -Date: Thu, 21 Feb 2013 11:55:05 -0800 -Subject: [PATCH] Input: cypress_ps2 - fix trackpadi found in Dell XPS12 - -Avoid firmware glitch in Cypress PS/2 Trackpad firmware version 11 -(as observed in Dell XPS12) which prevents driver from recognizing -the trackpad. - -BugLink: http://launchpad.net/bugs/1103594 - -Signed-off-by: Kamal Mostafa -Cc: Dudley Du -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/cypress_ps2.c | 19 +++++++++++++------ - 1 file changed, 13 insertions(+), 6 deletions(-) - -diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c -index 1673dc6..f51765f 100644 ---- a/drivers/input/mouse/cypress_ps2.c -+++ b/drivers/input/mouse/cypress_ps2.c -@@ -236,6 +236,13 @@ static int cypress_read_fw_version(struct psmouse *psmouse) - cytp->fw_version = param[2] & FW_VERSION_MASX; - cytp->tp_metrics_supported = (param[2] & TP_METRICS_MASK) ? 1 : 0; - -+ /* -+ * Trackpad fw_version 11 (in Dell XPS12) yields a bogus response to -+ * CYTP_CMD_READ_TP_METRICS so do not try to use it. LP: #1103594. -+ */ -+ if (cytp->fw_version >= 11) -+ cytp->tp_metrics_supported = 0; -+ - psmouse_dbg(psmouse, "cytp->fw_version = %d\n", cytp->fw_version); - psmouse_dbg(psmouse, "cytp->tp_metrics_supported = %d\n", - cytp->tp_metrics_supported); -@@ -258,6 +265,9 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) - cytp->tp_res_x = cytp->tp_max_abs_x / cytp->tp_width; - cytp->tp_res_y = cytp->tp_max_abs_y / cytp->tp_high; - -+ if (!cytp->tp_metrics_supported) -+ return 0; -+ - memset(param, 0, sizeof(param)); - if (cypress_send_ext_cmd(psmouse, CYTP_CMD_READ_TP_METRICS, param) == 0) { - /* Update trackpad parameters. */ -@@ -315,18 +325,15 @@ static int cypress_read_tp_metrics(struct psmouse *psmouse) - - static int cypress_query_hardware(struct psmouse *psmouse) - { -- struct cytp_data *cytp = psmouse->private; - int ret; - - ret = cypress_read_fw_version(psmouse); - if (ret) - return ret; - -- if (cytp->tp_metrics_supported) { -- ret = cypress_read_tp_metrics(psmouse); -- if (ret) -- return ret; -- } -+ ret = cypress_read_tp_metrics(psmouse); -+ if (ret) -+ return ret; - - return 0; - } --- -1.8.1.2 - diff --git a/alps-v2.patch b/alps-v2.patch deleted file mode 100644 index d394c4a92..000000000 --- a/alps-v2.patch +++ /dev/null @@ -1,2494 +0,0 @@ -From f822982515378982dc8d8e6058579288d0ee3cff Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 20:55:19 -0800 -Subject: [PATCH 01/15] Input: ALPS - document the alps.h data structures - -Add kernel-doc markup. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.h | 74 ++++++++++++++++++++++++++++++++++++++-------- - 1 file changed, 61 insertions(+), 13 deletions(-) - -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index ae1ac35..67be4e5 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -17,30 +17,78 @@ - #define ALPS_PROTO_V3 2 - #define ALPS_PROTO_V4 3 - -+/** -+ * struct alps_model_info - touchpad ID table -+ * @signature: E7 response string to match. -+ * @command_mode_resp: For V3/V4 touchpads, the final byte of the EC response -+ * (aka command mode response) identifies the firmware minor version. This -+ * can be used to distinguish different hardware models which are not -+ * uniquely identifiable through their E7 responses. -+ * @proto_version: Indicates V1/V2/V3/... -+ * @byte0: Helps figure out whether a position report packet matches the -+ * known format for this model. The first byte of the report, ANDed with -+ * mask0, should match byte0. -+ * @mask0: The mask used to check the first byte of the report. -+ * @flags: Additional device capabilities (passthrough port, trackstick, etc.). -+ * -+ * Many (but not all) ALPS touchpads can be identified by looking at the -+ * values returned in the "E7 report" and/or the "EC report." This table -+ * lists a number of such touchpads. -+ */ - struct alps_model_info { -- unsigned char signature[3]; -- unsigned char command_mode_resp; /* v3/v4 only */ -+ unsigned char signature[3]; -+ unsigned char command_mode_resp; - unsigned char proto_version; -- unsigned char byte0, mask0; -- unsigned char flags; -+ unsigned char byte0, mask0; -+ unsigned char flags; - }; - -+/** -+ * struct alps_nibble_commands - encodings for register accesses -+ * @command: PS/2 command used for the nibble -+ * @data: Data supplied as an argument to the PS/2 command, if applicable -+ * -+ * The ALPS protocol uses magic sequences to transmit binary data to the -+ * touchpad, as it is generally not OK to send arbitrary bytes out the -+ * PS/2 port. Each of the sequences in this table sends one nibble of the -+ * register address or (write) data. Different versions of the ALPS protocol -+ * use slightly different encodings. -+ */ - struct alps_nibble_commands { - int command; - unsigned char data; - }; - -+/** -+ * struct alps_data - private data structure for the ALPS driver -+ * @dev2: "Relative" device used to report trackstick or mouse activity. -+ * @phys: Physical path for the relative device. -+ * @i: Information on the detected touchpad model. -+ * @nibble_commands: Command mapping used for touchpad register accesses. -+ * @addr_command: Command used to tell the touchpad that a register address -+ * follows. -+ * @prev_fin: Finger bit from previous packet. -+ * @multi_packet: Multi-packet data in progress. -+ * @multi_data: Saved multi-packet data. -+ * @x1: First X coordinate from last MT report. -+ * @x2: Second X coordinate from last MT report. -+ * @y1: First Y coordinate from last MT report. -+ * @y2: Second Y coordinate from last MT report. -+ * @fingers: Number of fingers from last MT report. -+ * @quirks: Bitmap of ALPS_QUIRK_*. -+ * @timer: Timer for flushing out the final report packet in the stream. -+ */ - struct alps_data { -- struct input_dev *dev2; /* Relative device */ -- char phys[32]; /* Phys */ -- const struct alps_model_info *i;/* Info */ -+ struct input_dev *dev2; -+ char phys[32]; -+ const struct alps_model_info *i; - const struct alps_nibble_commands *nibble_commands; -- int addr_command; /* Command to set register address */ -- int prev_fin; /* Finger bit from previous packet */ -- int multi_packet; /* Multi-packet data in progress */ -- unsigned char multi_data[6]; /* Saved multi-packet data */ -- int x1, x2, y1, y2; /* Coordinates from last MT report */ -- int fingers; /* Number of fingers from MT report */ -+ int addr_command; -+ int prev_fin; -+ int multi_packet; -+ unsigned char multi_data[6]; -+ int x1, x2, y1, y2; -+ int fingers; - u8 quirks; - struct timer_list timer; - }; --- -1.8.1.2 - - -From 196069863604cb55061a02ad5f046c5e4054ba54 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 20:56:33 -0800 -Subject: [PATCH 02/15] Input: ALPS - copy "model" info into alps_data struct - -Not every type of ALPS touchpad is well-suited to table-based detection. -Start moving the various alps_model_data attributes into the alps_data -struct so that we don't need a unique table entry for every possible -permutation of protocol version, flags, byte0/mask0, etc. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 63 +++++++++++++++++++++++----------------------- - drivers/input/mouse/alps.h | 14 +++++++++-- - 2 files changed, 43 insertions(+), 34 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index e229fa3..33ee6e0 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -122,10 +122,10 @@ static const struct alps_model_info alps_model_data[] = { - - /* Packet formats are described in Documentation/input/alps.txt */ - --static bool alps_is_valid_first_byte(const struct alps_model_info *model, -+static bool alps_is_valid_first_byte(struct alps_data *priv, - unsigned char data) - { -- return (data & model->mask0) == model->byte0; -+ return (data & priv->mask0) == priv->byte0; - } - - static void alps_report_buttons(struct psmouse *psmouse, -@@ -158,14 +158,13 @@ static void alps_report_buttons(struct psmouse *psmouse, - static void alps_process_packet_v1_v2(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -- const struct alps_model_info *model = priv->i; - unsigned char *packet = psmouse->packet; - struct input_dev *dev = psmouse->dev; - struct input_dev *dev2 = priv->dev2; - int x, y, z, ges, fin, left, right, middle; - int back = 0, forward = 0; - -- if (model->proto_version == ALPS_PROTO_V1) { -+ if (priv->proto_version == ALPS_PROTO_V1) { - left = packet[2] & 0x10; - right = packet[2] & 0x08; - middle = 0; -@@ -181,12 +180,12 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse) - z = packet[5]; - } - -- if (model->flags & ALPS_FW_BK_1) { -+ if (priv->flags & ALPS_FW_BK_1) { - back = packet[0] & 0x10; - forward = packet[2] & 4; - } - -- if (model->flags & ALPS_FW_BK_2) { -+ if (priv->flags & ALPS_FW_BK_2) { - back = packet[3] & 4; - forward = packet[2] & 4; - if ((middle = forward && back)) -@@ -196,7 +195,7 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse) - ges = packet[2] & 1; - fin = packet[2] & 2; - -- if ((model->flags & ALPS_DUALPOINT) && z == 127) { -+ if ((priv->flags & ALPS_DUALPOINT) && z == 127) { - input_report_rel(dev2, REL_X, (x > 383 ? (x - 768) : x)); - input_report_rel(dev2, REL_Y, -(y > 255 ? (y - 512) : y)); - -@@ -239,15 +238,15 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse) - input_report_abs(dev, ABS_PRESSURE, z); - input_report_key(dev, BTN_TOOL_FINGER, z > 0); - -- if (model->flags & ALPS_WHEEL) -+ if (priv->flags & ALPS_WHEEL) - input_report_rel(dev, REL_WHEEL, ((packet[2] << 1) & 0x08) - ((packet[0] >> 4) & 0x07)); - -- if (model->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { -+ if (priv->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { - input_report_key(dev, BTN_FORWARD, forward); - input_report_key(dev, BTN_BACK, back); - } - -- if (model->flags & ALPS_FOUR_BUTTONS) { -+ if (priv->flags & ALPS_FOUR_BUTTONS) { - input_report_key(dev, BTN_0, packet[2] & 4); - input_report_key(dev, BTN_1, packet[0] & 0x10); - input_report_key(dev, BTN_2, packet[3] & 4); -@@ -699,9 +698,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse) - static void alps_process_packet(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -- const struct alps_model_info *model = priv->i; - -- switch (model->proto_version) { -+ switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: - alps_process_packet_v1_v2(psmouse); -@@ -765,7 +763,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) - if (((psmouse->packet[3] | - psmouse->packet[4] | - psmouse->packet[5]) & 0x80) || -- (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) { -+ (!alps_is_valid_first_byte(priv, psmouse->packet[6]))) { - psmouse_dbg(psmouse, - "refusing packet %4ph (suspected interleaved ps/2)\n", - psmouse->packet + 3); -@@ -844,7 +842,6 @@ static void alps_flush_packet(unsigned long data) - static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -- const struct alps_model_info *model = priv->i; - - if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */ - if (psmouse->pktcnt == 3) { -@@ -857,15 +854,15 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) - - /* Check for PS/2 packet stuffed in the middle of ALPS packet. */ - -- if ((model->flags & ALPS_PS2_INTERLEAVED) && -+ if ((priv->flags & ALPS_PS2_INTERLEAVED) && - psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) { - return alps_handle_interleaved_ps2(psmouse); - } - -- if (!alps_is_valid_first_byte(model, psmouse->packet[0])) { -+ if (!alps_is_valid_first_byte(priv, psmouse->packet[0])) { - psmouse_dbg(psmouse, - "refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n", -- psmouse->packet[0], model->mask0, model->byte0); -+ psmouse->packet[0], priv->mask0, priv->byte0); - return PSMOUSE_BAD_DATA; - } - -@@ -1190,16 +1187,16 @@ static int alps_poll(struct psmouse *psmouse) - unsigned char buf[sizeof(psmouse->packet)]; - bool poll_failed; - -- if (priv->i->flags & ALPS_PASS) -+ if (priv->flags & ALPS_PASS) - alps_passthrough_mode_v2(psmouse, true); - - poll_failed = ps2_command(&psmouse->ps2dev, buf, - PSMOUSE_CMD_POLL | (psmouse->pktsize << 8)) < 0; - -- if (priv->i->flags & ALPS_PASS) -+ if (priv->flags & ALPS_PASS) - alps_passthrough_mode_v2(psmouse, false); - -- if (poll_failed || (buf[0] & priv->i->mask0) != priv->i->byte0) -+ if (poll_failed || (buf[0] & priv->mask0) != priv->byte0) - return -1; - - if ((psmouse->badbyte & 0xc8) == 0x08) { -@@ -1217,9 +1214,8 @@ static int alps_poll(struct psmouse *psmouse) - static int alps_hw_init_v1_v2(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -- const struct alps_model_info *model = priv->i; - -- if ((model->flags & ALPS_PASS) && -+ if ((priv->flags & ALPS_PASS) && - alps_passthrough_mode_v2(psmouse, true)) { - return -1; - } -@@ -1234,7 +1230,7 @@ static int alps_hw_init_v1_v2(struct psmouse *psmouse) - return -1; - } - -- if ((model->flags & ALPS_PASS) && -+ if ((priv->flags & ALPS_PASS) && - alps_passthrough_mode_v2(psmouse, false)) { - return -1; - } -@@ -1520,10 +1516,9 @@ error: - static int alps_hw_init(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -- const struct alps_model_info *model = priv->i; - int ret = -1; - -- switch (model->proto_version) { -+ switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: - ret = alps_hw_init_v1_v2(psmouse); -@@ -1585,7 +1580,10 @@ int alps_init(struct psmouse *psmouse) - if (!model) - goto init_fail; - -- priv->i = model; -+ priv->proto_version = model->proto_version; -+ priv->byte0 = model->byte0; -+ priv->mask0 = model->mask0; -+ priv->flags = model->flags; - - if (alps_hw_init(psmouse)) - goto init_fail; -@@ -1609,7 +1607,7 @@ int alps_init(struct psmouse *psmouse) - - dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS); - -- switch (model->proto_version) { -+ switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: - input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0); -@@ -1633,17 +1631,17 @@ int alps_init(struct psmouse *psmouse) - - input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0); - -- if (model->flags & ALPS_WHEEL) { -+ if (priv->flags & ALPS_WHEEL) { - dev1->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL); - dev1->relbit[BIT_WORD(REL_WHEEL)] |= BIT_MASK(REL_WHEEL); - } - -- if (model->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { -+ if (priv->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { - dev1->keybit[BIT_WORD(BTN_FORWARD)] |= BIT_MASK(BTN_FORWARD); - dev1->keybit[BIT_WORD(BTN_BACK)] |= BIT_MASK(BTN_BACK); - } - -- if (model->flags & ALPS_FOUR_BUTTONS) { -+ if (priv->flags & ALPS_FOUR_BUTTONS) { - dev1->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_0); - dev1->keybit[BIT_WORD(BTN_1)] |= BIT_MASK(BTN_1); - dev1->keybit[BIT_WORD(BTN_2)] |= BIT_MASK(BTN_2); -@@ -1654,7 +1652,8 @@ int alps_init(struct psmouse *psmouse) - - snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys); - dev2->phys = priv->phys; -- dev2->name = (model->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse"; -+ dev2->name = (priv->flags & ALPS_DUALPOINT) ? -+ "DualPoint Stick" : "PS/2 Mouse"; - dev2->id.bustype = BUS_I8042; - dev2->id.vendor = 0x0002; - dev2->id.product = PSMOUSE_ALPS; -@@ -1673,7 +1672,7 @@ int alps_init(struct psmouse *psmouse) - psmouse->poll = alps_poll; - psmouse->disconnect = alps_disconnect; - psmouse->reconnect = alps_reconnect; -- psmouse->pktsize = model->proto_version == ALPS_PROTO_V4 ? 8 : 6; -+ psmouse->pktsize = priv->proto_version == ALPS_PROTO_V4 ? 8 : 6; - - /* We are having trouble resyncing ALPS touchpads so disable it for now */ - psmouse->resync_time = 0; -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index 67be4e5..efd0eea 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -63,10 +63,15 @@ struct alps_nibble_commands { - * struct alps_data - private data structure for the ALPS driver - * @dev2: "Relative" device used to report trackstick or mouse activity. - * @phys: Physical path for the relative device. -- * @i: Information on the detected touchpad model. - * @nibble_commands: Command mapping used for touchpad register accesses. - * @addr_command: Command used to tell the touchpad that a register address - * follows. -+ * @proto_version: Indicates V1/V2/V3/... -+ * @byte0: Helps figure out whether a position report packet matches the -+ * known format for this model. The first byte of the report, ANDed with -+ * mask0, should match byte0. -+ * @mask0: The mask used to check the first byte of the report. -+ * @flags: Additional device capabilities (passthrough port, trackstick, etc.). - * @prev_fin: Finger bit from previous packet. - * @multi_packet: Multi-packet data in progress. - * @multi_data: Saved multi-packet data. -@@ -81,9 +86,14 @@ struct alps_nibble_commands { - struct alps_data { - struct input_dev *dev2; - char phys[32]; -- const struct alps_model_info *i; -+ -+ /* these are autodetected when the device is identified */ - const struct alps_nibble_commands *nibble_commands; - int addr_command; -+ unsigned char proto_version; -+ unsigned char byte0, mask0; -+ unsigned char flags; -+ - int prev_fin; - int multi_packet; - unsigned char multi_data[6]; --- -1.8.1.2 - - -From b856c913996a38ced60bdf41aeae4da00882bf1f Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 20:57:04 -0800 -Subject: [PATCH 03/15] Input: ALPS - move alps_get_model() down below hw_init - code - -This will minimize the number of forward declarations needed when -alps_get_model() starts assigning function pointers. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 186 ++++++++++++++++++++++----------------------- - 1 file changed, 93 insertions(+), 93 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 33ee6e0..c473549 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -998,99 +998,6 @@ static inline int alps_exit_command_mode(struct psmouse *psmouse) - return 0; - } - --static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version) --{ -- struct ps2dev *ps2dev = &psmouse->ps2dev; -- static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 }; -- unsigned char param[4]; -- const struct alps_model_info *model = NULL; -- int i; -- -- /* -- * First try "E6 report". -- * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. -- * The bits 0-2 of the first byte will be 1s if some buttons are -- * pressed. -- */ -- param[0] = 0; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11)) -- return NULL; -- -- param[0] = param[1] = param[2] = 0xff; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -- return NULL; -- -- psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", -- param[0], param[1], param[2]); -- -- if ((param[0] & 0xf8) != 0 || param[1] != 0 || -- (param[2] != 10 && param[2] != 100)) -- return NULL; -- -- /* -- * Now try "E7 report". Allowed responses are in -- * alps_model_data[].signature -- */ -- param[0] = 0; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21)) -- return NULL; -- -- param[0] = param[1] = param[2] = 0xff; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -- return NULL; -- -- psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x", -- param[0], param[1], param[2]); -- -- if (version) { -- for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) -- /* empty */; -- *version = (param[0] << 8) | (param[1] << 4) | i; -- } -- -- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -- if (!memcmp(param, alps_model_data[i].signature, -- sizeof(alps_model_data[i].signature))) { -- model = alps_model_data + i; -- break; -- } -- } -- -- if (model && model->proto_version > ALPS_PROTO_V2) { -- /* -- * Need to check command mode response to identify -- * model -- */ -- model = NULL; -- if (alps_enter_command_mode(psmouse, param)) { -- psmouse_warn(psmouse, -- "touchpad failed to enter command mode\n"); -- } else { -- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -- if (alps_model_data[i].proto_version > ALPS_PROTO_V2 && -- alps_model_data[i].command_mode_resp == param[0]) { -- model = alps_model_data + i; -- break; -- } -- } -- alps_exit_command_mode(psmouse); -- -- if (!model) -- psmouse_dbg(psmouse, -- "Unknown command mode response %2.2x\n", -- param[0]); -- } -- } -- -- return model; --} -- - /* - * For DualPoint devices select the device that should respond to - * subsequent commands. It looks like glidepad is behind stickpointer, -@@ -1534,6 +1441,99 @@ static int alps_hw_init(struct psmouse *psmouse) - return ret; - } - -+static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 }; -+ unsigned char param[4]; -+ const struct alps_model_info *model = NULL; -+ int i; -+ -+ /* -+ * First try "E6 report". -+ * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. -+ * The bits 0-2 of the first byte will be 1s if some buttons are -+ * pressed. -+ */ -+ param[0] = 0; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11)) -+ return NULL; -+ -+ param[0] = param[1] = param[2] = 0xff; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ return NULL; -+ -+ psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", -+ param[0], param[1], param[2]); -+ -+ if ((param[0] & 0xf8) != 0 || param[1] != 0 || -+ (param[2] != 10 && param[2] != 100)) -+ return NULL; -+ -+ /* -+ * Now try "E7 report". Allowed responses are in -+ * alps_model_data[].signature -+ */ -+ param[0] = 0; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21)) -+ return NULL; -+ -+ param[0] = param[1] = param[2] = 0xff; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ return NULL; -+ -+ psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x", -+ param[0], param[1], param[2]); -+ -+ if (version) { -+ for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) -+ /* empty */; -+ *version = (param[0] << 8) | (param[1] << 4) | i; -+ } -+ -+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -+ if (!memcmp(param, alps_model_data[i].signature, -+ sizeof(alps_model_data[i].signature))) { -+ model = alps_model_data + i; -+ break; -+ } -+ } -+ -+ if (model && model->proto_version > ALPS_PROTO_V2) { -+ /* -+ * Need to check command mode response to identify -+ * model -+ */ -+ model = NULL; -+ if (alps_enter_command_mode(psmouse, param)) { -+ psmouse_warn(psmouse, -+ "touchpad failed to enter command mode\n"); -+ } else { -+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -+ if (alps_model_data[i].proto_version > ALPS_PROTO_V2 && -+ alps_model_data[i].command_mode_resp == param[0]) { -+ model = alps_model_data + i; -+ break; -+ } -+ } -+ alps_exit_command_mode(psmouse); -+ -+ if (!model) -+ psmouse_dbg(psmouse, -+ "Unknown command mode response %2.2x\n", -+ param[0]); -+ } -+ } -+ -+ return model; -+} -+ - static int alps_reconnect(struct psmouse *psmouse) - { - const struct alps_model_info *model; --- -1.8.1.2 - - -From b719d56d5743e2c338568f4edb6eab17ea9c9eec Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:19:01 -0800 -Subject: [PATCH 04/15] Input: ALPS - introduce helper function for repeated - commands - -Several ALPS driver init sequences repeat a command three times, then -issue PSMOUSE_CMD_GETINFO to read the result. Move this into a helper -function to simplify the code. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 71 ++++++++++++++++++++-------------------------- - 1 file changed, 30 insertions(+), 41 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index c473549..1ca854b 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -964,24 +964,42 @@ static int alps_command_mode_write_reg(struct psmouse *psmouse, int addr, - return __alps_command_mode_write_reg(psmouse, value); - } - -+static int alps_rpt_cmd(struct psmouse *psmouse, int init_command, -+ int repeated_command, unsigned char *param) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ -+ param[0] = 0; -+ if (init_command && ps2_command(ps2dev, param, init_command)) -+ return -EIO; -+ -+ if (ps2_command(ps2dev, NULL, repeated_command) || -+ ps2_command(ps2dev, NULL, repeated_command) || -+ ps2_command(ps2dev, NULL, repeated_command)) -+ return -EIO; -+ -+ param[0] = param[1] = param[2] = 0xff; -+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ return -EIO; -+ -+ psmouse_dbg(psmouse, "%2.2X report: %2.2x %2.2x %2.2x\n", -+ repeated_command, param[0], param[1], param[2]); -+ return 0; -+} -+ - static int alps_enter_command_mode(struct psmouse *psmouse, - unsigned char *resp) - { - unsigned char param[4]; -- struct ps2dev *ps2dev = &psmouse->ps2dev; - -- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) || -- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { -+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_RESET_WRAP, param)) { - psmouse_err(psmouse, "failed to enter command mode\n"); - return -1; - } - - if (param[0] != 0x88 && param[1] != 0x07) { - psmouse_dbg(psmouse, -- "unknown response while entering command mode: %2.2x %2.2x %2.2x\n", -- param[0], param[1], param[2]); -+ "unknown response while entering command mode\n"); - return -1; - } - -@@ -1041,18 +1059,10 @@ static int alps_absolute_mode_v1_v2(struct psmouse *psmouse) - - static int alps_get_status(struct psmouse *psmouse, char *param) - { -- struct ps2dev *ps2dev = &psmouse->ps2dev; -- - /* Get status: 0xF5 0xF5 0xF5 0xE9 */ -- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE) || -- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_DISABLE, param)) - return -1; - -- psmouse_dbg(psmouse, "Status: %2.2x %2.2x %2.2x", -- param[0], param[1], param[2]); -- - return 0; - } - -@@ -1443,7 +1453,6 @@ static int alps_hw_init(struct psmouse *psmouse) - - static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version) - { -- struct ps2dev *ps2dev = &psmouse->ps2dev; - static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 }; - unsigned char param[4]; - const struct alps_model_info *model = NULL; -@@ -1455,20 +1464,10 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int - * The bits 0-2 of the first byte will be 1s if some buttons are - * pressed. - */ -- param[0] = 0; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11)) -- return NULL; -- -- param[0] = param[1] = param[2] = 0xff; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE11, -+ param)) - return NULL; - -- psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", -- param[0], param[1], param[2]); -- - if ((param[0] & 0xf8) != 0 || param[1] != 0 || - (param[2] != 10 && param[2] != 100)) - return NULL; -@@ -1477,20 +1476,10 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int - * Now try "E7 report". Allowed responses are in - * alps_model_data[].signature - */ -- param[0] = 0; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21)) -- return NULL; -- -- param[0] = param[1] = param[2] = 0xff; -- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) -+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE21, -+ param)) - return NULL; - -- psmouse_dbg(psmouse, "E7 report: %2.2x %2.2x %2.2x", -- param[0], param[1], param[2]); -- - if (version) { - for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) - /* empty */; --- -1.8.1.2 - - -From c7fd5d0e90f577072ece70651aeecb37f62f5fdb Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:19:59 -0800 -Subject: [PATCH 05/15] Input: ALPS - rework detection sequence - -If the E6 report test passes, get the E7 and EC reports right away and -then try to match an entry in the table. - -Pass in the alps_data struct, so that the detection code will be able to -set operating parameters based on information found during detection. - -Change the version (psmouse->model) to report the protocol version only, -in preparation for supporting models that do not show up in the ID table. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 124 +++++++++++++++++++-------------------------- - drivers/input/mouse/alps.h | 8 +-- - 2 files changed, 56 insertions(+), 76 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 1ca854b..e6a27a5 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -1451,86 +1451,76 @@ static int alps_hw_init(struct psmouse *psmouse) - return ret; - } - --static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int *version) -+static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv, -+ unsigned char *e7, unsigned char *ec) - { -- static const unsigned char rates[] = { 0, 10, 20, 40, 60, 80, 100, 200 }; -- unsigned char param[4]; -- const struct alps_model_info *model = NULL; -+ const struct alps_model_info *model; - int i; - -+ for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -+ model = &alps_model_data[i]; -+ -+ if (!memcmp(e7, model->signature, sizeof(model->signature)) && -+ (!model->command_mode_resp || -+ model->command_mode_resp == ec[2])) { -+ -+ priv->proto_version = model->proto_version; -+ priv->flags = model->flags; -+ priv->byte0 = model->byte0; -+ priv->mask0 = model->mask0; -+ -+ return 0; -+ } -+ } -+ -+ return -EINVAL; -+} -+ -+static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) -+{ -+ unsigned char e6[4], e7[4], ec[4]; -+ - /* - * First try "E6 report". - * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. - * The bits 0-2 of the first byte will be 1s if some buttons are - * pressed. - */ -- if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE11, -- param)) -- return NULL; -+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, -+ PSMOUSE_CMD_SETSCALE11, e6)) -+ return -EIO; - -- if ((param[0] & 0xf8) != 0 || param[1] != 0 || -- (param[2] != 10 && param[2] != 100)) -- return NULL; -+ if ((e6[0] & 0xf8) != 0 || e6[1] != 0 || (e6[2] != 10 && e6[2] != 100)) -+ return -EINVAL; - - /* -- * Now try "E7 report". Allowed responses are in -- * alps_model_data[].signature -+ * Now get the "E7" and "EC" reports. These will uniquely identify -+ * most ALPS touchpads. - */ -- if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, PSMOUSE_CMD_SETSCALE21, -- param)) -- return NULL; -- -- if (version) { -- for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) -- /* empty */; -- *version = (param[0] << 8) | (param[1] << 4) | i; -- } -- -- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -- if (!memcmp(param, alps_model_data[i].signature, -- sizeof(alps_model_data[i].signature))) { -- model = alps_model_data + i; -- break; -- } -- } -+ if (alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, -+ PSMOUSE_CMD_SETSCALE21, e7) || -+ alps_rpt_cmd(psmouse, PSMOUSE_CMD_SETRES, -+ PSMOUSE_CMD_RESET_WRAP, ec) || -+ alps_exit_command_mode(psmouse)) -+ return -EIO; - -- if (model && model->proto_version > ALPS_PROTO_V2) { -- /* -- * Need to check command mode response to identify -- * model -- */ -- model = NULL; -- if (alps_enter_command_mode(psmouse, param)) { -- psmouse_warn(psmouse, -- "touchpad failed to enter command mode\n"); -- } else { -- for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) { -- if (alps_model_data[i].proto_version > ALPS_PROTO_V2 && -- alps_model_data[i].command_mode_resp == param[0]) { -- model = alps_model_data + i; -- break; -- } -- } -- alps_exit_command_mode(psmouse); -+ if (alps_match_table(psmouse, priv, e7, ec) == 0) -+ return 0; - -- if (!model) -- psmouse_dbg(psmouse, -- "Unknown command mode response %2.2x\n", -- param[0]); -- } -- } -+ psmouse_info(psmouse, -+ "Unknown ALPS touchpad: E7=%2.2x %2.2x %2.2x, EC=%2.2x %2.2x %2.2x\n", -+ e7[0], e7[1], e7[2], ec[0], ec[1], ec[2]); - -- return model; -+ return -EINVAL; - } - - static int alps_reconnect(struct psmouse *psmouse) - { -- const struct alps_model_info *model; -+ struct alps_data *priv = psmouse->private; - - psmouse_reset(psmouse); - -- model = alps_get_model(psmouse, NULL); -- if (!model) -+ if (alps_identify(psmouse, priv) < 0) - return -1; - - return alps_hw_init(psmouse); -@@ -1549,9 +1539,7 @@ static void alps_disconnect(struct psmouse *psmouse) - int alps_init(struct psmouse *psmouse) - { - struct alps_data *priv; -- const struct alps_model_info *model; - struct input_dev *dev1 = psmouse->dev, *dev2; -- int version; - - priv = kzalloc(sizeof(struct alps_data), GFP_KERNEL); - dev2 = input_allocate_device(); -@@ -1565,15 +1553,9 @@ int alps_init(struct psmouse *psmouse) - - psmouse_reset(psmouse); - -- model = alps_get_model(psmouse, &version); -- if (!model) -+ if (alps_identify(psmouse, priv) < 0) - goto init_fail; - -- priv->proto_version = model->proto_version; -- priv->byte0 = model->byte0; -- priv->mask0 = model->mask0; -- priv->flags = model->flags; -- - if (alps_hw_init(psmouse)) - goto init_fail; - -@@ -1678,18 +1660,16 @@ init_fail: - - int alps_detect(struct psmouse *psmouse, bool set_properties) - { -- int version; -- const struct alps_model_info *model; -+ struct alps_data dummy; - -- model = alps_get_model(psmouse, &version); -- if (!model) -+ if (alps_identify(psmouse, &dummy) < 0) - return -1; - - if (set_properties) { - psmouse->vendor = "ALPS"; -- psmouse->name = model->flags & ALPS_DUALPOINT ? -+ psmouse->name = dummy.flags & ALPS_DUALPOINT ? - "DualPoint TouchPad" : "GlidePoint"; -- psmouse->model = version; -+ psmouse->model = dummy.proto_version << 8; - } - return 0; - } -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index efd0eea..a81b318 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -12,10 +12,10 @@ - #ifndef _ALPS_H - #define _ALPS_H - --#define ALPS_PROTO_V1 0 --#define ALPS_PROTO_V2 1 --#define ALPS_PROTO_V3 2 --#define ALPS_PROTO_V4 3 -+#define ALPS_PROTO_V1 1 -+#define ALPS_PROTO_V2 2 -+#define ALPS_PROTO_V3 3 -+#define ALPS_PROTO_V4 4 - - /** - * struct alps_model_info - touchpad ID table --- -1.8.1.2 - - -From c7fb8a63ba1257e2ee829425ef7197c7cbe893a1 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:22:08 -0800 -Subject: [PATCH 06/15] Input: ALPS - use function pointers for different - protocol handlers - -In anticipation of adding more ALPS protocols and more per-device quirks, -use function pointers instead of switch statements to call functions that -differ from one device to the next. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 101 +++++++++++++++++++++------------------------ - drivers/input/mouse/alps.h | 7 ++++ - 2 files changed, 54 insertions(+), 54 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index e6a27a5..fe45687 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -114,6 +114,11 @@ static const struct alps_model_info alps_model_data[] = { - { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, - }; - -+static void alps_set_abs_params_st(struct alps_data *priv, -+ struct input_dev *dev1); -+static void alps_set_abs_params_mt(struct alps_data *priv, -+ struct input_dev *dev1); -+ - /* - * XXX - this entry is suspicious. First byte has zero lower nibble, - * which is what a normal mouse would report. Also, the value 0x0e -@@ -695,24 +700,6 @@ static void alps_process_packet_v4(struct psmouse *psmouse) - input_sync(dev); - } - --static void alps_process_packet(struct psmouse *psmouse) --{ -- struct alps_data *priv = psmouse->private; -- -- switch (priv->proto_version) { -- case ALPS_PROTO_V1: -- case ALPS_PROTO_V2: -- alps_process_packet_v1_v2(psmouse); -- break; -- case ALPS_PROTO_V3: -- alps_process_packet_v3(psmouse); -- break; -- case ALPS_PROTO_V4: -- alps_process_packet_v4(psmouse); -- break; -- } --} -- - static void alps_report_bare_ps2_packet(struct psmouse *psmouse, - unsigned char packet[], - bool report_buttons) -@@ -770,7 +757,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) - return PSMOUSE_BAD_DATA; - } - -- alps_process_packet(psmouse); -+ priv->process_packet(psmouse); - - /* Continue with the next packet */ - psmouse->packet[0] = psmouse->packet[6]; -@@ -814,6 +801,7 @@ static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse) - static void alps_flush_packet(unsigned long data) - { - struct psmouse *psmouse = (struct psmouse *)data; -+ struct alps_data *priv = psmouse->private; - - serio_pause_rx(psmouse->ps2dev.serio); - -@@ -831,7 +819,7 @@ static void alps_flush_packet(unsigned long data) - "refusing packet %3ph (suspected interleaved ps/2)\n", - psmouse->packet + 3); - } else { -- alps_process_packet(psmouse); -+ priv->process_packet(psmouse); - } - psmouse->pktcnt = 0; - } -@@ -876,7 +864,7 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) - } - - if (psmouse->pktcnt == psmouse->pktsize) { -- alps_process_packet(psmouse); -+ priv->process_packet(psmouse); - return PSMOUSE_FULL_PACKET; - } - -@@ -1430,25 +1418,26 @@ error: - return -1; - } - --static int alps_hw_init(struct psmouse *psmouse) -+static void alps_set_defaults(struct alps_data *priv) - { -- struct alps_data *priv = psmouse->private; -- int ret = -1; -- - switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: -- ret = alps_hw_init_v1_v2(psmouse); -+ priv->hw_init = alps_hw_init_v1_v2; -+ priv->process_packet = alps_process_packet_v1_v2; -+ priv->set_abs_params = alps_set_abs_params_st; - break; - case ALPS_PROTO_V3: -- ret = alps_hw_init_v3(psmouse); -+ priv->hw_init = alps_hw_init_v3; -+ priv->process_packet = alps_process_packet_v3; -+ priv->set_abs_params = alps_set_abs_params_mt; - break; - case ALPS_PROTO_V4: -- ret = alps_hw_init_v4(psmouse); -+ priv->hw_init = alps_hw_init_v4; -+ priv->process_packet = alps_process_packet_v4; -+ priv->set_abs_params = alps_set_abs_params_mt; - break; - } -- -- return ret; - } - - static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv, -@@ -1465,6 +1454,8 @@ static int alps_match_table(struct psmouse *psmouse, struct alps_data *priv, - model->command_mode_resp == ec[2])) { - - priv->proto_version = model->proto_version; -+ alps_set_defaults(priv); -+ - priv->flags = model->flags; - priv->byte0 = model->byte0; - priv->mask0 = model->mask0; -@@ -1523,7 +1514,7 @@ static int alps_reconnect(struct psmouse *psmouse) - if (alps_identify(psmouse, priv) < 0) - return -1; - -- return alps_hw_init(psmouse); -+ return priv->hw_init(psmouse); - } - - static void alps_disconnect(struct psmouse *psmouse) -@@ -1536,6 +1527,29 @@ static void alps_disconnect(struct psmouse *psmouse) - kfree(priv); - } - -+static void alps_set_abs_params_st(struct alps_data *priv, -+ struct input_dev *dev1) -+{ -+ input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0); -+ input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0); -+} -+ -+static void alps_set_abs_params_mt(struct alps_data *priv, -+ struct input_dev *dev1) -+{ -+ set_bit(INPUT_PROP_SEMI_MT, dev1->propbit); -+ input_mt_init_slots(dev1, 2, 0); -+ input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0); -+ input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0); -+ -+ set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit); -+ set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit); -+ set_bit(BTN_TOOL_QUADTAP, dev1->keybit); -+ -+ input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0); -+ input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0); -+} -+ - int alps_init(struct psmouse *psmouse) - { - struct alps_data *priv; -@@ -1556,7 +1570,7 @@ int alps_init(struct psmouse *psmouse) - if (alps_identify(psmouse, priv) < 0) - goto init_fail; - -- if (alps_hw_init(psmouse)) -+ if (priv->hw_init(psmouse)) - goto init_fail; - - /* -@@ -1578,28 +1592,7 @@ int alps_init(struct psmouse *psmouse) - - dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS); - -- switch (priv->proto_version) { -- case ALPS_PROTO_V1: -- case ALPS_PROTO_V2: -- input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0); -- input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0); -- break; -- case ALPS_PROTO_V3: -- case ALPS_PROTO_V4: -- set_bit(INPUT_PROP_SEMI_MT, dev1->propbit); -- input_mt_init_slots(dev1, 2, 0); -- input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0); -- input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0); -- -- set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit); -- set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit); -- set_bit(BTN_TOOL_QUADTAP, dev1->keybit); -- -- input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0); -- input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0); -- break; -- } -- -+ priv->set_abs_params(priv, dev1); - input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0); - - if (priv->flags & ALPS_WHEEL) { -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index a81b318..0934f8b 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -72,6 +72,9 @@ struct alps_nibble_commands { - * mask0, should match byte0. - * @mask0: The mask used to check the first byte of the report. - * @flags: Additional device capabilities (passthrough port, trackstick, etc.). -+ * @hw_init: Protocol-specific hardware init function. -+ * @process_packet: Protocol-specific function to process a report packet. -+ * @set_abs_params: Protocol-specific function to configure the input_dev. - * @prev_fin: Finger bit from previous packet. - * @multi_packet: Multi-packet data in progress. - * @multi_data: Saved multi-packet data. -@@ -94,6 +97,10 @@ struct alps_data { - unsigned char byte0, mask0; - unsigned char flags; - -+ int (*hw_init)(struct psmouse *psmouse); -+ void (*process_packet)(struct psmouse *psmouse); -+ void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); -+ - int prev_fin; - int multi_packet; - unsigned char multi_data[6]; --- -1.8.1.2 - - -From e2600c708bef8e1c8126ca9b8d4ce1f83c002688 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:23:04 -0800 -Subject: [PATCH 07/15] Input: ALPS - move {addr,nibble}_command settings into - alps_set_defaults() - -This allows alps_identify() to override these settings based on the -device characteristics, if it is ever necessary. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index fe45687..2221a00 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -1190,14 +1190,10 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse) - - static int alps_hw_init_v3(struct psmouse *psmouse) - { -- struct alps_data *priv = psmouse->private; - struct ps2dev *ps2dev = &psmouse->ps2dev; - int reg_val; - unsigned char param[4]; - -- priv->nibble_commands = alps_v3_nibble_commands; -- priv->addr_command = PSMOUSE_CMD_RESET_WRAP; -- - if (alps_enter_command_mode(psmouse, NULL)) - goto error; - -@@ -1343,13 +1339,9 @@ static int alps_absolute_mode_v4(struct psmouse *psmouse) - - static int alps_hw_init_v4(struct psmouse *psmouse) - { -- struct alps_data *priv = psmouse->private; - struct ps2dev *ps2dev = &psmouse->ps2dev; - unsigned char param[4]; - -- priv->nibble_commands = alps_v4_nibble_commands; -- priv->addr_command = PSMOUSE_CMD_DISABLE; -- - if (alps_enter_command_mode(psmouse, NULL)) - goto error; - -@@ -1431,11 +1423,15 @@ static void alps_set_defaults(struct alps_data *priv) - priv->hw_init = alps_hw_init_v3; - priv->process_packet = alps_process_packet_v3; - priv->set_abs_params = alps_set_abs_params_mt; -+ priv->nibble_commands = alps_v3_nibble_commands; -+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP; - break; - case ALPS_PROTO_V4: - priv->hw_init = alps_hw_init_v4; - priv->process_packet = alps_process_packet_v4; - priv->set_abs_params = alps_set_abs_params_mt; -+ priv->nibble_commands = alps_v4_nibble_commands; -+ priv->addr_command = PSMOUSE_CMD_DISABLE; - break; - } - } --- -1.8.1.2 - - -From df0bf385112a7b38c5c3d307bb9399f9f3b3bba2 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:23:34 -0800 -Subject: [PATCH 08/15] Input: ALPS - rework detection of Pinnacle AGx - touchpads - -The official ALPS driver uses the EC report, not the E7 report, to detect -these devices. Also, they check for a range of values; the original -table-based code only checked for two specific ones. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 15 ++++++++++++--- - 1 file changed, 12 insertions(+), 3 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 2221a00..eafeae2 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -109,8 +109,6 @@ static const struct alps_model_info alps_model_data[] = { - { { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ - { { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff, - ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ -- { { 0x73, 0x02, 0x64 }, 0x9b, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, -- { { 0x73, 0x02, 0x64 }, 0x9d, ALPS_PROTO_V3, 0x8f, 0x8f, ALPS_DUALPOINT }, - { { 0x73, 0x02, 0x64 }, 0x8a, ALPS_PROTO_V4, 0x8f, 0x8f, 0 }, - }; - -@@ -1412,6 +1410,10 @@ error: - - static void alps_set_defaults(struct alps_data *priv) - { -+ priv->byte0 = 0x8f; -+ priv->mask0 = 0x8f; -+ priv->flags = ALPS_DUALPOINT; -+ - switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: -@@ -1491,8 +1493,15 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) - alps_exit_command_mode(psmouse)) - return -EIO; - -- if (alps_match_table(psmouse, priv, e7, ec) == 0) -+ if (alps_match_table(psmouse, priv, e7, ec) == 0) { -+ return 0; -+ } else if (ec[0] == 0x88 && ec[1] == 0x07 && -+ ec[2] >= 0x90 && ec[2] <= 0x9d) { -+ priv->proto_version = ALPS_PROTO_V3; -+ alps_set_defaults(priv); -+ - return 0; -+ } - - psmouse_info(psmouse, - "Unknown ALPS touchpad: E7=%2.2x %2.2x %2.2x, EC=%2.2x %2.2x %2.2x\n", --- -1.8.1.2 - - -From 8e6493f800dc08a28abd59dfe63790aaade0c700 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:24:22 -0800 -Subject: [PATCH 09/15] Input: ALPS - fix command mode check - -Pinnacle class devices should return "88 07 xx" or "88 08 xx" when -entering command mode. If either the first byte or the second byte is -invalid, return an error. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index eafeae2..bfc1938 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -983,7 +983,7 @@ static int alps_enter_command_mode(struct psmouse *psmouse, - return -1; - } - -- if (param[0] != 0x88 && param[1] != 0x07) { -+ if (param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) { - psmouse_dbg(psmouse, - "unknown response while entering command mode\n"); - return -1; --- -1.8.1.2 - - -From 0302b4c4a1b4201bf82a45c46084f3ccd0ee696f Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:24:55 -0800 -Subject: [PATCH 10/15] Input: ALPS - move pixel and bitmap info into alps_data - struct - -Newer touchpads use different constants, so make them runtime- -configurable. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 47 ++++++++++++++++++++++++---------------------- - drivers/input/mouse/alps.h | 8 ++++++++ - 2 files changed, 33 insertions(+), 22 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index bfc1938..2cd8be7 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -27,12 +27,6 @@ - /* - * Definitions for ALPS version 3 and 4 command mode protocol - */ --#define ALPS_V3_X_MAX 2000 --#define ALPS_V3_Y_MAX 1400 -- --#define ALPS_BITMAP_X_BITS 15 --#define ALPS_BITMAP_Y_BITS 11 -- - #define ALPS_CMD_NIBBLE_10 0x01f2 - - static const struct alps_nibble_commands alps_v3_nibble_commands[] = { -@@ -269,7 +263,8 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse) - * These points are returned in x1, y1, x2, and y2 when the return value - * is greater than 0. - */ --static int alps_process_bitmap(unsigned int x_map, unsigned int y_map, -+static int alps_process_bitmap(struct alps_data *priv, -+ unsigned int x_map, unsigned int y_map, - int *x1, int *y1, int *x2, int *y2) - { - struct alps_bitmap_point { -@@ -311,7 +306,7 @@ static int alps_process_bitmap(unsigned int x_map, unsigned int y_map, - * y bitmap is reversed for what we need (lower positions are in - * higher bits), so we process from the top end. - */ -- y_map = y_map << (sizeof(y_map) * BITS_PER_BYTE - ALPS_BITMAP_Y_BITS); -+ y_map = y_map << (sizeof(y_map) * BITS_PER_BYTE - priv->y_bits); - prev_bit = 0; - point = &y_low; - for (i = 0; y_map != 0; i++, y_map <<= 1) { -@@ -357,16 +352,18 @@ static int alps_process_bitmap(unsigned int x_map, unsigned int y_map, - } - } - -- *x1 = (ALPS_V3_X_MAX * (2 * x_low.start_bit + x_low.num_bits - 1)) / -- (2 * (ALPS_BITMAP_X_BITS - 1)); -- *y1 = (ALPS_V3_Y_MAX * (2 * y_low.start_bit + y_low.num_bits - 1)) / -- (2 * (ALPS_BITMAP_Y_BITS - 1)); -+ *x1 = (priv->x_max * (2 * x_low.start_bit + x_low.num_bits - 1)) / -+ (2 * (priv->x_bits - 1)); -+ *y1 = (priv->y_max * (2 * y_low.start_bit + y_low.num_bits - 1)) / -+ (2 * (priv->y_bits - 1)); - - if (fingers > 1) { -- *x2 = (ALPS_V3_X_MAX * (2 * x_high.start_bit + x_high.num_bits - 1)) / -- (2 * (ALPS_BITMAP_X_BITS - 1)); -- *y2 = (ALPS_V3_Y_MAX * (2 * y_high.start_bit + y_high.num_bits - 1)) / -- (2 * (ALPS_BITMAP_Y_BITS - 1)); -+ *x2 = (priv->x_max * -+ (2 * x_high.start_bit + x_high.num_bits - 1)) / -+ (2 * (priv->x_bits - 1)); -+ *y2 = (priv->y_max * -+ (2 * y_high.start_bit + y_high.num_bits - 1)) / -+ (2 * (priv->y_bits - 1)); - } - - return fingers; -@@ -484,7 +481,8 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - ((packet[2] & 0x7f) << 1) | - (packet[4] & 0x01); - -- bmap_fingers = alps_process_bitmap(x_bitmap, y_bitmap, -+ bmap_fingers = alps_process_bitmap(priv, -+ x_bitmap, y_bitmap, - &x1, &y1, &x2, &y2); - - /* -@@ -641,7 +639,7 @@ static void alps_process_packet_v4(struct psmouse *psmouse) - ((priv->multi_data[3] & 0x1f) << 5) | - (priv->multi_data[1] & 0x1f); - -- fingers = alps_process_bitmap(x_bitmap, y_bitmap, -+ fingers = alps_process_bitmap(priv, x_bitmap, y_bitmap, - &x1, &y1, &x2, &y2); - - /* Store MT data.*/ -@@ -1414,6 +1412,11 @@ static void alps_set_defaults(struct alps_data *priv) - priv->mask0 = 0x8f; - priv->flags = ALPS_DUALPOINT; - -+ priv->x_max = 2000; -+ priv->y_max = 1400; -+ priv->x_bits = 15; -+ priv->y_bits = 11; -+ - switch (priv->proto_version) { - case ALPS_PROTO_V1: - case ALPS_PROTO_V2: -@@ -1544,15 +1547,15 @@ static void alps_set_abs_params_mt(struct alps_data *priv, - { - set_bit(INPUT_PROP_SEMI_MT, dev1->propbit); - input_mt_init_slots(dev1, 2, 0); -- input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, ALPS_V3_X_MAX, 0, 0); -- input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, ALPS_V3_Y_MAX, 0, 0); -+ input_set_abs_params(dev1, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0); -+ input_set_abs_params(dev1, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0); - - set_bit(BTN_TOOL_DOUBLETAP, dev1->keybit); - set_bit(BTN_TOOL_TRIPLETAP, dev1->keybit); - set_bit(BTN_TOOL_QUADTAP, dev1->keybit); - -- input_set_abs_params(dev1, ABS_X, 0, ALPS_V3_X_MAX, 0, 0); -- input_set_abs_params(dev1, ABS_Y, 0, ALPS_V3_Y_MAX, 0, 0); -+ input_set_abs_params(dev1, ABS_X, 0, priv->x_max, 0, 0); -+ input_set_abs_params(dev1, ABS_Y, 0, priv->y_max, 0, 0); - } - - int alps_init(struct psmouse *psmouse) -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index 0934f8b..5e638be 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -72,6 +72,10 @@ struct alps_nibble_commands { - * mask0, should match byte0. - * @mask0: The mask used to check the first byte of the report. - * @flags: Additional device capabilities (passthrough port, trackstick, etc.). -+ * @x_max: Largest possible X position value. -+ * @y_max: Largest possible Y position value. -+ * @x_bits: Number of X bits in the MT bitmap. -+ * @y_bits: Number of Y bits in the MT bitmap. - * @hw_init: Protocol-specific hardware init function. - * @process_packet: Protocol-specific function to process a report packet. - * @set_abs_params: Protocol-specific function to configure the input_dev. -@@ -96,6 +100,10 @@ struct alps_data { - unsigned char proto_version; - unsigned char byte0, mask0; - unsigned char flags; -+ int x_max; -+ int y_max; -+ int x_bits; -+ int y_bits; - - int (*hw_init)(struct psmouse *psmouse); - void (*process_packet)(struct psmouse *psmouse); --- -1.8.1.2 - - -From 3c9d054fef84ccc967445b330ab6012c6b6bd85b Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:26:11 -0800 -Subject: [PATCH 11/15] Input: ALPS - make the V3 packet field decoder - "pluggable" - -A number of different ALPS touchpad protocols can reuse -alps_process_touchpad_packet_v3() with small tweaks to the bitfield -decoding. Create a new priv->decode_fields() callback that handles the -per-model differences. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 101 +++++++++++++++++++++++++-------------------- - drivers/input/mouse/alps.h | 38 +++++++++++++++++ - 2 files changed, 95 insertions(+), 44 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 2cd8be7..270b7de 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -447,17 +447,49 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) - return; - } - -+static void alps_decode_buttons_v3(struct alps_fields *f, unsigned char *p) -+{ -+ f->left = !!(p[3] & 0x01); -+ f->right = !!(p[3] & 0x02); -+ f->middle = !!(p[3] & 0x04); -+ -+ f->ts_left = !!(p[3] & 0x10); -+ f->ts_right = !!(p[3] & 0x20); -+ f->ts_middle = !!(p[3] & 0x40); -+} -+ -+static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p) -+{ -+ f->first_mp = !!(p[4] & 0x40); -+ f->is_mp = !!(p[0] & 0x40); -+ -+ f->fingers = (p[5] & 0x3) + 1; -+ f->x_map = ((p[4] & 0x7e) << 8) | -+ ((p[1] & 0x7f) << 2) | -+ ((p[0] & 0x30) >> 4); -+ f->y_map = ((p[3] & 0x70) << 4) | -+ ((p[2] & 0x7f) << 1) | -+ (p[4] & 0x01); -+ -+ f->x = ((p[1] & 0x7f) << 4) | ((p[4] & 0x30) >> 2) | -+ ((p[0] & 0x30) >> 4); -+ f->y = ((p[2] & 0x7f) << 4) | (p[4] & 0x0f); -+ f->z = p[5] & 0x7f; -+ -+ alps_decode_buttons_v3(f, p); -+} -+ - static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; - unsigned char *packet = psmouse->packet; - struct input_dev *dev = psmouse->dev; - struct input_dev *dev2 = priv->dev2; -- int x, y, z; -- int left, right, middle; - int x1 = 0, y1 = 0, x2 = 0, y2 = 0; - int fingers = 0, bmap_fingers; -- unsigned int x_bitmap, y_bitmap; -+ struct alps_fields f; -+ -+ priv->decode_fields(&f, packet); - - /* - * There's no single feature of touchpad position and bitmap packets -@@ -472,17 +504,10 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - * packet. Check for this, and when it happens process the - * position packet as usual. - */ -- if (packet[0] & 0x40) { -- fingers = (packet[5] & 0x3) + 1; -- x_bitmap = ((packet[4] & 0x7e) << 8) | -- ((packet[1] & 0x7f) << 2) | -- ((packet[0] & 0x30) >> 4); -- y_bitmap = ((packet[3] & 0x70) << 4) | -- ((packet[2] & 0x7f) << 1) | -- (packet[4] & 0x01); -- -+ if (f.is_mp) { -+ fingers = f.fingers; - bmap_fingers = alps_process_bitmap(priv, -- x_bitmap, y_bitmap, -+ f.x_map, f.y_map, - &x1, &y1, &x2, &y2); - - /* -@@ -493,7 +518,7 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - fingers = bmap_fingers; - - /* Now process position packet */ -- packet = priv->multi_data; -+ priv->decode_fields(&f, priv->multi_data); - } else { - priv->multi_packet = 0; - } -@@ -507,10 +532,10 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - * out misidentified bitmap packets, we reject anything with this - * bit set. - */ -- if (packet[0] & 0x40) -+ if (f.is_mp) - return; - -- if (!priv->multi_packet && (packet[4] & 0x40)) { -+ if (!priv->multi_packet && f.first_mp) { - priv->multi_packet = 1; - memcpy(priv->multi_data, packet, sizeof(priv->multi_data)); - return; -@@ -518,22 +543,13 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - - priv->multi_packet = 0; - -- left = packet[3] & 0x01; -- right = packet[3] & 0x02; -- middle = packet[3] & 0x04; -- -- x = ((packet[1] & 0x7f) << 4) | ((packet[4] & 0x30) >> 2) | -- ((packet[0] & 0x30) >> 4); -- y = ((packet[2] & 0x7f) << 4) | (packet[4] & 0x0f); -- z = packet[5] & 0x7f; -- - /* - * Sometimes the hardware sends a single packet with z = 0 - * in the middle of a stream. Real releases generate packets - * with x, y, and z all zero, so these seem to be flukes. - * Ignore them. - */ -- if (x && y && !z) -+ if (f.x && f.y && !f.z) - return; - - /* -@@ -541,12 +557,12 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - * to rely on ST data. - */ - if (!fingers) { -- x1 = x; -- y1 = y; -- fingers = z > 0 ? 1 : 0; -+ x1 = f.x; -+ y1 = f.y; -+ fingers = f.z > 0 ? 1 : 0; - } - -- if (z >= 64) -+ if (f.z >= 64) - input_report_key(dev, BTN_TOUCH, 1); - else - input_report_key(dev, BTN_TOUCH, 0); -@@ -555,26 +571,22 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - - input_mt_report_finger_count(dev, fingers); - -- input_report_key(dev, BTN_LEFT, left); -- input_report_key(dev, BTN_RIGHT, right); -- input_report_key(dev, BTN_MIDDLE, middle); -+ input_report_key(dev, BTN_LEFT, f.left); -+ input_report_key(dev, BTN_RIGHT, f.right); -+ input_report_key(dev, BTN_MIDDLE, f.middle); - -- if (z > 0) { -- input_report_abs(dev, ABS_X, x); -- input_report_abs(dev, ABS_Y, y); -+ if (f.z > 0) { -+ input_report_abs(dev, ABS_X, f.x); -+ input_report_abs(dev, ABS_Y, f.y); - } -- input_report_abs(dev, ABS_PRESSURE, z); -+ input_report_abs(dev, ABS_PRESSURE, f.z); - - input_sync(dev); - - if (!(priv->quirks & ALPS_QUIRK_TRACKSTICK_BUTTONS)) { -- left = packet[3] & 0x10; -- right = packet[3] & 0x20; -- middle = packet[3] & 0x40; -- -- input_report_key(dev2, BTN_LEFT, left); -- input_report_key(dev2, BTN_RIGHT, right); -- input_report_key(dev2, BTN_MIDDLE, middle); -+ input_report_key(dev2, BTN_LEFT, f.ts_left); -+ input_report_key(dev2, BTN_RIGHT, f.ts_right); -+ input_report_key(dev2, BTN_MIDDLE, f.ts_middle); - input_sync(dev2); - } - } -@@ -1428,6 +1440,7 @@ static void alps_set_defaults(struct alps_data *priv) - priv->hw_init = alps_hw_init_v3; - priv->process_packet = alps_process_packet_v3; - priv->set_abs_params = alps_set_abs_params_mt; -+ priv->decode_fields = alps_decode_pinnacle; - priv->nibble_commands = alps_v3_nibble_commands; - priv->addr_command = PSMOUSE_CMD_RESET_WRAP; - break; -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index 5e638be..9704805 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -60,6 +60,42 @@ struct alps_nibble_commands { - }; - - /** -+ * struct alps_fields - decoded version of the report packet -+ * @x_map: Bitmap of active X positions for MT. -+ * @y_map: Bitmap of active Y positions for MT. -+ * @fingers: Number of fingers for MT. -+ * @x: X position for ST. -+ * @y: Y position for ST. -+ * @z: Z position for ST. -+ * @first_mp: Packet is the first of a multi-packet report. -+ * @is_mp: Packet is part of a multi-packet report. -+ * @left: Left touchpad button is active. -+ * @right: Right touchpad button is active. -+ * @middle: Middle touchpad button is active. -+ * @ts_left: Left trackstick button is active. -+ * @ts_right: Right trackstick button is active. -+ * @ts_middle: Middle trackstick button is active. -+ */ -+struct alps_fields { -+ unsigned int x_map; -+ unsigned int y_map; -+ unsigned int fingers; -+ unsigned int x; -+ unsigned int y; -+ unsigned int z; -+ unsigned int first_mp:1; -+ unsigned int is_mp:1; -+ -+ unsigned int left:1; -+ unsigned int right:1; -+ unsigned int middle:1; -+ -+ unsigned int ts_left:1; -+ unsigned int ts_right:1; -+ unsigned int ts_middle:1; -+}; -+ -+/** - * struct alps_data - private data structure for the ALPS driver - * @dev2: "Relative" device used to report trackstick or mouse activity. - * @phys: Physical path for the relative device. -@@ -78,6 +114,7 @@ struct alps_nibble_commands { - * @y_bits: Number of Y bits in the MT bitmap. - * @hw_init: Protocol-specific hardware init function. - * @process_packet: Protocol-specific function to process a report packet. -+ * @decode_fields: Protocol-specific function to read packet bitfields. - * @set_abs_params: Protocol-specific function to configure the input_dev. - * @prev_fin: Finger bit from previous packet. - * @multi_packet: Multi-packet data in progress. -@@ -107,6 +144,7 @@ struct alps_data { - - int (*hw_init)(struct psmouse *psmouse); - void (*process_packet)(struct psmouse *psmouse); -+ void (*decode_fields)(struct alps_fields *f, unsigned char *p); - void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1); - - int prev_fin; --- -1.8.1.2 - - -From 9e7c99b6c125653f53ef0999a176c3a79de21be8 Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:27:08 -0800 -Subject: [PATCH 12/15] Input: ALPS - add support for "Rushmore" touchpads - -Rushmore touchpads are found on Dell E6230/E6430/E6530. They use the V3 -protocol with slightly tweaked init sequences and report formats. - -The E7 report is 73 03 0a, and the EC report is 88 08 1d - -Credits: Emmanuel Thome reported the MT bitmap changes. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 52 insertions(+) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 270b7de..bf2fa51 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -479,6 +479,14 @@ static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p) - alps_decode_buttons_v3(f, p); - } - -+static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p) -+{ -+ alps_decode_pinnacle(f, p); -+ -+ f->x_map |= (p[5] & 0x10) << 11; -+ f->y_map |= (p[5] & 0x20) << 6; -+} -+ - static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -@@ -1329,6 +1337,40 @@ error: - return -1; - } - -+static int alps_hw_init_rushmore_v3(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ int reg_val, ret = -1; -+ -+ if (alps_enter_command_mode(psmouse, NULL) || -+ alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 || -+ alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00)) -+ goto error; -+ -+ reg_val = alps_command_mode_read_reg(psmouse, 0xc2c6); -+ if (reg_val == -1) -+ goto error; -+ if (__alps_command_mode_write_reg(psmouse, reg_val & 0xfd)) -+ goto error; -+ -+ if (alps_command_mode_write_reg(psmouse, 0xc2c9, 0x64)) -+ goto error; -+ -+ /* enter absolute mode */ -+ reg_val = alps_command_mode_read_reg(psmouse, 0xc2c4); -+ if (reg_val == -1) -+ goto error; -+ if (__alps_command_mode_write_reg(psmouse, reg_val | 0x02)) -+ goto error; -+ -+ alps_exit_command_mode(psmouse); -+ return ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); -+ -+error: -+ alps_exit_command_mode(psmouse); -+ return ret; -+} -+ - /* Must be in command mode when calling this function */ - static int alps_absolute_mode_v4(struct psmouse *psmouse) - { -@@ -1511,6 +1553,16 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) - - if (alps_match_table(psmouse, priv, e7, ec) == 0) { - return 0; -+ } else if (ec[0] == 0x88 && ec[1] == 0x08) { -+ priv->proto_version = ALPS_PROTO_V3; -+ alps_set_defaults(priv); -+ -+ priv->hw_init = alps_hw_init_rushmore_v3; -+ priv->decode_fields = alps_decode_rushmore; -+ priv->x_bits = 16; -+ priv->y_bits = 12; -+ -+ return 0; - } else if (ec[0] == 0x88 && ec[1] == 0x07 && - ec[2] >= 0x90 && ec[2] <= 0x9d) { - priv->proto_version = ALPS_PROTO_V3; --- -1.8.1.2 - - -From e5ca58dc506fb7f64760b483ecd407593b764f3b Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Wed, 13 Feb 2013 22:28:07 -0800 -Subject: [PATCH 13/15] Input: ALPS - enable trackstick on Rushmore touchpads - -Separate out the common trackstick probe/setup sequences, then call them -from each of the v3 init functions. - -Credits: Emmanual Thome furnished the information on the trackstick init -and how it affected the report format. - -Signed-off-by: Kevin Cernekee -Tested-by: Dave Turvene -Signed-off-by: Dmitry Torokhov ---- - drivers/input/mouse/alps.c | 185 ++++++++++++++++++++++++++++----------------- - 1 file changed, 115 insertions(+), 70 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index bf2fa51..7b99fc7 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -29,6 +29,9 @@ - */ - #define ALPS_CMD_NIBBLE_10 0x01f2 - -+#define ALPS_REG_BASE_RUSHMORE 0xc2c0 -+#define ALPS_REG_BASE_PINNACLE 0x0000 -+ - static const struct alps_nibble_commands alps_v3_nibble_commands[] = { - { PSMOUSE_CMD_SETPOLL, 0x00 }, /* 0 */ - { PSMOUSE_CMD_RESET_DIS, 0x00 }, /* 1 */ -@@ -1166,26 +1169,31 @@ static int alps_hw_init_v1_v2(struct psmouse *psmouse) - } - - /* -- * Enable or disable passthrough mode to the trackstick. Must be in -- * command mode when calling this function. -+ * Enable or disable passthrough mode to the trackstick. - */ --static int alps_passthrough_mode_v3(struct psmouse *psmouse, bool enable) -+static int alps_passthrough_mode_v3(struct psmouse *psmouse, -+ int reg_base, bool enable) - { -- int reg_val; -+ int reg_val, ret = -1; - -- reg_val = alps_command_mode_read_reg(psmouse, 0x0008); -- if (reg_val == -1) -+ if (alps_enter_command_mode(psmouse, NULL)) - return -1; - -+ reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x0008); -+ if (reg_val == -1) -+ goto error; -+ - if (enable) - reg_val |= 0x01; - else - reg_val &= ~0x01; - -- if (__alps_command_mode_write_reg(psmouse, reg_val)) -- return -1; -+ ret = __alps_command_mode_write_reg(psmouse, reg_val); - -- return 0; -+error: -+ if (alps_exit_command_mode(psmouse)) -+ ret = -1; -+ return ret; - } - - /* Must be in command mode when calling this function */ -@@ -1204,69 +1212,102 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse) - return 0; - } - --static int alps_hw_init_v3(struct psmouse *psmouse) -+static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base) - { -- struct ps2dev *ps2dev = &psmouse->ps2dev; -- int reg_val; -- unsigned char param[4]; -+ int ret = -EIO, reg_val; - - if (alps_enter_command_mode(psmouse, NULL)) - goto error; - -- /* Check for trackstick */ -- reg_val = alps_command_mode_read_reg(psmouse, 0x0008); -+ reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x08); - if (reg_val == -1) - goto error; -- if (reg_val & 0x80) { -- if (alps_passthrough_mode_v3(psmouse, true)) -- goto error; -- if (alps_exit_command_mode(psmouse)) -- goto error; -+ -+ /* bit 7: trackstick is present */ -+ ret = reg_val & 0x80 ? 0 : -ENODEV; -+ -+error: -+ alps_exit_command_mode(psmouse); -+ return ret; -+} -+ -+static int alps_setup_trackstick_v3(struct psmouse *psmouse, int reg_base) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ int ret = 0; -+ unsigned char param[4]; -+ -+ if (alps_passthrough_mode_v3(psmouse, reg_base, true)) -+ return -EIO; -+ -+ /* -+ * E7 report for the trackstick -+ * -+ * There have been reports of failures to seem to trace back -+ * to the above trackstick check failing. When these occur -+ * this E7 report fails, so when that happens we continue -+ * with the assumption that there isn't a trackstick after -+ * all. -+ */ -+ if (alps_rpt_cmd(psmouse, 0, PSMOUSE_CMD_SETSCALE21, param)) { -+ psmouse_warn(psmouse, "trackstick E7 report failed\n"); -+ ret = -ENODEV; -+ } else { -+ psmouse_dbg(psmouse, -+ "trackstick E7 report: %2.2x %2.2x %2.2x\n", -+ param[0], param[1], param[2]); - - /* -- * E7 report for the trackstick -- * -- * There have been reports of failures to seem to trace back -- * to the above trackstick check failing. When these occur -- * this E7 report fails, so when that happens we continue -- * with the assumption that there isn't a trackstick after -- * all. -+ * Not sure what this does, but it is absolutely -+ * essential. Without it, the touchpad does not -+ * work at all and the trackstick just emits normal -+ * PS/2 packets. - */ -- param[0] = 0x64; -- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE21) || -- ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { -- psmouse_warn(psmouse, "trackstick E7 report failed\n"); -- } else { -- psmouse_dbg(psmouse, -- "trackstick E7 report: %2.2x %2.2x %2.2x\n", -- param[0], param[1], param[2]); -- -- /* -- * Not sure what this does, but it is absolutely -- * essential. Without it, the touchpad does not -- * work at all and the trackstick just emits normal -- * PS/2 packets. -- */ -- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -- alps_command_mode_send_nibble(psmouse, 0x9) || -- alps_command_mode_send_nibble(psmouse, 0x4)) { -- psmouse_err(psmouse, -- "Error sending magic E6 sequence\n"); -- goto error_passthrough; -- } -+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || -+ alps_command_mode_send_nibble(psmouse, 0x9) || -+ alps_command_mode_send_nibble(psmouse, 0x4)) { -+ psmouse_err(psmouse, -+ "Error sending magic E6 sequence\n"); -+ ret = -EIO; -+ goto error; - } - -- if (alps_enter_command_mode(psmouse, NULL)) -- goto error_passthrough; -- if (alps_passthrough_mode_v3(psmouse, false)) -- goto error; -+ /* -+ * This ensures the trackstick packets are in the format -+ * supported by this driver. If bit 1 isn't set the packet -+ * format is different. -+ */ -+ if (alps_enter_command_mode(psmouse, NULL) || -+ alps_command_mode_write_reg(psmouse, -+ reg_base + 0x08, 0x82) || -+ alps_exit_command_mode(psmouse)) -+ ret = -EIO; - } - -- if (alps_absolute_mode_v3(psmouse)) { -+error: -+ if (alps_passthrough_mode_v3(psmouse, reg_base, false)) -+ ret = -EIO; -+ -+ return ret; -+} -+ -+static int alps_hw_init_v3(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ int reg_val; -+ unsigned char param[4]; -+ -+ reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE); -+ if (reg_val == -EIO) -+ goto error; -+ if (reg_val == 0 && -+ alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) -+ goto error; -+ -+ if (alps_enter_command_mode(psmouse, NULL) || -+ alps_absolute_mode_v3(psmouse)) { - psmouse_err(psmouse, "Failed to enter absolute mode\n"); - goto error; - } -@@ -1303,14 +1344,6 @@ static int alps_hw_init_v3(struct psmouse *psmouse) - if (alps_command_mode_write_reg(psmouse, 0x0162, 0x04)) - goto error; - -- /* -- * This ensures the trackstick packets are in the format -- * supported by this driver. If bit 1 isn't set the packet -- * format is different. -- */ -- if (alps_command_mode_write_reg(psmouse, 0x0008, 0x82)) -- goto error; -- - alps_exit_command_mode(psmouse); - - /* Set rate and enable data reporting */ -@@ -1323,10 +1356,6 @@ static int alps_hw_init_v3(struct psmouse *psmouse) - - return 0; - --error_passthrough: -- /* Something failed while in passthrough mode, so try to get out */ -- if (!alps_enter_command_mode(psmouse, NULL)) -- alps_passthrough_mode_v3(psmouse, false); - error: - /* - * Leaving the touchpad in command mode will essentially render -@@ -1339,9 +1368,19 @@ error: - - static int alps_hw_init_rushmore_v3(struct psmouse *psmouse) - { -+ struct alps_data *priv = psmouse->private; - struct ps2dev *ps2dev = &psmouse->ps2dev; - int reg_val, ret = -1; - -+ if (priv->flags & ALPS_DUALPOINT) { -+ reg_val = alps_setup_trackstick_v3(psmouse, -+ ALPS_REG_BASE_RUSHMORE); -+ if (reg_val == -EIO) -+ goto error; -+ if (reg_val == -ENODEV) -+ priv->flags &= ~ALPS_DUALPOINT; -+ } -+ - if (alps_enter_command_mode(psmouse, NULL) || - alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 || - alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00)) -@@ -1562,6 +1601,12 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) - priv->x_bits = 16; - priv->y_bits = 12; - -+ /* hack to make addr_command, nibble_command available */ -+ psmouse->private = priv; -+ -+ if (alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_RUSHMORE)) -+ priv->flags &= ~ALPS_DUALPOINT; -+ - return 0; - } else if (ec[0] == 0x88 && ec[1] == 0x07 && - ec[2] >= 0x90 && ec[2] <= 0x9d) { --- -1.8.1.2 - - -From db7192fa07fa5c70c9849d8f658a7ff696cff99d Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Sat, 16 Feb 2013 22:40:03 -0800 -Subject: [PATCH 14/15] Input: ALPS - Remove unused argument to - alps_enter_command_mode() - -Now that alps_identify() explicitly issues an EC report using -alps_rpt_cmd(), we no longer need to look at the magic numbers returned -by alps_enter_command_mode(). - -Signed-off-by: Kevin Cernekee ---- - drivers/input/mouse/alps.c | 18 +++++++----------- - 1 file changed, 7 insertions(+), 11 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 7b99fc7..9c97531 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -994,8 +994,7 @@ static int alps_rpt_cmd(struct psmouse *psmouse, int init_command, - return 0; - } - --static int alps_enter_command_mode(struct psmouse *psmouse, -- unsigned char *resp) -+static int alps_enter_command_mode(struct psmouse *psmouse) - { - unsigned char param[4]; - -@@ -1009,9 +1008,6 @@ static int alps_enter_command_mode(struct psmouse *psmouse, - "unknown response while entering command mode\n"); - return -1; - } -- -- if (resp) -- *resp = param[2]; - return 0; - } - -@@ -1176,7 +1172,7 @@ static int alps_passthrough_mode_v3(struct psmouse *psmouse, - { - int reg_val, ret = -1; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - return -1; - - reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x0008); -@@ -1216,7 +1212,7 @@ static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base) - { - int ret = -EIO, reg_val; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - goto error; - - reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x08); -@@ -1279,7 +1275,7 @@ static int alps_setup_trackstick_v3(struct psmouse *psmouse, int reg_base) - * supported by this driver. If bit 1 isn't set the packet - * format is different. - */ -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_command_mode_write_reg(psmouse, - reg_base + 0x08, 0x82) || - alps_exit_command_mode(psmouse)) -@@ -1306,7 +1302,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse) - alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) - goto error; - -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_absolute_mode_v3(psmouse)) { - psmouse_err(psmouse, "Failed to enter absolute mode\n"); - goto error; -@@ -1381,7 +1377,7 @@ static int alps_hw_init_rushmore_v3(struct psmouse *psmouse) - priv->flags &= ~ALPS_DUALPOINT; - } - -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 || - alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00)) - goto error; -@@ -1431,7 +1427,7 @@ static int alps_hw_init_v4(struct psmouse *psmouse) - struct ps2dev *ps2dev = &psmouse->ps2dev; - unsigned char param[4]; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - goto error; - - if (alps_absolute_mode_v4(psmouse)) { --- -1.8.1.2 - - -From 10740a25bb3b895b5de7773f926a978416b38409 Mon Sep 17 00:00:00 2001 -From: Dave Turvene -Date: Sat, 16 Feb 2013 22:40:04 -0800 -Subject: [PATCH 15/15] Input: ALPS - Add "Dolphin V1" touchpad support - -These touchpads use a different protocol; they have been seen on Dell -N5110, Dell 17R SE, and others. - -The official ALPS driver identifies them by looking for an exact match -on the E7 report: 73 03 50. Dolphin V1 returns an EC report of -73 01 xx (02 and 0d have been seen); Dolphin V2 returns an EC report of -73 02 xx (02 has been seen). - -Dolphin V2 probably needs a different initialization sequence and/or -report parser, so it is left for a future commit. - -Signed-off-by: Dave Turvene -Signed-off-by: Kevin Cernekee ---- - drivers/input/mouse/alps.c | 67 ++++++++++++++++++++++++++++++++++++++++++++-- - drivers/input/mouse/alps.h | 1 + - 2 files changed, 66 insertions(+), 2 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 9c97531..0238e0e 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -490,6 +490,29 @@ static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p) - f->y_map |= (p[5] & 0x20) << 6; - } - -+static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p) -+{ -+ f->first_mp = !!(p[0] & 0x02); -+ f->is_mp = !!(p[0] & 0x20); -+ -+ f->fingers = ((p[0] & 0x6) >> 1 | -+ (p[0] & 0x10) >> 2); -+ f->x_map = ((p[2] & 0x60) >> 5) | -+ ((p[4] & 0x7f) << 2) | -+ ((p[5] & 0x7f) << 9) | -+ ((p[3] & 0x07) << 16) | -+ ((p[3] & 0x70) << 15) | -+ ((p[0] & 0x01) << 22); -+ f->y_map = (p[1] & 0x7f) | -+ ((p[2] & 0x1f) << 7); -+ -+ f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); -+ f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); -+ f->z = (p[0] & 4) ? 0 : p[5] & 0x7f; -+ -+ alps_decode_buttons_v3(f, p); -+} -+ - static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -@@ -874,7 +897,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) - } - - /* Bytes 2 - pktsize should have 0 in the highest bit */ -- if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && -+ if (priv->proto_version != ALPS_PROTO_V5 && -+ psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && - (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { - psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", - psmouse->pktcnt - 1, -@@ -1003,7 +1027,8 @@ static int alps_enter_command_mode(struct psmouse *psmouse) - return -1; - } - -- if (param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) { -+ if ((param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) && -+ param[0] != 0x73) { - psmouse_dbg(psmouse, - "unknown response while entering command mode\n"); - return -1; -@@ -1495,6 +1520,23 @@ error: - return -1; - } - -+static int alps_hw_init_dolphin_v1(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ unsigned char param[2]; -+ -+ /* This is dolphin "v1" as empirically defined by florin9doi */ -+ param[0] = 0x64; -+ param[1] = 0x28; -+ -+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSTREAM) || -+ ps2_command(ps2dev, ¶m[0], PSMOUSE_CMD_SETRATE) || -+ ps2_command(ps2dev, ¶m[1], PSMOUSE_CMD_SETRATE)) -+ return -1; -+ -+ return 0; -+} -+ - static void alps_set_defaults(struct alps_data *priv) - { - priv->byte0 = 0x8f; -@@ -1528,6 +1570,21 @@ static void alps_set_defaults(struct alps_data *priv) - priv->nibble_commands = alps_v4_nibble_commands; - priv->addr_command = PSMOUSE_CMD_DISABLE; - break; -+ case ALPS_PROTO_V5: -+ priv->hw_init = alps_hw_init_dolphin_v1; -+ priv->process_packet = alps_process_packet_v3; -+ priv->decode_fields = alps_decode_dolphin; -+ priv->set_abs_params = alps_set_abs_params_mt; -+ priv->nibble_commands = alps_v3_nibble_commands; -+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP; -+ priv->byte0 = 0xc8; -+ priv->mask0 = 0xc8; -+ priv->flags = 0; -+ priv->x_max = 1360; -+ priv->y_max = 660; -+ priv->x_bits = 23; -+ priv->y_bits = 12; -+ break; - } - } - -@@ -1588,6 +1645,12 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) - - if (alps_match_table(psmouse, priv, e7, ec) == 0) { - return 0; -+ } else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0x50 && -+ ec[0] == 0x73 && ec[1] == 0x01) { -+ priv->proto_version = ALPS_PROTO_V5; -+ alps_set_defaults(priv); -+ -+ return 0; - } else if (ec[0] == 0x88 && ec[1] == 0x08) { - priv->proto_version = ALPS_PROTO_V3; - alps_set_defaults(priv); -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index 9704805..eee5985 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -16,6 +16,7 @@ - #define ALPS_PROTO_V2 2 - #define ALPS_PROTO_V3 3 - #define ALPS_PROTO_V4 4 -+#define ALPS_PROTO_V5 5 - - /** - * struct alps_model_info - touchpad ID table --- -1.8.1.2 - diff --git a/amd64_edac_fix_rank_count.patch b/amd64_edac_fix_rank_count.patch deleted file mode 100644 index eb58f0d03..000000000 --- a/amd64_edac_fix_rank_count.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 56ba4c93d909ef9dfab4f1101a8c3bf75bc4cdab Mon Sep 17 00:00:00 2001 -From: Mauro Carvalho Chehab -Date: Mon, 11 Mar 2013 08:19:52 -0400 -Subject: [PATCH EDAC] edac: merge mci.mem_is_per_rank with mci.csbased - -Both mci.mem_is_per_rank and mci.csbased have the same meaning: -the memory controller is csrows based. Merge both fields into one. - -There's no need for the driver to actually fill it, as the core -detectsi it by checking if one of the layes has the csrows type -as part of the memory hierarchy: - - if (layers[i].type == EDAC_MC_LAYER_CHIP_SELECT) - per_rank = true; -... - mci->csbased = per_rank; - -Signed-off-by: Mauro Carvalho Chehab - -From 2b6018dbd206e4af16edcfb80497b73105e97803 Mon Sep 17 00:00:00 2001 -From: Mauro Carvalho Chehab -Date: Mon, 11 Mar 2013 08:18:24 -0400 -Subject: [PATCH EDAC] amd64_edac: Correct dimm sizes - -We were filling the csrow size with a wrong value. 16a528ee3975 ("EDAC: -Fix csrow size reported in sysfs") tried to address the issue. It fixed -the report with the old API but not with the new one. Correct it for the -new API too. - -Signed-off-by: Mauro Carvalho Chehab -Signed-off-by: Borislav Petkov -diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c -index ad8bf2a..10ed0c7 100644 ---- a/drivers/edac/amd64_edac.c -+++ b/drivers/edac/amd64_edac.c -@@ -2148,12 +2148,18 @@ static int init_csrows(struct mem_ctl_info *mci) - edac_dbg(1, "MC node: %d, csrow: %d\n", - pvt->mc_node_id, i); - -- if (row_dct0) -+ if (row_dct0) { - nr_pages = amd64_csrow_nr_pages(pvt, 0, i); -+ csrow->channels[0]->dimm->nr_pages = nr_pages; -+ } - - /* K8 has only one DCT */ -- if (boot_cpu_data.x86 != 0xf && row_dct1) -- nr_pages += amd64_csrow_nr_pages(pvt, 1, i); -+ if (boot_cpu_data.x86 != 0xf && row_dct1) { -+ int row_dct1_pages = amd64_csrow_nr_pages(pvt, 1, i); -+ -+ csrow->channels[1]->dimm->nr_pages = row_dct1_pages; -+ nr_pages += row_dct1_pages; -+ } - - mtype = amd64_determine_memory_type(pvt, i); - -@@ -2172,9 +2178,7 @@ static int init_csrows(struct mem_ctl_info *mci) - dimm = csrow->channels[j]->dimm; - dimm->mtype = mtype; - dimm->edac_mode = edac_mode; -- dimm->nr_pages = nr_pages; - } -- csrow->nr_pages = nr_pages; - } - - return empty; -@@ -2519,7 +2523,6 @@ static int amd64_init_one_instance(struct pci_dev *F2) - - mci->pvt_info = pvt; - mci->pdev = &pvt->F2->dev; -- mci->csbased = 1; - - setup_mci_misc_attrs(mci, fam_type); - -diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c -index cdb81aa..27e86d9 100644 ---- a/drivers/edac/edac_mc.c -+++ b/drivers/edac/edac_mc.c -@@ -86,7 +86,7 @@ static void edac_mc_dump_dimm(struct dimm_info *dimm, int number) - edac_dimm_info_location(dimm, location, sizeof(location)); - - edac_dbg(4, "%s%i: %smapped as virtual row %d, chan %d\n", -- dimm->mci->mem_is_per_rank ? "rank" : "dimm", -+ dimm->mci->csbased ? "rank" : "dimm", - number, location, dimm->csrow, dimm->cschannel); - edac_dbg(4, " dimm = %p\n", dimm); - edac_dbg(4, " dimm->label = '%s'\n", dimm->label); -@@ -341,7 +341,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, - memcpy(mci->layers, layers, sizeof(*layer) * n_layers); - mci->nr_csrows = tot_csrows; - mci->num_cschannel = tot_channels; -- mci->mem_is_per_rank = per_rank; -+ mci->csbased = per_rank; - - /* - * Alocate and fill the csrow/channels structs -@@ -1235,7 +1235,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, - * incrementing the compat API counters - */ - edac_dbg(4, "%s csrows map: (%d,%d)\n", -- mci->mem_is_per_rank ? "rank" : "dimm", -+ mci->csbased ? "rank" : "dimm", - dimm->csrow, dimm->cschannel); - if (row == -1) - row = dimm->csrow; -diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c -index 4f4b613..6ab4a50 100644 ---- a/drivers/edac/edac_mc_sysfs.c -+++ b/drivers/edac/edac_mc_sysfs.c -@@ -180,9 +180,6 @@ static ssize_t csrow_size_show(struct device *dev, - int i; - u32 nr_pages = 0; - -- if (csrow->mci->csbased) -- return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages)); -- - for (i = 0; i < csrow->nr_channels; i++) - nr_pages += csrow->channels[i]->dimm->nr_pages; - return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); -@@ -612,7 +609,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci, - device_initialize(&dimm->dev); - - dimm->dev.parent = &mci->dev; -- if (mci->mem_is_per_rank) -+ if (mci->csbased) - dev_set_name(&dimm->dev, "rank%d", index); - else - dev_set_name(&dimm->dev, "dimm%d", index); -@@ -778,14 +775,10 @@ static ssize_t mci_size_mb_show(struct device *dev, - for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) { - struct csrow_info *csrow = mci->csrows[csrow_idx]; - -- if (csrow->mci->csbased) { -- total_pages += csrow->nr_pages; -- } else { -- for (j = 0; j < csrow->nr_channels; j++) { -- struct dimm_info *dimm = csrow->channels[j]->dimm; -+ for (j = 0; j < csrow->nr_channels; j++) { -+ struct dimm_info *dimm = csrow->channels[j]->dimm; - -- total_pages += dimm->nr_pages; -- } -+ total_pages += dimm->nr_pages; - } - } - -diff --git a/include/linux/edac.h b/include/linux/edac.h -index 4fd4999..0b76327 100644 ---- a/include/linux/edac.h -+++ b/include/linux/edac.h -@@ -561,7 +561,6 @@ struct csrow_info { - - u32 ue_count; /* Uncorrectable Errors for this csrow */ - u32 ce_count; /* Correctable Errors for this csrow */ -- u32 nr_pages; /* combined pages count of all channels */ - - struct mem_ctl_info *mci; /* the parent */ - -@@ -676,11 +675,11 @@ struct mem_ctl_info { - * sees memory sticks ("dimms"), and the ones that sees memory ranks. - * All old memory controllers enumerate memories per rank, but most - * of the recent drivers enumerate memories per DIMM, instead. -- * When the memory controller is per rank, mem_is_per_rank is true. -+ * When the memory controller is per rank, csbased is true. - */ - unsigned n_layers; - struct edac_mc_layer *layers; -- bool mem_is_per_rank; -+ bool csbased; - - /* - * DIMM info. Will eventually remove the entire csrows_info some day -@@ -741,8 +740,6 @@ struct mem_ctl_info { - u32 fake_inject_ue; - u16 fake_inject_count; - #endif -- __u8 csbased : 1, /* csrow-based memory controller */ -- __resv : 7; - }; - - #endif diff --git a/cfg80211-mac80211-disconnect-on-suspend.patch b/cfg80211-mac80211-disconnect-on-suspend.patch deleted file mode 100644 index 940ac2cc4..000000000 --- a/cfg80211-mac80211-disconnect-on-suspend.patch +++ /dev/null @@ -1,227 +0,0 @@ -From ad3a7b84092599eef931bce4de54e18e47612f9f Mon Sep 17 00:00:00 2001 -From: Stanislaw Gruszka -Date: Thu, 28 Feb 2013 09:55:25 +0000 -Subject: [PATCH] cfg80211/mac80211: disconnect on suspend - -If possible that after suspend, cfg80211 will receive request to -disconnect what require action on interface that was removed during -suspend. - -Problem can manifest itself by various warnings similar to below one: - -WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]() -wlan0: Failed check-sdata-in-driver check, flags: 0x4 -Call Trace: - [] warn_slowpath_fmt+0x33/0x40 - [] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211] - [] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211] - [] ieee80211_set_disassoc+0xf6/0x500 [mac80211] - [] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211] - [] ieee80211_deauth+0x16/0x20 [mac80211] - [] cfg80211_mlme_down+0x70/0xc0 [cfg80211] - [] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211] - -To fix the problem disconnect from any associated network before -suspend. User space is responsible to establish connection again -after resume. This basically need to be done by user space anyway, -because associated stations can go away during suspend (for example -NetworkManager disconnects on suspend and connect on resume by default). - -Patch also handle situation when driver refuse to suspend with wowlan -configured and try to suspend again without it. - -Signed-off-by: Stanislaw Gruszka -Signed-off-by: Johannes Berg ---- - net/mac80211/pm.c | 2 +- - net/wireless/core.c | 73 +++++++++++++++++++++++++++---------------------- - net/wireless/core.h | 3 ++ - net/wireless/rdev-ops.h | 7 +++-- - net/wireless/sysfs.c | 25 +++++++++++++---- - 5 files changed, 69 insertions(+), 41 deletions(-) - -diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c -index 79a48f3..ce4f973 100644 ---- a/net/mac80211/pm.c -+++ b/net/mac80211/pm.c -@@ -92,7 +92,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) - return err; - } else if (err > 0) { - WARN_ON(err != 1); -- local->wowlan = false; -+ return err; - } else { - list_for_each_entry(sdata, &local->interfaces, list) { - cancel_work_sync(&sdata->work); -diff --git a/net/wireless/core.c b/net/wireless/core.c -index b677eab..66cc98d 100644 ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -806,6 +806,46 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, - rdev->num_running_monitor_ifaces += num; - } - -+void cfg80211_leave(struct cfg80211_registered_device *rdev, -+ struct wireless_dev *wdev) -+{ -+ struct net_device *dev = wdev->netdev; -+ -+ switch (wdev->iftype) { -+ case NL80211_IFTYPE_ADHOC: -+ cfg80211_leave_ibss(rdev, dev, true); -+ break; -+ case NL80211_IFTYPE_P2P_CLIENT: -+ case NL80211_IFTYPE_STATION: -+ mutex_lock(&rdev->sched_scan_mtx); -+ __cfg80211_stop_sched_scan(rdev, false); -+ mutex_unlock(&rdev->sched_scan_mtx); -+ -+ wdev_lock(wdev); -+#ifdef CONFIG_CFG80211_WEXT -+ kfree(wdev->wext.ie); -+ wdev->wext.ie = NULL; -+ wdev->wext.ie_len = 0; -+ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; -+#endif -+ __cfg80211_disconnect(rdev, dev, -+ WLAN_REASON_DEAUTH_LEAVING, true); -+ cfg80211_mlme_down(rdev, dev); -+ wdev_unlock(wdev); -+ break; -+ case NL80211_IFTYPE_MESH_POINT: -+ cfg80211_leave_mesh(rdev, dev); -+ break; -+ case NL80211_IFTYPE_AP: -+ cfg80211_stop_ap(rdev, dev); -+ break; -+ default: -+ break; -+ } -+ -+ wdev->beacon_interval = 0; -+} -+ - static int cfg80211_netdev_notifier_call(struct notifier_block *nb, - unsigned long state, - void *ndev) -@@ -874,38 +914,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, - dev->priv_flags |= IFF_DONT_BRIDGE; - break; - case NETDEV_GOING_DOWN: -- switch (wdev->iftype) { -- case NL80211_IFTYPE_ADHOC: -- cfg80211_leave_ibss(rdev, dev, true); -- break; -- case NL80211_IFTYPE_P2P_CLIENT: -- case NL80211_IFTYPE_STATION: -- mutex_lock(&rdev->sched_scan_mtx); -- __cfg80211_stop_sched_scan(rdev, false); -- mutex_unlock(&rdev->sched_scan_mtx); -- -- wdev_lock(wdev); --#ifdef CONFIG_CFG80211_WEXT -- kfree(wdev->wext.ie); -- wdev->wext.ie = NULL; -- wdev->wext.ie_len = 0; -- wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; --#endif -- __cfg80211_disconnect(rdev, dev, -- WLAN_REASON_DEAUTH_LEAVING, true); -- cfg80211_mlme_down(rdev, dev); -- wdev_unlock(wdev); -- break; -- case NL80211_IFTYPE_MESH_POINT: -- cfg80211_leave_mesh(rdev, dev); -- break; -- case NL80211_IFTYPE_AP: -- cfg80211_stop_ap(rdev, dev); -- break; -- default: -- break; -- } -- wdev->beacon_interval = 0; -+ cfg80211_leave(rdev, wdev); - break; - case NETDEV_DOWN: - cfg80211_update_iface_num(rdev, wdev->iftype, -1); -diff --git a/net/wireless/core.h b/net/wireless/core.h -index 3563097..49d79d9 100644 ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -481,6 +481,9 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, - void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, - enum nl80211_iftype iftype, int num); - -+void cfg80211_leave(struct cfg80211_registered_device *rdev, -+ struct wireless_dev *wdev); -+ - #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10 - - #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS -diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h -index 6c0c819..08e4145 100644 ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -6,11 +6,12 @@ - #include "core.h" - #include "trace.h" - --static inline int rdev_suspend(struct cfg80211_registered_device *rdev) -+static inline int rdev_suspend(struct cfg80211_registered_device *rdev, -+ struct cfg80211_wowlan *wowlan) - { - int ret; -- trace_rdev_suspend(&rdev->wiphy, rdev->wowlan); -- ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan); -+ trace_rdev_suspend(&rdev->wiphy, wowlan); -+ ret = rdev->ops->suspend(&rdev->wiphy, wowlan); - trace_rdev_return_int(&rdev->wiphy, ret); - return ret; - } -diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c -index 1f6f01e..a6a108b 100644 ---- a/net/wireless/sysfs.c -+++ b/net/wireless/sysfs.c -@@ -83,6 +83,14 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env) - return 0; - } - -+static void cfg80211_leave_all(struct cfg80211_registered_device *rdev) -+{ -+ struct wireless_dev *wdev; -+ -+ list_for_each_entry(wdev, &rdev->wdev_list, list) -+ cfg80211_leave(rdev, wdev); -+} -+ - static int wiphy_suspend(struct device *dev, pm_message_t state) - { - struct cfg80211_registered_device *rdev = dev_to_rdev(dev); -@@ -90,12 +98,19 @@ static int wiphy_suspend(struct device *dev, pm_message_t state) - - rdev->suspend_at = get_seconds(); - -- if (rdev->ops->suspend) { -- rtnl_lock(); -- if (rdev->wiphy.registered) -- ret = rdev_suspend(rdev); -- rtnl_unlock(); -+ rtnl_lock(); -+ if (rdev->wiphy.registered) { -+ if (!rdev->wowlan) -+ cfg80211_leave_all(rdev); -+ if (rdev->ops->suspend) -+ ret = rdev_suspend(rdev, rdev->wowlan); -+ if (ret == 1) { -+ /* Driver refuse to configure wowlan */ -+ cfg80211_leave_all(rdev); -+ ret = rdev_suspend(rdev, NULL); -+ } - } -+ rtnl_unlock(); - - return ret; - } --- -1.8.1.2 - diff --git a/config-debug b/config-debug index e1b3f9db2..43655a1a1 100644 --- a/config-debug +++ b/config-debug @@ -96,6 +96,7 @@ CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y +CONFIG_KDB_CONTINUE_CATASTROPHIC=0 CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y CONFIG_TEST_LIST_SORT=y diff --git a/config-generic b/config-generic index 6550abbbb..92827f15d 100644 --- a/config-generic +++ b/config-generic @@ -188,6 +188,8 @@ CONFIG_FW_LOADER=y # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set + # CONFIG_CMA is not set # CONFIG_SPI is not set @@ -199,6 +201,7 @@ CONFIG_MTD=m # CONFIG_MTD_TESTS is not set # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_AR7_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set # # User Modules And Translation Layers @@ -320,6 +323,7 @@ CONFIG_BLK_DEV_THROTTLING=y # CONFIG_IDE is not set # CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_RSXX is not set CONFIG_SCSI_VIRTIO=m CONFIG_VIRTIO_BLK=m @@ -328,7 +332,6 @@ CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_MMIO=m # CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set CONFIG_VIRTIO_NET=m -CONFIG_VMXNET3=m CONFIG_HW_RANDOM_VIRTIO=m CONFIG_VIRTIO_CONSOLE=y CONFIG_VHOST_NET=m @@ -394,7 +397,8 @@ CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_ACARD=m CONFIG_SCSI_AACRAID=m CONFIG_SCSI_AIC7XXX=m -CONFIG_SCSI_AIC7XXX_OLD=m +# http://lists.fedoraproject.org/pipermail/kernel/2013-February/004102.html +# CONFIG_SCSI_AIC7XXX_OLD is not set CONFIG_AIC7XXX_CMDS_PER_DEVICE=4 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set @@ -428,6 +432,7 @@ CONFIG_SCSI_MPT3SAS_MAX_SGE=128 CONFIG_SCSI_MPT3SAS_LOGGING=y CONFIG_SCSI_UFSHCD=m +CONFIG_SCSI_UFSHCD_PCI=m CONFIG_SCSI_MVUMI=m @@ -437,6 +442,7 @@ CONFIG_SCSI_OSD_DPRINT_SENSE=1 # CONFIG_SCSI_OSD_DEBUG is not set CONFIG_SCSI_BNX2_ISCSI=m +CONFIG_SCSI_BNX2X_FCOE=m CONFIG_BE2ISCSI=m CONFIG_SCSI_PMCRAID=m @@ -476,7 +482,9 @@ CONFIG_SCSI_DC390T=m CONFIG_SCSI_QLA_FC=m CONFIG_TCM_QLA2XXX=m CONFIG_SCSI_QLA_ISCSI=m -# CONFIG_SCSI_IPR is not set +CONFIG_SCSI_IPR=m +CONFIG_SCSI_IPR_TRACE=y +CONFIG_SCSI_IPR_DUMP=y # CONFIG_SCSI_DPT_I2O is not set CONFIG_SCSI_LPFC=m # CONFIG_SCSI_LPFC_DEBUG_FS is not set @@ -509,6 +517,7 @@ CONFIG_SATA_SX4=m CONFIG_SATA_ULI=m CONFIG_SATA_VIA=m CONFIG_SATA_VITESSE=m +# CONFIG_SATA_ZPODD is not set CONFIG_SATA_ACARD_AHCI=m # CONFIG_PATA_LEGACY is not set @@ -580,11 +589,14 @@ CONFIG_ASYNC_RAID6_TEST=m CONFIG_BLK_DEV_DM=y CONFIG_DM_CRYPT=m CONFIG_DM_DEBUG=y -# CONFIG_DM_DELAY is not set +CONFIG_DM_DELAY=m CONFIG_DM_MIRROR=y CONFIG_DM_MULTIPATH=m CONFIG_DM_SNAPSHOT=y CONFIG_DM_THIN_PROVISIONING=m +CONFIG_DM_CACHE=m +CONFIG_DM_CACHE_MQ=m +CONFIG_DM_CACHE_CLEANER=m # CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set # CONFIG_DM_DEBUG_SPACE_MAPS is not set CONFIG_DM_UEVENT=y @@ -661,7 +673,7 @@ CONFIG_TCP_MD5SIG=y # Networking options # CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set +CONFIG_PACKET_DIAG=m CONFIG_UNIX=y CONFIG_UNIX_DIAG=m CONFIG_NET_KEY=m @@ -761,6 +773,7 @@ CONFIG_NET_9P_RDMA=m # CONFIG_DECNET is not set CONFIG_BRIDGE=m CONFIG_BRIDGE_IGMP_SNOOPING=y +CONFIG_BRIDGE_VLAN_FILTERING=y # PHY timestamping adds overhead CONFIG_NETWORK_PHY_TIMESTAMPING=y @@ -803,10 +816,12 @@ CONFIG_NETFILTER_XT_TARGET_TEE=m CONFIG_NETFILTER_XT_TARGET_TPROXY=m CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_BPF=m CONFIG_NETFILTER_XT_MATCH_CLUSTER=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CPU=m CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m +CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m CONFIG_NETFILTER_XT_MATCH_CONNMARK=m CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y @@ -996,6 +1011,7 @@ CONFIG_SCTP_COOKIE_HMAC_SHA1=y CONFIG_ATM=m CONFIG_VLAN_8021Q=m CONFIG_VLAN_8021Q_GVRP=y +CONFIG_VLAN_8021Q_MVRP=y CONFIG_LLC=m # CONFIG_LLC2 is not set CONFIG_IPX=m @@ -1020,7 +1036,8 @@ CONFIG_IP_DCCP_CCID3=y # # TIPC Configuration (EXPERIMENTAL) # -# CONFIG_TIPC is not set +CONFIG_TIPC=m +CONFIG_TIPC_PORTS=8192 # CONFIG_TIPC_ADVANCED is not set # CONFIG_TIPC_DEBUG is not set @@ -1093,6 +1110,7 @@ CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y # CONFIG_BATMAN_ADV_DEBUG is not set CONFIG_OPENVSWITCH=m +CONFIG_VSOCKETS=m CONFIG_NETPRIO_CGROUP=m @@ -1260,6 +1278,7 @@ CONFIG_E100=m CONFIG_E1000=m CONFIG_E1000E=m CONFIG_IGB=m +CONFIG_IGB_HWMON=y CONFIG_IGB_DCA=y CONFIG_IGB_PTP=y CONFIG_IGBVF=m @@ -1412,6 +1431,8 @@ CONFIG_NET_PCI=y CONFIG_B44=m CONFIG_B44_PCI=y CONFIG_BNX2=m +CONFIG_BNX2X=m +CONFIG_BNX2X_SRIOV=y CONFIG_CNIC=m CONFIG_FEALNX=m CONFIG_NET_POCKET=y @@ -1428,7 +1449,6 @@ CONFIG_JME=m # # CONFIG_IP1000 is not set # CONFIG_MLX4_EN is not set -# CONFIG_MLX4_DEBUG is not set # CONFIG_SFC is not set # CONFIG_FDDI is not set @@ -1573,6 +1593,8 @@ CONFIG_LIBERTAS_SDIO=m # CONFIG_LIBERTAS_THINFIRM is not set CONFIG_LIBERTAS_MESH=y CONFIG_IWLWIFI=m +CONFIG_IWLDVM=m +CONFIG_IWLMVM=m CONFIG_IWLWIFI_DEBUG=y CONFIG_IWLWIFI_DEBUGFS=y CONFIG_IWLWIFI_DEVICE_SVTOOL=y @@ -1614,7 +1636,6 @@ CONFIG_RT2800PCI_RT53XX=y CONFIG_RT73USB=m CONFIG_RTL8180=m CONFIG_RTL8187=m -# CONFIG_RTLWIFI_DEBUG is not set # CONFIG_USB_ZD1201 is not set CONFIG_USB_NET_RNDIS_WLAN=m CONFIG_USB_NET_KALMIA=m @@ -1635,6 +1656,8 @@ CONFIG_WL1251=m CONFIG_WL1251_SPI=m CONFIG_WL1251_SDIO=m +CONFIG_RTLWIFI=m +# CONFIG_RTLWIFI_DEBUG is not set CONFIG_RTL8192CE=m CONFIG_RTL8192SE=m CONFIG_RTL8192CU=m @@ -1695,9 +1718,11 @@ CONFIG_NFC_LLCP=y # # Near Field Communication (NFC) devices # -CONFIG_PN544_NFC=m -CONFIG_PN544_HCI_NFC=m +CONFIG_NFC_PN544=m +CONFIG_NFC_PN544_I2C=m CONFIG_NFC_PN533=m +CONFIG_NFC_MICROREAD=m +CONFIG_NFC_MICROREAD_I2C=m # # IrDA (infrared) support @@ -1992,6 +2017,7 @@ CONFIG_MOUSE_APPLETOUCH=m CONFIG_MOUSE_BCM5974=m CONFIG_MOUSE_SYNAPTICS_I2C=m CONFIG_MOUSE_SYNAPTICS_USB=m +CONFIG_MOUSE_CYAPA=m CONFIG_INPUT_JOYSTICK=y CONFIG_JOYSTICK_ANALOG=m CONFIG_JOYSTICK_A3D=m @@ -2112,12 +2138,14 @@ CONFIG_TCG_TIS=m CONFIG_TCG_NSC=m CONFIG_TCG_ATMEL=m # CONFIG_TCG_INFINEON is not set +# CONFIG_TCG_ST33_I2C is not set CONFIG_TELCLOCK=m # # Serial drivers # CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CS=m CONFIG_SERIAL_8250_NR_UARTS=32 @@ -2279,6 +2307,7 @@ CONFIG_SENSORS_LM93=m CONFIG_SENSORS_LTC4245=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_MAX6650=m +CONFIG_SENSORS_MAX6697=m CONFIG_SENSORS_MCP3021=m CONFIG_SENSORS_NTC_THERMISTOR=m CONFIG_SENSORS_PC87360=m @@ -2319,6 +2348,7 @@ CONFIG_SENSORS_WM831X=m CONFIG_SENSORS_LM73=m CONFIG_SENSORS_AMC6821=m CONFIG_SENSORS_INA2XX=m +CONFIG_SENSORS_INA209=m CONFIG_SENSORS_ADT7411=m CONFIG_SENSORS_ASC7621=m CONFIG_SENSORS_EMC1403=m @@ -2365,6 +2395,7 @@ CONFIG_SENSORS_MAX197=m # CONFIG_USB_SWITCH_FSA9480 is not set CONFIG_SERIAL_ARC=m CONFIG_SERIAL_ARC_NR_PORTS=1 +# CONFIG_SERIAL_RP2 is not set CONFIG_W1=m CONFIG_W1_CON=y @@ -2376,6 +2407,7 @@ CONFIG_W1_MASTER_DS1WM=m CONFIG_W1_SLAVE_THERM=m CONFIG_W1_SLAVE_SMEM=m CONFIG_W1_SLAVE_DS2408=m +CONFIG_W1_SLAVE_DS2413=m CONFIG_W1_SLAVE_DS2423=m CONFIG_W1_SLAVE_DS2431=m CONFIG_W1_SLAVE_DS2433=m @@ -2451,6 +2483,7 @@ CONFIG_HW_RANDOM_TPM=m # CONFIG_GEN_RTC is not set CONFIG_RTC_CLASS=y CONFIG_RTC_HCTOSYS=y +# CONFIG_RTC_SYSTOHC is not set CONFIG_RTC_HCTOSYS_DEVICE="rtc0" CONFIG_RTC_INTF_SYSFS=y CONFIG_RTC_INTF_PROC=y @@ -2495,6 +2528,10 @@ CONFIG_RTC_DRV_MSM6242=m CONFIG_RTC_DRV_RP5C01=m CONFIG_RTC_DRV_EM3027=m CONFIG_RTC_DRV_RV3029C2=m +CONFIG_RTC_DRV_PCF50633=m +CONFIG_RTC_DRV_DS3232=m +CONFIG_RTC_DRV_ISL12022=m +# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set CONFIG_R3964=m # CONFIG_APPLICOM is not set @@ -2528,6 +2565,7 @@ CONFIG_DRM_CIRRUS_QEMU=m # do not enable on f17 or older # CONFIG_DRM_R128 is not set CONFIG_DRM_RADEON=m CONFIG_DRM_RADEON_KMS=y +# CONFIG_DRM_RADEON_UMS is not set # CONFIG_DRM_I810 is not set # CONFIG_DRM_MGA is not set CONFIG_DRM_MGAG200=m # do not enable on f17 or older @@ -2544,10 +2582,12 @@ CONFIG_DRM_NOUVEAU_DEBUG=y # CONFIG_DRM_PSB is not set CONFIG_DRM_I2C_CH7006=m CONFIG_DRM_I2C_SIL164=m +CONFIG_DRM_I2C_NXP_TDA998X=m CONFIG_DRM_UDL=m CONFIG_DRM_VMWGFX=m CONFIG_DRM_VMWGFX_FBCON=y CONFIG_DRM_VGEM=m +CONFIG_DRM_QXL=m # # PCMCIA character devices @@ -2578,6 +2618,7 @@ CONFIG_VIDEO_DEV=m # CONFIG_VIDEO_ADV_DEBUG is not set CONFIG_VIDEO_HELPER_CHIPS_AUTO=y CONFIG_VIDEO_V4L2=y +# CONFIG_VIDEO_V4L2_INT_DEVICE is not set CONFIG_VIDEO_V4L2_SUBDEV_API=y # CONFIG_VIDEO_VIVI is not set @@ -2592,6 +2633,7 @@ CONFIG_V4L_USB_DRIVERS=y CONFIG_VIDEO_CAPTURE_DRIVERS=y CONFIG_V4L_PCI_DRIVERS=y CONFIG_VIDEO_AU0828=m +CONFIG_VIDEO_AU0828_V4L2=y CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BT848_DVB=y CONFIG_VIDEO_BWQCAM=m @@ -2810,6 +2852,7 @@ CONFIG_IR_GPIO_CIR=m CONFIG_V4L_MEM2MEM_DRIVERS=y # CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set +# CONFIG_VIDEO_SH_VEU is not set # CONFIG_V4L_TEST_DRIVERS is not set # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set @@ -2895,6 +2938,7 @@ CONFIG_FB_EFI=y # CONFIG_FB_TMIO is not set # CONFIG_FB_BROADSHEET is not set # CONFIG_FB_UDL is not set +# CONFIG_FB_GOLDFISH is not set # CONFIG_FIRMWARE_EDID is not set @@ -3018,6 +3062,7 @@ CONFIG_SND_HDA_CODEC_CMEDIA=y CONFIG_SND_HDA_CODEC_SI3054=y CONFIG_SND_HDA_CODEC_HDMI=y CONFIG_SND_HDA_CODEC_CA0132=y +CONFIG_SND_HDA_CODEC_CA0132_DSP=y CONFIG_SND_HDA_GENERIC=y CONFIG_SND_HDA_POWER_SAVE=y CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 @@ -3202,9 +3247,11 @@ CONFIG_HID_ROCCAT_KONE=m CONFIG_HID_SAMSUNG=m CONFIG_HID_SONY=m CONFIG_HID_SUNPLUS=m +CONFIG_HID_STEELSERIES=m CONFIG_HID_GREENASIA=m CONFIG_HID_SMARTJOYPLUS=m CONFIG_HID_TOPSEED=m +CONFIG_HID_THINGM=m CONFIG_HID_THRUSTMASTER=m CONFIG_HID_ZEROPLUS=m CONFIG_HID_ZYDACRON=m @@ -3313,6 +3360,7 @@ CONFIG_USB_RTL8150=m CONFIG_USB_USBNET=m CONFIG_USB_SPEEDTOUCH=m CONFIG_USB_NET_AX8817X=m +CONFIG_USB_NET_AX88179_178A=m CONFIG_USB_NET_DM9601=m CONFIG_USB_NET_SMSC95XX=m CONFIG_USB_NET_GL620A=m @@ -3422,6 +3470,7 @@ CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_QCAUX=m CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m +CONFIG_USB_SERIAL_XSENS_MT=m CONFIG_USB_SERIAL_DEBUG=m CONFIG_USB_SERIAL_SSU100=m CONFIG_USB_SERIAL_QT2=m @@ -3443,6 +3492,8 @@ CONFIG_USB_SEVSEG=m CONFIG_USB_ALI_M5632=y CONFIG_USB_APPLEDISPLAY=m # CONFIG_OMAP_USB2 is not set +# CONFIG_OMAP_USB3 is not set +# CONFIG_OMAP_CONTROL_USB is not set CONFIG_USB_RCAR_PHY=m CONFIG_USB_ATM=m CONFIG_USB_CXACRU=m @@ -3463,6 +3514,7 @@ CONFIG_USB_IOWARRIOR=m CONFIG_USB_ISIGHTFW=m CONFIG_USB_YUREX=m CONFIG_USB_EZUSB_FX2=m +CONFIG_USB_HSIC_USB3503=m CONFIG_USB_LCD=m CONFIG_USB_LD=m CONFIG_USB_LEGOTOWER=m @@ -3475,6 +3527,7 @@ CONFIG_USB_SISUSBVGA=m CONFIG_USB_SISUSBVGA_CON=y CONFIG_RADIO_SI470X=y CONFIG_USB_KEENE=m +CONFIG_USB_MA901=m CONFIG_USB_SI470X=m CONFIG_I2C_SI470X=m CONFIG_RADIO_SI4713=m @@ -3513,9 +3566,6 @@ CONFIG_PCF50633_GPIO=m # CONFIG_AB3100_CORE is not set CONFIG_INPUT_PCF50633_PMU=m CONFIG_INPUT_GPIO_ROTARY_ENCODER=m -CONFIG_RTC_DRV_PCF50633=m -CONFIG_RTC_DRV_DS3232=m -CONFIG_RTC_DRV_ISL12022=m CONFIG_MFD_SUPPORT=y CONFIG_MFD_VX855=m @@ -3656,6 +3706,7 @@ CONFIG_DEBUG_FS=y # CONFIG_ADFS_FS is not set CONFIG_AFFS_FS=m CONFIG_ECRYPT_FS=m +# CONFIG_ECRYPT_FS_MESSAGING is not set CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m CONFIG_BEFS_FS=m @@ -3899,6 +3950,7 @@ CONFIG_LOCKUP_DETECTOR=y # CONFIG_DEBUG_INFO_REDUCED is not set # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set +# CONFIG_PANIC_ON_OOPS is not set CONFIG_ATOMIC64_SELFTEST=y CONFIG_MEMORY_FAILURE=y CONFIG_HWPOISON_INJECT=m @@ -3973,6 +4025,7 @@ CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CCM=m CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRC32=m CONFIG_CRYPTO_CTR=y CONFIG_CRYPTO_CTS=m CONFIG_CRYPTO_DEFLATE=m @@ -4112,9 +4165,10 @@ CONFIG_HWMON=y CONFIG_THERMAL_HWMON=y # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set # CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -CONFIG_FAIR_SHARE=y -CONFIG_STEP_WISE=y -# CONFIG_USER_SPACE is not set +CONFIG_THERMAL_GOV_FAIR_SHARE=y +# CONFIG_THERMAL_GOV_USER_SPACE is not set +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_EMULATION is not set # CONFIG_CPU_THERMAL is not set CONFIG_INOTIFY=y @@ -4209,6 +4263,7 @@ CONFIG_LEDS_DELL_NETBOOKS=m # CONFIG_LEDS_TCA6507 is not set # CONFIG_LEDS_LM355x is not set # CONFIG_LEDS_OT200 is not set +# CONFIG_LEDS_PWM is not set CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=m CONFIG_LEDS_TRIGGER_ONESHOT=m @@ -4237,6 +4292,7 @@ CONFIG_LEDS_WM831X_STATUS=m CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DW_DMAC=m +# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set # CONFIG_TIMB_DMA is not set # CONFIG_DMATEST is not set CONFIG_ASYNC_TX_DMA=y @@ -4250,6 +4306,7 @@ CONFIG_DYNAMIC_FTRACE=y # CONFIG_IRQSOFF_TRACER is not set CONFIG_SCHED_TRACER=y CONFIG_CONTEXT_SWITCH_TRACER=y +CONFIG_TRACER_SNAPSHOT=y CONFIG_FTRACE_SYSCALLS=y CONFIG_FTRACE_MCOUNT_RECORD=y # CONFIG_FTRACE_STARTUP_TEST is not set @@ -4297,6 +4354,7 @@ CONFIG_APM_POWER=m # CONFIG_BATTERY_BQ27x00 is not set # CONFIG_BATTERY_MAX17040 is not set # CONFIG_BATTERY_MAX17042 is not set +# CONFIG_BATTERY_GOLDFISH is not set # CONFIG_CHARGER_ISP1704 is not set # CONFIG_CHARGER_MAX8903 is not set @@ -4342,9 +4400,6 @@ CONFIG_LIRC_TTUSBIR=m # CONFIG_DEVKMEM is not set -CONFIG_BNX2X=m -CONFIG_SCSI_BNX2X_FCOE=m - CONFIG_NOZOMI=m # CONFIG_TPS65010 is not set @@ -4390,6 +4445,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=m # CONFIG_PHONET is not set # CONFIG_ICS932S401 is not set +# CONFIG_ATMEL_SSC is not set # CONFIG_C2PORT is not set @@ -4414,7 +4470,6 @@ CONFIG_UWB_WHCI=m CONFIG_UWB_I1480U=m CONFIG_STAGING=y -# CONFIG_RTLLIB is not set # CONFIG_ANDROID is not set CONFIG_STAGING_MEDIA=y # CONFIG_DVB_AS102 is not set @@ -4599,6 +4654,13 @@ CONFIG_GPIO_VIPERBOARD=m CONFIG_EVENT_POWER_TRACING_DEPRECATED=y CONFIG_TEST_KSTRTOX=y +CONFIG_XZ_DEC=y +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_SPARC is not set # CONFIG_XZ_DEC_TEST is not set # CONFIG_POWER_AVS is not set @@ -4621,6 +4683,7 @@ CONFIG_PSTORE_RAM=m # CONFIG_AVERAGE is not set +# CONFIG_VMXNET3 is not set # CONFIG_SIGMA is not set @@ -4638,10 +4701,14 @@ CONFIG_BCMA_DRIVER_GPIO=y # CONFIG_INTEL_MID_PTI is not set CONFIG_IOMMU_SUPPORT=y +# CONFIG_MAILBOX is not set + # CONFIG_HSI is not set # CONFIG_PM_DEVFREQ is not set # CONFIG_MODULE_SIG is not set +# CONFIG_SYSTEM_TRUSTED_KEYRING is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set # CONFIG_MODULE_VERIFY_ELF is not set # CONFIG_CRYPTO_KEY_TYPE is not set # CONFIG_PGP_LIBRARY is not set diff --git a/config-nodebug b/config-nodebug index f5cbe10b9..aa7568c82 100644 --- a/config-nodebug +++ b/config-nodebug @@ -96,6 +96,7 @@ CONFIG_PCI_DEFAULT_USE_CRS=y CONFIG_KGDB_KDB=y CONFIG_KDB_KEYBOARD=y +CONFIG_KDB_CONTINUE_CATASTROPHIC=0 # CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set # CONFIG_TEST_LIST_SORT is not set diff --git a/config-powerpc-generic b/config-powerpc-generic index 03341c818..b6df88ea8 100644 --- a/config-powerpc-generic +++ b/config-powerpc-generic @@ -346,6 +346,7 @@ CONFIG_I2C_MPC=m CONFIG_RFKILL_GPIO=m # CONFIG_CRYPTO_DEV_FSL_CAAM is not set +# CONFIG_CRYPTO_SHA1_PPC is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_MCP23S08 is not set @@ -381,8 +382,13 @@ CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_RTC_DRV_SNVS is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set +# CONFIG_OF_DISPLAY_TIMING is not set +# CONFIG_OF_VIDEOMODE is not set + CONFIG_POWER_RESET_GPIO=y CONFIG_FB_SSD1307=m CONFIG_INPUT_PWM_BEEPER=m CONFIG_BACKLIGHT_PWM=m CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=n + +CONFIG_XZ_DEC_POWERPC=y diff --git a/config-powerpc64 b/config-powerpc64 index 7c0477cf1..d0e0aab5b 100644 --- a/config-powerpc64 +++ b/config-powerpc64 @@ -178,4 +178,6 @@ CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_USE_SIGILL is not set # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set # CONFIG_PCIEPORTBUS is not set - +# CONFIG_PPC_TRANSACTIONAL_MEM is not set +# CONFIG_SND_HDA_INTEL is not set +CONFIG_BLK_DEV_RSXX=m diff --git a/config-powerpc64p7 b/config-powerpc64p7 index 9a8289588..285d9fff9 100644 --- a/config-powerpc64p7 +++ b/config-powerpc64p7 @@ -169,4 +169,5 @@ CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_USE_SIGILL is not set # CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set # CONFIG_PCIEPORTBUS is not set - +# CONFIG_SND_HDA_INTEL is not set +CONFIG_BLK_DEV_RSXX=m diff --git a/config-x86-32-generic b/config-x86-32-generic index 0e9b3f4be..6b6c60d30 100644 --- a/config-x86-32-generic +++ b/config-x86-32-generic @@ -3,6 +3,7 @@ CONFIG_X86_32_NON_STANDARD=y # CONFIG_X86_ELAN is not set +# CONFIG_X86_GOLDFISH is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set CONFIG_X86_BIGSMP=y @@ -227,3 +228,5 @@ CONFIG_BACKLIGHT_PWM=m # CONFIG_GPIO_ADNP is not set # CONFIG_BACKLIGHT_OT200 is not set # CONFIG_RTC_DRV_SNVS is not set +# CONFIG_OF_DISPLAY_TIMING is not set +# CONFIG_OF_VIDEOMODE is not set diff --git a/config-x86-generic b/config-x86-generic index 761e1da3f..67a9e1477 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -14,6 +14,7 @@ CONFIG_I8K=m CONFIG_SONYPI_COMPAT=y CONFIG_MICROCODE=m CONFIG_MICROCODE_INTEL=y +CONFIG_MICROCODE_INTEL_EARLY=y CONFIG_MICROCODE_AMD=y CONFIG_X86_MSR=y @@ -37,7 +38,7 @@ CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_VARS=y CONFIG_EFI_VARS_PSTORE=y -# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set +CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y CONFIG_EFI_PCDP=y CONFIG_FB_EFI=y @@ -69,7 +70,7 @@ CONFIG_ACPI_AC=y # CONFIG_ACPI_ASUS is not set CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y -CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CONTAINER=y CONFIG_ACPI_DOCK=y CONFIG_ACPI_FAN=y CONFIG_ACPI_NUMA=y @@ -96,11 +97,12 @@ CONFIG_ACPI_IPMI=m CONFIG_ACPI_CUSTOM_METHOD=m CONFIG_ACPI_BGRT=y -CONFIG_X86_ACPI_CPUFREQ=y -CONFIG_X86_PCC_CPUFREQ=y +# CONFIG_X86_INTEL_PSTATE is not set +CONFIG_X86_ACPI_CPUFREQ=m +CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ_CPB=y -CONFIG_X86_POWERNOW_K8=y -CONFIG_X86_P4_CLOCKMOD=y +CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_P4_CLOCKMOD=m # CONFIG_X86_SPEEDSTEP_CENTRINO is not set # @@ -144,6 +146,7 @@ CONFIG_I2C_AMD756_S4882=m CONFIG_I2C_AMD8111=m CONFIG_I2C_I801=m CONFIG_I2C_ISCH=m +CONFIG_I2C_ISMT=m CONFIG_I2C_NFORCE2=m CONFIG_I2C_NFORCE2_S4985=m CONFIG_I2C_PIIX4=m @@ -196,6 +199,7 @@ CONFIG_AMILO_RFKILL=m CONFIG_ASUS_LAPTOP=m CONFIG_COMPAL_LAPTOP=m CONFIG_DELL_LAPTOP=m +CONFIG_CHROMEOS_LAPTOP=m CONFIG_EEEPC_LAPTOP=m CONFIG_FUJITSU_TABLET=m CONFIG_FUJITSU_LAPTOP=m @@ -366,6 +370,7 @@ CONFIG_LPC_SCH=m CONFIG_LPC_ICH=m CONFIG_GPIO_ICH=m +# CONFIG_GPIO_LYNXPOINT is not set CONFIG_PCI_CNB20LE_QUIRK=y @@ -396,6 +401,7 @@ CONFIG_PCH_PHUB=m CONFIG_CRYPTO_AES_NI_INTEL=y CONFIG_CRYPTO_SERPENT_SSE2_586=m +CONFIG_CRYPTO_CRC32_PCLMUL=m CONFIG_HP_ACCEL=m @@ -425,14 +431,31 @@ CONFIG_DRM_GMA3600=y CONFIG_RCU_FANOUT_LEAF=16 CONFIG_INTEL_MEI=m +CONFIG_INTEL_MEI_ME=y # Maybe enable in debug kernels? # CONFIG_DEBUG_NMI_SELFTEST is not set +# CONFIG_X86_INTEL_LPSS is not set + +# CONFIG_INTEL_POWERCLAMP is not set + +CONFIG_VMWARE_VMCI=m +CONFIG_VMWARE_VMCI_VSOCKETS=m + +CONFIG_XZ_DEC_X86=y + CONFIG_MPILIB=y +CONFIG_PKCS7_MESSAGE_PARSER=y +CONFIG_PE_FILE_PARSER=y CONFIG_MODULE_SIG=y +CONFIG_MODULE_SIG_ALL=y # CONFIG_MODULE_SIG_SHA1 is not set CONFIG_MODULE_SIG_SHA256=y # CONFIG_MODULE_SIG_FORCE is not set -CONFIG_MODULE_SIG_BLACKLIST=y +CONFIG_SYSTEM_BLACKLIST_KEYRING=y + CONFIG_MODULE_SIG_UEFI=y + +CONFIG_VMXNET3=m +CONFIG_VFIO_PCI_VGA=y diff --git a/config-x86_64-generic b/config-x86_64-generic index f4fc09d98..67ac161f3 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -130,6 +130,9 @@ CONFIG_BPF_JIT=y # Should be 32bit only, but lacks KConfig depends # CONFIG_XO15_EBOOK is not set +CONFIG_NTB=m +CONFIG_NTB_NETDEV=m + # 10GigE # CONFIG_IP1000=m diff --git a/debug-bad-pte-modules.patch b/debug-bad-pte-modules.patch index bcf328667..0cc7d550e 100644 --- a/debug-bad-pte-modules.patch +++ b/debug-bad-pte-modules.patch @@ -9,13 +9,13 @@ diff -durpN '--exclude-from=/home/davej/.exclude' /home/davej/src/kernel/git-tre #include #include ---- linux-3.8.6-104.fc17.noarch/mm/memory.c~ 2013-04-11 11:48:54.024470277 -0400 -+++ linux-3.8.6-104.fc17.noarch/mm/memory.c 2013-04-11 11:49:15.770425274 -0400 -@@ -718,6 +718,7 @@ static void print_bad_pte(struct vm_area +--- linux-3.9.0-200.fc18.x86_64/mm/memory.c~ 2013-05-06 15:04:30.324416922 -0400 ++++ linux-3.9.0-200.fc18.x86_64/mm/memory.c 2013-05-06 15:04:43.933398227 -0400 +@@ -723,6 +723,7 @@ static void print_bad_pte(struct vm_area if (vma->vm_file && vma->vm_file->f_op) print_symbol(KERN_ALERT "vma->vm_file->f_op->mmap: %s\n", (unsigned long)vma->vm_file->f_op->mmap); + print_modules(); dump_stack(); - add_taint(TAINT_BAD_PAGE); + add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); } diff --git a/drm-i915-dp-stfu.patch b/drm-i915-dp-stfu.patch index c005a06ba..0f28ed240 100644 --- a/drm-i915-dp-stfu.patch +++ b/drm-i915-dp-stfu.patch @@ -11,15 +11,15 @@ index 296cfc2..516e1e2 100644 DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n", I915_READ(PCH_PP_STATUS), I915_READ(PCH_PP_CONTROL)); -@@ -400,7 +400,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, +@@ -447,7 +447,7 @@ intel_dp_aux_ch(struct intel_dp *intel_d } if (try == 3) { - WARN(1, "dp_aux_ch not started status 0x%08x\n", + DRM_ERROR("dp_aux_ch not started status 0x%08x\n", I915_READ(ch_ctl)); - return -EBUSY; - } + ret = -EBUSY; + goto out; @@ -1024,8 +1024,8 @@ static void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) return; DRM_DEBUG_KMS("Turn eDP VDD on\n"); diff --git a/kernel.spec b/kernel.spec index 4344f9769..670eaf8cb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -68,13 +68,13 @@ Summary: The Linux kernel # base_sublevel is the kernel version we're starting with and patching # on top of -- for example, 3.1-rc7-git1 starts with a 3.0 base, # which yields a base_sublevel of 0. -%define base_sublevel 8 +%define base_sublevel 9 ## If this is a released kernel ## %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 11 +%define stable_update 0 # Is it a -stable RC? %define stable_rc 0 # Set rpm version accordingly @@ -666,9 +666,7 @@ Patch460: serial-460800.patch Patch470: die-floppy-die.patch Patch510: silence-noise.patch -Patch520: quiet-apm.patch Patch530: silence-fbcon-logo.patch -Patch540: silence-empty-ipi-mask-warning.patch Patch800: crash-driver.patch @@ -713,8 +711,6 @@ Patch14000: hibernate-freeze-filesystems.patch Patch14010: lis3-improve-handling-of-null-rate.patch -Patch14011: team-net-next-update-20130307.patch - Patch20000: 0001-efifb-Skip-DMI-checks-if-the-bootloader-knows-what-i.patch Patch20001: 0002-x86-EFI-Calculate-the-EFI-framebuffer-size-instead-o.patch @@ -735,13 +731,6 @@ Patch22001: selinux-apply-different-permission-to-ptrace-child.patch #rhbz 859485 Patch22226: vt-Drop-K_OFF-for-VC_MUTE.patch -#rhbz 799564 -Patch22240: Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch -Patch22241: Input-add-support-for-Cypress-PS2-Trackpads.patch - -#rhbz 912166 -Patch22243: Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch - #rhbz 892811 Patch22247: ath9k_rx_dma_stop_check.patch @@ -751,36 +740,15 @@ Patch22261: 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch #rhbz 916544 Patch22263: 0001-drivers-crypto-nx-fix-init-race-alignmasks-and-GCM-b.patch -#rhbz 812111 -Patch24000: alps-v2.patch - -Patch24100: userns-avoid-recursion-in-put_user_ns.patch - -#rhbz 879462 -Patch24107: uvcvideo-suspend-fix.patch - -#rhbz 856863 892599 -Patch24111: cfg80211-mac80211-disconnect-on-suspend.patch -Patch24112: mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch - #rhbz 859282 Patch24113: VMX-x86-handle-host-TSC-calibration-failure.patch -#rhbz 920586 -Patch25000: amd64_edac_fix_rank_count.patch - #rhbz 921500 Patch25001: i7300_edac_single_mode_fixup.patch -#rhbz 920218 -Patch25006: mac80211-Dont-restart-sta-timer-if-not-running.patch - #rhbz 927469 Patch25007: fix-child-thread-introspection.patch -#rhbz 844750 -Patch25008: 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch - #rhbz 919176 Patch25010: wireless-regulatory-fix-channel-disabling-race-condition.patch @@ -1409,9 +1377,6 @@ ApplyPatch silence-noise.patch # Make fbcon not show the penguins with 'quiet' ApplyPatch silence-fbcon-logo.patch -# no-one cares about these warnings. -ApplyPatch silence-empty-ipi-mask-warning.patch - # Changes to upstream defaults. @@ -1419,7 +1384,7 @@ ApplyPatch silence-empty-ipi-mask-warning.patch ApplyPatch crash-driver.patch # secure boot -ApplyPatch secure-boot-20130409.patch +#ApplyPatch secure-boot-20130409.patch # Assorted Virt Fixes @@ -1436,7 +1401,6 @@ ApplyPatch drm-i915-tv-detect-hush.patch # silence the ACPI blacklist code ApplyPatch silence-acpi-blacklist.patch -ApplyPatch quiet-apm.patch # V4L/DVB updates/fixes/experimental drivers # apply if non-empty @@ -1470,54 +1434,24 @@ ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch #rhbz 859485 ApplyPatch vt-Drop-K_OFF-for-VC_MUTE.patch -#rhbz 799564 -ApplyPatch Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch -ApplyPatch Input-add-support-for-Cypress-PS2-Trackpads.patch - -#rhbz 912166 -ApplyPatch Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch - #rhbz 892811 ApplyPatch ath9k_rx_dma_stop_check.patch -#rhbz 812111 -ApplyPatch alps-v2.patch - #rhbz 903192 ApplyPatch 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch #rhbz 916544 ApplyPatch 0001-drivers-crypto-nx-fix-init-race-alignmasks-and-GCM-b.patch -ApplyPatch userns-avoid-recursion-in-put_user_ns.patch - -#rhbz 920586 -ApplyPatch amd64_edac_fix_rank_count.patch - #rhbz 921500 ApplyPatch i7300_edac_single_mode_fixup.patch -#Team Driver update -ApplyPatch team-net-next-update-20130307.patch - -#rhbz 879462 -ApplyPatch uvcvideo-suspend-fix.patch - -#rhbz 856863 892599 -ApplyPatch cfg80211-mac80211-disconnect-on-suspend.patch -ApplyPatch mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch - #rhbz 859282 ApplyPatch VMX-x86-handle-host-TSC-calibration-failure.patch -#rhbz 920218 -ApplyPatch mac80211-Dont-restart-sta-timer-if-not-running.patch - #rhbz 927469 ApplyPatch fix-child-thread-introspection.patch -ApplyPatch 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch - #rhbz 919176 ApplyPatch wireless-regulatory-fix-channel-disabling-race-condition.patch @@ -1544,6 +1478,11 @@ mkdir configs rm -f kernel-%{version}-*debug.config %endif + +# FIXME: ARM config broken on 3.9 rebase +rm -f kernel-%{version}-arm*.config + + # now run oldconfig over all the config files for i in *.config do @@ -2381,6 +2320,25 @@ fi # ||----w | # || || %changelog +* Mon May 06 2013 Dave Jones - 3.9.0-200 +- Rebase to Linux 3.9 + merged: silence-empty-ipi-mask-warning.patch + merged: quiet-apm.patch + merged: Input-increase-struct-ps2dev-cmdbuf-to-8-bytes.patch + merged: Input-add-support-for-Cypress-PS2-Trackpads.patch + merged: Input-cypress_ps2-fix-trackpadi-found-in-Dell-XPS12.patch + merged: alps-v2.patch + merged: userns-avoid-recursion-in-put_user_ns.patch + merged: amd64_edac_fix_rank_count.patch + merged: team-net-next-update-20130307.patch + merged: uvcvideo-suspend-fix.patch + merged: cfg80211-mac80211-disconnect-on-suspend.patch + merged: mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch + merged: mac80211-Dont-restart-sta-timer-if-not-running.patch + merged: 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch + TODO: secure-boot + TODO: ARM configs. + * Wed May 01 2013 Justin M. Forbes - 3.8.11-200 - Linux v3.8.11 diff --git a/mac80211-Dont-restart-sta-timer-if-not-running.patch b/mac80211-Dont-restart-sta-timer-if-not-running.patch deleted file mode 100644 index 7727ad8f2..000000000 --- a/mac80211-Dont-restart-sta-timer-if-not-running.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Ben Greear - -I found another crash when deleting lots of virtual stations -in a congested environment. I think the problem is that -the ieee80211_mlme_notify_scan_completed could call -ieee80211_restart_sta_timer for a stopped interface -that was about to be deleted. Fix similar problem for -mesh interfaces as well. - -Signed-off-by: Ben Greear ---- -v4: Fix up mesh as well, add check in calling code instead of - in the methods that mucks iwth the timers. - -:100644 100644 67fcfdf... 02e3d75... M net/mac80211/mesh.c -:100644 100644 aec786d... 1d237e9... M net/mac80211/mlme.c - net/mac80211/mesh.c | 3 ++- - net/mac80211/mlme.c | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c -index 67fcfdf..02e3d75 100644 ---- a/net/mac80211/mesh.c -+++ b/net/mac80211/mesh.c -@@ -779,7 +779,8 @@ void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) - - rcu_read_lock(); - list_for_each_entry_rcu(sdata, &local->interfaces, list) -- if (ieee80211_vif_is_mesh(&sdata->vif)) -+ if (ieee80211_sdata_running(sdata) -+ && ieee80211_vif_is_mesh(&sdata->vif)) - ieee80211_queue_work(&local->hw, &sdata->work); - rcu_read_unlock(); - } -diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c -index aec786d..1d237e9 100644 ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3054,7 +3054,8 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local) - /* Restart STA timers */ - rcu_read_lock(); - list_for_each_entry_rcu(sdata, &local->interfaces, list) -- ieee80211_restart_sta_timer(sdata); -+ if (ieee80211_sdata_running(sdata)) -+ ieee80211_restart_sta_timer(sdata); - rcu_read_unlock(); - } - --- -1.7.3.4 - --- -To unsubscribe from this list: send the line "unsubscribe linux-wireless" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file diff --git a/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch b/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch deleted file mode 100644 index 8249ab38c..000000000 --- a/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.8.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index 8be854e..6d2bab7 100644 ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -605,7 +605,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) - } - - ieee80211_adjust_monitor_flags(sdata, 1); -- ieee80211_configure_filter(local); -+ /* tell driver latter (if not suspended) */ - - netif_carrier_on(dev); - break; -@@ -804,8 +804,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, - sdata->dev->addr_len); - spin_unlock_bh(&local->filter_lock); - netif_addr_unlock_bh(sdata->dev); -- -- ieee80211_configure_filter(local); -+ /* configure filter latter (if not suspended) */ - } - - del_timer_sync(&local->dynamic_ps_timer); -@@ -872,32 +871,30 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, - */ - ieee80211_free_keys(sdata); - -- if (going_down) -+ if (going_down && !local->suspended) - drv_remove_interface(local, sdata); - } - - sdata->bss = NULL; - -- mutex_lock(&local->mtx); -- hw_reconf_flags |= __ieee80211_recalc_idle(local); -- mutex_unlock(&local->mtx); -- -- ieee80211_recalc_ps(local, -1); -+ if (!local->suspended) { -+ if (local->open_count == 0) { -+ if (local->ops->napi_poll) -+ napi_disable(&local->napi); -+ ieee80211_clear_tx_pending(local); -+ ieee80211_stop_device(local); -+ } else { -+ ieee80211_recalc_ps(local, -1); - -- if (local->open_count == 0) { -- if (local->ops->napi_poll) -- napi_disable(&local->napi); -- ieee80211_clear_tx_pending(local); -- ieee80211_stop_device(local); -+ mutex_lock(&local->mtx); -+ hw_reconf_flags |= __ieee80211_recalc_idle(local); -+ mutex_unlock(&local->mtx); - -- /* no reconfiguring after stop! */ -- hw_reconf_flags = 0; -+ if (hw_reconf_flags) -+ ieee80211_hw_config(local, hw_reconf_flags); -+ } - } - -- /* do after stop to avoid reconfiguring when we stop anyway */ -- if (hw_reconf_flags) -- ieee80211_hw_config(local, hw_reconf_flags); -- - spin_lock_irqsave(&local->queue_stop_reason_lock, flags); - for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { - skb_queue_walk_safe(&local->pending[i], skb, tmp) { diff --git a/quiet-apm.patch b/quiet-apm.patch deleted file mode 100644 index c38511c41..000000000 --- a/quiet-apm.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c -index a46bd38..416dd12 100644 ---- a/arch/x86/kernel/apm_32.c -+++ b/arch/x86/kernel/apm_32.c -@@ -903,7 +903,7 @@ static void apm_cpu_idle(void) - unsigned int jiffies_since_last_check = jiffies - last_jiffies; - unsigned int bucket; - -- WARN_ONCE(1, "deprecated apm_cpu_idle will be deleted in 2012"); -+ printk_once(KERN_INFO "deprecated apm_cpu_idle will be deleted in 2012"); - recalc: - if (jiffies_since_last_check > IDLE_CALC_LIMIT) { - use_apm_idle = 0; diff --git a/serial-460800.patch b/serial-460800.patch index 0e68378e7..bdae70e31 100644 --- a/serial-460800.patch +++ b/serial-460800.patch @@ -1,7 +1,7 @@ diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 2209620..659c1bb 100644 ---- a/drivers/tty/serial/8250/8250.c -+++ b/drivers/tty/serial/8250/8250.c +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c @@ -7,6 +7,9 @@ * * Copyright (C) 2001 Russell King. diff --git a/silence-empty-ipi-mask-warning.patch b/silence-empty-ipi-mask-warning.patch deleted file mode 100644 index 65a637c06..000000000 --- a/silence-empty-ipi-mask-warning.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- linux-3.6.noarch/arch/x86/kernel/apic/ipi.c~ 2013-01-23 10:48:14.716069615 -0500 -+++ linux-3.6.noarch/arch/x86/kernel/apic/ipi.c 2013-01-23 10:48:26.217046545 -0500 -@@ -106,7 +106,7 @@ void default_send_IPI_mask_logical(const - unsigned long mask = cpumask_bits(cpumask)[0]; - unsigned long flags; - -- if (WARN_ONCE(!mask, "empty IPI mask")) -+ if (!mask) - return; - - local_irq_save(flags); diff --git a/sources b/sources index b1f904923..06558d5b1 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -1c738edfc54e7c65faeb90c436104e2f linux-3.8.tar.xz -76ec67882ad94b8ab43c70a46befca13 patch-3.8.11.xz +4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz diff --git a/taint-vbox.patch b/taint-vbox.patch index 5cb3e47c9..5cde0ce28 100644 --- a/taint-vbox.patch +++ b/taint-vbox.patch @@ -1,15 +1,13 @@ -diff --git a/kernel/module.c b/kernel/module.c -index 04379f92..d26c9a3 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -2653,6 +2653,10 @@ static int check_module_license_and_versions(struct module *mod) +--- linux-3.9.0-200.fc18.x86_64/kernel/module.c~ 2013-05-06 15:01:57.589631369 -0400 ++++ linux-3.9.0-200.fc18.x86_64/kernel/module.c 2013-05-06 15:02:30.635583966 -0400 +@@ -2873,6 +2873,10 @@ static int check_module_license_and_vers if (strcmp(mod->name, "ndiswrapper") == 0) - add_taint(TAINT_PROPRIETARY_MODULE); + add_taint(TAINT_PROPRIETARY_MODULE, LOCKDEP_NOW_UNRELIABLE); + /* vbox is garbage. */ + if (strcmp(mod->name, "vboxdrv") == 0) -+ add_taint(TAINT_CRAP); ++ add_taint(TAINT_CRAP, LOCKDEP_NOW_UNRELIABLE); + /* driverloader was caught wrongly pretending to be under GPL */ if (strcmp(mod->name, "driverloader") == 0) - add_taint_module(mod, TAINT_PROPRIETARY_MODULE); + add_taint_module(mod, TAINT_PROPRIETARY_MODULE, diff --git a/team-net-next-update-20130307.patch b/team-net-next-update-20130307.patch deleted file mode 100644 index ebaa06762..000000000 --- a/team-net-next-update-20130307.patch +++ /dev/null @@ -1,608 +0,0 @@ -Update team driver to 3.9-rc1. - -Split patches available here: -http://people.redhat.com/jpirko/f18_team_update_4/ - -Flavio Leitner (5): - team: implement carrier change - team: add ethtool support - team: update master carrier state - team: use strlcpy with ethtool_drvinfo fields - team: allow userspace to take control over carrier - -Jiri Pirko (5): - rtnl: expose carrier value with possibility to set it - net: add change_carrier netdev op - team: handle sending port list in the same way option list is sent - team: move netlink event notifiers after team_port_leave() - team: ab: set active port option as changed when port is leaving - - Documentation/networking/operstates.txt | 4 + - drivers/net/team/team.c | 246 +++++++++++++++++++----------- - drivers/net/team/team_mode_activebackup.c | 13 +- - include/linux/if_team.h | 1 + - include/linux/netdevice.h | 12 ++ - include/uapi/linux/if_link.h | 1 + - net/core/dev.c | 19 +++ - net/core/rtnetlink.c | 10 ++ - 8 files changed, 215 insertions(+), 91 deletions(-) - -Signed-off-by: Jiri Pirko - -diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt -index 1a77a3c..9769457 100644 ---- a/Documentation/networking/operstates.txt -+++ b/Documentation/networking/operstates.txt -@@ -88,6 +88,10 @@ set this flag. On netif_carrier_off(), the scheduler stops sending - packets. The name 'carrier' and the inversion are historical, think of - it as lower layer. - -+Note that for certain kind of soft-devices, which are not managing any -+real hardware, there is possible to set this bit from userpsace. -+One should use TVL IFLA_CARRIER to do so. -+ - netif_carrier_ok() can be used to query that bit. - - __LINK_STATE_DORMANT, maps to IFF_DORMANT: -diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c -index ad86660..9e68014 100644 ---- a/drivers/net/team/team.c -+++ b/drivers/net/team/team.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - - #define DRV_NAME "team" -@@ -507,6 +508,7 @@ static bool team_is_mode_set(struct team *team) - - static void team_set_no_mode(struct team *team) - { -+ team->user_carrier_enabled = false; - team->mode = &__team_no_mode; - } - -@@ -1129,10 +1131,6 @@ static int team_port_del(struct team *team, struct net_device *port_dev) - return -ENOENT; - } - -- __team_option_inst_mark_removed_port(team, port); -- __team_options_change_check(team); -- __team_option_inst_del_port(team, port); -- __team_port_change_port_removed(port); - team_port_disable(team, port); - list_del_rcu(&port->list); - netdev_rx_handler_unregister(port_dev); -@@ -1141,6 +1139,12 @@ static int team_port_del(struct team *team, struct net_device *port_dev) - vlan_vids_del_by_dev(port_dev, dev); - dev_close(port_dev); - team_port_leave(team, port); -+ -+ __team_option_inst_mark_removed_port(team, port); -+ __team_options_change_check(team); -+ __team_option_inst_del_port(team, port); -+ __team_port_change_port_removed(port); -+ - team_port_set_orig_dev_addr(port); - dev_set_mtu(port_dev, port->orig.mtu); - synchronize_rcu(); -@@ -1399,13 +1403,11 @@ static void team_destructor(struct net_device *dev) - - static int team_open(struct net_device *dev) - { -- netif_carrier_on(dev); - return 0; - } - - static int team_close(struct net_device *dev) - { -- netif_carrier_off(dev); - return 0; - } - -@@ -1707,6 +1709,19 @@ static netdev_features_t team_fix_features(struct net_device *dev, - return features; - } - -+static int team_change_carrier(struct net_device *dev, bool new_carrier) -+{ -+ struct team *team = netdev_priv(dev); -+ -+ team->user_carrier_enabled = true; -+ -+ if (new_carrier) -+ netif_carrier_on(dev); -+ else -+ netif_carrier_off(dev); -+ return 0; -+} -+ - static const struct net_device_ops team_netdev_ops = { - .ndo_init = team_init, - .ndo_uninit = team_uninit, -@@ -1729,8 +1744,24 @@ static const struct net_device_ops team_netdev_ops = { - .ndo_add_slave = team_add_slave, - .ndo_del_slave = team_del_slave, - .ndo_fix_features = team_fix_features, -+ .ndo_change_carrier = team_change_carrier, - }; - -+/*********************** -+ * ethtool interface -+ ***********************/ -+ -+static void team_ethtool_get_drvinfo(struct net_device *dev, -+ struct ethtool_drvinfo *drvinfo) -+{ -+ strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver)); -+ strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version)); -+} -+ -+static const struct ethtool_ops team_ethtool_ops = { -+ .get_drvinfo = team_ethtool_get_drvinfo, -+ .get_link = ethtool_op_get_link, -+}; - - /*********************** - * rt netlink interface -@@ -1780,6 +1811,7 @@ static void team_setup(struct net_device *dev) - ether_setup(dev); - - dev->netdev_ops = &team_netdev_ops; -+ dev->ethtool_ops = &team_ethtool_ops; - dev->destructor = team_destructor; - dev->tx_queue_len = 0; - dev->flags |= IFF_MULTICAST; -@@ -1941,30 +1973,6 @@ static void team_nl_team_put(struct team *team) - dev_put(team->dev); - } - --static int team_nl_send_generic(struct genl_info *info, struct team *team, -- int (*fill_func)(struct sk_buff *skb, -- struct genl_info *info, -- int flags, struct team *team)) --{ -- struct sk_buff *skb; -- int err; -- -- skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -- if (!skb) -- return -ENOMEM; -- -- err = fill_func(skb, info, NLM_F_ACK, team); -- if (err < 0) -- goto err_fill; -- -- err = genlmsg_unicast(genl_info_net(info), skb, info->snd_portid); -- return err; -- --err_fill: -- nlmsg_free(skb); -- return err; --} -- - typedef int team_nl_send_func_t(struct sk_buff *skb, - struct team *team, u32 portid); - -@@ -2309,16 +2317,57 @@ team_put: - return err; - } - --static int team_nl_fill_port_list_get(struct sk_buff *skb, -- u32 portid, u32 seq, int flags, -- struct team *team, -- bool fillall) -+static int team_nl_fill_one_port_get(struct sk_buff *skb, -+ struct team_port *port) -+{ -+ struct nlattr *port_item; -+ -+ port_item = nla_nest_start(skb, TEAM_ATTR_ITEM_PORT); -+ if (!port_item) -+ goto nest_cancel; -+ if (nla_put_u32(skb, TEAM_ATTR_PORT_IFINDEX, port->dev->ifindex)) -+ goto nest_cancel; -+ if (port->changed) { -+ if (nla_put_flag(skb, TEAM_ATTR_PORT_CHANGED)) -+ goto nest_cancel; -+ port->changed = false; -+ } -+ if ((port->removed && -+ nla_put_flag(skb, TEAM_ATTR_PORT_REMOVED)) || -+ (port->state.linkup && -+ nla_put_flag(skb, TEAM_ATTR_PORT_LINKUP)) || -+ nla_put_u32(skb, TEAM_ATTR_PORT_SPEED, port->state.speed) || -+ nla_put_u8(skb, TEAM_ATTR_PORT_DUPLEX, port->state.duplex)) -+ goto nest_cancel; -+ nla_nest_end(skb, port_item); -+ return 0; -+ -+nest_cancel: -+ nla_nest_cancel(skb, port_item); -+ return -EMSGSIZE; -+} -+ -+static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq, -+ int flags, team_nl_send_func_t *send_func, -+ struct team_port *one_port) - { - struct nlattr *port_list; -+ struct nlmsghdr *nlh; - void *hdr; - struct team_port *port; -+ int err; -+ struct sk_buff *skb = NULL; -+ bool incomplete; -+ int i; -+ -+ port = list_first_entry(&team->port_list, struct team_port, list); - -- hdr = genlmsg_put(skb, portid, seq, &team_nl_family, flags, -+start_again: -+ err = __send_and_alloc_skb(&skb, team, portid, send_func); -+ if (err) -+ return err; -+ -+ hdr = genlmsg_put(skb, portid, seq, &team_nl_family, flags | NLM_F_MULTI, - TEAM_CMD_PORT_LIST_GET); - if (!hdr) - return -EMSGSIZE; -@@ -2329,47 +2378,54 @@ static int team_nl_fill_port_list_get(struct sk_buff *skb, - if (!port_list) - goto nla_put_failure; - -- list_for_each_entry(port, &team->port_list, list) { -- struct nlattr *port_item; -+ i = 0; -+ incomplete = false; - -- /* Include only changed ports if fill all mode is not on */ -- if (!fillall && !port->changed) -- continue; -- port_item = nla_nest_start(skb, TEAM_ATTR_ITEM_PORT); -- if (!port_item) -- goto nla_put_failure; -- if (nla_put_u32(skb, TEAM_ATTR_PORT_IFINDEX, port->dev->ifindex)) -- goto nla_put_failure; -- if (port->changed) { -- if (nla_put_flag(skb, TEAM_ATTR_PORT_CHANGED)) -- goto nla_put_failure; -- port->changed = false; -+ /* If one port is selected, called wants to send port list containing -+ * only this port. Otherwise go through all listed ports and send all -+ */ -+ if (one_port) { -+ err = team_nl_fill_one_port_get(skb, one_port); -+ if (err) -+ goto errout; -+ } else { -+ list_for_each_entry(port, &team->port_list, list) { -+ err = team_nl_fill_one_port_get(skb, port); -+ if (err) { -+ if (err == -EMSGSIZE) { -+ if (!i) -+ goto errout; -+ incomplete = true; -+ break; -+ } -+ goto errout; -+ } -+ i++; - } -- if ((port->removed && -- nla_put_flag(skb, TEAM_ATTR_PORT_REMOVED)) || -- (port->state.linkup && -- nla_put_flag(skb, TEAM_ATTR_PORT_LINKUP)) || -- nla_put_u32(skb, TEAM_ATTR_PORT_SPEED, port->state.speed) || -- nla_put_u8(skb, TEAM_ATTR_PORT_DUPLEX, port->state.duplex)) -- goto nla_put_failure; -- nla_nest_end(skb, port_item); - } - - nla_nest_end(skb, port_list); -- return genlmsg_end(skb, hdr); -+ genlmsg_end(skb, hdr); -+ if (incomplete) -+ goto start_again; -+ -+send_done: -+ nlh = nlmsg_put(skb, portid, seq, NLMSG_DONE, 0, flags | NLM_F_MULTI); -+ if (!nlh) { -+ err = __send_and_alloc_skb(&skb, team, portid, send_func); -+ if (err) -+ goto errout; -+ goto send_done; -+ } -+ -+ return send_func(skb, team, portid); - - nla_put_failure: -+ err = -EMSGSIZE; -+errout: - genlmsg_cancel(skb, hdr); -- return -EMSGSIZE; --} -- --static int team_nl_fill_port_list_get_all(struct sk_buff *skb, -- struct genl_info *info, int flags, -- struct team *team) --{ -- return team_nl_fill_port_list_get(skb, info->snd_portid, -- info->snd_seq, NLM_F_ACK, -- team, true); -+ nlmsg_free(skb); -+ return err; - } - - static int team_nl_cmd_port_list_get(struct sk_buff *skb, -@@ -2382,7 +2438,8 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb, - if (!team) - return -EINVAL; - -- err = team_nl_send_generic(info, team, team_nl_fill_port_list_get_all); -+ err = team_nl_send_port_list_get(team, info->snd_portid, info->snd_seq, -+ NLM_F_ACK, team_nl_send_unicast, NULL); - - team_nl_team_put(team); - -@@ -2433,27 +2490,11 @@ static int team_nl_send_event_options_get(struct team *team, - sel_opt_inst_list); - } - --static int team_nl_send_event_port_list_get(struct team *team) -+static int team_nl_send_event_port_get(struct team *team, -+ struct team_port *port) - { -- struct sk_buff *skb; -- int err; -- struct net *net = dev_net(team->dev); -- -- skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); -- if (!skb) -- return -ENOMEM; -- -- err = team_nl_fill_port_list_get(skb, 0, 0, 0, team, false); -- if (err < 0) -- goto err_fill; -- -- err = genlmsg_multicast_netns(net, skb, 0, team_change_event_mcgrp.id, -- GFP_KERNEL); -- return err; -- --err_fill: -- nlmsg_free(skb); -- return err; -+ return team_nl_send_port_list_get(team, 0, 0, 0, team_nl_send_multicast, -+ port); - } - - static int team_nl_init(void) -@@ -2526,28 +2567,53 @@ static void __team_port_change_send(struct team_port *port, bool linkup) - port->state.duplex = 0; - - send_event: -- err = team_nl_send_event_port_list_get(port->team); -+ err = team_nl_send_event_port_get(port->team, port); - if (err && err != -ESRCH) - netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n", - port->dev->name, err); - - } - -+static void __team_carrier_check(struct team *team) -+{ -+ struct team_port *port; -+ bool team_linkup; -+ -+ if (team->user_carrier_enabled) -+ return; -+ -+ team_linkup = false; -+ list_for_each_entry(port, &team->port_list, list) { -+ if (port->linkup) { -+ team_linkup = true; -+ break; -+ } -+ } -+ -+ if (team_linkup) -+ netif_carrier_on(team->dev); -+ else -+ netif_carrier_off(team->dev); -+} -+ - static void __team_port_change_check(struct team_port *port, bool linkup) - { - if (port->state.linkup != linkup) - __team_port_change_send(port, linkup); -+ __team_carrier_check(port->team); - } - - static void __team_port_change_port_added(struct team_port *port, bool linkup) - { - __team_port_change_send(port, linkup); -+ __team_carrier_check(port->team); - } - - static void __team_port_change_port_removed(struct team_port *port) - { - port->removed = true; - __team_port_change_send(port, false); -+ __team_carrier_check(port->team); - } - - static void team_port_change_check(struct team_port *port, bool linkup) -diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c -index 6262b4d..40fd338 100644 ---- a/drivers/net/team/team_mode_activebackup.c -+++ b/drivers/net/team/team_mode_activebackup.c -@@ -19,6 +19,7 @@ - - struct ab_priv { - struct team_port __rcu *active_port; -+ struct team_option_inst_info *ap_opt_inst_info; - }; - - static struct ab_priv *ab_priv(struct team *team) -@@ -54,8 +55,17 @@ drop: - - static void ab_port_leave(struct team *team, struct team_port *port) - { -- if (ab_priv(team)->active_port == port) -+ if (ab_priv(team)->active_port == port) { - RCU_INIT_POINTER(ab_priv(team)->active_port, NULL); -+ team_option_inst_set_change(ab_priv(team)->ap_opt_inst_info); -+ } -+} -+ -+static int ab_active_port_init(struct team *team, -+ struct team_option_inst_info *info) -+{ -+ ab_priv(team)->ap_opt_inst_info = info; -+ return 0; - } - - static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) -@@ -88,6 +98,7 @@ static const struct team_option ab_options[] = { - { - .name = "activeport", - .type = TEAM_OPTION_TYPE_U32, -+ .init = ab_active_port_init, - .getter = ab_active_port_get, - .setter = ab_active_port_set, - }, -diff --git a/include/linux/if_team.h b/include/linux/if_team.h -index 0245def..4648d80 100644 ---- a/include/linux/if_team.h -+++ b/include/linux/if_team.h -@@ -186,6 +186,7 @@ struct team { - - const struct team_mode *mode; - struct team_mode_ops ops; -+ bool user_carrier_enabled; - bool queue_override_enabled; - struct list_head *qom_lists; /* array of queue override mapping lists */ - long mode_priv[TEAM_MODE_PRIV_LONGS]; -diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 9ef07d0..7ebddc7 100644 ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -894,6 +894,14 @@ struct netdev_fcoe_hbainfo { - * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) - * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, - * struct net_device *dev) -+ * -+ * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); -+ * Called to change device carrier. Soft-devices (like dummy, team, etc) -+ * which do not represent real hardware may define this to allow their -+ * userspace components to manage their virtual carrier state. Devices -+ * that determine carrier state from physical hardware properties (eg -+ * network cables) or protocol-dependent mechanisms (eg -+ * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. - */ - struct net_device_ops { - int (*ndo_init)(struct net_device *dev); -@@ -1011,6 +1019,8 @@ struct net_device_ops { - int (*ndo_bridge_getlink)(struct sk_buff *skb, - u32 pid, u32 seq, - struct net_device *dev); -+ int (*ndo_change_carrier)(struct net_device *dev, -+ bool new_carrier); - }; - - /* -@@ -2197,6 +2207,8 @@ extern int dev_set_mtu(struct net_device *, int); - extern void dev_set_group(struct net_device *, int); - extern int dev_set_mac_address(struct net_device *, - struct sockaddr *); -+extern int dev_change_carrier(struct net_device *, -+ bool new_carrier); - extern int dev_hard_start_xmit(struct sk_buff *skb, - struct net_device *dev, - struct netdev_queue *txq); -diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h -index 60f3b6b..c4edfe1 100644 ---- a/include/uapi/linux/if_link.h -+++ b/include/uapi/linux/if_link.h -@@ -142,6 +142,7 @@ enum { - #define IFLA_PROMISCUITY IFLA_PROMISCUITY - IFLA_NUM_TX_QUEUES, - IFLA_NUM_RX_QUEUES, -+ IFLA_CARRIER, - __IFLA_MAX - }; - -diff --git a/net/core/dev.c b/net/core/dev.c -index f64e439..e0045ba 100644 ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -5027,6 +5027,25 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) - } - EXPORT_SYMBOL(dev_set_mac_address); - -+/** -+ * dev_change_carrier - Change device carrier -+ * @dev: device -+ * @new_carries: new value -+ * -+ * Change device carrier -+ */ -+int dev_change_carrier(struct net_device *dev, bool new_carrier) -+{ -+ const struct net_device_ops *ops = dev->netdev_ops; -+ -+ if (!ops->ndo_change_carrier) -+ return -EOPNOTSUPP; -+ if (!netif_device_present(dev)) -+ return -ENODEV; -+ return ops->ndo_change_carrier(dev, new_carrier); -+} -+EXPORT_SYMBOL(dev_change_carrier); -+ - /* - * Perform the SIOCxIFxxx calls, inside rcu_read_lock() - */ -diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c -index 1868625..2ef7a56 100644 ---- a/net/core/rtnetlink.c -+++ b/net/core/rtnetlink.c -@@ -780,6 +780,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, - + nla_total_size(4) /* IFLA_MTU */ - + nla_total_size(4) /* IFLA_LINK */ - + nla_total_size(4) /* IFLA_MASTER */ -+ + nla_total_size(1) /* IFLA_CARRIER */ - + nla_total_size(4) /* IFLA_PROMISCUITY */ - + nla_total_size(4) /* IFLA_NUM_TX_QUEUES */ - + nla_total_size(4) /* IFLA_NUM_RX_QUEUES */ -@@ -909,6 +910,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, - nla_put_u32(skb, IFLA_LINK, dev->iflink)) || - (dev->master && - nla_put_u32(skb, IFLA_MASTER, dev->master->ifindex)) || -+ nla_put_u8(skb, IFLA_CARRIER, netif_carrier_ok(dev)) || - (dev->qdisc && - nla_put_string(skb, IFLA_QDISC, dev->qdisc->ops->id)) || - (dev->ifalias && -@@ -1108,6 +1110,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = { - [IFLA_MTU] = { .type = NLA_U32 }, - [IFLA_LINK] = { .type = NLA_U32 }, - [IFLA_MASTER] = { .type = NLA_U32 }, -+ [IFLA_CARRIER] = { .type = NLA_U8 }, - [IFLA_TXQLEN] = { .type = NLA_U32 }, - [IFLA_WEIGHT] = { .type = NLA_U32 }, - [IFLA_OPERSTATE] = { .type = NLA_U8 }, -@@ -1438,6 +1441,13 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, - modified = 1; - } - -+ if (tb[IFLA_CARRIER]) { -+ err = dev_change_carrier(dev, nla_get_u8(tb[IFLA_CARRIER])); -+ if (err) -+ goto errout; -+ modified = 1; -+ } -+ - if (tb[IFLA_TXQLEN]) - dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); - diff --git a/userns-avoid-recursion-in-put_user_ns.patch b/userns-avoid-recursion-in-put_user_ns.patch deleted file mode 100644 index c3bb60444..000000000 --- a/userns-avoid-recursion-in-put_user_ns.patch +++ /dev/null @@ -1,117 +0,0 @@ -commit c61a2810a2161986353705b44d9503e6bb079f4f -Author: Eric W. Biederman -Date: Fri Dec 28 18:58:39 2012 -0800 - - userns: Avoid recursion in put_user_ns - - When freeing a deeply nested user namespace free_user_ns calls - put_user_ns on it's parent which may in turn call free_user_ns again. - When -fno-optimize-sibling-calls is passed to gcc one stack frame per - user namespace is left on the stack, potentially overflowing the - kernel stack. CONFIG_FRAME_POINTER forces -fno-optimize-sibling-calls - so we can't count on gcc to optimize this code. - - Remove struct kref and use a plain atomic_t. Making the code more - flexible and easier to comprehend. Make the loop in free_user_ns - explict to guarantee that the stack does not overflow with - CONFIG_FRAME_POINTER enabled. - - I have tested this fix with a simple program that uses unshare to - create a deeply nested user namespace structure and then calls exit. - With 1000 nesteuser namespaces before this change running my test - program causes the kernel to die a horrible death. With 10,000,000 - nested user namespaces after this change my test program runs to - completion and causes no harm. - - Acked-by: Serge Hallyn - Pointed-out-by: Vasily Kulikov - Signed-off-by: "Eric W. Biederman" - -diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h -index b9bd2e6..4ce0093 100644 ---- a/include/linux/user_namespace.h -+++ b/include/linux/user_namespace.h -@@ -21,7 +21,7 @@ struct user_namespace { - struct uid_gid_map uid_map; - struct uid_gid_map gid_map; - struct uid_gid_map projid_map; -- struct kref kref; -+ atomic_t count; - struct user_namespace *parent; - kuid_t owner; - kgid_t group; -@@ -35,18 +35,18 @@ extern struct user_namespace init_user_ns; - static inline struct user_namespace *get_user_ns(struct user_namespace *ns) - { - if (ns) -- kref_get(&ns->kref); -+ atomic_inc(&ns->count); - return ns; - } - - extern int create_user_ns(struct cred *new); - extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred); --extern void free_user_ns(struct kref *kref); -+extern void free_user_ns(struct user_namespace *ns); - - static inline void put_user_ns(struct user_namespace *ns) - { -- if (ns) -- kref_put(&ns->kref, free_user_ns); -+ if (ns && atomic_dec_and_test(&ns->count)) -+ free_user_ns(ns); - } - - struct seq_operations; -diff --git a/kernel/user.c b/kernel/user.c -index 33acb5e..57ebfd4 100644 ---- a/kernel/user.c -+++ b/kernel/user.c -@@ -47,9 +47,7 @@ struct user_namespace init_user_ns = { - .count = 4294967295U, - }, - }, -- .kref = { -- .refcount = ATOMIC_INIT(3), -- }, -+ .count = ATOMIC_INIT(3), - .owner = GLOBAL_ROOT_UID, - .group = GLOBAL_ROOT_GID, - .proc_inum = PROC_USER_INIT_INO, -diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c -index 2b042c4..24f8ec3 100644 ---- a/kernel/user_namespace.c -+++ b/kernel/user_namespace.c -@@ -78,7 +78,7 @@ int create_user_ns(struct cred *new) - return ret; - } - -- kref_init(&ns->kref); -+ atomic_set(&ns->count, 1); - /* Leave the new->user_ns reference with the new user namespace. */ - ns->parent = parent_ns; - ns->owner = owner; -@@ -104,15 +104,16 @@ int unshare_userns(unsigned long unshare_flags, struct cred **new_cred) - return create_user_ns(cred); - } - --void free_user_ns(struct kref *kref) -+void free_user_ns(struct user_namespace *ns) - { -- struct user_namespace *parent, *ns = -- container_of(kref, struct user_namespace, kref); -+ struct user_namespace *parent; - -- parent = ns->parent; -- proc_free_inum(ns->proc_inum); -- kmem_cache_free(user_ns_cachep, ns); -- put_user_ns(parent); -+ do { -+ parent = ns->parent; -+ proc_free_inum(ns->proc_inum); -+ kmem_cache_free(user_ns_cachep, ns); -+ ns = parent; -+ } while (atomic_dec_and_test(&parent->count)); - } - EXPORT_SYMBOL(free_user_ns); - diff --git a/uvcvideo-suspend-fix.patch b/uvcvideo-suspend-fix.patch deleted file mode 100644 index e8d825217..000000000 --- a/uvcvideo-suspend-fix.patch +++ /dev/null @@ -1,38 +0,0 @@ -From a82a45f65377b05fe8cd3167c7b0a70c508356b8 Mon Sep 17 00:00:00 2001 -From: Oliver Neukum -Date: Thu, 10 Jan 2013 07:04:55 -0300 -Subject: [PATCH] [media] uvcvideo: Fix race of open and suspend in error case - -Ming Lei reported: -IMO, there is a minor fault in the error handling path of -uvc_status_start() inside uvc_v4l2_open(), and the 'users' count should -have been decreased before usb_autopm_put_interface(). In theory, a [URB -resubmission] warning can be triggered when the device is opened just -between usb_autopm_put_interface() and atomic_dec(&stream->dev->users). -The fix is trivial. - -Reported-by: Ming Lei -Signed-off-by: Oliver Neukum -Signed-off-by: Laurent Pinchart -Signed-off-by: Mauro Carvalho Chehab ---- - drivers/media/usb/uvc/uvc_v4l2.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c -index 97a4ffd..b2dc326 100644 ---- a/drivers/media/usb/uvc/uvc_v4l2.c -+++ b/drivers/media/usb/uvc/uvc_v4l2.c -@@ -501,8 +501,8 @@ static int uvc_v4l2_open(struct file *file) - if (atomic_inc_return(&stream->dev->users) == 1) { - ret = uvc_status_start(stream->dev); - if (ret < 0) { -- usb_autopm_put_interface(stream->dev->intf); - atomic_dec(&stream->dev->users); -+ usb_autopm_put_interface(stream->dev->intf); - kfree(handle); - return ret; - } --- -1.8.1.2 -