Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

Pull input layer fixes from Dmitry Torokhov:
 "A few fixups for the input subsystem"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: document INPUT_PROP_TOPBUTTONPAD
  Input: fix defuzzing logic
  Input: sirfsoc-onkey - fix GPL v2 license string typo
  Input: st-keyscan - fix 'defined but not used' compiler warnings
  Input: synaptics - add min/max quirk for pnp-id LEN2002 (Edge E531)
  Input: i8042 - add Acer Aspire 5710 to nomux blacklist
  Input: ti_am335x_tsc - warn about incorrect spelling
  Input: wacom - cleanup multitouch code when touch_max is 2
  • Loading branch information
torvalds committed Jul 23, 2014
2 parents 7442cf9 + f62d14a commit b292d6b
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 27 deletions.
13 changes: 13 additions & 0 deletions Documentation/input/event-codes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,19 @@ gestures can normally be extracted from it.
If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT
device.

INPUT_PROP_TOPBUTTONPAD:
-----------------------
Some laptops, most notably the Lenovo *40 series provide a trackstick
device but do not have physical buttons associated with the trackstick
device. Instead, the top area of the touchpad is marked to show
visual/haptic areas for left, middle, right buttons intended to be used
with the trackstick.

If INPUT_PROP_TOPBUTTONPAD is set, userspace should emulate buttons
accordingly. This property does not affect kernel behavior.
The kernel does not provide button emulation for such devices but treats
them as any other INPUT_PROP_BUTTONPAD device.

Guidelines:
==========
The guidelines below ensure proper single-touch and multi-finger functionality.
Expand Down
6 changes: 4 additions & 2 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ static int input_handle_abs_event(struct input_dev *dev,
}

static int input_get_disposition(struct input_dev *dev,
unsigned int type, unsigned int code, int value)
unsigned int type, unsigned int code, int *pval)
{
int disposition = INPUT_IGNORE_EVENT;
int value = *pval;

switch (type) {

Expand Down Expand Up @@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev,
break;
}

*pval = value;
return disposition;
}

Expand All @@ -365,7 +367,7 @@ static void input_handle_event(struct input_dev *dev,
{
int disposition;

disposition = input_get_disposition(dev, type, code, value);
disposition = input_get_disposition(dev, type, code, &value);

if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
dev->event(dev, type, code, value);
Expand Down
2 changes: 2 additions & 0 deletions drivers/input/keyboard/st-keyscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ static int keyscan_probe(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int keyscan_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
Expand Down Expand Up @@ -249,6 +250,7 @@ static int keyscan_resume(struct device *dev)
mutex_unlock(&input->mutex);
return retval;
}
#endif

static SIMPLE_DEV_PM_OPS(keyscan_dev_pm_ops, keyscan_suspend, keyscan_resume);

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/sirfsoc-onkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {

module_platform_driver(sirfsoc_pwrc_driver);

MODULE_LICENSE("GPLv2");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Binghua Duan <[email protected]>, Xianglong Du <[email protected]>");
MODULE_DESCRIPTION("CSR Prima2 PWRC Driver");
MODULE_ALIAS("platform:sirfsoc-pwrc");
5 changes: 3 additions & 2 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
1232, 5710, 1156, 4696
},
{
(const char * const []){"LEN0034", "LEN0036", "LEN2004", NULL},
(const char * const []){"LEN0034", "LEN0036", "LEN2002",
"LEN2004", NULL},
1024, 5112, 2024, 4832
},
{
Expand Down Expand Up @@ -168,7 +169,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
"LEN0049",
"LEN2000",
"LEN2001", /* Edge E431 */
"LEN2002",
"LEN2002", /* Edge E531 */
"LEN2003",
"LEN2004", /* L440 */
"LEN2005",
Expand Down
7 changes: 7 additions & 0 deletions drivers/input/serio/i8042-x86ia64io.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
},
},
{
/* Acer Aspire 5710 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
},
},
{
/* Gericom Bellagio */
.matches = {
Expand Down
28 changes: 7 additions & 21 deletions drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,9 +1217,9 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
* a=(pi*r^2)/C.
*/
int a = data[5];
int x_res = input_abs_get_res(input, ABS_X);
int y_res = input_abs_get_res(input, ABS_Y);
width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
int x_res = input_abs_get_res(input, ABS_MT_POSITION_X);
int y_res = input_abs_get_res(input, ABS_MT_POSITION_Y);
width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
height = width * y_res / x_res;
}

Expand Down Expand Up @@ -1587,7 +1587,7 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
input_abs_set_res(input_dev, ABS_X, features->x_resolution);
input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
} else {
if (features->touch_max <= 2) {
if (features->touch_max == 1) {
input_set_abs_params(input_dev, ABS_X, 0,
features->x_max, features->x_fuzz, 0);
input_set_abs_params(input_dev, ABS_Y, 0,
Expand Down Expand Up @@ -1815,14 +1815,8 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
case MTTPC:
case MTTPC_B:
case TABLETPC2FG:
if (features->device_type == BTN_TOOL_FINGER) {
unsigned int flags = INPUT_MT_DIRECT;

if (wacom_wac->features.type == TABLETPC2FG)
flags = 0;

input_mt_init_slots(input_dev, features->touch_max, flags);
}
if (features->device_type == BTN_TOOL_FINGER && features->touch_max > 1)
input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_DIRECT);
/* fall through */

case TABLETPC:
Expand Down Expand Up @@ -1883,23 +1877,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
__set_bit(BTN_RIGHT, input_dev->keybit);

if (features->touch_max) {
/* touch interface */
unsigned int flags = INPUT_MT_POINTER;

__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
input_set_abs_params(input_dev,
ABS_MT_TOUCH_MAJOR,
0, features->x_max, 0, 0);
input_set_abs_params(input_dev,
ABS_MT_TOUCH_MINOR,
0, features->y_max, 0, 0);
} else {
__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
flags = 0;
}
input_mt_init_slots(input_dev, features->touch_max, flags);
input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_POINTER);
} else {
/* buttons/keys only interface */
__clear_bit(ABS_X, input_dev->absbit);
Expand Down
5 changes: 4 additions & 1 deletion drivers/input/touchscreen/ti_am335x_tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,12 @@ static int titsc_parse_dt(struct platform_device *pdev,
*/
err = of_property_read_u32(node, "ti,coordinate-readouts",
&ts_dev->coordinate_readouts);
if (err < 0)
if (err < 0) {
dev_warn(&pdev->dev, "please use 'ti,coordinate-readouts' instead\n");
err = of_property_read_u32(node, "ti,coordiante-readouts",
&ts_dev->coordinate_readouts);
}

if (err < 0)
return err;

Expand Down

0 comments on commit b292d6b

Please sign in to comment.