aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-04-19Input: psmouse - ignore parity error for basic protocolsDmitry Torokhov1-3/+15
Observing behavior of the other OS it appears that parity errors reported by the keyboard controller are being ignored and the data is processed as usual. Let's do the same for standard PS/2 protocols (bare, Intellimouse and Intellimouse Explorer) to provide better compatibility. Thsi should fix teh following bug: https://bugzilla.kernel.org/show_bug.cgi?id=6105 Thanks for Damjan Jovanovic for locating the source of issue and ideas for the patch. Tested-by: Damjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-02-07Input: psmouse - make sure we don't schedule reconnects after cleanupDmitry Torokhov1-1/+8
Set state of the device as "initializing" during and after cleanup to ensure that unsolicited data from the device is not passed on. We especially want to avoid processing new device announcements "0xaa 0x00" that can come up before we perform reconnect operation. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-01-13Input: pmouse - move Sentelic probe down the listTai-hwa Liang1-13/+15
Sentelic probes confuse IBM trackpoints so they stop responding to TP_READ_ID command. See: http://bugzilla.kernel.org/show_bug.cgi?id=14970 Let's move FSP detection lower so it is probed after trackpoint and others, just before we strat probing for Intellimouse Explorer. Signed-off-by: Tai-hwa Liang <avatar@sentelic.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-01-07Input: psmouse - fix Synaptics detection when protocol is disabledDaniel Drake1-1/+8
For configurations where Synaptics hardware is present but the Synaptics extensions support is not compiled in, the mouse is reprobed and a new device is allocated on every suspend/resume. During probe, psmouse_switch_protocol() calls psmouse_extensions() with set_properties=1. This calls the dummy synaptics_init() which returns an error code, instructing us not to use the synaptics extensions. During resume, psmouse_reconnect() calls psmouse_extensions() with set_properties=0, in which case call to synaptics_init() is bypassed and PSMOUSE_SYNAPTICS is returned. Since the result is different from previous attempt psmouse_reconnect() fails and full re-probe happens. Fix this by tweaking the set_properties=0 codepath in psmouse_extensions() to be more careful about offering PSMOUSE_SYNAPTICS extensions. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-01-06Input: serio - fix potential deadlock when unbinding driversEric W. Biederman1-29/+3
sysfs_remove_group() waits for sysfs attributes to be removed, therefore we do not need to worry about driver-specific attributes being accessed after driver has been detached from the device. In fact, attempts to take serio->drv_mutex in attribute methods may lead to the following deadlock: sysfs_read_file() fill_read_buffer() sysfs_get_active_two() psmouse_attr_show_helper() serio_pin_driver() serio_disconnect_driver() mutex_lock(&serio->drv_mutex); <--------> mutex_lock(&serio_drv_mutex); psmouse_disconnect() sysfs_remove_group(... psmouse_attr_group); .... sysfs_deactivate(); wait_for_completion(); Fix this by removing calls to serio_[un]pin_driver() and functions themselves and using driver-private mutexes to serialize access to attribute's set() methods that may change device state. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-24Input: speed up suspend/shutdown for PS/2 mice and keyboardsDmitry Torokhov1-1/+4
Instead of doing full-blown reset while suspending or shutting down the box use lighter form of reset that should take less time. Tested-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-03Input: psmouse - do not carry DMI data aroundDmitry Torokhov1-0/+3
DMI tables use considerable amount of memory. Mark them as __initconst so they will be discarded once module is loaded. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-02Merge commit 'v2.6.32' into nextDmitry Torokhov1-2/+2
2009-11-20Input: psmouse - rework setting of BTN_MIDDLE capabilityDmitry Torokhov1-11/+27
Do not start protocol detection assuming that middle mouse is present, instead let individual protocols explicitly set this capability. This fixes issue with Synaptics touchpads pretending that they have middle button when hardware clearly reports otherwise. Reported-and-tested-by: Andrey Borzenkov <arvidjaar@mail.ru> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-16Input: psmouse - fix breakage introduced by b7802c5c1eaJiri Kosina1-1/+1
Commit b7802c5c1ea ("Input: psmouse - use boolean type") caused the synaptics_hardware variable to be completely useless, as it is constantly set to 'true' throughout the whole psmouse_extensions(). This was caused by the following hunk in the commit in question - int synaptics_hardware = 0; + bool synaptics_hardware = true; which is wrong and causes driver to issue extra reset when falling back to bare PS/2 protocol. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-11-12Input: psmouse - remove unneeded '\n' from psmouse.proto parameterTakashi Iwai1-1/+1
The get parameter function should return a string without a life-feed. Otherwise you'll see additional empty line in sysfs parameters file. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-09-10Input: psmouse - use boolean typeDmitry Torokhov1-41/+46
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-08-19Input: add new driver for Sentelic Finger Sensing PadTai-hwa Liang1-1/+25
This is the driver for Sentelic Finger Sensing Pad which can be found on MSI WIND Netbook. Signed-off-by: Tai-hwa Liang <avatar@sentelic.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-05-15Input: psmouse - ESD workaround fix for OLPC XO touchpadZephaniah E. Hull1-1/+3
It appears that when the XO touchpad unit resets from ESD, it sends AA AA instead of AA 00, the psmouse-base code handles the case of AA 00 by triggering a serio reconnect for the port, causing a full reprobe of the device. Testing with OFW shows that this is likely to solve the problem, so the attached patch simply expands the existing test to also catch AA AA. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Deepak Saxena <dsaxena@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-10-16Input: psmouse - add support for Elantech touchpadsArjan Opmeer1-0/+23
This is version 5 of the driver. Relative mode support has been dropped (users wishing to use touchpad in relative mode can use standard PS/2 protocol emulation done in hardware). The driver supports both original version of Elantech protocol and the newer one used by touchpads installed in EeePC. Signed-off-by: Arjan Opmeer <arjan@opmeer.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-21Input: psmouse - add OLPC touchpad driverAndres Salomon1-1/+22
This adds support for OLPC's touchpad. It has lots of neat features, none of which are enabled because the hardware is too buggy. Instead, we use it like a normal touchpad, but with a number of workarounds in place to deal with the frequent hardware spasms. Humidity changes, sweat, tinfoil underwear, plugging in AC, drinks, evil felines.. All tend to cause the touchpad to freak out. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-21Input: psmouse - tweak PSMOUSE_DEFINE_ATTR to support raw set callbacksAndres Salomon1-13/+17
We want to support attr->set callbacks that may need psmouse->state to not be updated, or may want to manually deal w/ enabling and disabling the device. To do that, we create __PSMOUSE_DEFINE_ATTR which enables us to set a 'protect' argument specifying whether or not the set callback should be protected with psmouse_disable and state setting. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-21Input: psmouse - add psmouse_queue_work() for ps/2 extension to make use ofAndres Salomon1-4/+10
psmouse_queue_work is passed a delayed_work struct, and queues up the work with kpsmouse_wq. Since we're dealing with delayed_work stuff, this also switches resync_work to a delayed_work struct as well, and makes use of psmouse_queue_work when doing a resync within psmouse-base. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-21Input: psmouse - export psmouse_set_state for ps/2 extensions to useAndres Salomon1-1/+1
Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-09-10Input: convert drivers to use strict_strtoul()Joe Rouvier1-9/+3
strict_strtoul() allows newline character at the end of the the input string and therefore is more user-friendly. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2008-01-21Input: drop redundant includes of moduleparam.hJulia Lawall1-1/+0
Drop #include <linux/moduleparam.h> in files that also include linux/module.h, since module.h includes moduleparam.h already. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-01-17Input: psmouse - fix potential memory leak in psmouse_connect()Andres Salomon1-0/+2
If we successfully call input_register_device() in psmouse_connect() but sysfs_create_group() fails, we'll enter the error path without ever having called input_unregister_device() potentially leaking memory. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-10-19Spelling fix: explicitlyJean Delvare1-1/+1
From: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby1-3/+4
get rid of input BIT* duplicate defines use newly global defined macros for input layer. Also remove includes of input.h from non-input sources only for BIT macro definiton. Define the macro temporarily in local manner, all those local definitons will be removed further in this patchset (to not break bisecting). BIT macro will be globally defined (1<<x) Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: <dtor@mail.ru> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: <lenb@kernel.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: <perex@suse.cz> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: <vernux@us.ibm.com> Cc: <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-30Input: psmouse - reset harder during probeAlon Ziv1-2/+3
Some rodents appear to be extra-finicky, and require both PSMOUSE_RESET_DIS and PSMOUSE_RESET_BAT before they are unconfused enough to be probed. Signed-off-by: Alon Ziv <lkml@nolaviz.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: psmouse - add support for Cortron PS/2 TrackballsAristeu Rozanski1-0/+29
Cortron PS/2 Trackballs (700-0001A) report the 4th button using the 4th bit of the first packet (yes, it breaks the standard PS/2 protocol). This patch adds an extra protocol to generate BTN_SIDE based on the 4th bit. There's no way to detect those trackballs using any kind of special sequence, thus the protocol must be activated explicitely by writing into 'protocol' sysfs attribute: echo -n "cortps" > /sys/devices/platform/i8042/serio1/protocol Signed-off-by: Aristeu Rozanski <arozansk@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-04-12Input: mice - switch to using input_dev->dev.parentDmitry Torokhov1-1/+1
In preparation for struct class_device -> struct device input core conversion, switch to using input_dev->dev.parent when specifying device position in sysfs tree. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-04-12Input: drivers/input/mice - don't access dev->private directlyDmitry Torokhov1-1/+0
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-03-10Input: psmouse - allow disabing certain protocol extensionsAndres Salomon1-1/+15
Allow ALPS, LOGIPS2PP, LIFEBOOK, TRACKPOINT and TOUCHKIT protocol extensions of psmouse to be disabled during compilation. This will allow users save some memory when they are sure that they will only use a certain type of mice. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-03-07Input: psmouse - do not force stream modeDmitry Torokhov1-6/+0
Forcing stream mode after reset confuses some devices (reported by Andrea Arcangeli) so let's take it out - spec says that after reset mouse should already be in stream mode. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-02-18Input: psmouse - add support for eGalax PS/2 touchscreen controllerStefan Lucke1-6/+19
Based on the touchkit USB and lifebook PS/2 touchscreen driver. The egalax touchsreen controller (PS/2 or USB version) is used in this 7" device: http://www.cartft.com/catalog/il/449 Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-02-18Input: remove obsolete setup parameters from input driversDmitry Torokhov1-6/+0
They have been marked as __obsolete_setup() for several years, it is time for them to go. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-02-18Input: psmouse - properly reset mouse on shutdown/suspendDmitry Torokhov1-0/+28
Some people report that they need psmouse module unloaded for suspend to ram/disk to work properly. Let's make port cleanup behave the same way as driver unload. This fixes "bad state" roblem on various HP laptops, such as nx7400. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-12-08Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov1-3/+4
Conflicts: drivers/usb/input/hid.h
2006-11-23Input: handle serio_register_driver() errorsAkinobu Mita1-2/+6
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-11-22WorkStruct: make allyesconfigDavid Howells1-3/+4
Fix up for make allyesconfig. Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-09Input: psmouse - fix attribute access on 64-bit systemsSergey Vlasov1-3/+6
psmouse_show_int_attr() and psmouse_set_int_attr() were accessing unsigned int fields as unsigned long, which gave garbage on x86_64. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-11-05Input: mice - handle errors when registering input devicesDmitry Torokhov1-25/+59
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-9/+7
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-09-19Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov1-7/+0
2006-09-10Input: constify psmouse driverHelge Deller1-18/+24
Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-08-23Input: psmouse - fix Intellimouse 4.0 initializationPozsar Balazs1-7/+0
Revert the superfluous initilization causing some mice become jumpy. Signed-off-by: Pozsar Balazs <pozsy@uhulinux.hu> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-06-26Input: psmouse - add support for Intellimouse 4.0Pozsar Balazs1-3/+30
Add support for the H-Wheel present on Microsoft Intellimouse 4.0 (AKA "tilt mouse") Signed-off-by: Pozsar Balazs <pozsy@uhulinux.hu> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-06-26Input: fix potential overflows in driver/input/mouseDmitry Torokhov1-3/+3
Change all sprintfs into snprintfs to make sure we won't stomp on data adjacent to our buffers. Noticed by Wouter Paesen <wouter@kangaroot.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-04-29Input: psmouse - fix new device detection logicDmitry Torokhov1-1/+3
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-03-13Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov1-1/+1
2006-03-10[PATCH] Input: psmouse - disable autoresyncDmitry Torokhov1-1/+1
Automatic resynchronization in psmouse driver causes problems on some hardware so disable it by default for now. People with KVM switches that require resync can still enable it via module parameter or sysfs attribute. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-19Input: psmouse - semaphore to mutex conversionIngo Molnar1-18/+20
The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-01-29Input: psmouse - set name for Genius miceDmitry Torokhov1-0/+1
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-01-14Input: psmouse - attempt to re-synchronize mouse every 5 secondsDmitry Torokhov1-64/+252
This should help driver to deal vith KVMs that reset mice when switching between boxes. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>