diff options
author | Armin Wolf <W_Armin@gmx.de> | 2025-01-13 23:13:14 +0100 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-01-15 16:26:39 +0200 |
commit | cec8c359f87c0f7c9cf63b570c0ce968b5ef62a4 (patch) | |
tree | 7f354c47bec3a01ac2295623244e02576d1239b5 /drivers/input/misc/ideapad_slidebar.c | |
parent | 1e4e3dff9e13e3d12d78cf742980ca731af80c7b (diff) |
Input: i8042 - Add support for platform filter contexts
Currently the platform filter cannot access any driver-specific state
which forces drivers installing a i8042 filter to have at least some
kind of global pointer for their filter.
Allow callers of i8042_install_filter() to submit a context pointer
which is then passed to the i8042 filter. This frees drivers from the
responsibility of having to manage this global pointer themself.
Also introduce a separate type for the i8042 filter (i8042_filter_t)
so that the function definitions can stay compact.
Tested on a Dell Inspiron 3505.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250113221314.435812-1-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/input/misc/ideapad_slidebar.c')
-rw-r--r-- | drivers/input/misc/ideapad_slidebar.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/ideapad_slidebar.c b/drivers/input/misc/ideapad_slidebar.c index f6e5fc807b4d..ab2e0a401904 100644 --- a/drivers/input/misc/ideapad_slidebar.c +++ b/drivers/input/misc/ideapad_slidebar.c @@ -121,7 +121,7 @@ static void slidebar_mode_set(u8 mode) } static bool slidebar_i8042_filter(unsigned char data, unsigned char str, - struct serio *port) + struct serio *port, void *context) { static bool extended = false; @@ -219,7 +219,7 @@ static int __init ideapad_probe(struct platform_device* pdev) input_set_capability(slidebar_input_dev, EV_ABS, ABS_X); input_set_abs_params(slidebar_input_dev, ABS_X, 0, 0xff, 0, 0); - err = i8042_install_filter(slidebar_i8042_filter); + err = i8042_install_filter(slidebar_i8042_filter, NULL); if (err) { dev_err(&pdev->dev, "Failed to install i8042 filter: %d\n", err); |