aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
Commit message (Collapse)AuthorAge
...
| * Driver core: change add_uevent_var to use a structKay Sievers2007-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-30
|/ | | | | | 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-18
| | | | | | | | | | 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-10
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* header cleaning: don't include smp_lock.h when not usedRandy Dunlap2007-05-08
| | | | | | | | | | | | 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-25
| | | | | | | | 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-12
| | | | | | | | | | 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-12
| | | | | | | | - 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-16
| | | | | | | 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-14
| | | | | | | | 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-07
| | | | | | | 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-07
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: do not lock device when showing name, phys and uniqDmitry Torokhov2007-02-18
| | | | | | | | 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-14
| | | | | | | | | | | | | | | | | | | | | | | | 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-12
| | | | | | | | | | | 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-02
| | | | | | | 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-14
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: remove cruft that was needed for transition to sysfsDmitry Torokhov2006-09-14
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix input module refcountingDmitry Torokhov2006-09-14
| | | | | | | | | 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-14
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: send key up events at disconnectDmitry Torokhov2006-09-10
| | | | | | | | 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-19
| | | | | | | | | | | | | | | | | 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-19
| | | | | | | | 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-15
| | | | | Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: introduce input_inject_event() functionDmitry Torokhov2006-07-06
| | | | | | | | | | 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-06
| | | | | | | | | 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-06
| | | | | | | 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-27
| | | | | | | | | 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-26
| | | | | | 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-26
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: reset name, phys and uniq when unregisteringDmitry Torokhov2006-06-26
| | | | | | | | | | 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-26
| | | | | Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: make EVIOCGSND return meaningful dataDmitry Torokhov2006-04-29
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: move input_device_id to mod_devicetable.hDmitry Torokhov2006-04-26
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: make modalias code respect allowed buffer sizeDmitry Torokhov2006-04-02
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: convert /proc handling to seq_fileDmitry Torokhov2006-04-02
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: limit attributes' output to PAGE_SIZEDmitry Torokhov2006-04-02
| | | | | | | 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>
* Manual merge with Linus.Dmitry Torokhov2006-04-02
|\ | | | | | | | | | | | | Conflicts: arch/powerpc/kernel/setup-common.c drivers/input/keyboard/hil_kbd.c drivers/input/mouse/hil_ptr.c
| * [PATCH] mark f_ops const in the inodeArjan van de Ven2006-03-28
| | | | | | | | | | | | | | | | | | | | | | Mark the f_ops members of inodes as const, as well as fix the ripple-through this causes by places that copy this f_ops and then "do stuff" with it. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | Input: input core - semaphore to mutex conversionJes Sorensen2006-02-19
|/ | | | | | | Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* [PATCH] INPUT: add MODALIAS to the event environmentKay Sievers2006-01-13
| | | | | | | input: add MODALIAS to the event environment Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Input: prepare for f_ops constnessArjan van de Ven2006-01-10
| | | | | | | | Avoid doing assignments to a live ->fops so it can be marked as 'const'. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* [PATCH] Input: add modalias supportRusty Russell2006-01-04
| | | | | | | | | | | | | | | | Here's the patch for modalias support for input classes. It uses comma-separated numbers, and doesn't describe all the potential keys (no module currently cares, and that would make the strings huge). The changes to input.h are to move the definitions needed by file2alias outside __KERNEL__. I chose not to move those definitions to mod_devicetable.h, because there are so many that it might break compile of something else in the kernel. The rest is fairly straightforward. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> CC: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] driver core: replace "hotplug" by "uevent"Kay Sievers2006-01-04
| | | | | | | | | Leave the overloaded "hotplug" word to susbsystems which are handling real devices. The driver core does not "plug" anything, it just exports the state to userspace and generates events. Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] remove CONFIG_KOBJECT_UEVENT optionKay Sievers2006-01-04
| | | | | | | | | It makes zero sense to have hotplug, but not the netlink events enabled today. Remove this option and merge the kobject_uevent.h header into the kobject.h header file. Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Input: handle failures in input_register_device()Dmitry Torokhov2005-11-20
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* [PATCH] Input: fix 'uniq' reporting in hotplug handlerDmitry Torokhov2005-11-09
| | | | | | | | Input: fix 'uniq' reporting in hotplug handler Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Input: fix input device deregistrationDmitry Torokhov2005-11-02
| | | | | | | Remove main attribute group (name, phys, uniq) when unregistering input devices. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: do not register statically allocated devicesDmitry Torokhov2005-11-02
| | | | | | | | Do not register statically allocated input devices to prevent OOPS when attaching input interfaces since it requires class device to be properly initialized. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* Input: fix input_dev registration messageDmitry Torokhov2005-10-31
| | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru>