aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-16Input: psmouse - fix Synaptics detection when protocol is disabledDmitry Torokhov1-13/+21
When Synaptics protocol is disabled, we still need to try and detect the hardware, so we can switch to SMBus device if SMbus is detected, or we know that it is Synaptics device and reset it properly for the bare PS/2 protocol. Fixes: c378b5119eb0 ("Input: psmouse - factor out common protocol probing code") Reported-by: Matteo Croce <mcroce@redhat.com> Tested-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-07-12Input: psmouse - constify attribute_group structuresArvind Yadav1-1/+1
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by <linux/sysfs.h> work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 12850 740 12 13602 3522 drivers/input/mouse/psmouse-base.o File size After adding 'const': text data bss dec hex filename 12914 676 12 13602 3522 drivers/input/mouse/psmouse-base.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: synaptics - add support for Intertouch devicesBenjamin Tissoires1-4/+20
Most of the Synaptics devices are connected through PS/2 and a different bus (SMBus or HID over I2C). The secondary bus capability is indicated by the InterTouch bit in extended capability 0x0C. We only enable the InterTouch device to be created for the laptops registered with the top software button property or those we know that are functional. In the future, we might change the default to always rely on the InterTouch bus. Currently, users can enable/disable the feature with the psmouse parameter synaptics_intertouch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - add support for SMBus companionsBenjamin Tissoires1-2/+14
This provides glue between PS/2 devices that enumerate the RMI4 devices and Elan touchpads to the RMI4 (or Elan) SMBus driver. The SMBus devices keep their PS/2 connection alive. If the initialization process goes too far (psmouse_activate called), the device disconnects from the I2C bus and stays on the PS/2 bus, that is why we explicitly disable PS/2 device reporting (by calling psmouse_deactivate) before trying to register SMBus companion device. The HID over I2C devices are enumerated through the ACPI DSDT, and their PS/2 device also exports the InterTouch bit in the extended capability 0x0C. However, the firmware keeps its I2C connection open even after going further in the PS/2 initialization. We don't need to take extra precautions with those device, especially because they block their PS/2 communication when HID over I2C is used. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - introduce notion of SMBus companionsDmitry Torokhov1-33/+70
Prepare PS/2 mouse drivers to work with devices that are accessible both via PS/2 and SMBus, which provides higher bandwidth, and thus suits better for modern multi-touch devices. We expect that SMBus drivers will take control over the device, so when we detect SMBus "protocol" we forego registering input device, or enabling PS/2 device reports (as it usually makes device unresponsive to access over SMBus). Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - store pointer to current protocolDmitry Torokhov1-26/+17
Instead of storing only protocol "type" in pmsouse structure, store pointer to the protocol structure, so that we have access to more data without having to copy it over to psmouse structure. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25Input: psmouse - implement fast reconnect optionDmitry Torokhov1-3/+27
Make use of serio's fast reconnect option and allow psmouse protocol handler's to implement fast reconnect handlers that will be called during system resume. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-02-09Input: psmouse - add a custom serio protocol to send extra informationBenjamin Tissoires1-3/+38
The tracksticks on the Lenovo thinkpads have their buttons connected through the touchpad device. We already fixed that in synaptics.c, but when we switch the device into RMI4 mode to have proper support, the pass-through functionality can't deal with them easily. We add a new PS/2 flag and protocol designed for psmouse. The RMI4 F03 pass-through can then emit a special set of commands to notify psmouse the state of the buttons. This patch implements the protocol in psmouse, while an other will do the same for rmi4-f03. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-11-16Input: psmouse - disable automatic probing of BYD touchpadsDmitry Torokhov1-4/+0
BYD automatic protocol detection is extremely unreliable and is often triggers false positives on regular mice, Sentelic touchpads, and other devices. BYD has several documents that have recommended detection sequence, but they conflict with each other and, as far as I can see, still would not produce unique enough output to reliably differentiate BYD from other PS/2 devices. OEMs sourcing BYD devices also do not do us any favors by not supplying any reasonable DMI data and instead leaving turds like "To Be Filled By O.E.M." in place of vendor data, or "System Serial Number" as serial number. On top of that BYD is not truly modern multitouch controller, but rather a single-touch transitional device that only reports absolute coordinates at the beginning of finger contact and then reverts to reporting displacements, and thus not very precise; the only benefit from using BYD mode vs the legacy PS/2 mode is possibility of edge scrolling. Given the above, and the fact that BYD devices are somewhat uncommon, let's disable automatic detection of BYD devices. Users who know they have BYD trackpads or want to experiment can attempt to activate BYD protocol via sysfs: echo -n "byd" > /sys/bus/serio/devices/serio1/drvctl Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=151691 Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=175421 Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=120781 Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=121281 Fixes: 98ee37714493 ("Input: byd - add BYD PS/2 touchpad driver") Cc: stable@vger.kernel.org # 4.6+ Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-08-25Input: psmouse - remove deprecated create_singletheread_workqueueBhaktipriya Shridhar1-1/+1
alloc_ordered_workqueue() replaces the deprecated create_singlethread_workqueue(). There are multiple work items on the work queue viz &priv->dev3_register_work, &priv->recalib_wq, &psmouse->resync_work, which require execution ordering. Hence, an ordered workqueue has been used. The workqueue is not being used on a memory reclaim path. Hence, WQ_MEM_RECLAIM has not been set. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-03-17Input: byd - enable absolute modeRichard Pospesel1-1/+1
The Windows driver's settings dialog contains a visualization of the regions for the hardware edge scrolling capability, which uses a temporarily-enabled limited-resolution absolute mode. This patch enables this during normal operation, and combines the absolute packets with the existing relative packets to provide accurate absolute position and touch reporting. It also adds documentation for all known gesture packets and initialization commands. Reviewed-by: Chris Diamand <chris@diamand.org> Signed-off-by: Richard Pospesel <pospeselr@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-01-27Input: byd - add BYD PS/2 touchpad driverChris Diamand1-0/+14
Driver for the BYD BTP10463 touchpad, found in PC Specialist `Lafite' laptops. This patch sends the magic command sequence which causes the touchpad to stream intellimouse-style packets. Gestures are detected inside the touchpad, and exposed as special values in the Z component of each packet - absolute coordinates are not supported, even in the Windows driver. At present, this supports two-finger vertical and horizontal scrolling, and provides the framework to expose the other gestures it can recognize. Signed-off-by: Chris Diamand <chris@diamand.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - rename ps2pp_init() to ps2pp_detect()Dmitry Torokhov1-1/+1
This makes Logitech PS2++ protocol implementation consistent with the naming in other protocols. Also mark the stub as "static inline" Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - limit protocols that we try on passthrough portsDmitry Torokhov1-0/+10
PS/2 protocol is slow, and using it with pass-through port (where we encapsulate PS/2 into PS/2) is slower yet so it takes quite a bit of time to do full protocol discovery for device attached to a pass-through port. However, so far we have not see anything but trackpoints or basic PS/2 mice on pass-through ports, so let's limit protocols that we probe there to Trackpoint, IntelliMouse Explorer, IntelliMouse, and bare PS/2 protocol, and avoid other extended protocols, such as Synaptics, ALPS, etc. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - factor out common protocol probing codeDmitry Torokhov1-78/+86
In preparation of limiting protocols that we try on pass-through ports, let's rework initialization code and factor common code into psmouse_try_protocol() that accepts protocol type (instead of detec() function pointer) and can, for most protocols, perform both detection and initialization. Note that this removes option of forcing Lifebook protocol on devices that are not recognized by lifebook_detect() as having the hardware, but I do not recall anyone using this option. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - move protocol descriptions aroundDmitry Torokhov1-190/+189
We move protocol descriptions and psmouse_find_by_type() and pmouse_find_by_name() so that we can use them without forward declarations in the subsequent patches. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - clean up Cypress probeDmitry Torokhov1-12/+8
When Cypress protocol support is disabled cypress_init() is a stub that always returns -ENOSYS, so there is not point in testing for CONFIG_MOUSE_PS2_CYPRESS after we decided that we are dealing with a Cypress device. Also, we should only be calling cypress_detect() when set_properties argument is "true", like with other protocols. There is a slight change in behavior to make follow-up patches more uniform: when we detect Cypress but its initialization fails, instead of immediately returning PSMOUSE_PS2 protocol we now continue trying IntelliMouse [Explorer]. Given that Cypress devices only have issue with Sentelic probes probing Imtellimouse should be safe. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - rearrange Focaltech init codeDmitry Torokhov1-11/+12
The fact that we were calling focaltech_init() even when Focaltech support is disabled was confusing. Rearrange the code so that if support is disabled we continue to fall through the rest of protocol probing code until we get to full reset that Focaltech devices need to work properly. Also, replace focaltech_init() with a stub now that it is only called when protocol is enabled. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - fix comment styleDmitry Torokhov1-155/+124
The module was using non-standard comment style with comment blocks often starting at the very beginning of a line instead of being aligned with the code. Let's switch to standard formatting. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-12-17Input: psmouse - use switch statement in psmouse_process_byte()Dmitry Torokhov1-34/+31
Instead of a series mostly exclusive "if" statements testing protocol type of the mouse let's use "switch" statement. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com> Tested-by: Till <till2.schaefer@uni-dortmund.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-26Input: psmouse - add small delay for IBM trackpoint pass-through modeStefan Assmann1-0/+4
There are trackpoint devices that fail to respond to the PS2 command PSMOUSE_CMD_GETID if immediately queried after the parent device is deactivated. Add a small delay for the hardware to get in a sane state before sending any PS2 commands. One example of such a system is: Lenovo ThinkPad X120e, model 30515QG synaptics: Touchpad model: 1, fw: 8.0, id: 0x1e2b1, caps: 0xd001a3/0x940300/0x121c00, board id: 1811, fw id: 797391 Signed-off-by: Stefan Assmann <sassmann@kpanic.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-01Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linuxLinus Torvalds1-1/+1
Pull module updates from Rusty Russell: "Main excitement here is Peter Zijlstra's lockless rbtree optimization to speed module address lookup. He found some abusers of the module lock doing that too. A little bit of parameter work here too; including Dan Streetman's breaking up the big param mutex so writing a parameter can load another module (yeah, really). Unfortunately that broke the usual suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were appended too" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits) modules: only use mod->param_lock if CONFIG_MODULES param: fix module param locks when !CONFIG_SYSFS. rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() module: add per-module param_lock module: make perm const params: suppress unused variable error, warn once just in case code changes. modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'. kernel/module.c: avoid ifdefs for sig_enforce declaration kernel/workqueue.c: remove ifdefs over wq_power_efficient kernel/params.c: export param_ops_bool_enable_only kernel/params.c: generalize bool_enable_only kernel/module.c: use generic module param operaters for sig_enforce kernel/params: constify struct kernel_param_ops uses sysfs: tightened sysfs permission checks module: Rework module_addr_{min,max} module: Use __module_address() for module_address_lookup() module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING module: Optimize __module_address() using a latched RB-tree rbtree: Implement generic latch_tree seqlock: Introduce raw_read_seqcount_latch() ...
2015-05-28kernel/params: constify struct kernel_param_ops usesLuis R. Rodriguez1-1/+1
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-26Input: psmouse - use true instead of 1 for boolean valuesShailendra Verma1-1/+1
The variable psmouse_smartscroll is bool type so assigning true instead of 1. Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-14Input: add vmmouse driverThomas Hellstrom1-0/+17
VMMouse enables low-latency mouse-cursor-movements for VMWare and QEMU guests. By removing the guest cursor and using the host as a guest cursor the cursor movement appears instant although in reality there is some lag. To be able to do this, the host's view of the cursor position must exactly match the guest's view and an absolute pointer device is needed. Enter the VMMouse. While the VMMouse driver has historically been an Xorg user-space driver, implementing it as a kernel imput driver enables rootless Xorg and new compositing display servers for VMware guests. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-23Merge tag 'v4.0-rc5' into nextDmitry Torokhov1-1/+13
Merge with the latest upstream to synchronize Synaptics changes and bring in new infrastructure pieces. Conflicts: drivers/input/mouse/synaptics.c
2015-03-07Input: psmouse - disable changing resolution/rate/scale for FocalTechMathias Gottschlag1-1/+13
These PS/2 commands make some touchpads stop responding, so this commit adds some dummy functions to replace the generic implementation. Because scale changes were not encapsulated in a method of struct psmouse yet, this commit adds a method set_scale to psmouse. Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-06Input: psmouse - when comparing PNP IDs ignore caseDmitry Torokhov1-7/+33
PNP IDs are supposed to be case-insensitive and so we should compare them as such. Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15Input: psmouse - use IS_ENABLED instead of homegrown codeDmitry Torokhov1-3/+3
Instead of having various protocols provide <protocol>_supported() functions, let's use IS_ENABLED() macro that works well in "if" statements. Acked-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-15Merge tag 'v3.19-rc4' into nextDmitry Torokhov1-7/+0
Merge with mainline to bring in the latest thermal and other changes.
2014-12-29Input: psmouse - support for the FocalTech PS/2 protocol extensionsMathias Gottschlag1-10/+22
Most of the protocol for these touchpads has been reverse engineered. This commit adds a basic multitouch-capable driver. A lot of the protocol is still unknown. Especially, we don't know how to identify the device yet apart from the PNP ID. The previous workaround for these devices has been left in place in case the driver is not compiled into the kernel or in case some other device with the same PNP ID is not recognized by the driver yet still has the same problems with the device probing code. Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-10-28Input: psmouse - remove unneeded check in psmouse_reconnect()Dmitry Torokhov1-7/+0
psmouse_reconnect() will not be called if psmouse driver is not bound to the serio port, so there is no point in checking that. Also, as coded, it introduces potential NULL dereference in psmouse_dbg() in case psmouse is indeed NULL. Let's just remove it. Detected by Coverity: CID 146528 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-10-11Merge tag 'v3.17' into nextDmitry Torokhov1-0/+2
Synchronize with mainline to bring in changes to Synaptics and i8042 drivers.
2014-10-03Merge branch 'next' into for-linusDmitry Torokhov1-0/+30
Prepare first round of input updates for 3.18.
2014-09-15Input: psmouse - add support for detecting FocalTech PS/2 touchpadsHans de Goede1-0/+16
The Asus X450 and X550 laptops use a PS/2 touchpad from a new manufacturer called FocalTech: https://bugzilla.kernel.org/show_bug.cgi?id=77391 https://bugzilla.redhat.com/show_bug.cgi?id=1110011 The protocol for these devices is not known at this time, but even without knowing the protocol they need some special handling. They get upset by some of our other PS/2 device probing, and once upset generate random mouse events making things unusable even with an external mouse. This patch adds detection of these devices based on their pnp ids, and when they are detected, treats them as a bare ps/2 mouse. Doing things this way they at least work in their ps/2 mouse emulation mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-09-12Input: psmouse - add psmouse_matches_pnp_id helper functionHans de Goede1-0/+14
The matches_pnp_id function from the synaptics driver is useful for other drivers too. Make it a generic psmouse helper function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-09-08Input: add missing POINTER / DIRECT properties to a bunch of driversHans de Goede1-0/+2
I've not done a full audit of all mouse drivers, I noticed these ones were missing the POINTER property while working on the POINTING_STICK property. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2013-01-17Input: add support for Cypress PS/2 TrackpadsDudley Du1-0/+32
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 <dudl@cypress.com> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kyle Fazzari <git@status.e4ward.com> Signed-off-by: Mario Limonciello <mario_limonciello@dell.com> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com> Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Reviewed-by: Dudley Du <dudl@cypress.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-03-09Merge commit 'v3.3-rc6' into nextDmitry Torokhov1-1/+1
2012-02-24Input: psmouse - allow drivers to use psmouse_{de,}activateAndres Salomon1-5/+10
Other drivers duplicate this code; no sense in having it be private to psmouse-base. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-13module_param: make bool parameters really bool (drivers & misc)Rusty Russell1-1/+1
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-12-30Input: psmouse - make sure we do not use stale methodsDmitry Torokhov1-69/+124
Several protocol initialization routines can fail after they set up psmouse methods, such as reconnect and disconnect. This may lead to these stale methods used with different protocol that they were intended to be used for and may cause unpredictavle behavior and/or crashes. Make sure we start with a clean slate before executing each and every protocol detection and/or initialization routine. Reported-by: Paul Fox <pgf@laptop.org> Acked-by: Tai-hwa Liang <avatar@sentelic.com> Acked-by: Paul Fox <pgf@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-11-09Input: synaptics - add support for Relative modeDaniel Drake1-1/+8
Currently, the synaptics driver puts the device into Absolute mode. As explained in the synaptics documentation section 3.2, in this mode, the device sends a continuous stream of packets at the maximum rate to the host when the user's fingers are near or on the pad or pressing buttons, and continues streaming for 1 second afterwards. These packets are even sent when there is no new information to report, even when they are duplicates of the previous packet. For embedded systems this is a bit much - it results in a huge and uninterrupted stream of interrupts at high rate. This patch adds support for Relative mode, which can be selected as a new psmouse protocol. In this mode, the device does not send duplicate packets and acts like a standard PS/2 mouse. However, synaptics-specific functionality is still available, such as the ability to set the packet rate, and rather than disabling gestures and taps at the hardware level unconditionally, a 'synaptics_disable_gesture' sysfs attribute has been added to allow control of this functionality. This solves a long standing OLPC issue: synaptics hardware enables tap to click by default (even in the default relative mode), but we have found this to be inappropriate for young children and first time computer users. Enabling the synaptics driver disables tap-to-click, but we have previously been unable to use this because it also enables Absolute mode, which is too "spammy" for our desires and actually overloads our EC with its continuous stream of packets. Now we can enable the synaptics driver, disabling tap to click while retaining the less noisy Relative mode. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-11-09Input: convert obsolete strict_strtox to kstrtoxJJ Ding1-12/+15
With commit 67d0a0754455f89ef3946946159d8ec9e45ce33a we mark strict_strtox as obsolete. Convert all remaining such uses in drivers/input/. Also change long to appropriate types, and return error conditions from kstrtox separately, as Dmitry sugguests. Signed-off-by: JJ Ding <dgdunix@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: psmouse - switch to using dev_*() for messagesDmitry Torokhov1-28/+39
This will ensure our reporting is consistent with the rest of the system and we do not refer to obsolete source file names. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Reviewed-by: JJ Ding <dgdunix@gmail.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-11-11Input: hgpk - support GlideSensor and PenTablet modesDaniel Drake1-0/+1
Add a "hgpk_mode" sysfs attribute that allows selection between 3 options: Mouse (the existing option), GlideSensor and PenTablet. GlideSensor is an enhanced protocol for the regular touchpad mode that additionally reports pressure and uses absolute coordinates. We suspect that it may be more reliable than mouse mode in some environments. PenTablet mode puts the touchpad into resistive mode, you must then use a stylus as an input. We suspect this is the most reliable way to drive the touchpad. The GlideSensor and PenTablet devices expose themselves with the intention of being combined with the synaptics X11 input driver. Based on earlier work by Paul Fox. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-10-13Input: serio - support multiple child devices per single parentDmitry Eremin-Solenikov1-2/+2
Some (rare) serio devices need to have multiple serio children. One of the examples is PS/2 multiplexer present on several TQC STKxxx boards, which connect PS/2 keyboard and mouse to single tty port. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-08-11param: use ops in struct kernel_param, rather than get and set fns directlyRusty Russell1-6/+8
This is more kernel-ish, saves some space, and also allows us to expand the ops without breaking all the callers who are happy for the new members to be NULL. The few places which defined their own param types are changed to the new scheme (more which crept in recently fixed in following patches). Since we're touching them anyway, we change get() and set() to take a const struct kernel_param (which they really are). This causes some harmless warnings until we fix them (in following patches). To reduce churn, module_param_call creates the ops struct so the callers don't have to change (and casts the functions to reduce warnings). The modern version which takes an ops struct is called module_param_cb. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Takashi Iwai <tiwai@suse.de> Tested-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Ville Syrjala <syrjala@sci.fi> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Alessandro Rubini <rubini@ipvvis.unipv.it> Cc: Michal Januszewski <spock@gentoo.org> Cc: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Neil Brown <neilb@suse.de> Cc: linux-kernel@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: linux-fbdev-devel@lists.sourceforge.net Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org
2010-05-19Input: psmouse - small formatting changes to better follow coding styleDmitry Torokhov1-36/+36
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-05-13Input: psmouse - reset all types of mice before reconnectingDmitry Torokhov1-4/+10
Synaptics hardware requires resetting device after suspend to ram in order for the device to be operational. The reset lives in synaptics-specific reconnect handler, but it is not being invoked if synaptics support is disabled and the device is handled as a standard PS/2 device (bare or IntelliMouse protocol). Let's add reset into generic reconnect handler as well. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>