aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-03Input: psmouse - switch to using dev_groups for driver-specific attributesDmitry Torokhov1-18/+4
The driver core now has the ability to handle the creation and removal of device-specific sysfs files, let's use it instead of registering and unregistering attributes by hand. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20220903051119.1332808-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-07-21Input: psmouse - add a newline when printing 'proto' by sysfsXiongfeng Wang1-1/+1
When I cat parameter 'proto' by sysfs, it displays as follows. It's better to add a newline for easy reading. root@syzkaller:~# cat /sys/module/psmouse/parameters/proto autoroot@syzkaller:~# Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Link: https://lore.kernel.org/r/20200720073846.120724-1-wangxiongfeng2@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
Based on 2 normalized pattern(s): 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 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 # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-04Input: i8042 - signal wakeup from atkbd/psmouseDmitry Torokhov1-0/+2
Instead of signalling wakeup directly from i8042, let psmouse and atkbd drivers execute basic protocol handling and only then signal wakeup condition. This solves the issue where we increment wakeup counter simply because we are getting responses from keyboard/mouse to the commands we ourselves send to them as part of suspend transition. Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-26Input: psmouse - fix button reporting for basic protocolsDmitry Torokhov1-6/+6
The commit ba667650c568 ("Input: psmouse - clean up code") was pretty brain-dead and broke extra buttons reporting for variety of PS/2 mice: Genius, Thinkmouse and Intellimouse Explorer. We need to actually inspect the data coming from the device when reporting events. Fixes: ba667650c568 ("Input: psmouse - clean up code") Reported-by: Jiri Slaby <jslaby@suse.cz> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-05-23Input: elantech - add support for SMBus devicesBenjamin Tissoires1-3/+18
Many of the Elantech devices are connected through PS/2 and a different bus (SMBus or plain I2C). To not break any existing device, we only enable SMBus based on a module parameter. If some laptops require the quirk to be set, we will have to rely on a list of PNPIds or MDI matching to individually expose those hardware over SMBus. the parameter mentioned above is elantech_smbus from the psmouse module. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: KT Liao <kt.liao@emc.com.tw> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-03-17Merge branch 'psmouse' into nextDmitry Torokhov1-86/+103
Merge various PS/2 handling improvements.
2018-02-02Input: psmouse - move sliced command implementation to libps2Dmitry Torokhov1-26/+0
In preparation to adding some debugging statements to PS/2 control sequences let's move psmouse_sliced_command() into libps2 and rename it to ps2_sliced_command(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02Input: psmouse - add support for 2nd wheel on A4Tech Dual-Scroll wheel miceStephen Lyons1-2/+17
This Far-Eastern company's PS/2 mice use a deviant format for the data relating to movement of the scroll wheels for, at least, their dual wheel mice, such as their "Optical GreatEye Wheelmouse" model "WOP-35". This product has five "buttons" (one of which is the click action on the first wheel) and TWO scroll wheels. However for a byte comprising d0-d7 instead of setting one of d6-7 in the forth byte of the mouse data packet and a twos complement number of scroll steps in the remaining d5-d0 (or d3-d0 should there be a fourth (BTN_SIDE - d4) or fifth (BTN_EXTRA - d5) button to report; they only report a single +/- event for each wheel and use a bit pattern that corresponds to +/-1 for the first wheel and +/- 2 for the second in the lower nibble of the fourth byte. The effect with existing code is that the second mouse wheel merely repeats the effect of the first but providing two steps per click rather than the one of the first wheel - so there is no HORIZONTAL scroll wheel movement detected from the device as far as the rest of the kernel sees it. This patch, if enabled by the "a4tech_workaround" module parameter modifies the handling just for mice of type PSMOUSE_IMEX so that the second scroll wheel movement gets correctly reported as REL_HWHEEL events. Should this module parameter be activated for other mice of the same PSMOUSE_IMEX type then it is possible that at the point where the mouse reports more than a single movement step the user may start seeing horizontal rather than vertical wheel events, but should the movement steps get to be more than two at a time the hack will get immediately deactivated and the behaviour will revert to the past code. This was discussed around *fifteen* *years* *ago* on the LKML and the best summary is in post https://lkml.org/lkml/2002/7/18/111 "Re: PS2 Input Core Support" by Vojtech Pavlik. I was not able to locate any discussion later than this on this topic. Given that most users of the "psmouse" module will NOT want this additional feature enabled I have taken the apparently erroneous step of defaulting the module parameter that enables it to be "disabled" - this functionality may interfere with the operation of "normal" mice of this type (until a large enough scroll wheel movement is detected) so I cannot see how it would want to be enabled for "normal" users - i.e. everyone without this brand of mouse. I am using this patch at the moment and I can confirm that it is working for me as both a module and compiled into the kernel for my mouse that is of the type (WOP-35) described - I note that it is still available from certain on-line retailers and that the manufacturers site does not list GNU/Linux as being supported on the product page - this patch however does enable full use of this product: http://www.a4tech.com/product.asp?cid=3D1&scid=3D8&id=3D22 Signed-off-by: Stephen Lyons <slysven@virginmedia.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02Input: psmouse - clean up codeDmitry Torokhov1-63/+77
- switch to using BIT() macros - use u8 instead of unsigned char for byte data - use input_set_capability() instead of manipulating capabilities bits directly - use sign_extend32() when extracting wheel data. - do not abuse -1 as error code, propagate errors from various calls. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02Input: psmouse - create helper for reporting standard buttons/motionDmitry Torokhov1-6/+20
Many protocol driver re-implement code to parse buttons or motion data from the standard PS/2 protocol. Let's split the parsing into separate functions and reuse them in protocol drivers. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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