summaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into nextDmitry Torokhov2008-07-211-4/+12
|\
| * Input: cdev lock_kernel() pushdownJonathan Corbet2008-06-201-4/+12
| | | | | | | | Signed-off-by: Jonathan Corbet <corbet@lwn.net>
* | Input: don't reset sync flag when ignoring eventDmitry Torokhov2008-06-301-1/+1
|/ | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* drivers: use non-racy method for proc entries creation (2)Denis V. Lunev2008-04-291-8/+4Star
| | | | | | | | | | | | | | | | | | | Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Peter Osterlund <petero2@telia.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Neil Brown <neilb@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* proc: remove proc_busAlexey Dobriyan2008-04-291-3/+3
| | | | | | | | | Remove proc_bus export and variable itself. Using pathnames works fine and is slightly more understandable and greppable. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: constify function pointer tables (seq_operations)Jan Engelhardt2008-01-311-2/+2
| | | | | Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: remove cdev from input_dev structureDmitry Torokhov2008-01-211-3/+0Star
| | | | | | | | Cdev field was obsolete and provided only for backward compatibility since conversion of input core from class devices to regular devices. It is time to remove it. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: Add proper locking when changing device's keymapDmitry Torokhov2008-01-211-6/+72
| | | | | | | Take dev->event_lock to make sure that we don't race with input_event() and also force key up event when removing a key from keymap table. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: pass EV_PWR events to event handlersRichard Purdie2008-01-031-0/+4
| | | | | | | | | | input_handle_event() used to pass EV_PWR events to event handlers but no longer does so in 2.6.23. Modules to trigger power management events based on input power events exist but rely on the EV_PWR events being passed to the input event handlers. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: Handle EV_PWR type of input caps in input_set_capability.Dmitry Baryshkov2007-12-141-0/+4
| | | | | Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* get rid of input BIT* duplicate definesJiri Slaby2007-10-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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>
* Input: use full RCU APIDmitry Torokhov2007-10-131-21/+15Star
| | | | | | | | RT guys alerted me to the fact that in their tree spinlocks are preemptible and it is better to use full RCU API (rcu_read_lock()/rcu_read_unlock()) to be safe. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov2007-10-131-42/+20Star
|\ | | | | | | | | | | Conflicts: drivers/macintosh/adbhid.c
| * Driver core: change add_uevent_var to use a structKay Sievers2007-10-121-42/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the uevent buffer functions to use a struct instead of a long list of parameters. It does no longer require the caller to do the proper buffer termination and size accounting, which is currently wrong in some places. It fixes a known bug where parts of the uevent environment are overwritten because of wrong index calculations. Many thanks to Mathieu Desnoyers for finding bugs and improving the error handling. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Input: implement proper locking in input coreDmitry Torokhov2007-08-301-175/+491
|/ | | | | | Also add some kerneldoc documentation to input.h Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: switch to using seq_list_xxx helpersPavel Emelianov2007-07-181-25/+4Star
| | | | | | | | | | This is essentially just a renaming of the existing functions as copies of seq_list_start() and seq_list_next() already existed in the input.c. Signed-off-by: Pavel Emelianov <xemul@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: convert from class devices to standard devicesDmitry Torokhov2007-07-101-62/+74
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* header cleaning: don't include smp_lock.h when not usedRandy Dunlap2007-05-081-1/+0Star
| | | | | | | | | | | | Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: add input_set_capability() helperDmitry Torokhov2007-04-251-0/+56
| | | | | | | | Add input_set_capability() helper used to indicate that an input device supports a certain event without need to manipulate bitmaps directly. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: prepare to switching to struct deviceDmitry Torokhov2007-04-121-0/+3
| | | | | | | | | | In preparation to switching to struct device and class device going away provide an alias to allow drivers that create devices to use either input_dev->cdev.dev or input_dev->dev.parent to put them into sysfs tree. The former will go away once conversion to struct device is complete. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: rework handle creation codeDmitry Torokhov2007-04-121-36/+52
| | | | | | | | - consolidate code for binding handlers to a device - return error codes from handlers connect() methods back to input core and log failures Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: simplify input_free_device()Dmitry Torokhov2007-03-161-7/+1Star
| | | | | | | Now that sysfs attributes that were marked for deletion can't access their devices we do not need to set name, phys and uniq to NULL. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: add getkeycode and setkeycode methodsMarvin Raaijmakers2007-03-151-0/+87
| | | | | | | | Allow drivers to implement their own get and set keycode methods. This will allow drivers to change their keymaps without allocating huge tables covering entire range of possible scancodes. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: let driver core create class device attribute groupsDmitry Torokhov2007-03-081-21/+8Star
| | | | | | | Rely on device core to create attribute groups for input devices instead of open-coding it. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: export 'uniq' in /proc/bus/input/devicesDmitry Torokhov2007-03-081-0/+1
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: do not lock device when showing name, phys and uniqDmitry Torokhov2007-02-181-15/+2Star
| | | | | | | | Now that sysfs attributes return -ENODEV once driver requests their removal we do not need to handle scenario when data is deleted from under our feet and can simplify the code. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* [PATCH] remove many unneeded #includes of sched.hTim Schmielau2007-02-141-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [PATCH] mark struct file_operations const 3Arjan van de Ven2007-02-121-3/+3
| | | | | | | | | | | Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Input: add comments to input_{allocate|free}_device()Dmitry Torokhov2006-11-031-1/+24
| | | | | | | Hopefully this will stop people from using input_free_device() incorrectly. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: make input_register_handler() return error codesDmitry Torokhov2006-09-141-5/+7
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: remove cruft that was needed for transition to sysfsDmitry Torokhov2006-09-141-10/+0Star
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix input module refcountingDmitry Torokhov2006-09-141-2/+2
| | | | | | | | | Now that input_free_device is basically an alias for input_put_device we need to acquire a reference to input module right when we allocate device because input_dev_release releases reference to input module unconditionally. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: constify input coreDmitry Torokhov2006-09-141-3/+4
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: send key up events at disconnectDmitry Torokhov2006-09-111-2/+5
| | | | | | | | Emit key up events for all pressed keys/buttons when disconnecting an input device. Cures "stuck" enter key effect when unloading keyboard module. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: implement new force feedback interfaceAnssi Hannula2006-07-191-0/+6
| | | | | | | | | | | | | | | | | Implement a new force feedback interface, in which all non-driver-specific operations are separated to a common module. This includes handling effect type validations, locking, etc. The effects are now file descriptor specific instead of the previous strange half-process half-fd specific behaviour. The effect memory of devices is not emptied if the root user opens and closes the device while another user is using effects. This is a minor change and most likely no force feedback aware programs are affected by this negatively. Otherwise the userspace interface is left unaltered. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: add missing handler->start() callDmitry Torokhov2006-07-191-1/+4
| | | | | | | | The start() method need to be called every time we create a new handle. This includes not only registering new devices but also when registering new handlers. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix list iteration in input_release_device()Andrew Morton2006-07-151-3/+5
| | | | | Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: introduce input_inject_event() functionDmitry Torokhov2006-07-061-0/+27
| | | | | | | | | | Create input_inject_event() function which is to be used by input handlers as opposed to input_event() which is reserved for drivers implementing input devices. The difference is that if device is "grabbed" by some process input_inject_event() will ignore events unless sent from the handle that is currently owns the device. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: add start() method to input handlersDmitry Torokhov2006-07-061-2/+10
| | | | | | | | | The new start() method is called immediately after connect() and also when "grabbed" device is released by its owner. This will allow input handlers to re-synchronize state of once-grabbed device with the rest of devices. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: remove accept method from input_devDmitry Torokhov2006-07-061-9/+0Star
| | | | | | | This method used to enforce exclusive access to iforce devices, but presenlty there are no known users of this method. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix resetting name, phys and uniq when unregistering deviceDmitry Torokhov2006-06-271-1/+2
| | | | | | | | | It should be done before calling class_device_unregister() because it will destroy the device and free memory if there are no other references to the device. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Input: rearrange exportsDmitry Torokhov2006-06-261-15/+14Star
| | | | | | New style is to mark symbol as exported right after its definition. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix formatting to better follow CodingStyleDmitry Torokhov2006-06-261-12/+25
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: reset name, phys and uniq when unregisteringDmitry Torokhov2006-06-261-1/+18
| | | | | | | | | | Name, phys and uniq are quite often constant strings in moules implementing particular input device. If a module unregisters input device and then gets unloaded, the device could still be present in memory (pinned via sysfs), but aforementioned members would point to some random memory. Set them all to NULL when unregistering so sysfs handlers won't try dereferencing them. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: return correct size when reading modalias attributeRichard Purdie2006-06-261-1/+1
| | | | | Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: make EVIOCGSND return meaningful dataDmitry Torokhov2006-04-291-0/+3
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: move input_device_id to mod_devicetable.hDmitry Torokhov2006-04-261-4/+4
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: make modalias code respect allowed buffer sizeDmitry Torokhov2006-04-021-39/+71
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: convert /proc handling to seq_fileDmitry Torokhov2006-04-021-111/+168
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: limit attributes' output to PAGE_SIZEDmitry Torokhov2006-04-021-12/+24
| | | | | | | sysfs can't handle more than PAGE_SIZE data coming from attributes' show() methods; make sure we respect this limit. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>