Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
675 mass ave cambridge ma 02139 usa
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 441 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Michael Ellerman <[email protected]> (powerpc)
Reviewed-by: Richard Fontana <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Reviewed-by: Kate Stewart <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Warning level 2 was used: -Wimplicit-fallthrough=2
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
atp_open(), atp_recover() and atp_resume() are never called in atomic
context. They call usb_submit_urb() with GFP_ATOMIC, which is not
necessary. GFP_ATOMIC can be replaced with GFP_KERNEL.
This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: Jia-Ju Bai <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Assign true or false to boolean variables instead of an integer value.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Addresses issues related to when a second finger enters or leaves the
field, causing the cursor to jump or the page to scroll unexpectedly; now,
we discard any movement change that happens at the exact moment we detect a
change in the number of fingers touching the trackpad. This doesn't
completely resolve the issue but does greatly mitigate it.
Signed-off-by: Clinton Sprain <[email protected]>
Reviewed-by: Henrik Rydberg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Use smoothed version of sensor array data to calculate movement and add
weight to prior values when calculating average. This gives more granular
and more predictable movement.
Signed-off-by: Clinton Sprain <[email protected]>
Reviewed-by: Henrik Rydberg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Let's dial back the default fuzz setting for most devices using this
driver, based on values from user feedback from forums and bug reports.
Signed-off-by: Clinton Sprain <[email protected]>
Reviewed-by: Henrik Rydberg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.
Signed-off-by: Paul Gortmaker <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
My last patch fixing up the dev_* messages caused a compiler warning
accidentally for an unused variable. Fix this up, as it was my fault.
Cc: Alessandro Rubini <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Alessandro Rubini <[email protected]>
CC: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
dbg() was a very old USB-specific macro that should no longer
be used. This patch removes it from being used in the driver
and uses dev_dbg() instead.
CC: Alessandro Rubini <[email protected]>
CC: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
We should always reference the input device for dev_err(), not the USB
device. Fix up the places where I got this wrong.
Reported-by: Dmitry Torokhov <[email protected]>
CC: Alessandro Rubini <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
err() was a very old USB-specific macro that I thought had
gone away. This patch removes it from being used in the
driver and uses dev_err() instead.
CC: Alessandro Rubini <[email protected]>
CC: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This reverts commit 04b4b88cca.
While the original problem only caused a slight disturbance on the
edge of the touchpad, the commit above to "fix" it completely breaks
operation on some other models such as mine.
We'll sort this out separately, revert the patch for now.
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
For more clearance what the functions actually do,
usb_buffer_alloc() is renamed to usb_alloc_coherent()
usb_buffer_free() is renamed to usb_free_coherent()
They should only be used in code which really needs DMA coherency.
All call sites have been changed accordingly, except for staging
drivers.
Signed-off-by: Daniel Mack <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Pedro Ribeiro <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When reading data from Geyser 2 touchpads used on post Oct 2005 Apple
PowerBooks the driver was casting X and Y coordinates values to
'signed char'. Testing on one of such PowerBooks I have noticed that
touchpad always generates positive values, but some of them are greater
that 127, and thus, when cast to 'signed char' being interpreted as
a negative.
Such bigger values have been observed infrequently, closer to the
edges of a touchpad, so the problem was not very visible.
Nevertheless, the patch would potentially improve touchpad
driver accuracy.
Signed-off-by: Vadim Zaliva <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The appletouch driver is prone to reporting multiple fingers when only
one is pressing. The appletouch driver queries an array of pressure
sensors and counts local maxima in pressure to determine the number of
fingers. It just does this on the raw values, so a data stream like:
0 100 250 300 299 300 250 100 0
actually registers as 2 fingers.
This patch updates the logic to ignore small dips in pressure that are
less than the threshold.
Signed-off-by: Jeremy Huddleston <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
CONFIG_DMA_API_DEBUG spotted an instance of appletouch using
an array on the stack as a DMA buffer for certain hardware.
Change it to use a kmalloc()ed buffer instead.
Signed-off-by: Bob Copeland <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The appletouch driver has grown up from supporting only a couple of
touchpads into supporting many touchpads, which can have different
number of sensors, different aspect ratios etc.
This patch cleans up the current driver code and makes it easy to
support the features of each different touchpad.
As a side effect, this patch also modifies the 'Y' multiplication factor
of the 'geyser3' and 'geyser4' touchpads (found on Core Duo and Core2
Duo MacBook and MacBook Pro laptops) in order to make the touchpad
output match the aspect ratio of the touchpad (Y factor changed from 43
to 64).
[[email protected]: make atp_info constant]
Signed-off-by: Stelian Pop <[email protected]>
Acked-by: Johannes Berg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Split complete function into separate functions for GEYSER1/2 and GEYSER 3/4.
Signed-off-by: Sven Anders <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
On some boxes the touchpad needs to be reinitialized after resume to make
it function again. This fixes bugzilla #10825.
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
This patch does some code cleanups in appletouch:
* useless comment removal
* make almost checkpatch clean
* make sparse clean
Signed-off-by: Sven Anders <[email protected]>
[jberg: most of the changes including removing much of the original patch]
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Fountains do not support change mode request and therefore
should be excluded from idle reset attempts.
Also:
- do not re-submit URB when we decide that touchpad needs to be
reinicialized
- do not repeat size detection when reinitializing the touchpad
- Add missing KERN_* prefixes to messages
Signed-off-by: Dmitry Torokhov <[email protected]>
Acked-by: Johannes Berg <[email protected]>
Not only Geyser 3 but also Geyser 1 need to be reset after they become
idle to stop them from needlessly waking up the kernel. Do idle reset
on all touchpads, regardless of their version - if we see 10 empty
packets the touchpad needs to be reset; good touchpads should not send
empty packets anyway.
Signed-off-by: Dmitry Torokhov <[email protected]>
Make sure we reset idlecount when we get a good (non-empty) packet.
Signed-off-by: Soeren Sonnenburg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Idle count should only be incremented when touchpad button
is not pressed, otherwise reset may happen at a wrong time
and touchpad will never report button release event.
Signed-off-by: Thomas Rohwer <[email protected]>
Acked-by: Matthew Garrett <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
The appletouch geyser3 devices found in the Intel Macs (and possibly
some later PPC ones?) send a constant stream of packets after the first
touch. This results in the kernel waking up around once every couple of
milliseconds to process them, making it almost impossible to spend any
significant amount of time in C3 state on a dynamic HZ kernel. Sending
the mode initialization code makes the device shut up until it's touched
again. This patch does so after receiving 10 packets with no interesting
content.
Signed-off-by: Soeren Sonnenburg <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
This will allow concentrating all input devices in one place
in {menu|x|q}config.
Signed-off-by: Dmitry Torokhov <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>