From 1719ec4136035472d3e83a373908dd1b186dbc0b Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Tue, 8 Jun 2010 01:01:48 -0700 Subject: Input: bcm5974 - turn wellspring mode off if failed to start traffic If we fail to submit URBs we should take touchpad out of wellsping mode. Signed-off-by: Luo Jinghua Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/bcm5974.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 6dedded..354c578 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -580,23 +580,30 @@ exit: */ static int bcm5974_start_traffic(struct bcm5974 *dev) { - if (bcm5974_wellspring_mode(dev, true)) { + int error; + + error = bcm5974_wellspring_mode(dev, true); + if (error) { dprintk(1, "bcm5974: mode switch failed\n"); - goto error; + goto err_out; } - if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) - goto error; + error = usb_submit_urb(dev->bt_urb, GFP_KERNEL); + if (error) + goto err_reset_mode; - if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) + error = usb_submit_urb(dev->tp_urb, GFP_KERNEL); + if (error) goto err_kill_bt; return 0; err_kill_bt: usb_kill_urb(dev->bt_urb); -error: - return -EIO; +err_reset_mode: + bcm5974_wellspring_mode(dev, false); +err_out: + return error; } static void bcm5974_pause_traffic(struct bcm5974 *dev) -- cgit v1.1 From c13aea033cbeb181e7e135f280ecdfca49f90180 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 23 Jun 2010 09:30:22 -0700 Subject: Input: bcm5974 - set the average number of events per MT event packet The MT devices produce a lot of data. Tell the underlying input device approximately how many events will be sent per synchronization, to allow for better buffering. The number is a template based on continuously reporting details for each finger on a single hand. Signed-off-by: Henrik Rydberg Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/bcm5974.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 354c578..ea67c49 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -312,6 +312,8 @@ static void setup_events_to_report(struct input_dev *input_dev, __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); __set_bit(BTN_LEFT, input_dev->keybit); + + input_set_events_per_packet(input_dev, 60); } /* report button data as logical button state */ -- cgit v1.1 From 2a8e77102e02dd236ff276a2151073ed551d04f2 Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Mon, 19 Jul 2010 09:06:15 -0700 Subject: Input: synaptics - only report width on hardware that supports it Synaptics devices report fixed value of 5 for finger/palm widths on devices that do not support capability and driver further hardcodes to 5. Stop reporting this fixed value when its not supported since its not useful. This will aid applications so they can better auto-enable support for multi-touch emulation and palm detection logic using finger width only for devices that support width detection. I can find no applications that currently require existence on ABS_TOOL_WIDTH. Since only synaptics and bcm input devices currently support this tool, it seems they must handle it gracefully. Signed-off-by: Chris Bagwell Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 40cea33..1b49d7f 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -496,7 +496,9 @@ static void synaptics_process_packet(struct psmouse *psmouse) } input_report_abs(dev, ABS_PRESSURE, hw.z); - input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); + if (SYN_CAP_PALMDETECT(priv->capabilities)) + input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); + input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1); input_report_key(dev, BTN_LEFT, hw.left); input_report_key(dev, BTN_RIGHT, hw.right); @@ -596,7 +598,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0); input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); - __set_bit(ABS_TOOL_WIDTH, dev->absbit); + + if (SYN_CAP_PALMDETECT(priv->capabilities)) + __set_bit(ABS_TOOL_WIDTH, dev->absbit); __set_bit(EV_KEY, dev->evbit); __set_bit(BTN_TOUCH, dev->keybit); -- cgit v1.1 From 58fb021827b7455e05d89371556e6c255e9fb2e1 Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Mon, 19 Jul 2010 09:06:15 -0700 Subject: Input: synaptics - set min/max for finger width Reporting this will allow GUI config apps to correctly scale width sensitive config values (such as palm detect) to correct range. Current user apps are detecting kernels min/max=0/0 and making an assumption that it means 0/16 or 0/15. Synaptics touchpad interface guides show 4/15 are correct values but driver forces to 0 when no fingers on touchpad. Signed-off-by: Chris Bagwell Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 1b49d7f..85a1e14 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -600,7 +600,7 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); if (SYN_CAP_PALMDETECT(priv->capabilities)) - __set_bit(ABS_TOOL_WIDTH, dev->absbit); + input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0); __set_bit(EV_KEY, dev->evbit); __set_bit(BTN_TOUCH, dev->keybit); -- cgit v1.1