15 Sep, 2018
1 commit
-
[ Upstream commit 100294cee9a98bfd4d6cb2d1c8a8aef0e959b0c4 ]
Some of fuzzers set panic_on_warn=1 so that they can handle WARN()ings
the same way they handle full-blown kernel crashes. We used WARN() in
input_alloc_absinfo() to get a better idea where memory allocation
failed, but since then kmalloc() and friends started dumping call stack on
memory allocation failures anyway, so we are not getting anything extra
from WARN().Because of the above, let's replace WARN with dev_err(). We use dev_err()
instead of simply removing message and relying on kcalloc() to give us
stack dump so that we'd know the instance of hardware device to which we
were trying to attach input device.Reported-by: Dmitry Vyukov
Acked-by: Dmitry Vyukov
Signed-off-by: Dmitry Torokhov
Signed-off-by: Sasha Levin
Signed-off-by: Greg Kroah-Hartman
20 Oct, 2017
2 commits
-
Let's allow matching input devices on their property bits, both in-kernel
and when generating module aliases.Tested-by: Roderick Colenbrander
Signed-off-by: Dmitry Torokhov -
Factor out and export input_match_device_id() so that modules may use it.
It will be needed by joydev to blacklist accelerometers in composite
devices.Tested-by: Roderick Colenbrander
Signed-off-by: Dmitry Torokhov
13 Jul, 2017
1 commit
-
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by work with const
attribute_group. So mark the non-const structs as const.File size before:
text data bss dec hex filename
17755 1312 16 19083 4a8b drivers/input/input.oFile size After adding 'const':
text data bss dec hex filename
17947 1120 16 19083 4a8b drivers/input/input.oSigned-off-by: Arvind Yadav
Signed-off-by: Dmitry Torokhov
11 May, 2017
3 commits
-
Instead of specifying type explicitly, derive it from the type of pointer
when allocating memory, which is considered safer practice.Signed-off-by: Markus Elfring
Signed-off-by: Dmitry Torokhov -
Use seq_puts() when printing a string which does not contain a data format
specification.Signed-off-by: Markus Elfring
Signed-off-by: Dmitry Torokhov -
Switch to using seq_putc() when printing a single character '0'.
Signed-off-by: Markus Elfring
Signed-off-by: Dmitry Torokhov
02 Feb, 2017
1 commit
-
If device is supposed to send absolute events (i.e. EV_ABS bit is set in
dev->evbit) but dev->absinfo is not allocated, then the driver has done
something wrong, and we should not register such device. Otherwise we'll
crash later, when driver tries to send absolute event.Reviewed-by: Benjamin Tissoires
Acked-by: Jiri Kosina
Signed-off-by: Dmitry Torokhov
25 Jan, 2017
1 commit
-
Declare device_type structures as const as they are only stored in the
type field of a device structure. This field is of type const, so add
const to declaration of device_type structures.File size before:
text data bss dec hex filename
17184 1344 80 18608 48b0 drivers/input/input.oFile size after:
text data bss dec hex filename
17248 1280 80 18608 48b0 drivers/input/input.oFile size before:
text data bss dec hex filename
2355 384 8 2747 abb drivers/input/rmi4/rmi_bus.oFile size after:
text data bss dec hex filename
2483 264 8 2755 ac3 drivers/input/rmi4/rmi_bus.oSigned-off-by: Bhumika Goyal
Signed-off-by: Dmitry Torokhov
20 Jul, 2016
1 commit
-
Sync up to bring in wacom_w8001 changes to avoid merge conflicts later.
20 May, 2016
1 commit
-
Commit 4369c64c79a22 ("Input: Send events one packet at a time")
significantly reduced amount of entropy input core was feeding to the rest
of the system, because only the very first event in the event block would
be used as source of entropy.With this change we will be calling add_input_randomness() for every event
that is not filtered by the input core as a duplicate. In addition, all
EV_SYN events are ignored.Acked-by: Henrik Rydberg
Acked-by: Benjamin Tissoires
Acked-by: Jiri Kosina
Signed-off-by: Dmitry Torokhov
26 Mar, 2016
1 commit
-
INPUT_COMPAT_TEST became much simpler after commit f4056b52845283
("input: redefine INPUT_COMPAT_TEST as in_compat_syscall()") so we can
cleanly eliminate it altogether.Acked-by: Dmitry Torokhov
Cc: Andy Lutomirski
Cc: Andy Lutomirski
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Oct, 2015
1 commit
-
Add new function input_enable_softrepeat() that allows drivers to
initialize their own values for input_dev->rep[REP_DELAY] and
input_dev->rep[REP_PERIOD], but also use the software autorepeat
functionality from input.c.For example, a HID driver could do:
static void xyz_input_configured(struct hid_device *hid,
struct hid_input *hidinput)
{
input_enable_softrepeat(hidinput->input, 400, 100);
}static struct hid_driver xyz_driver = {
.input_configured = xyz_input_configured,
}Signed-off-by: Petri Gynther
Signed-off-by: Dmitry Torokhov
08 Aug, 2015
1 commit
-
Do not emit EV_SYN/SYN_REPORT on suspend if there were no keys that are
still pressed as we are suspending the device (and in all other cases when
input core is forcibly releasing keys via input_dev_release_keys() call).Reviewed-by: Benson Leung
Signed-off-by: Dmitry Torokhov
26 Jun, 2015
1 commit
-
Instead of iterating over all bits in a bitmap and test them individually
let's siwtch to for_each_set_bit() which is more compact and is also
faster.Also use bitmap_weight() when counting number of set bits.
This also fixes INPUT_DO_TOGGLE() implementation as it should have used
*_CNT as the upper boundary, not *_MAX.Signed-off-by: Anshul Garg
Signed-off-by: Dmitry Torokhov
21 May, 2015
1 commit
-
Signed-off-by: Shailendra Verma
Signed-off-by: Dmitry Torokhov
09 Jan, 2015
2 commits
-
If given input handler is not a filter there is no point is iterating list
of events in a packet to see if some of them need to be filtered out.Signed-off-by: Anshul Garg
Signed-off-by: Dmitry Torokhov -
If a device does not support autorepeat or does not emit any key events we
should not be scanning all events in a packet to decide if we should start
or stop autorepeat function.Signed-off-by: Anshul Garg
Signed-off-by: Dmitry Torokhov
16 Dec, 2014
1 commit
-
This patch avoids unnecessary operations while estimating events per
packet for an input device when event type is not set.Signed-off-by: Anshul Garg
Signed-off-by: Dmitry Torokhov
03 Dec, 2014
1 commit
-
Let's initializes input_no to -1 in order to avoid extra subtraction
operation performed every time we allocate an input device.Signed-off-by: Aniroop Mathur
Signed-off-by: Dmitry Torokhov
10 Oct, 2014
1 commit
-
Fix the format string for input device name generation to avoid negative
device numbers when the id exceeds the maximum signed integer value.Signed-off-by: Richard Leitner
Signed-off-by: Dmitry Torokhov
09 Oct, 2014
1 commit
-
Let's automatically set EV_ABS bit in device's event type list when calling
input_set_abs_params() so that drivers do not have to do it explicitly.These calls are never in a hot paths so we won't lose much time by setting
the same bit several times.Reviewed-by: David Herrmann
Signed-off-by: Dmitry Torokhov
21 Jul, 2014
1 commit
-
We attempt to remove noise from coordinates reported by devices in
input_handle_abs_event(), unfortunately, unless we were dropping the
event altogether, we were ignoring the adjusted value and were passing
on the original value instead.Cc: stable@vger.kernel.org
Reviewed-by: Andrew de los Reyes
Reviewed-by: Benson Leung
Reviewed-by: David Herrmann
Reviewed-by: Henrik Rydberg
Signed-off-by: Dmitry Torokhov
24 Jan, 2014
1 commit
-
First round of input updates for 3.14.
01 Jan, 2014
1 commit
-
We need to make sure we allocate absinfo data when we are setting one of
EV_ABS/ABS_XXX capabilities, otherwise we may bomb when we try to emit this
event.Rested-by: Paul Cercueil
Signed-off-by: Dmitry Torokhov
16 Dec, 2013
1 commit
-
When waking up the platform by pressing a specific key, sending a
release on that key makes it impossible to react on the event in
user-space. This is fixed by moving the input_reset_device() call to
resume instead.[dmitry.torokhov@gmail.com: make sure we still restore LED/sound state
after resume, handle hibernation properly]Signed-off-by: Aleksej Makarov
Signed-off-by: Oskar Andero
Signed-off-by: Dmitry Torokhov
15 Nov, 2013
1 commit
-
Merge first round of changes for 3.13 merge window.
31 Oct, 2013
1 commit
-
dev->hint_events_per_packet is guaranteed to be >= packet_size.
so an extra max() call is not needed.Signed-off-by: Kang Hu
Signed-off-by: Dmitry Torokhov
06 Oct, 2013
1 commit
-
We want to allow drivers to call input_event() at any time after the
device got allocated. This means input_event() and input_register_device()
must be allowed to run in parallel.The only conflicting calls in input_register_device() are init_timer() and
dev_set_name(). Both can safely be moved to device allocation and we're
good to go.Signed-off-by: David Herrmann
Signed-off-by: Dmitry Torokhov
10 Jan, 2013
1 commit
-
Apparently some users of managed input devices are confused whether
input_unregister_device() is needed when working with them. Clarify
this in the kernel doc for devm_input_allocate_device(): in most cases
there is no need to call neither input_unregister_device() nor
input_free_device() when working with managed devices.Signed-off-by: Dmitry Torokhov
09 Nov, 2012
1 commit
-
There is a demand from driver's writers to use managed devices framework
for their drivers. Unfortunately up to this moment input devices did not
provide support for managed devices and that lead to mixing two styles
of resource management which usually introduced more bugs, such as
manually unregistering input device but relying in devres to free
interrupt handler which (unless device is properly shut off) can cause
ISR to reference already freed memory.This change introduces devm_input_allocate_device() that will allocate
managed instance of input device so that driver writers who prefer
using devm_* framework do not have to mix 2 styles.Reviewed-by: Henrik Rydberg
Reviewed-by: Tejun Heo
Signed-off-by: Dmitry Torokhov
25 Oct, 2012
1 commit
-
This fixes the following warning:
drivers/input/input.c:538:23: error: incompatible types in comparison expression (different address spaces)Signed-off-by: Dmitry Torokhov
09 Oct, 2012
1 commit
-
Extend the amount of character devices, such as eventX, mouseX and jsX,
from a hard limit of 32 per input handler to about 1024 shared across
all handlers.To be compatible with legacy installations input handlers will start
creating char devices with minors in their legacy range, however once
legacy range is exhausted they will start allocating minors from the
dynamic range 256-1024.Reviewed-by: David Herrmann
Signed-off-by: Dmitry Torokhov
02 Oct, 2012
1 commit
-
Merge Henrik's updates to multitouch code. Even though Jiri already
pulled them in I need to do it too since my changes to evdev using
dynamic major would clash with them.
20 Sep, 2012
5 commits
-
On heavy event loads, such as a multitouch driver, the irqsoff latency
can be as high as 250 us. By accumulating a frame worth of data
before passing it on, the latency can be dramatically reduced. As a
side effect, the special EV_SYN handling can be removed, since the
frame is now atomic.This patch adds the events() handler callback and uses it if it
exists. The latency is improved by 50 us even without the callback.Cc: Daniel Kurtz
Tested-by: Benjamin Tissoires
Tested-by: Ping Cheng
Tested-by: Sedat Dilek
Acked-by: Dmitry Torokhov
Signed-off-by: Henrik Rydberg -
Preparing to split event filtering and event passing, move the
autorepeat function to the point where the event is actually passed.Tested-by: Benjamin Tissoires
Tested-by: Ping Cheng
Acked-by: Dmitry Torokhov
Signed-off-by: Henrik Rydberg -
For some EV_KEY types, sending a larger-than-one value causes the
input state to oscillate. This patch makes sure this cannot happen,
clearing up the autorepeat bypass logic in the process.Tested-by: Benjamin Tissoires
Tested-by: Ping Cheng
Acked-by: Dmitry Torokhov
Signed-off-by: Henrik Rydberg -
The events-per-packet estimate has so far been used by MT devices
only. This patch adjusts the packet buffer size to also accomodate the
KEY and MSC events. Keyboards normally send one or two keys at a
time. MT devices normally send a number of button keys along with the
MT information. The buffer size chosen here covers those cases, and
matches the default buffer size in evdev. Since the input estimate is
now preferred, remove the special input-mt estimate.Reviewed-and-tested-by: Ping Cheng
Tested-by: Benjamin Tissoires
Acked-by: Dmitry Torokhov
Signed-off-by: Henrik Rydberg -
Move all MT-related things to a separate place. This saves some
bytes for non-mt input devices, and prepares for new MT features.Reviewed-and-tested-by: Benjamin Tissoires
Tested-by: Ping Cheng
Acked-by: Dmitry Torokhov
Signed-off-by: Henrik Rydberg
22 Aug, 2012
1 commit
-
MATCH_BIT() is ugly and stupid, we have much nicer bitmap_subset() which
does the same and does not hide control flow.Reported-by: Baodong Chen
Signed-off-by: Dmitry Torokhov