aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/input.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-29drivers: use non-racy method for proc entries creation (2)Denis V. Lunev1-8/+4
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 <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Peter Osterlund <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Neil Brown <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29proc: remove proc_busAlexey Dobriyan1-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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-01-31Input: constify function pointer tables (seq_operations)Jan Engelhardt1-2/+2
Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2008-01-21Input: remove cdev from input_dev structureDmitry Torokhov1-3/+0
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 <[email protected]>
2008-01-21Input: Add proper locking when changing device's keymapDmitry Torokhov1-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 <[email protected]>
2008-01-03Input: pass EV_PWR events to event handlersRichard Purdie1-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2007-12-14Input: Handle EV_PWR type of input caps in input_set_capability.Dmitry Baryshkov1-0/+4
Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2007-10-19get rid of input BIT* duplicate definesJiri Slaby1-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 <[email protected]> Cc: <[email protected]> Acked-by: Jiri Kosina <[email protected]> Cc: <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Cc: <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-13Input: use full RCU APIDmitry Torokhov1-21/+15
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 <[email protected]>
2007-10-12Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6Dmitry Torokhov1-42/+20
Conflicts: drivers/macintosh/adbhid.c
2007-10-12Driver core: change add_uevent_var to use a structKay Sievers1-42/+20
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 <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Cornelia Huck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-08-30Input: implement proper locking in input coreDmitry Torokhov1-175/+491
Also add some kerneldoc documentation to input.h Signed-off-by: Dmitry Torokhov <[email protected]>
2007-07-18Input: switch to using seq_list_xxx helpersPavel Emelianov1-25/+4
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2007-07-10Input: convert from class devices to standard devicesDmitry Torokhov1-62/+74
Signed-off-by: Dmitry Torokhov <[email protected]>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap1-1/+0
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-04-25Input: add input_set_capability() helperDmitry Torokhov1-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 <[email protected]>
2007-04-12Input: prepare to switching to struct deviceDmitry Torokhov1-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 <[email protected]>
2007-04-12Input: rework handle creation codeDmitry Torokhov1-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 <[email protected]>
2007-03-16Input: simplify input_free_device()Dmitry Torokhov1-7/+1
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 <[email protected]>
2007-03-14Input: add getkeycode and setkeycode methodsMarvin Raaijmakers1-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 <[email protected]>
2007-03-07Input: let driver core create class device attribute groupsDmitry Torokhov1-21/+8
Rely on device core to create attribute groups for input devices instead of open-coding it. Signed-off-by: Dmitry Torokhov <[email protected]>
2007-03-07Input: export 'uniq' in /proc/bus/input/devicesDmitry Torokhov1-0/+1
Signed-off-by: Dmitry Torokhov <[email protected]>
2007-02-18Input: do not lock device when showing name, phys and uniqDmitry Torokhov1-15/+2
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 <[email protected]>
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau1-1/+0
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 <[email protected]> Acked-by: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-02-12[PATCH] mark struct file_operations const 3Arjan van de Ven1-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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-11-02Input: add comments to input_{allocate|free}_device()Dmitry Torokhov1-1/+24
Hopefully this will stop people from using input_free_device() incorrectly. Signed-off-by: Dmitry Torokhov <[email protected]>
2006-09-14Input: make input_register_handler() return error codesDmitry Torokhov1-5/+7
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-09-14Input: remove cruft that was needed for transition to sysfsDmitry Torokhov1-10/+0
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-09-14Input: fix input module refcountingDmitry Torokhov1-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 <[email protected]>
2006-09-14Input: constify input coreDmitry Torokhov1-3/+4
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-09-10Input: send key up events at disconnectDmitry Torokhov1-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 <[email protected]>
2006-07-19Input: implement new force feedback interfaceAnssi Hannula1-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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2006-07-19Input: add missing handler->start() callDmitry Torokhov1-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 <[email protected]>
2006-07-15Input: fix list iteration in input_release_device()Andrew Morton1-3/+5
Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2006-07-06Input: introduce input_inject_event() functionDmitry Torokhov1-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 <[email protected]>
2006-07-06Input: add start() method to input handlersDmitry Torokhov1-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 <[email protected]>
2006-07-06Input: remove accept method from input_devDmitry Torokhov1-9/+0
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 <[email protected]>
2006-06-27Input: fix resetting name, phys and uniq when unregistering deviceDmitry Torokhov1-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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-06-26Input: rearrange exportsDmitry Torokhov1-15/+14
New style is to mark symbol as exported right after its definition. Signed-off-by: Dmitry Torokhov <[email protected]>
2006-06-26Input: fix formatting to better follow CodingStyleDmitry Torokhov1-12/+25
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-06-26Input: reset name, phys and uniq when unregisteringDmitry Torokhov1-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 <[email protected]>
2006-06-26Input: return correct size when reading modalias attributeRichard Purdie1-1/+1
Signed-off-by: Richard Purdie <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2006-04-29Input: make EVIOCGSND return meaningful dataDmitry Torokhov1-0/+3
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-04-26Input: move input_device_id to mod_devicetable.hDmitry Torokhov1-4/+4
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-04-02Input: make modalias code respect allowed buffer sizeDmitry Torokhov1-39/+71
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-04-02Input: convert /proc handling to seq_fileDmitry Torokhov1-111/+168
Signed-off-by: Dmitry Torokhov <[email protected]>
2006-04-02Input: limit attributes' output to PAGE_SIZEDmitry Torokhov1-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 <[email protected]>
2006-04-02Manual merge with Linus.Dmitry Torokhov1-1/+1
Conflicts: arch/powerpc/kernel/setup-common.c drivers/input/keyboard/hil_kbd.c drivers/input/mouse/hil_ptr.c
2006-03-28[PATCH] mark f_ops const in the inodeArjan van de Ven1-1/+1
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 <[email protected]> Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-02-19Input: input core - semaphore to mutex conversionJes Sorensen1-7/+8
Signed-off-by: Jes Sorensen <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>