Andy Whitcroft [Mon, 24 Jan 2011 17:31:38 +0000 (09:31 -0800)]
Input: sysrq - ensure sysrq_enabled and __sysrq_enabled are consistent
Currently sysrq_enabled and __sysrq_enabled are initialised separately
and inconsistently, leading to sysrq being actually enabled by reported
as not enabled in sysfs. The first change to the sysfs configurable
synchronises these two:
static int __read_mostly sysrq_enabled = 1;
static int __sysrq_enabled;
Add a common define to carry the default for these preventing them becoming
out of sync again. Default this to 1 to mirror previous behaviour.
Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: stable@kernel.org Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: gpio_keys - switch to using request_any_context_irq
The driver does not require hardirq context and can work with threaded
interrupts as well, so let's switch to request_any_context_irq which
will select the context that is available for us.
Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Mark Brown [Fri, 7 Jan 2011 07:01:03 +0000 (23:01 -0800)]
Input: cy8ctmg110_ts - Convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the cy8ctmg110_ts driver over.
Compile tested only.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Mark Brown [Fri, 7 Jan 2011 07:01:03 +0000 (23:01 -0800)]
Input: migor_ts - convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the migor_ts driver over.
Compile tested only.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Mark Brown [Fri, 7 Jan 2011 07:01:03 +0000 (23:01 -0800)]
Input: mcs5000_ts - convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the mcs5000_ts driver over.
Compile tested only.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Mark Brown [Fri, 7 Jan 2011 07:01:02 +0000 (23:01 -0800)]
Input: eeti_ts - convert to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the eeti_ts driver over.
Compile tested only by me, but Sven Neumann reports that the new code
works.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Sven Neumann <s.neumann@raumfeld.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Mark Brown [Fri, 7 Jan 2011 07:01:02 +0000 (23:01 -0800)]
Input: ad7879 - convert I2C to dev_pm_ops
There is a general move towards the use of dev_pm_ops rather than
bus specific suspend APIs as this simplifies both the bus and PM core
implementations. Convert the ad7879-ts I2C support over.
Compile tested only.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Ping Cheng [Fri, 24 Dec 2010 21:16:53 +0000 (13:16 -0800)]
Input: wacom_w8001 - support pen or touch only devices
Not all penabled devices support touch. The same holds true for touch
devices, so we should be setting up devices according to the results
returned when we query the hardware.
Andres Salomon [Thu, 23 Dec 2010 09:19:38 +0000 (01:19 -0800)]
Input: psmouse - disable the synaptics extension on OLPC machines
OLPC has switched to a Synaptics touchpad. It turns out that it's
pretty useless in absolute mode. This patch looks for an OLPC
system (via DMI tables), and refuses to init Synaptics mode in
that scenario (falling back to relative mode).
Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Henrik Rydberg [Sat, 18 Dec 2010 14:42:30 +0000 (15:42 +0100)]
Input: synaptics - ignore bogus mt packet
In multitouch mode, at least one device (fw: 7.4 id: 0x1c0b1) sometimes
sends a final main packet with x == 1. Since the normal values are above
1472, this is clearly bogus. At the same time, a two-finger touch is
signaled, even though only one finger was on the pad to begin with. This
patch ignores the packet altogether, removing the problem.
Acked-by: Chris Bagwell <chris@cnpbagwell.com> Acked-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Tue, 21 Dec 2010 17:11:25 +0000 (18:11 +0100)]
Input: synaptics - add multi-finger and semi-mt support
The Synaptics 2.7 series of touchpads support a mode for reporting two
sets of X/Y/Pressure data (advanced gesture mode). By default, these
devices report only single finger data, depriving userspace of the
nowadays ubiquitous two-finger scroll gesture.
Enabling advanced gesture mode also enables the multi-finger report,
although the device does not claim that capability. Up to three
fingers can be reported this way.
While two or three fingers are touching, the normal packet is
prepended by a reduced finger packet of lower resolution. From the two
packets (which do not represent the actual fingers), the bounding
rectangle of the individual contacts can be extracted. This
information is sufficient to perform scaling gestures and a limited
form of rotation gesture. The behavior has been coined semi-mt
capability, and is signaled to userspace via the INPUT_PROP_SEMI_MT
device property.
Work to decode the advanced gesture packet: Takashi Iwai.
Cleanup and testing of the original patch: Chase Douglas.
Minor cleanup and testing: Chris Bagwell.
Finalization and semi-mt support: Henrik Rydberg.
Reported-by: Tobyn Bertram Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Thu, 16 Dec 2010 08:52:23 +0000 (09:52 +0100)]
Input: synaptics - report clickpad property
With the new input property interface, it is possible to report the
special quirks of a device using ioctl/sysfs. This patch sets up the
device as a pointer, and reports the clickpad functionality via the
INPUT_PROP_BUTTONPAD property.
Acked-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Sat, 18 Dec 2010 19:28:26 +0000 (20:28 +0100)]
Input: fix double equality sign in uevent
Looking at the uevent stream for input devices, all properties are on
the form "A=B" except the bitmap values, which are on the form
"A==B". This bug has been around at least since 2007, and the input
uevent code has been untouched since. The recent addition of device
properties suggests this is a good time for a remedy.
Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Sat, 18 Dec 2010 19:51:13 +0000 (20:51 +0100)]
Input: introduce device properties
Today, userspace sets up an input device based on the data it emits.
This is not always enough; a tablet and a touchscreen may emit exactly
the same data, for instance, but the former should be set up with a
pointer whereas the latter does not need to. Recently, a new type of
touchpad has emerged where the buttons are under the pad, which
changes logic without changing the emitted data. This patch introduces
a new ioctl, EVIOCGPROP, which enables user access to a set of device
properties useful during setup. The properties are given as a bitmap
in the same fashion as the event types, and are also made available
via sysfs, uevent and /proc/bus/input/devices.
Acked-by: Ping Cheng <pingc@wacom.com> Acked-by: Chase Douglas <chase.douglas@canonical.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Andy Ross [Thu, 16 Dec 2010 23:53:19 +0000 (15:53 -0800)]
hid: egalax: Add support for Wetab (726b)
This patch adds support for another Wetab device (726b), and grabs it
accordingly in hid-core.
[rydberg@euromail.se: rename and log message changes] Signed-off-by: Andy Ross <andy@plausible.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Mon, 29 Nov 2010 06:27:49 +0000 (07:27 +0100)]
hid: egalax: Add support for Wetab
The Wetab tablet dual-touch controller works the same way as the one
in the Joojoo tablet. This patch adds the Wetab to the list of
supported devices, and grabs it accordingly in hid-core.
Henrik Rydberg [Mon, 6 Dec 2010 13:04:21 +0000 (14:04 +0100)]
hid: egalax: Convert to MT slots
The firmware in the joojoo reports touches sequentially, one per
report, which confuses the current driver. A further complication is
the absense of any indication of a touch frame. This patch converts
the driver to the MT slots protocol, and outputs one full touch frame
per report. This way, proper handling for both firmwares is ensured.
Tested-by: Philipp Merkel <mail@philmerk.de> Cc: Stephane Chatty <chatty@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Mon, 11 Oct 2010 19:16:43 +0000 (21:16 +0200)]
hid: egalax: Report zero as minimum pressure
The firmware reports a logical minimum of one, but in order for
userspace applications to correctly map all reported values to
non-zero pressure, the driver needs to report a logical minimum of
zero. Fixed with this patch.
Tested-by: Philipp Merkel <mail@philmerk.de> Cc: Stephane Chatty <chatty@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Mon, 6 Dec 2010 09:05:43 +0000 (10:05 +0100)]
input: mt: Add hovering distance axis
Touch devices capable of hovering, i.e., fingers detected a
distance from the surface, are not supported by the current
input MT protocol. This patch adds ABS_MT_DISTANCE, which may
be used to indicate the distance between the contact and the
surface.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Henrik Rydberg [Wed, 15 Dec 2010 12:50:34 +0000 (13:50 +0100)]
input: mt: Move tracking and pointer emulation to input-mt
The drivers using the type B protocol all report tracking information
the same way. The contact id is semantically equivalent to
ABS_MT_SLOT, and the handling of ABS_MT_TRACKING_ID only complicates
the driver. The situation can be improved upon by providing a common
pointer emulation code, thereby removing the need for the tracking id
in the driver. This patch moves all tracking event handling over to
the input core, simplifying both the existing drivers and the ones
currently in preparation.
Henrik Rydberg [Sat, 27 Nov 2010 09:50:54 +0000 (10:50 +0100)]
input: mt: Collect slots initialization code
The MT slots devices all follow the same initialization pattern
of creating slots and hinting about buffer size. Let drivers call
an initialization function instead, and make sure it can be called
repeatedly without side effects.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Tony SIM [Thu, 16 Dec 2010 07:39:25 +0000 (23:39 -0800)]
Input: add ST1232 touchscreen controller driver
This patch introduces support for Sitronix ST1232 integrated capacitive
touchscreen with LCD module. The touchscreen is multitouch capable and
can report coordinates of up to two contact points.
Signed-off-by: Tony SIM <chinyeow.sim.xt@renesas.com> Reviewed-by: Trilok Soni <tsoni@codeaurora.org> Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Wed, 15 Dec 2010 07:53:21 +0000 (23:53 -0800)]
Input: define separate EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2
The desire to keep old names for the EVIOCGKEYCODE/EVIOCSKEYCODE while
extending them to support large scancodes was a mistake. While we tried
to keep ABI intact (and we succeeded in doing that, programs compiled
on older kernels will work on newer ones) there is still a problem with
recompiling existing software with newer kernel headers.
New kernel headers will supply updated ioctl numbers and kernel will
expect that userspace will use struct input_keymap_entry to set and
retrieve keymap data. But since the names of ioctls are still the same
userspace will happily compile even if not adjusted to make use of the
new structure and will start miraculously fail in the field.
To avoid this issue let's revert EVIOCGKEYCODE/EVIOCSKEYCODE definitions
and add EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2 so that userspace can explicitly
select the style of ioctls it wants to employ.
Reviewed-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Jarod Wilson <jarod@redhat.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Gabor Juhos [Tue, 7 Dec 2010 01:14:47 +0000 (17:14 -0800)]
Input: add input driver for polled GPIO buttons
The existing gpio-keys driver can be usable only for GPIO lines with
interrupt support. Several devices have buttons connected to a GPIO
line which is not capable to generate interrupts. This patch adds a
new input driver using the generic GPIO layer and the input-polldev
to support such buttons.
[Ben Gardiner <bengardiner@nanometrics.ca: fold code to use more
of the original gpio_keys infrastructure; cleanups and other
improvements.]
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Tested-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Yan Li [Wed, 1 Dec 2010 07:51:03 +0000 (23:51 -0800)]
Input: synaptics - fix handling of 2-button ClickPads
Lenovo S10-3t's ClickPad is a 2-button ClickPad that reports BTN_LEFT
and BTN_RIGHT as normal touchpad, unlike the 1-button ClickPad used in
HP mini 210 that reports solely BTN_MIDDLE.
In 0xc0-cap response, the 1-button ClickPad has the 20-bit set while
2-button ClickPad has the 8-bit set.
This patch makes the kernel only handle 1-button ClickPad specially,
and treat 2-button ClickPad in the same fashion as regular touchpads.
This fixes kernel bug #18122 and MeeGo bug #4807.
Signed-off-by: Yan Li <yan.i.li@intel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Tue, 30 Nov 2010 07:33:04 +0000 (23:33 -0800)]
Input: document struct input_absinfo
Add documentation for struct input_absinfo that is used in EVIOCGABS
and EVIOCSABS ioctl and specify units of measure used for reporting
resolution for an axis.
Acked-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Bastien Nocera [Tue, 30 Nov 2010 07:33:05 +0000 (23:33 -0800)]
Input: add keycodes for touchpad on/off keys
Some laptops will have a "touchpad toggle" soft button, which expects
user-space to turn off the touchpad themselves, some other devices will
do this in hardware, but send key events telling us that the touchpad
has been turned off/on.
KEY_TOUCHPAD_ON/KEY_TOUCHPAD_OFF will be used by user-space to show a
popup with the status of the touchpad.
Joe Perches [Tue, 30 Nov 2010 07:33:07 +0000 (23:33 -0800)]
Input: i8042 - use pr_<level>, pr_fmt, fix dbg and __FILE__ use
Standardized message logging prefixes.
Removed \n from dbg macro, added \n to each dbg call site.
Removed direct use of __FILE__ from dbg, converted to pr_fmt(fmt)
Added non-debug printf argument verification of dbg calls
Removed "i8042.c" from printks, converted to pr_<level>
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Hemanth V [Wed, 1 Dec 2010 07:03:54 +0000 (23:03 -0800)]
Input: add CMA3000 accelerometer driver
Add support for CMA3000 Tri-axis accelerometer, which supports Motion
detect, Measurement and Free fall modes. CMA3000 supports both I2C/SPI
bus for communication, currently the driver supports I2C based
communication.
Signed-off-by: Hemanth V <hemanthv@ti.com> Reviewed-by: Jonathan Cameron <jic23@cam.ac.uk> Reviewed-by: Sergio Aguirre <saaguirre@ti.com> Reviewed-by: Shubhrajyoti <Shubhrajyoti@ti.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Mon, 22 Nov 2010 20:39:28 +0000 (12:39 -0800)]
Input: clean up Makefile (use input-core-y)
The proper way to specify multi-source object is to use <name>-y instead
of <name>-obj (which is deprecated) as it allows conditional inclusion
of modules in the list.
Jesper Juhl [Sat, 20 Nov 2010 21:36:49 +0000 (13:36 -0800)]
Input: serio HIL MLC - don't deref null, don't leak and return proper error
While reviewing various users of kernel memory allocation functions I came
across drivers/input/serio/hil_mlc.c::hil_mlc_register() and noticed that:
- it calls kzalloc() but fails to check for a NULL return before use.
- it makes several allocations and if one fails it doesn't free the
previous ones.
- It doesn't return -ENOMEM in the failed memory allocation case (it just
crashes).
This patch corrects all of the above and also reworks the only caller of
this function that I could find
(drivers/input/serio/hp_sdc_mlc.c::hp_sdc_mlc_out()) so that it now checks
the return value of hil_mlc_register() and properly propagates it on
failure and I also restructured the code to remove some labels and goto's
to make it, IMHO nicer to read.
Dmitry Torokhov [Mon, 15 Nov 2010 09:39:57 +0000 (01:39 -0800)]
Input: gameport - convert to use common workqueue instead of a thread
Instead of creating an exclusive thread to handle gameport events (which
happen rarely), let's switch to common workqueue. With the arrival
of concurrency-managed workqueue infrastructure we are not concerned
that our callers or callees also using workqueue (no deadlocks anymore)
and it should reduce total number of threads in the system.
Dmitry Torokhov [Mon, 15 Nov 2010 09:39:57 +0000 (01:39 -0800)]
Input: serio - convert to common workqueue instead of a thread
Instead of creating an exclusive thread to handle serio events (which
happen rarely), let's switch to using common workqueue. With the arrival
of concurrency-managed workqueue infrastructure we are not concerned
that our callers or callees also using workqueue (no deadlocks anymore)
and it should reduce total number of threads in the system.
Chris Leech [Thu, 18 Nov 2010 07:59:54 +0000 (23:59 -0800)]
Input: qt602240_ts - fix wrong sizeof in object table allocation
The kcalloc call for the object table is using sizeof(struct qt602240_data)
when it should be using sizeof(struct qt6602240_object), resulting in a larger
allocation than is required.
Signed-off-by: Chris Leech <christopher.leech@linux.intel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Axel Lin [Thu, 18 Nov 2010 07:59:34 +0000 (23:59 -0800)]
Input: xpad - ensure xpad->bulk_out is initialized before submitting urb
As pointed out by Oliver Neukum:
xpad->irq_in is currently submitted before xpad->bulk_out is allocated.
That however is a race, because the callback for irq_in can call
xpad360w_process_packet(), which will in turn submit the bulk URB.
This patch moves initialization for xpad->bulk_out earlier, so we can
ensure xpad->bulk_out is initialized before submitting urb.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Mon, 15 Nov 2010 21:33:25 +0000 (13:33 -0800)]
Input: aiptek - tighten up permissions on sysfs attributes
Sysfs attributes affecting device behavior should not be, by default,
world-writeable. If distributions want to allow console users access
these attributes they need to employ udev and friends to adjust
permissions as needed.
Daniel Drake [Mon, 15 Nov 2010 09:33:22 +0000 (01:33 -0800)]
Input: hgpk - recalibration tweaks
Disable the recalibration guard where new recalibrations are triggered
if we detect a packet too soon after calibrating - we found that this
results in erroneous recalibrations, and if the recalibration failed
then the rest of our badness-detection code will request another.
Add a module option disabling all of the recalibration code, in case
an OLPC deployment thinks all of the workarounds we have are doing
more damage than good and wants to experiment with them all disabled.
Based on work by Paul Fox.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Mon, 15 Nov 2010 08:23:42 +0000 (00:23 -0800)]
Input: sysrq - pass along lone Alt + SysRq
When user presses and releases Alt + SysRq without pressing any of the
hot keys re-inject the combination and pass it on to userspace instead
of suppressing it - maybe he or she wanted to take print screen
instead of invoking SysRq handler.
Also pass along release events for keys that have been pressed before
SysRq mode has been invoked so that keys do not appear to be "stuck".
Acked-by: Jason Wessel <jason.wessel@windriver.com> Tested-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Daniel Drake [Fri, 12 Nov 2010 06:20:03 +0000 (22:20 -0800)]
Input: hgpk - extend jumpiness detection
In addition to forcing recalibrations upon detection of cursor jumps (and
performing them quicker than before), detect and discard errant 'jump'
packets caused by a firmware bug, which are then repeated with each one
being approximately half the delta of the one previously (as if it is
averaging out)
Based on original work by Paul Fox.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Daniel Drake [Fri, 12 Nov 2010 06:20:02 +0000 (22:20 -0800)]
Input: hgpk - rework spew detection
The old implementation of spew detection simply tracked the overall
position delta of the cursor over every 100 packets. We found that
this causes occasional false positives in spew detection, and also
that the conditions of the spewy packets are perhaps more fixed than
we once thought.
Rework the spew detection to look for packets of specific small
delta, and only recalibrating if the overall movement delta stays
within expected bounds.
Also discard duplicate packets in the advanced mode, which appear
to be very common. If we don't, the spew detection kicks in far
too early. If we get a large spew of duplicates, request a
recalibration straight up.
Based on earlier work by Paul Fox.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Daniel Drake [Fri, 12 Nov 2010 06:19:57 +0000 (22:19 -0800)]
Input: hgpk - support GlideSensor and PenTablet modes
Add a "hgpk_mode" sysfs attribute that allows selection between 3 options:
Mouse (the existing option), GlideSensor and PenTablet.
GlideSensor is an enhanced protocol for the regular touchpad mode that
additionally reports pressure and uses absolute coordinates. We suspect
that it may be more reliable than mouse mode in some environments.
PenTablet mode puts the touchpad into resistive mode, you must then use
a stylus as an input. We suspect this is the most reliable way to drive
the touchpad.
The GlideSensor and PenTablet devices expose themselves with the
intention of being combined with the synaptics X11 input driver.
Based on earlier work by Paul Fox.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov [Tue, 9 Nov 2010 05:51:25 +0000 (21:51 -0800)]
Input: do not pass injected events back to the originating handler
Sometimes input handlers (as opposed to input devices) have a need to
inject (or re-inject) events back into input core. For example sysrq
filter may want to inject previously suppressed Alt-SysRq so that user
can take a screen print. In this case we do not want to pass such events
back to the same same handler that injected them to avoid loops.
Dan Carpenter [Thu, 11 Nov 2010 07:59:20 +0000 (23:59 -0800)]
Input: pcf8574_keypad - fix error handling in pcf8574_kp_probe
It is not allowed to call input_free_device() after calling
input_unregister_device() because input devices are refcounted and
unregister will free the device if we were holding he last referenc.
The preferred style in input/ is to make input_register_device() the
last function in the probe which can fail. That way we don't need to
call input_unregister_device().
Also do not need to call input_set_drvdata() as nothing in the driver
uses the data.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>