| Age | Commit message (Collapse) | Author |
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Start using __free() and guard() primitives to simplify the code and error
handling.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Start using __free(firmware) to simplify the code and error handling.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Note that callers of exc3000_vendor_data_request() always expect
response, so it was adjusted to always wait for it.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Start using __free() and guard() primitives to simplify the code
and error handling.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This makes the code more compact and error handling more robust.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Also fix the touchscreen not being marked as suspended when noone has
opened/is using it.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Guard notation simplifies code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This makes the code more compact and error handling more robust.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Start using __free() and guard() primitives to simplify the code
and error handling.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Start using __free() and guard() primitives to simplify the code
and error handling.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This makes the code more compact and error handling more robust.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This makes the code more compact and error handling more robust.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
In all cases in which a struct acpi_driver is used for binding a driver
to an ACPI device object, a corresponding platform device is created by
the ACPI core and that device is regarded as a proper representation of
underlying hardware. Accordingly, a struct platform_driver should be
used by driver code to bind to that device. There are multiple reasons
why drivers should not bind directly to ACPI device objects [1].
Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the ACPI Atlas button driver to a platform
one.
While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.
Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3429591.aeNJFYEL58@rafael.j.wysocki
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Enable doubletap functionality by default on TrackPoint devices that
support it. The feature is detected using firmware ID pattern matching
(PNP: LEN03xxx) with a deny list of incompatible devices.
This provides immediate doubletap functionality without requiring
userspace configuration. The hardware is enabled during device
detection, while event filtering continues to be handled by the
thinkpad_acpi driver as before.
Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
Suggested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20260311143144.482145-2-vishnuocv@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
|
The only user of psmouse_queue_work() and therefore kpsmoused workqueue
is psmouse-base itself, when it tries to schedule the resync work. Since
resyncing is not going to race with itself we no longer need the
dedicated ordered workqueue.
Remove it and switch to using regular (non-delayed) work structure
scheduled on the default workqueue.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Registering supplemental bare PS/2 device does not need to be ordered
relative to attempt to resynchronization done in psmouse core.
Switch to the default workqueue and use normal (non-delayed) work.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The original code uses flush_workqueue() in psmouse_disconnect() to
ensure the completion of both resync_work and dev3_register_work.
Given that alps_disconnect() already uses disable_delayed_work_sync()
to cancel dev3_register_work, replacing flush_workqueue() with
disable_delayed_work_sync(&psmouse->resync_work) is more robust
and efficient.
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://patch.msgid.link/6e40a46e5d9e6e3237702958b8f641263c28d2e4.1765939397.git.duoming@zju.edu.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The protocol flavor for ALPS touchpads found in OLPC laptops has been
broken since 2015 commit c378b5119eb0 ("Input: psmouse - factor out
common protocol probing code") that forgot to add hgpk_init() to HGPK
entry in psmouse_protocols array.
Since nobody complained for 10 years let's remove it.
Acked-by: Andres Salomon <dilinger@queued.net>
Link: https://patch.msgid.link/abC5U_JigA9TrGYu@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Sync up with the mainline to brig up the latest changes, specifically
changes to ALPS driver.
|
|
The driver currently calls device_init_wakeup() and manually toggles
IRQ wake in suspend and resume paths. This is unnecessary since the
I2C core already handles wakeup configuration when the device is
described in Device Tree with the "wakeup-source" property.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260309071413.92709-1-phucduc.bui@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Over the years we accumulated a number of formatting issues, fix them.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of using "unsigned short" and "unsigned char" for holding 16-bit
and 8-bit data, switch to using common in kernel u16 and u8.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Instead of explicitly using printk_ratelimit() switch to using
dev_warn_ratelimited().
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Annotating the temporary keymap pointer as __free(kfree) ensures that it
will get released when exiting the function and explicit freeing in all
the return paths can be removed.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The SCANCODE() macro extracts a 16-bit value (0..65535) from firmware
device property data, but atkbd_get_keymap_from_fwnode() uses it
directly to index atkbd->keycode[], which only has ATKBD_KEYMAP_SIZE
(512) elements. A firmware-supplied scancode >= 512 causes a heap
out-of-bounds write that can corrupt adjacent struct atkbd fields and
neighboring slab objects.
Add a bounds check that rejects the entire firmware keymap if any entry
contains an out-of-range scancode, consistent with the validation
performed by matrix_keypad_parse_keymap() in drivers/input/matrix-keymap.c
for the same "linux,keymap" property format. When rejected, the driver
falls back to the default keycode table.
Fixes: 9d17ad2369dc ("Input: atkbd - receive and use physcode->keycode mapping from FW")
Signed-off-by: Ariel Silver <arielsilver77@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Lock f54->data_mutex when entering the function statement since jumping
to the 'error' label when checking report_size fails causes that mutex
to be unlocked.
This bug has been detected by the Clang thread-safety checker.
Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 diagnostics")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223215118.2154194-16-bvanassche@acm.org
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Factor out column processing and eagerly skip processing columns that do
not have any changes in them.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Now that we know the upper bound for the number of columns, and know
that it is pretty small, there is no point in allocating it separately.
We are wasting more memory tracking the allocations.
Embed valid_keys and old_kb_state directly into cros_ec_keyb structure.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Introduce temporaries for event_data pointer and event_size to simplify
the code a bit.
In cros_ec_keyb_compute_valid_keys() explicitly compare with
KEY_RESERVED to make the intent of the comparison more clear.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Using the macro clarifies the code.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
In the kernel u8/u16/u32 are preferred to the uint*_t variants.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Add support for handling an Fn button and sending separate keycodes for
a subset of keys in the matrix defined in the upper half of the keymap.
Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Export input_default_setkeycode so that a driver can set a custom
setkeycode handler to take some driver specific action but still call
the default handler at some point.
Signed-off-by: Fabio Baltieri <fabiobaltieri@chromium.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260222003717.471977-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The device occasionally wakes up from suspend with missing input on the
internal keyboard and the following suspend attempt results in an instant
wake-up. The quirks fix both issues for this device.
Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Link: https://patch.msgid.link/20260223142054.50310-1-wse@tuxedocomputers.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Inline i2c_check_functionality(), which really returns a bool and not an
error code, and remove the local variable. No functional changes.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260223000308.319335-1-thorsten.blum@linux.dev
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.
As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
|
|
Mode switches sent before control response are ignored. This results in
an unresponsive trackpad and "bcm5974: bad trackpad package, length: 8"
repeated in logs.
On receiving unknown 8-byte packets, assume that mode switch was ignored
and schedule an asynchronous mode reset. The reset will switch the
device to normal mode, wait, then switch back to wellspring mode.
Signed-off-by: Liam Mitchell <mitchell.liam@gmail.com>
Link: https://lore.kernel.org/linux-input/CAOQ1CL4+DP1TuLAGNsz5GdFBTHvnTg=5q=Dr2Z1OQc6RXydSYA@mail.gmail.com/
Acked-by: Henrik Rydberg <rydberg@bitmath.org>
Link: https://patch.msgid.link/20260213-bcm5974-reset-v2-1-1837851336b0@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
The driver acquires the 'vbat' regulator during probing but never enables
it. Consequently, in the suspend method, the driver disables the regulator
without enabling it first, causing an 'Unbalanced regulator_disable()'
error.
Enable the regulator in the probe() method and add the remove() method with
regulator disabling to fix this.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Link: https://patch.msgid.link/20260215141435.727872-5-jekhor@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
If something goes wrong during calibration (for instance, if the
'enable' GPIO was not properly defined), the GO bit may not be cleared
after some time, causing the driver to get stuck.
To prevent this, add a timeout check to the waiting loop and return an
error if it times out.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Link: https://patch.msgid.link/20260215141435.727872-6-jekhor@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
|
Add ACPI ID for drv2604 haptics device found in Lenovo Yoga Book
YB1-X91L tablet.
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Link: https://patch.msgid.link/20260215141435.727872-4-jekhor@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|