* Re: [PATCH] HID: hid-lenovo-go: fix LEDS dependencies
From: Jiri Kosina @ 2026-03-27 10:55 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Benjamin Tissoires, Derek J. Clark, Mark Pearson,
Mario Limonciello, Ethan Tidmore, Arnd Bergmann, Aditya Garg,
Jonathan Denose, Geert Uytterhoeven, linux-input, linux-kernel
In-Reply-To: <20260324192045.2895560-1-arnd@kernel.org>
On Tue, 24 Mar 2026, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added hid-lenovo-go and hid-lenovo-go-s drivers attempt to
> 'select LEDS_CLASS', which has a dependency on NEW_LEDS, causing a build
> failure when NEW_LEDS itself it disabled:
>
> WARNING: unmet direct dependencies detected for LEDS_CLASS
> Depends on [n]: NEW_LEDS [=n]
> Selected by [m]:
> - HID_LENOVO_GO [=m] && HID_SUPPORT [=y] && HID [=m] && USB_HID [=m]
> - HID_LENOVO_GO_S [=m] && HID_SUPPORT [=y] && HID [=m] && USB_HID [=m]
>
> WARNING: unmet direct dependencies detected for LEDS_CLASS_MULTICOLOR
> Depends on [n]: NEW_LEDS [=n] && LEDS_CLASS [=m]
> Selected by [m]:
> - HID_LENOVO_GO [=m] && HID_SUPPORT [=y] && HID [=m] && USB_HID [=m]
> - HID_LENOVO_GO_S [=m] && HID_SUPPORT [=y] && HID [=m] && USB_HID [=m]
> ERROR: modpost: "led_set_brightness_nopm" [drivers/leds/led-class.ko] undefined!
> ERROR: modpost: "led_set_brightness" [drivers/leds/led-class.ko] undefined!
> ERROR: modpost: "led_get_color_name" [drivers/leds/led-class-multicolor.ko] undefined!
> ERROR: modpost: "led_set_brightness" [drivers/leds/led-class-multicolor.ko] undefined!
>
> Device drivers generally should not select other subsystems like this, as
> that tends to cause dependency problems including loops in the dependency
> graph.
>
> Change these two and the older hid-lenovo driver to behave the same way as all
> other HID drivers and use 'depends on LEDS_CLASS' or 'depends on LEDS_CLASS_MULTICOLOR'
> instead, which itself has NEW_LEDS and LEDS_CLASS as dependencies.
>
> Fixes: a23f3497bf20 ("HID: hid-lenovo-go-s: Add Lenovo Legion Go S Series HID Driver")
> Fixes: d69ccfcbc955 ("HID: hid-lenovo-go: Add Lenovo Legion Go Series HID Driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Good catch, that escaped my attention during review. Applied to
hid.git#for-7.1/lenovo-v2, thanks Arnd!
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH v2] HID: quirks: add HID_QUIRK_ALWAYS_POLL for 8BitDo Pro 3
From: Jiri Kosina @ 2026-03-27 10:51 UTC (permalink / raw)
To: leo vriska; +Cc: linux-input, Benjamin Tissoires, linux-kernel
In-Reply-To: <20260304183727.538405-1-leo@60228.dev>
On Wed, 4 Mar 2026, leo vriska wrote:
> According to a mailing list report [1], this controller's predecessor
> has the same issue. However, it uses the xpad driver instead of HID, so
> this quirk wouldn't apply.
>
> [1]: https://lore.kernel.org/linux-input/unufo3$det$1@ciao.gmane.io/
>
> Signed-off-by: leo vriska <leo@60228.dev>
> ---
> drivers/hid/hid-ids.h | 3 +++
> drivers/hid/hid-quirks.c | 1 +
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 4ab7640b119a..8c1f41a9e5f6 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -22,6 +22,9 @@
> #define USB_DEVICE_ID_3M2256 0x0502
> #define USB_DEVICE_ID_3M3266 0x0506
>
> +#define USB_VENDOR_ID_8BITDO 0x2dc8
> +#define USB_DEVICE_ID_8BITDO_PRO_3 0x6009
> +
> #define USB_VENDOR_ID_A4TECH 0x09da
> #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006
> #define USB_DEVICE_ID_A4TECH_X5_005D 0x000a
> diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
> index 3217e436c052..f6be3ffee023 100644
> --- a/drivers/hid/hid-quirks.c
> +++ b/drivers/hid/hid-quirks.c
> @@ -25,6 +25,7 @@
> */
>
> static const struct hid_device_id hid_quirks[] = {
> + { HID_USB_DEVICE(USB_VENDOR_ID_8BITDO, USB_DEVICE_ID_8BITDO_PRO_3), HID_QUIRK_ALWAYS_POLL },
> { HID_USB_DEVICE(USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD), HID_QUIRK_BADPAD },
> { HID_USB_DEVICE(USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR), HID_QUIRK_BADPAD },
> { HID_USB_DEVICE(USB_VENDOR_ID_ADATA_XPG, USB_VENDOR_ID_ADATA_XPG_WL_GAMING_MOUSE), HID_QUIRK_ALWAYS_POLL },
Applied to hid.git#for-7.0/upstream-fixes, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: sony: add support for more instruments
From: Jiri Kosina @ 2026-03-27 10:49 UTC (permalink / raw)
To: Rosalie Wanders
Cc: Benjamin Tissoires, Sanjay Govind, Brenton Simpson, linux-input,
linux-kernel
In-Reply-To: <20260228060552.53741-2-rosalie@mailbox.org>
On Sat, 28 Feb 2026, Rosalie Wanders wrote:
> This patch adds support for the following instruments:
>
> * Rock Band 1/2/3 Wii/PS3 instruments
> * Rock Band 3 PS3 Pro instruments
> * DJ Hero Turntable
>
> Wii and PS3 instruments are the same besides the vendor and product ID.
>
> This patch also fixes the mappings for the existing Guitar Hero
> instruments.
>
> Co-developed-by: Sanjay Govind <sanjay.govind9@gmail.com>
> Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com>
> Co-developed-by: Brenton Simpson <appsforartists@google.com>
> Signed-off-by: Brenton Simpson <appsforartists@google.com>
> Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
Applied to hid.git#for-7.1/sony, thanks!
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] hid: usbhid: fix deadlock in hid_post_reset()
From: Jiri Kosina @ 2026-03-27 10:34 UTC (permalink / raw)
To: Oliver Neukum; +Cc: bentiss, linux-input, linux-usb
In-Reply-To: <20260324142507.74873-1-oneukum@suse.com>
On Tue, 24 Mar 2026, Oliver Neukum wrote:
> You can build a USB device that includes a HID component
> and a storage or UAS component. The components can be reset
> only together. That means that hid_pre_reset() and hid_post_reset()
> are in the block IO error handling. Hence no memory allocation
> used in them may do block IO because the IO can deadlock
> on the mutex held while resetting a device and calling the
> interface drivers.
> Use GFP_NOIO for all allocations in them.
>
> Fixes: dc3c78e434690 ("HID: usbhid: Check HID report descriptor contents after device reset")
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
Thanks Oliver.
Did you find this just by code inspection, or was this reported with a
real device?
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* Re: [PATCH] HID: roccat: fix use-after-free in roccat_report_event
From: Jiri Kosina @ 2026-03-27 10:28 UTC (permalink / raw)
To: FirstName LastName
Cc: Stefan Achatz, Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <20260323161107.3478633-1-bsevens@google.com>
On Mon, 23 Mar 2026, FirstName LastName wrote:
> From: Benoît Sevens <bsevens@google.com>
>
> roccat_report_event() iterates over the device->readers list without
> holding the readers_lock. This allows a concurrent roccat_release() to
> remove and free a reader while it's still being accessed, leading to a
> use-after-free.
>
> Protect the readers list traversal with the readers_lock mutex.
>
> Signed-off-by: Benoît Sevens <bsevens@google.com>
> ---
> drivers/hid/hid-roccat.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
> index fd0ea52f7cba..d6fff53d4ee7 100644
> --- a/drivers/hid/hid-roccat.c
> +++ b/drivers/hid/hid-roccat.c
> @@ -257,6 +257,7 @@ int roccat_report_event(int minor, u8 const *data)
> if (!new_value)
> return -ENOMEM;
>
> + mutex_lock(&device->readers_lock);
> mutex_lock(&device->cbuf_lock);
>
> report = &device->cbuf[device->cbuf_end];
> @@ -279,6 +280,7 @@ int roccat_report_event(int minor, u8 const *data)
> }
>
> mutex_unlock(&device->cbuf_lock);
> + mutex_unlock(&device->readers_lock);
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply
* [PATCH] input: fix missing newline in pr_err message
From: Haoyu Lu @ 2026-03-27 7:53 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, haoyu.lu
From: "haoyu.lu" <hechushiguitu666@gmail.com>
---
drivers/input/input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 7b7490a1fbc6..092c92380911 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2730,7 +2730,7 @@ static int __init input_init(void)
err = register_chrdev_region(MKDEV(INPUT_MAJOR, 0),
INPUT_MAX_CHAR_DEVICES, "input");
if (err) {
- pr_err("unable to register char major %d", INPUT_MAJOR);
+ pr_err("unable to register char major %d\n", INPUT_MAJOR);
goto fail2;
}
--
2.53.0.windows.1
^ permalink raw reply related
* [PATCH] Input: add keycodes for contextual AI usages (HUTRR119)
From: Akshai Murari @ 2026-03-27 6:54 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Dmitry Torokhov
Cc: Akshai Murari, linux-input, linux-kernel
HUTRR119 introduces new usages for keys intended to invoke AI agents
based on the current context. These are useful with the increasing
number of operating systems with integrated Large Language Models
Add new key definitions for KEY_ACTION_ON_SELECTION,
KEY_CONTEXTUAL_INSERT and KEY_CONTEXTUAL_QUERY
Signed-off-by: Akshai Murari <akshaim@google.com>
---
drivers/hid/hid-debug.c | 6 ++++++
drivers/hid/hid-input.c | 3 +++
include/uapi/linux/input-event-codes.h | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index f20dc46fd8eb..f44e6e708404 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -990,6 +990,9 @@ static const struct hid_usage_entry hid_usage_table[] = {
{ 0x0c, 0x01c9, "ALContactSync" },
{ 0x0c, 0x01ca, "ALNavigation" },
{ 0x0c, 0x01cb, "ALContextawareDesktopAssistant" },
+ { 0x0c, 0x01cc, "ALActionOnSelection" },
+ { 0x0c, 0x01cd, "ALContextualInsertion" },
+ { 0x0c, 0x01ce, "ALContextualQuery" },
{ 0x0c, 0x0200, "GenericGUIApplicationControls" },
{ 0x0c, 0x0201, "ACNew" },
{ 0x0c, 0x0202, "ACOpen" },
@@ -3375,6 +3378,9 @@ static const char *keys[KEY_MAX + 1] = {
[KEY_BRIGHTNESS_MIN] = "BrightnessMin",
[KEY_BRIGHTNESS_MAX] = "BrightnessMax",
[KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",
+ [KEY_ACTION_ON_SELECTION] = "ActionOnSelection",
+ [KEY_CONTEXTUAL_INSERT] = "ContextualInsert",
+ [KEY_CONTEXTUAL_QUERY] = "ContextualQuery",
[KEY_KBDINPUTASSIST_PREV] = "KbdInputAssistPrev",
[KEY_KBDINPUTASSIST_NEXT] = "KbdInputAssistNext",
[KEY_KBDINPUTASSIST_PREVGROUP] = "KbdInputAssistPrevGroup",
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 9475b7e9da43..e824c793f669 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1227,6 +1227,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x1bc: map_key_clear(KEY_MESSENGER); break;
case 0x1bd: map_key_clear(KEY_INFO); break;
case 0x1cb: map_key_clear(KEY_ASSISTANT); break;
+ case 0x1cc: map_key_clear(KEY_ACTION_ON_SELECTION); break;
+ case 0x1cd: map_key_clear(KEY_CONTEXTUAL_INSERT); break;
+ case 0x1ce: map_key_clear(KEY_CONTEXTUAL_QUERY); break;
case 0x201: map_key_clear(KEY_NEW); break;
case 0x202: map_key_clear(KEY_OPEN); break;
case 0x203: map_key_clear(KEY_CLOSE); break;
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 4bdb6a165987..3528168f7c6d 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -643,6 +643,10 @@
#define KEY_EPRIVACY_SCREEN_ON 0x252
#define KEY_EPRIVACY_SCREEN_OFF 0x253
+#define KEY_ACTION_ON_SELECTION 0x254 /* AL Action on Selection (HUTRR119) */
+#define KEY_CONTEXTUAL_INSERT 0x255 /* AL Contextual Insertion (HUTRR119) */
+#define KEY_CONTEXTUAL_QUERY 0x256 /* AL Contextual Query (HUTRR119) */
+
#define KEY_KBDINPUTASSIST_PREV 0x260
#define KEY_KBDINPUTASSIST_NEXT 0x261
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262
--
2.53.0.1018.g2bb0e51243-goog
^ permalink raw reply related
* Re: [PATCH 3/3] Input: snvs_pwrkey - report press event in interrupt handler
From: Frank Li @ 2026-03-26 19:57 UTC (permalink / raw)
To: Joy Zou
Cc: Dmitry Torokhov, Peng Fan, Jacky Bai, Ye Li, imx, linux-input,
linux-kernel
In-Reply-To: <20260326-pwrkey-cleanup-v1-3-d85d7c0bf275@nxp.com>
On Thu, Mar 26, 2026 at 06:39:40PM +0800, Joy Zou wrote:
> On some boards such as i.MX8MQ-EVK, the PCIe driver may take up to
> 200ms to restore the PCIe link during the no_irq resume phase. This
> causes key press events to be lost because the key may be released
> before the timer starts running, as interrupts are disabled during
> this 200ms window.
if irq disable, how imx_snvs_pwrkey_interrupt get run?
Frank
>
> Report key press events directly in interrupt handler to prevent event
> loss during system suspend.
>
> Signed-off-by: Joy Zou <joy.zou@nxp.com>
> ---
> drivers/input/keyboard/snvs_pwrkey.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index bab3ab57fdac77256be75a080773ea99372ec9c7..b557c1618d7369e872c6ce708a7b3017264ee385 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -78,6 +78,16 @@ static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void *dev_id)
>
> pm_wakeup_event(input->dev.parent, 0);
>
> + /*
> + * Report key press events directly in interrupt handler to prevent event
> + * loss during system suspend.
> + */
> + if (pdev->dev.power.is_suspended) {
> + pdata->keystate = 1;
> + input_report_key(input, pdata->keycode, 1);
> + input_sync(input);
> + }
> +
> regmap_read(pdata->snvs, SNVS_LPSR_REG, &lp_status);
> if (lp_status & SNVS_LPSR_SPO) {
> if (pdata->minor_rev == 0) {
>
> --
> 2.37.1
>
^ permalink raw reply
* Re: [PATCH 2/3] Input: snvs_pwrkey - use local device pointer avoid reference platform_device pointer every time
From: Frank Li @ 2026-03-26 19:55 UTC (permalink / raw)
To: Joy Zou
Cc: Dmitry Torokhov, Peng Fan, Jacky Bai, Ye Li, imx, linux-input,
linux-kernel
In-Reply-To: <20260326-pwrkey-cleanup-v1-2-d85d7c0bf275@nxp.com>
On Thu, Mar 26, 2026 at 06:39:39PM +0800, Joy Zou wrote:
> Make use of local struct device pointer to not dereference the
> platform_device pointer every time.
Input: snvs_pwrkey - use local device pointer to simple code
Use local struct device pointer to avoid reference the platform_device
pointer every time.
No functional change.
Frank
>
> Signed-off-by: Joy Zou <joy.zou@nxp.com>
> ---
> drivers/input/keyboard/snvs_pwrkey.c | 41 ++++++++++++++++++------------------
> 1 file changed, 21 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index 836ab94c160615f4b0f645d9b9f85d54638c2624..bab3ab57fdac77256be75a080773ea99372ec9c7 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -112,6 +112,7 @@ static void imx_snvs_pwrkey_act(void *pdata)
>
> static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> {
> + struct device *dev = &pdev->dev;
> struct pwrkey_drv_data *pdata;
> struct input_dev *input;
> struct device_node *np;
> @@ -122,33 +123,33 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> u32 vid;
>
> /* Get SNVS register Page */
> - np = pdev->dev.of_node;
> + np = dev->of_node;
> if (!np)
> - return dev_err_probe(&pdev->dev, -ENODEV, "Device tree node not found\n");
> + return dev_err_probe(dev, -ENODEV, "Device tree node not found\n");
>
> - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> return -ENOMEM;
>
> pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
> if (IS_ERR(pdata->snvs))
> - return dev_err_probe(&pdev->dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
> + return dev_err_probe(dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
>
> if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
> pdata->keycode = KEY_POWER;
> - dev_warn(&pdev->dev, "KEY_POWER without setting in dts\n");
> + dev_warn(dev, "KEY_POWER without setting in dts\n");
> }
>
> - clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
> + clk = devm_clk_get_optional_enabled(dev, NULL);
> if (IS_ERR(clk))
> - return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> + return dev_err_probe(dev, PTR_ERR(clk),
> "Failed to get snvs clock (%pe)\n", clk);
>
> pdata->wakeup = of_property_read_bool(np, "wakeup-source");
>
> pdata->irq = platform_get_irq(pdev, 0);
> if (pdata->irq < 0)
> - return dev_err_probe(&pdev->dev, -EINVAL, "Failed to get interrupt\n");
> + return dev_err_probe(dev, -EINVAL, "Failed to get interrupt\n");
>
> error = of_property_read_u32(np, "power-off-time-sec", &val);
> if (!error) {
> @@ -162,7 +163,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> bpt = (val / 5) - 1;
> break;
> default:
> - return dev_err_probe(&pdev->dev, -EINVAL,
> + return dev_err_probe(dev, -EINVAL,
> "power-off-time-sec %d out of range\n", val);
> }
>
> @@ -182,7 +183,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
>
> input = devm_input_allocate_device(&pdev->dev);
> if (!input) {
> - dev_err(&pdev->dev, "failed to allocate the input device\n");
> + dev_err(dev, "failed to allocate the input device\n");
> return -ENOMEM;
> }
>
> @@ -193,27 +194,27 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> input_set_capability(input, EV_KEY, pdata->keycode);
>
> /* input customer action to cancel release timer */
> - error = devm_add_action(&pdev->dev, imx_snvs_pwrkey_act, pdata);
> + error = devm_add_action(dev, imx_snvs_pwrkey_act, pdata);
> if (error)
> - return dev_err_probe(&pdev->dev, error, "failed to register remove action\n");
> + return dev_err_probe(dev, error, "failed to register remove action\n");
>
> pdata->input = input;
> platform_set_drvdata(pdev, pdata);
>
> - error = devm_request_irq(&pdev->dev, pdata->irq,
> - imx_snvs_pwrkey_interrupt,
> - 0, pdev->name, pdev);
> + error = devm_request_irq(dev, pdata->irq,
> + imx_snvs_pwrkey_interrupt,
> + 0, pdev->name, pdev);
> if (error)
> - return dev_err_probe(&pdev->dev, error, "interrupt not available.\n");
> + return dev_err_probe(dev, error, "interrupt not available.\n");
>
> error = input_register_device(input);
> if (error < 0)
> - return dev_err_probe(&pdev->dev, error, "failed to register input device\n");
> + return dev_err_probe(dev, error, "failed to register input device\n");
>
> - device_init_wakeup(&pdev->dev, pdata->wakeup);
> - error = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
> + device_init_wakeup(dev, pdata->wakeup);
> + error = dev_pm_set_wake_irq(dev, pdata->irq);
> if (error)
> - dev_err(&pdev->dev, "irq wake enable failed.\n");
> + dev_err(dev, "irq wake enable failed.\n");
>
> return 0;
> }
>
> --
> 2.37.1
>
^ permalink raw reply
* Re: [PATCH 1/3] Input: snvs_pwrkey - make use of dev_err_probe()
From: Frank Li @ 2026-03-26 19:51 UTC (permalink / raw)
To: Joy Zou
Cc: Dmitry Torokhov, Peng Fan, Jacky Bai, Ye Li, imx, linux-input,
linux-kernel
In-Reply-To: <20260326-pwrkey-cleanup-v1-1-d85d7c0bf275@nxp.com>
On Thu, Mar 26, 2026 at 06:39:38PM +0800, Joy Zou wrote:
> Add dev_err_probe() at return path of probe() to support users to
> identify issues easier.
>
> Signed-off-by: Joy Zou <joy.zou@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/input/keyboard/snvs_pwrkey.c | 40 ++++++++++++++----------------------
> 1 file changed, 15 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> index 954055aaf6e29527f22f8129fd47ca17722e2bc9..836ab94c160615f4b0f645d9b9f85d54638c2624 100644
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
> @@ -124,17 +124,15 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> /* Get SNVS register Page */
> np = pdev->dev.of_node;
> if (!np)
> - return -ENODEV;
> + return dev_err_probe(&pdev->dev, -ENODEV, "Device tree node not found\n");
>
> pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> return -ENOMEM;
>
> pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
> - if (IS_ERR(pdata->snvs)) {
> - dev_err(&pdev->dev, "Can't get snvs syscon\n");
> - return PTR_ERR(pdata->snvs);
> - }
> + if (IS_ERR(pdata->snvs))
> + return dev_err_probe(&pdev->dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
>
> if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
> pdata->keycode = KEY_POWER;
> @@ -142,16 +140,15 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> }
>
> clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
> - if (IS_ERR(clk)) {
> - dev_err(&pdev->dev, "Failed to get snvs clock (%pe)\n", clk);
> - return PTR_ERR(clk);
> - }
> + if (IS_ERR(clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> + "Failed to get snvs clock (%pe)\n", clk);
>
> pdata->wakeup = of_property_read_bool(np, "wakeup-source");
>
> pdata->irq = platform_get_irq(pdev, 0);
> if (pdata->irq < 0)
> - return -EINVAL;
> + return dev_err_probe(&pdev->dev, -EINVAL, "Failed to get interrupt\n");
>
> error = of_property_read_u32(np, "power-off-time-sec", &val);
> if (!error) {
> @@ -165,9 +162,8 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> bpt = (val / 5) - 1;
> break;
> default:
> - dev_err(&pdev->dev,
> - "power-off-time-sec %d out of range\n", val);
> - return -EINVAL;
> + return dev_err_probe(&pdev->dev, -EINVAL,
> + "power-off-time-sec %d out of range\n", val);
> }
>
> regmap_update_bits(pdata->snvs, SNVS_LPCR_REG, SNVS_LPCR_BPT_MASK,
> @@ -198,10 +194,8 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
>
> /* input customer action to cancel release timer */
> error = devm_add_action(&pdev->dev, imx_snvs_pwrkey_act, pdata);
> - if (error) {
> - dev_err(&pdev->dev, "failed to register remove action\n");
> - return error;
> - }
> + if (error)
> + return dev_err_probe(&pdev->dev, error, "failed to register remove action\n");
>
> pdata->input = input;
> platform_set_drvdata(pdev, pdata);
> @@ -209,16 +203,12 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> error = devm_request_irq(&pdev->dev, pdata->irq,
> imx_snvs_pwrkey_interrupt,
> 0, pdev->name, pdev);
> - if (error) {
> - dev_err(&pdev->dev, "interrupt not available.\n");
> - return error;
> - }
> + if (error)
> + return dev_err_probe(&pdev->dev, error, "interrupt not available.\n");
>
> error = input_register_device(input);
> - if (error < 0) {
> - dev_err(&pdev->dev, "failed to register input device\n");
> - return error;
> - }
> + if (error < 0)
> + return dev_err_probe(&pdev->dev, error, "failed to register input device\n");
>
> device_init_wakeup(&pdev->dev, pdata->wakeup);
> error = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
>
> --
> 2.37.1
>
^ permalink raw reply
* [dtor-input:next] BUILD SUCCESS 79df764dbecd5c4bf1b1431b865a361ce7bebb2d
From: kernel test robot @ 2026-03-26 16:57 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
branch HEAD: 79df764dbecd5c4bf1b1431b865a361ce7bebb2d Input: zinitix - use guard notation when acquiring mutex
elapsed time: 1313m
configs tested: 186
configs skipped: 10
The following configs have been built successfully.
More configs may be tested in the coming days.
tested configs:
alpha allnoconfig gcc-15.2.0
alpha allyesconfig gcc-15.2.0
alpha defconfig gcc-15.2.0
arc allmodconfig clang-16
arc allmodconfig gcc-15.2.0
arc allnoconfig gcc-15.2.0
arc allyesconfig clang-23
arc allyesconfig gcc-15.2.0
arc defconfig gcc-15.2.0
arc randconfig-001-20260326 gcc-8.5.0
arc randconfig-002-20260326 gcc-8.5.0
arm allnoconfig clang-23
arm allnoconfig gcc-15.2.0
arm allyesconfig clang-16
arm allyesconfig gcc-15.2.0
arm defconfig gcc-15.2.0
arm keystone_defconfig gcc-15.2.0
arm randconfig-001-20260326 gcc-8.5.0
arm randconfig-002-20260326 gcc-8.5.0
arm randconfig-003-20260326 gcc-8.5.0
arm randconfig-004-20260326 gcc-8.5.0
arm64 allmodconfig clang-23
arm64 allnoconfig gcc-15.2.0
arm64 defconfig gcc-15.2.0
arm64 randconfig-001-20260326 clang-19
arm64 randconfig-002-20260326 clang-19
arm64 randconfig-003-20260326 clang-19
arm64 randconfig-004-20260326 clang-19
csky allmodconfig gcc-15.2.0
csky allnoconfig gcc-15.2.0
csky defconfig gcc-15.2.0
csky randconfig-001-20260326 clang-19
csky randconfig-002-20260326 clang-19
hexagon allmodconfig gcc-15.2.0
hexagon allnoconfig clang-23
hexagon allnoconfig gcc-15.2.0
hexagon defconfig gcc-15.2.0
hexagon randconfig-001-20260326 gcc-8.5.0
hexagon randconfig-002-20260326 gcc-8.5.0
i386 allmodconfig clang-20
i386 allmodconfig gcc-14
i386 allnoconfig gcc-14
i386 allnoconfig gcc-15.2.0
i386 allyesconfig clang-20
i386 allyesconfig gcc-14
i386 buildonly-randconfig-001-20260326 gcc-14
i386 buildonly-randconfig-002-20260326 gcc-14
i386 buildonly-randconfig-003-20260326 gcc-14
i386 buildonly-randconfig-004-20260326 gcc-14
i386 buildonly-randconfig-005-20260326 gcc-14
i386 buildonly-randconfig-006-20260326 gcc-14
i386 defconfig gcc-15.2.0
i386 randconfig-001-20260326 gcc-14
i386 randconfig-002-20260326 gcc-14
i386 randconfig-003-20260326 gcc-14
i386 randconfig-004-20260326 gcc-14
i386 randconfig-005-20260326 gcc-14
i386 randconfig-006-20260326 gcc-14
i386 randconfig-007-20260326 gcc-14
i386 randconfig-011-20260326 clang-20
i386 randconfig-012-20260326 clang-20
i386 randconfig-013-20260326 clang-20
i386 randconfig-014-20260326 clang-20
i386 randconfig-015-20260326 clang-20
i386 randconfig-016-20260326 clang-20
i386 randconfig-017-20260326 clang-20
loongarch allmodconfig clang-23
loongarch allnoconfig clang-23
loongarch allnoconfig gcc-15.2.0
loongarch defconfig clang-19
loongarch randconfig-001-20260326 gcc-8.5.0
loongarch randconfig-002-20260326 gcc-8.5.0
m68k allmodconfig gcc-15.2.0
m68k allnoconfig gcc-15.2.0
m68k allyesconfig clang-16
m68k allyesconfig gcc-15.2.0
m68k defconfig clang-19
m68k q40_defconfig gcc-15.2.0
microblaze allnoconfig gcc-15.2.0
microblaze allyesconfig gcc-15.2.0
microblaze defconfig clang-19
mips allmodconfig gcc-15.2.0
mips allnoconfig gcc-15.2.0
mips allyesconfig gcc-15.2.0
mips ip30_defconfig gcc-15.2.0
nios2 allmodconfig clang-23
nios2 allmodconfig gcc-11.5.0
nios2 allnoconfig clang-23
nios2 defconfig clang-19
nios2 randconfig-001-20260326 gcc-8.5.0
nios2 randconfig-002-20260326 gcc-8.5.0
openrisc allmodconfig clang-23
openrisc allmodconfig gcc-15.2.0
openrisc allnoconfig clang-23
openrisc defconfig gcc-15.2.0
parisc allmodconfig gcc-15.2.0
parisc allnoconfig clang-23
parisc allyesconfig clang-19
parisc allyesconfig gcc-15.2.0
parisc defconfig gcc-15.2.0
parisc randconfig-001-20260326 clang-19
parisc randconfig-002-20260326 clang-19
parisc64 defconfig clang-19
powerpc allmodconfig gcc-15.2.0
powerpc allnoconfig clang-23
powerpc randconfig-001-20260326 clang-19
powerpc randconfig-002-20260326 clang-19
powerpc64 randconfig-001-20260326 clang-19
powerpc64 randconfig-002-20260326 clang-19
riscv allmodconfig clang-23
riscv allnoconfig clang-23
riscv allyesconfig clang-16
riscv defconfig gcc-15.2.0
riscv randconfig-001-20260326 clang-23
riscv randconfig-002-20260326 clang-23
s390 allmodconfig clang-18
s390 allmodconfig clang-19
s390 allnoconfig clang-23
s390 allyesconfig gcc-15.2.0
s390 defconfig gcc-15.2.0
s390 randconfig-001-20260326 clang-23
s390 randconfig-002-20260326 clang-23
sh allmodconfig gcc-15.2.0
sh allnoconfig clang-23
sh allyesconfig clang-19
sh allyesconfig gcc-15.2.0
sh defconfig gcc-14
sh randconfig-001-20260326 clang-23
sh randconfig-002-20260326 clang-23
sparc allnoconfig clang-23
sparc defconfig gcc-15.2.0
sparc randconfig-001-20260326 gcc-14
sparc randconfig-002-20260326 gcc-14
sparc64 allmodconfig clang-23
sparc64 defconfig gcc-14
sparc64 randconfig-001-20260326 gcc-14
sparc64 randconfig-002-20260326 gcc-14
um allmodconfig clang-19
um allnoconfig clang-23
um allyesconfig gcc-14
um allyesconfig gcc-15.2.0
um defconfig gcc-14
um i386_defconfig gcc-14
um randconfig-001-20260326 gcc-14
um randconfig-002-20260326 gcc-14
um x86_64_defconfig gcc-14
x86_64 allmodconfig clang-20
x86_64 allnoconfig clang-23
x86_64 allyesconfig clang-20
x86_64 buildonly-randconfig-001-20260326 clang-20
x86_64 buildonly-randconfig-002-20260326 clang-20
x86_64 buildonly-randconfig-003-20260326 clang-20
x86_64 buildonly-randconfig-004-20260326 clang-20
x86_64 buildonly-randconfig-005-20260326 clang-20
x86_64 buildonly-randconfig-006-20260326 clang-20
x86_64 defconfig gcc-14
x86_64 kexec clang-20
x86_64 randconfig-001-20260326 clang-20
x86_64 randconfig-002-20260326 clang-20
x86_64 randconfig-003-20260326 clang-20
x86_64 randconfig-004-20260326 clang-20
x86_64 randconfig-005-20260326 clang-20
x86_64 randconfig-006-20260326 clang-20
x86_64 randconfig-011-20260326 gcc-14
x86_64 randconfig-012-20260326 gcc-14
x86_64 randconfig-013-20260326 gcc-14
x86_64 randconfig-014-20260326 gcc-14
x86_64 randconfig-015-20260326 gcc-14
x86_64 randconfig-016-20260326 gcc-14
x86_64 randconfig-071-20260326 gcc-14
x86_64 randconfig-072-20260326 gcc-14
x86_64 randconfig-073-20260326 gcc-14
x86_64 randconfig-074-20260326 gcc-14
x86_64 randconfig-075-20260326 gcc-14
x86_64 randconfig-076-20260326 gcc-14
x86_64 rhel-9.4 clang-20
x86_64 rhel-9.4-bpf gcc-14
x86_64 rhel-9.4-func clang-20
x86_64 rhel-9.4-kselftests clang-20
x86_64 rhel-9.4-kunit gcc-14
x86_64 rhel-9.4-ltp gcc-14
x86_64 rhel-9.4-rust clang-20
xtensa allnoconfig clang-23
xtensa allyesconfig clang-23
xtensa randconfig-001-20260326 gcc-14
xtensa randconfig-002-20260326 gcc-14
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH] HID: cherry: Fix switch case formatting
From: Benjamin Tissoires @ 2026-03-26 16:35 UTC (permalink / raw)
To: aravindanilraj0702; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <20260325161328.260110-1-aravindanilraj0702@gmail.com>
On Mar 25 2026, aravindanilraj0702@gmail.com wrote:
> From: Aravind Anilraj <aravindanilraj0702@gmail.com>
>
> Fix checkpatch warnings by splitting single-line case
> statements into multiple lines.
>
> No functional changes.
>
> Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com>
> ---
> drivers/hid/hid-cherry.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hid/hid-cherry.c b/drivers/hid/hid-cherry.c
> index a504632febfc..828a3cc67512 100644
> --- a/drivers/hid/hid-cherry.c
> +++ b/drivers/hid/hid-cherry.c
> @@ -43,9 +43,15 @@ static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> return 0;
>
> switch (usage->hid & HID_USAGE) {
> - case 0x301: ch_map_key_clear(KEY_PROG1); break;
> - case 0x302: ch_map_key_clear(KEY_PROG2); break;
> - case 0x303: ch_map_key_clear(KEY_PROG3); break;
> + case 0x301:
> + ch_map_key_clear(KEY_PROG1);
> + break;
> + case 0x302:
> + ch_map_key_clear(KEY_PROG2);
> + break;
> + case 0x303:
> + ch_map_key_clear(KEY_PROG3);
> + break;
Nack: please don't run checkpatch on existing and already merged code.
This comment is valid for all the other similar patches you sent today.
There are many reasons to refuse such a patch, but mostly it's just
pointless and makes looking into the history harder.
If you fix something in the code, then yes, you can also make formatting
fixes, but formatting for just fomratting is going to be rejected in all
subsystems you attempt to contribute to.
Cheers,
Benjamin
> default:
> return 0;
> }
> --
> 2.47.3
>
>
^ permalink raw reply
* [PATCH] HID: sunplus: Split switch case statements
From: aravindanilraj0702 @ 2026-03-26 16:21 UTC (permalink / raw)
To: jikos, bentiss; +Cc: linux-input, linux-kernel, Aravind Anilraj
From: Aravind Anilraj <aravindanilraj0702@gmail.com>
Split single-line case statements into multiple lines to improve
readability and conform to kernal coding style.
No functional changes.
Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com>
---
drivers/hid/hid-sunplus.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-sunplus.c b/drivers/hid/hid-sunplus.c
index 64e4cff8ca1d..a1703f6dc727 100644
--- a/drivers/hid/hid-sunplus.c
+++ b/drivers/hid/hid-sunplus.c
@@ -40,8 +40,12 @@ static int sp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x2003: sp_map_key_clear(KEY_ZOOMIN); break;
- case 0x2103: sp_map_key_clear(KEY_ZOOMOUT); break;
+ case 0x2003:
+ sp_map_key_clear(KEY_ZOOMIN);
+ break;
+ case 0x2103:
+ sp_map_key_clear(KEY_ZOOMOUT);
+ break;
default:
return 0;
}
--
2.47.3
^ permalink raw reply related
* [PATCH] HID: belkin: Split switch case statement
From: aravindanilraj0702 @ 2026-03-26 16:00 UTC (permalink / raw)
To: jikos, bentiss; +Cc: linux-input, linux-kernel, Aravind Anilraj
From: Aravind Anilraj <aravindanilraj0702@gmail.com>
Split a single-line case statement into multiple lines to improve
readability and conform to kernel coding style.
No functional changes.
Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com>
---
drivers/hid/hid-belkin.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-belkin.c b/drivers/hid/hid-belkin.c
index 75aaed35ee9f..61fdcfac3219 100644
--- a/drivers/hid/hid-belkin.c
+++ b/drivers/hid/hid-belkin.c
@@ -34,9 +34,15 @@ static int belkin_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x03a: belkin_map_key_clear(KEY_SOUND); break;
- case 0x03b: belkin_map_key_clear(KEY_CAMERA); break;
- case 0x03c: belkin_map_key_clear(KEY_DOCUMENTS); break;
+ case 0x03a:
+ belkin_map_key_clear(KEY_SOUND);
+ break;
+ case 0x03b:
+ belkin_map_key_clear(KEY_CAMERA);
+ break;
+ case 0x03c:
+ belkin_map_key_clear(KEY_DOCUMENTS);
+ break;
default:
return 0;
}
--
2.47.3
^ permalink raw reply related
* [PATCH] HID: kensington: fix trailing statements in switch cases
From: aravindanilraj0702 @ 2026-03-26 15:29 UTC (permalink / raw)
To: jikos, bentiss; +Cc: linux-input, linux-kernel, Aravind Anilraj
From: Aravind Anilraj <aravindanilraj0702@gmail.com>
Split single-line case statements into multiple lines to comply with
kernel coding style guidelines.
No functional changes are done
Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com>
---
drivers/hid/hid-kensington.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-kensington.c b/drivers/hid/hid-kensington.c
index 16839027981f..e838dc0c9a8a 100644
--- a/drivers/hid/hid-kensington.c
+++ b/drivers/hid/hid-kensington.c
@@ -25,8 +25,12 @@ static int ks_input_mapping(struct hid_device *hdev, struct hid_input *hi,
return 0;
switch (usage->hid & HID_USAGE) {
- case 0x01: ks_map_key(BTN_MIDDLE); break;
- case 0x02: ks_map_key(BTN_SIDE); break;
+ case 0x01:
+ ks_map_key(BTN_MIDDLE);
+ break;
+ case 0x02:
+ ks_map_key(BTN_SIDE);
+ break;
default:
return 0;
}
--
2.47.3
^ permalink raw reply related
* Re: [PATCH v3] dt-bindings: input: touchscreen: ti,tsc2005: Add wakeup-source
From: Rob Herring @ 2026-03-26 14:15 UTC (permalink / raw)
To: phucduc.bui
Cc: conor+dt, krzk+dt, conor, devicetree, dmitry.torokhov, krzk,
linux-input, linux-kernel, marex, mingo, tglx
In-Reply-To: <20260318083124.21793-1-phucduc.bui@gmail.com>
On Wed, Mar 18, 2026 at 03:31:24PM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Document the "wakeup-source" property for the ti,tsc2005 touchscreen
> controllers to allow the device to wake the system from suspend.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>
> changes:
> v3: Remove blank lines
> v2: Revise the commit content and remove patch1 related to I2C and SPI
> wakeup handling
>
> .../devicetree/bindings/input/touchscreen/ti,tsc2005.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml
> index 7187c390b2f5..a9842509c1fe 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2005.yaml
> @@ -55,6 +55,9 @@ properties:
> touchscreen-size-x: true
> touchscreen-size-y: true
>
> + wakeup-source:
> + type: boolean
wakeup-source already has a defined type.
wakeup-source: true
> +
> allOf:
> - $ref: touchscreen.yaml#
> - if:
> @@ -97,6 +100,7 @@ examples:
>
> ti,x-plate-ohms = <280>;
> ti,esd-recovery-timeout-ms = <8000>;
> + wakeup-source;
> };
> };
> - |
> @@ -124,5 +128,6 @@ examples:
>
> ti,x-plate-ohms = <280>;
> ti,esd-recovery-timeout-ms = <8000>;
> + wakeup-source;
> };
> };
> --
> 2.43.0
>
^ permalink raw reply
* [PATCH v2] HID: wiimote: Fix table layout and whitespace errors
From: J. Neuschäfer via B4 Relay @ 2026-03-26 14:03 UTC (permalink / raw)
To: David Rheinsberg, Jiri Kosina, Benjamin Tissoires, Bogdan Petru,
Joshua Jun
Cc: linux-input, linux-kernel, J. Neuschäfer
From: "J. Neuschäfer" <j.ne@posteo.net>
Some tab characters snuck into the data layout table for turntable
extensions, which resulted in the table only looking right at a tabstop
of 4, which is uncommon in the kernel. Change them to the equivalent
amount of spaces, which should look correct in any editor.
While at it, also fix the other whitespace errors (trailing spaces at
end of line) introduced in the same commit.
Fixes: 05086f3db530b3 ("HID: wiimote: Add support for the DJ Hero turntable")
Reviewed-by: David Rheinsberg <david@readahead.eu>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
---
Changes in v2:
- also fix the other whitespace errors in the file
(suggested by David Rheinsberg <david@readahead.eu>)
- add Reviewed-by
- Link to v1: https://lore.kernel.org/r/20260316-wiimod-table-v1-1-c1f91be05137@posteo.net
---
drivers/hid/hid-wiimote-modules.c | 58 +++++++++++++++++++--------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/hid/hid-wiimote-modules.c b/drivers/hid/hid-wiimote-modules.c
index dbccdfa6391672..dccb78bb3afd61 100644
--- a/drivers/hid/hid-wiimote-modules.c
+++ b/drivers/hid/hid-wiimote-modules.c
@@ -2403,7 +2403,7 @@ static const struct wiimod_ops wiimod_guitar = {
.in_ext = wiimod_guitar_in_ext,
};
-/*
+/*
* Turntable
* DJ Hero came with a Turntable Controller that was plugged in
* as an extension.
@@ -2439,15 +2439,15 @@ static const __u16 wiimod_turntable_map[] = {
static void wiimod_turntable_in_ext(struct wiimote_data *wdata, const __u8 *ext)
{
__u8 be, cs, sx, sy, ed, rtt, rbg, rbr, rbb, ltt, lbg, lbr, lbb, bp, bm;
- /*
+ /*
* Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
*------+------+-----+-----+-----+-----+------+------+--------+
- * 0 | RTT<4:3> | SX <5:0> |
- * 1 | RTT<2:1> | SY <5:0> |
+ * 0 | RTT<4:3> | SX <5:0> |
+ * 1 | RTT<2:1> | SY <5:0> |
*------+------+-----+-----+-----+-----+------+------+--------+
* 2 |RTT<0>| ED<4:3> | CS<3:0> | RTT<5> |
*------+------+-----+-----+-----+-----+------+------+--------+
- * 3 | ED<2:0> | LTT<4:0> |
+ * 3 | ED<2:0> | LTT<4:0> |
*------+------+-----+-----+-----+-----+------+------+--------+
* 4 | 0 | 0 | LBR | B- | 0 | B+ | RBR | LTT<5> |
*------+------+-----+-----+-----+-----+------+------+--------+
@@ -2458,20 +2458,20 @@ static void wiimod_turntable_in_ext(struct wiimote_data *wdata, const __u8 *ext)
* With Motion+ enabled, it will look like this:
* Byte | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
*------+------+-----+-----+-----+-----+------+------+--------+
- * 1 | RTT<4:3> | SX <5:1> | 0 |
- * 2 | RTT<2:1> | SY <5:1> | 0 |
+ * 1 | RTT<4:3> | SX <5:1> | 0 |
+ * 2 | RTT<2:1> | SY <5:1> | 0 |
*------+------+-----+-----+-----+-----+------+------+--------+
* 3 |RTT<0>| ED<4:3> | CS<3:0> | RTT<5> |
*------+------+-----+-----+-----+-----+------+------+--------+
- * 4 | ED<2:0> | LTT<4:0> |
+ * 4 | ED<2:0> | LTT<4:0> |
*------+------+-----+-----+-----+-----+------+------+--------+
* 5 | 0 | 0 | LBR | B- | 0 | B+ | RBR | XXXX |
*------+------+-----+-----+-----+-----+------+------+--------+
* 6 | LBB | 0 | RBG | BE | LBG | RBB | XXXX | XXXX |
*------+------+-----+-----+-----+-----+------+------+--------+
*/
-
- be = !(ext[5] & 0x10);
+
+ be = !(ext[5] & 0x10);
cs = ((ext[2] & 0x1e));
sx = ext[0] & 0x3f;
sy = ext[1] & 0x3f;
@@ -2499,32 +2499,32 @@ static void wiimod_turntable_in_ext(struct wiimote_data *wdata, const __u8 *ext)
input_report_abs(wdata->extension.input, ABS_HAT1X, ltt);
input_report_abs(wdata->extension.input, ABS_HAT2X, cs);
input_report_abs(wdata->extension.input, ABS_HAT3X, ed);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_G_RIGHT],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_G_RIGHT],
rbg);
input_report_key(wdata->extension.input,
wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_R_RIGHT],
rbr);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_B_RIGHT],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_B_RIGHT],
rbb);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_G_LEFT],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_G_LEFT],
lbg);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_R_LEFT],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_R_LEFT],
lbr);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_B_LEFT],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_B_LEFT],
lbb);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_EUPHORIA],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_EUPHORIA],
be);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_PLUS],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_PLUS],
bp);
- input_report_key(wdata->extension.input,
- wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_MINUS],
+ input_report_key(wdata->extension.input,
+ wiimod_turntable_map[WIIMOD_TURNTABLE_KEY_MINUS],
bm);
input_sync(wdata->extension.input);
@@ -2557,7 +2557,7 @@ static void wiimod_turntable_close(struct input_dev *dev)
static int wiimod_turntable_probe(const struct wiimod_ops *ops,
struct wiimote_data *wdata)
{
- int ret, i;
+ int ret, i;
wdata->extension.input = input_allocate_device();
if (!wdata->extension.input)
@@ -2594,9 +2594,9 @@ static int wiimod_turntable_probe(const struct wiimod_ops *ops,
input_set_abs_params(wdata->extension.input,
ABS_HAT1X, -8, 8, 0, 0);
input_set_abs_params(wdata->extension.input,
- ABS_HAT2X, 0, 31, 1, 1);
+ ABS_HAT2X, 0, 31, 1, 1);
input_set_abs_params(wdata->extension.input,
- ABS_HAT3X, 0, 7, 0, 0);
+ ABS_HAT3X, 0, 7, 0, 0);
ret = input_register_device(wdata->extension.input);
if (ret)
goto err_free;
---
base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c
change-id: 20260316-wiimod-table-cd9abc0a2a98
Best regards,
--
J. Neuschäfer <j.ne@posteo.net>
^ permalink raw reply related
* Re: [PATCH v3 5/9] mfd: mt6397: Add support for MT6392 pmic
From: Lee Jones @ 2026-03-26 12:10 UTC (permalink / raw)
To: Luca Leonardo Scorcia
Cc: linux-mediatek, Fabien Parent, Val Packett, Dmitry Torokhov,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Sen Chu,
Sean Wang, Macpaul Lin, Matthias Brugger,
AngeloGioacchino Del Regno, Linus Walleij, Liam Girdwood,
Mark Brown, Julien Massot, Gary Bisson, Louis-Alexis Eyraud,
Chen Zhong, linux-input, devicetree, linux-kernel, linux-pm,
linux-arm-kernel, linux-gpio
In-Reply-To: <20260317184507.523060-6-l.scorcia@gmail.com>
On Tue, 17 Mar 2026, Luca Leonardo Scorcia wrote:
> From: Fabien Parent <parent.f@gmail.com>
>
> Update the MT6397 MFD driver to support the MT6392 PMIC.
>
> Signed-off-by: Fabien Parent <parent.f@gmail.com>
> Signed-off-by: Val Packett <val@packett.cool>
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
> ---
> drivers/mfd/mt6397-core.c | 46 +++
> drivers/mfd/mt6397-irq.c | 8 +
> include/linux/mfd/mt6392/core.h | 42 +++
> include/linux/mfd/mt6392/registers.h | 487 +++++++++++++++++++++++++++
> include/linux/mfd/mt6397/core.h | 1 +
> 5 files changed, 584 insertions(+)
> create mode 100644 include/linux/mfd/mt6392/core.h
> create mode 100644 include/linux/mfd/mt6392/registers.h
>
> diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
> index 3e58d0764c7e..c4b86a44c68b 100644
> --- a/drivers/mfd/mt6397-core.c
> +++ b/drivers/mfd/mt6397-core.c
> @@ -18,6 +18,7 @@
> #include <linux/mfd/mt6357/core.h>
> #include <linux/mfd/mt6358/core.h>
> #include <linux/mfd/mt6359/core.h>
> +#include <linux/mfd/mt6392/core.h>
> #include <linux/mfd/mt6397/core.h>
> #include <linux/mfd/mt6323/registers.h>
> #include <linux/mfd/mt6328/registers.h>
> @@ -25,6 +26,7 @@
> #include <linux/mfd/mt6357/registers.h>
> #include <linux/mfd/mt6358/registers.h>
> #include <linux/mfd/mt6359/registers.h>
> +#include <linux/mfd/mt6392/registers.h>
> #include <linux/mfd/mt6397/registers.h>
>
> #define MT6323_RTC_BASE 0x8000
> @@ -39,6 +41,9 @@
> #define MT6358_RTC_BASE 0x0588
> #define MT6358_RTC_SIZE 0x3c
>
> +#define MT6392_RTC_BASE 0x8000
> +#define MT6392_RTC_SIZE 0x3e
> +
> #define MT6397_RTC_BASE 0xe000
> #define MT6397_RTC_SIZE 0x3e
>
> @@ -65,6 +70,11 @@ static const struct resource mt6358_rtc_resources[] = {
> DEFINE_RES_IRQ(MT6358_IRQ_RTC),
> };
>
> +static const struct resource mt6392_rtc_resources[] = {
> + DEFINE_RES_MEM(MT6392_RTC_BASE, MT6392_RTC_SIZE),
> + DEFINE_RES_IRQ(MT6392_IRQ_RTC),
> +};
> +
> static const struct resource mt6397_rtc_resources[] = {
> DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
> DEFINE_RES_IRQ(MT6397_IRQ_RTC),
> @@ -114,6 +124,11 @@ static const struct resource mt6331_keys_resources[] = {
> DEFINE_RES_IRQ_NAMED(MT6331_IRQ_STATUS_HOMEKEY, "homekey"),
> };
>
> +static const struct resource mt6392_keys_resources[] = {
> + DEFINE_RES_IRQ_NAMED(MT6392_IRQ_PWRKEY, "powerkey"),
> + DEFINE_RES_IRQ_NAMED(MT6392_IRQ_FCHRKEY, "homekey"),
> +};
> +
> static const struct resource mt6397_keys_resources[] = {
> DEFINE_RES_IRQ_NAMED(MT6397_IRQ_PWRKEY, "powerkey"),
> DEFINE_RES_IRQ_NAMED(MT6397_IRQ_HOMEKEY, "homekey"),
> @@ -253,6 +268,26 @@ static const struct mfd_cell mt6359_devs[] = {
> },
> };
>
> +static const struct mfd_cell mt6392_devs[] = {
> + {
> + .name = "mt6392-rtc",
> + .num_resources = ARRAY_SIZE(mt6392_rtc_resources),
> + .resources = mt6392_rtc_resources,
> + .of_compatible = "mediatek,mt6392-rtc",
> + }, {
> + .name = "mt6392-regulator",
> + .of_compatible = "mediatek,mt6392-regulator",
> + }, {
> + .name = "mt6392-pinctrl",
> + .of_compatible = "mediatek,mt6392-pinctrl",
> + }, {
> + .name = "mt6392-keys",
> + .num_resources = ARRAY_SIZE(mt6392_keys_resources),
> + .resources = mt6392_keys_resources,
> + .of_compatible = "mediatek,mt6392-keys"
> + },
> +};
> +
> static const struct mfd_cell mt6397_devs[] = {
> {
> .name = "mt6397-rtc",
> @@ -335,6 +370,14 @@ static const struct chip_data mt6359_core = {
> .irq_init = mt6358_irq_init,
> };
>
> +static const struct chip_data mt6392_core = {
> + .cid_addr = MT6392_CID,
> + .cid_shift = 0,
> + .cells = mt6392_devs,
I'm not really sure what came over me when I accepted this 6 years ago,
but I have a _strong_ aversion to MFD data being passed through the OF APIs.
Before this patch lands, please could you refactor this driver to only
pass through an identifier through mt6397_of_match[*].data. Then, you
can match on that via a switch statement where you can allocate each
device's data structures.
This is how the vast majority of MFD drivers work so there should be
lots of examples to work through to make this trivial.
> + .cell_size = ARRAY_SIZE(mt6392_devs),
> + .irq_init = mt6397_irq_init,
> +};
--
Lee Jones [李琼斯]
^ permalink raw reply
* [PATCH 3/3] Input: snvs_pwrkey - report press event in interrupt handler
From: Joy Zou @ 2026-03-26 10:39 UTC (permalink / raw)
To: Dmitry Torokhov, Frank Li, Peng Fan, Jacky Bai, Ye Li
Cc: imx, linux-input, linux-kernel, Joy Zou
In-Reply-To: <20260326-pwrkey-cleanup-v1-0-d85d7c0bf275@nxp.com>
On some boards such as i.MX8MQ-EVK, the PCIe driver may take up to
200ms to restore the PCIe link during the no_irq resume phase. This
causes key press events to be lost because the key may be released
before the timer starts running, as interrupts are disabled during
this 200ms window.
Report key press events directly in interrupt handler to prevent event
loss during system suspend.
Signed-off-by: Joy Zou <joy.zou@nxp.com>
---
drivers/input/keyboard/snvs_pwrkey.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
index bab3ab57fdac77256be75a080773ea99372ec9c7..b557c1618d7369e872c6ce708a7b3017264ee385 100644
--- a/drivers/input/keyboard/snvs_pwrkey.c
+++ b/drivers/input/keyboard/snvs_pwrkey.c
@@ -78,6 +78,16 @@ static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void *dev_id)
pm_wakeup_event(input->dev.parent, 0);
+ /*
+ * Report key press events directly in interrupt handler to prevent event
+ * loss during system suspend.
+ */
+ if (pdev->dev.power.is_suspended) {
+ pdata->keystate = 1;
+ input_report_key(input, pdata->keycode, 1);
+ input_sync(input);
+ }
+
regmap_read(pdata->snvs, SNVS_LPSR_REG, &lp_status);
if (lp_status & SNVS_LPSR_SPO) {
if (pdata->minor_rev == 0) {
--
2.37.1
^ permalink raw reply related
* [PATCH 2/3] Input: snvs_pwrkey - use local device pointer avoid reference platform_device pointer every time
From: Joy Zou @ 2026-03-26 10:39 UTC (permalink / raw)
To: Dmitry Torokhov, Frank Li, Peng Fan, Jacky Bai, Ye Li
Cc: imx, linux-input, linux-kernel, Joy Zou
In-Reply-To: <20260326-pwrkey-cleanup-v1-0-d85d7c0bf275@nxp.com>
Make use of local struct device pointer to not dereference the
platform_device pointer every time.
Signed-off-by: Joy Zou <joy.zou@nxp.com>
---
drivers/input/keyboard/snvs_pwrkey.c | 41 ++++++++++++++++++------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
index 836ab94c160615f4b0f645d9b9f85d54638c2624..bab3ab57fdac77256be75a080773ea99372ec9c7 100644
--- a/drivers/input/keyboard/snvs_pwrkey.c
+++ b/drivers/input/keyboard/snvs_pwrkey.c
@@ -112,6 +112,7 @@ static void imx_snvs_pwrkey_act(void *pdata)
static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct pwrkey_drv_data *pdata;
struct input_dev *input;
struct device_node *np;
@@ -122,33 +123,33 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
u32 vid;
/* Get SNVS register Page */
- np = pdev->dev.of_node;
+ np = dev->of_node;
if (!np)
- return dev_err_probe(&pdev->dev, -ENODEV, "Device tree node not found\n");
+ return dev_err_probe(dev, -ENODEV, "Device tree node not found\n");
- pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
if (IS_ERR(pdata->snvs))
- return dev_err_probe(&pdev->dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
+ return dev_err_probe(dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
pdata->keycode = KEY_POWER;
- dev_warn(&pdev->dev, "KEY_POWER without setting in dts\n");
+ dev_warn(dev, "KEY_POWER without setting in dts\n");
}
- clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
+ clk = devm_clk_get_optional_enabled(dev, NULL);
if (IS_ERR(clk))
- return dev_err_probe(&pdev->dev, PTR_ERR(clk),
+ return dev_err_probe(dev, PTR_ERR(clk),
"Failed to get snvs clock (%pe)\n", clk);
pdata->wakeup = of_property_read_bool(np, "wakeup-source");
pdata->irq = platform_get_irq(pdev, 0);
if (pdata->irq < 0)
- return dev_err_probe(&pdev->dev, -EINVAL, "Failed to get interrupt\n");
+ return dev_err_probe(dev, -EINVAL, "Failed to get interrupt\n");
error = of_property_read_u32(np, "power-off-time-sec", &val);
if (!error) {
@@ -162,7 +163,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
bpt = (val / 5) - 1;
break;
default:
- return dev_err_probe(&pdev->dev, -EINVAL,
+ return dev_err_probe(dev, -EINVAL,
"power-off-time-sec %d out of range\n", val);
}
@@ -182,7 +183,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
input = devm_input_allocate_device(&pdev->dev);
if (!input) {
- dev_err(&pdev->dev, "failed to allocate the input device\n");
+ dev_err(dev, "failed to allocate the input device\n");
return -ENOMEM;
}
@@ -193,27 +194,27 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
input_set_capability(input, EV_KEY, pdata->keycode);
/* input customer action to cancel release timer */
- error = devm_add_action(&pdev->dev, imx_snvs_pwrkey_act, pdata);
+ error = devm_add_action(dev, imx_snvs_pwrkey_act, pdata);
if (error)
- return dev_err_probe(&pdev->dev, error, "failed to register remove action\n");
+ return dev_err_probe(dev, error, "failed to register remove action\n");
pdata->input = input;
platform_set_drvdata(pdev, pdata);
- error = devm_request_irq(&pdev->dev, pdata->irq,
- imx_snvs_pwrkey_interrupt,
- 0, pdev->name, pdev);
+ error = devm_request_irq(dev, pdata->irq,
+ imx_snvs_pwrkey_interrupt,
+ 0, pdev->name, pdev);
if (error)
- return dev_err_probe(&pdev->dev, error, "interrupt not available.\n");
+ return dev_err_probe(dev, error, "interrupt not available.\n");
error = input_register_device(input);
if (error < 0)
- return dev_err_probe(&pdev->dev, error, "failed to register input device\n");
+ return dev_err_probe(dev, error, "failed to register input device\n");
- device_init_wakeup(&pdev->dev, pdata->wakeup);
- error = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
+ device_init_wakeup(dev, pdata->wakeup);
+ error = dev_pm_set_wake_irq(dev, pdata->irq);
if (error)
- dev_err(&pdev->dev, "irq wake enable failed.\n");
+ dev_err(dev, "irq wake enable failed.\n");
return 0;
}
--
2.37.1
^ permalink raw reply related
* [PATCH 1/3] Input: snvs_pwrkey - make use of dev_err_probe()
From: Joy Zou @ 2026-03-26 10:39 UTC (permalink / raw)
To: Dmitry Torokhov, Frank Li, Peng Fan, Jacky Bai, Ye Li
Cc: imx, linux-input, linux-kernel, Joy Zou
In-Reply-To: <20260326-pwrkey-cleanup-v1-0-d85d7c0bf275@nxp.com>
Add dev_err_probe() at return path of probe() to support users to
identify issues easier.
Signed-off-by: Joy Zou <joy.zou@nxp.com>
---
drivers/input/keyboard/snvs_pwrkey.c | 40 ++++++++++++++----------------------
1 file changed, 15 insertions(+), 25 deletions(-)
diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
index 954055aaf6e29527f22f8129fd47ca17722e2bc9..836ab94c160615f4b0f645d9b9f85d54638c2624 100644
--- a/drivers/input/keyboard/snvs_pwrkey.c
+++ b/drivers/input/keyboard/snvs_pwrkey.c
@@ -124,17 +124,15 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
/* Get SNVS register Page */
np = pdev->dev.of_node;
if (!np)
- return -ENODEV;
+ return dev_err_probe(&pdev->dev, -ENODEV, "Device tree node not found\n");
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
pdata->snvs = syscon_regmap_lookup_by_phandle(np, "regmap");
- if (IS_ERR(pdata->snvs)) {
- dev_err(&pdev->dev, "Can't get snvs syscon\n");
- return PTR_ERR(pdata->snvs);
- }
+ if (IS_ERR(pdata->snvs))
+ return dev_err_probe(&pdev->dev, PTR_ERR(pdata->snvs), "Can't get snvs syscon\n");
if (of_property_read_u32(np, "linux,keycode", &pdata->keycode)) {
pdata->keycode = KEY_POWER;
@@ -142,16 +140,15 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
}
clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
- if (IS_ERR(clk)) {
- dev_err(&pdev->dev, "Failed to get snvs clock (%pe)\n", clk);
- return PTR_ERR(clk);
- }
+ if (IS_ERR(clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(clk),
+ "Failed to get snvs clock (%pe)\n", clk);
pdata->wakeup = of_property_read_bool(np, "wakeup-source");
pdata->irq = platform_get_irq(pdev, 0);
if (pdata->irq < 0)
- return -EINVAL;
+ return dev_err_probe(&pdev->dev, -EINVAL, "Failed to get interrupt\n");
error = of_property_read_u32(np, "power-off-time-sec", &val);
if (!error) {
@@ -165,9 +162,8 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
bpt = (val / 5) - 1;
break;
default:
- dev_err(&pdev->dev,
- "power-off-time-sec %d out of range\n", val);
- return -EINVAL;
+ return dev_err_probe(&pdev->dev, -EINVAL,
+ "power-off-time-sec %d out of range\n", val);
}
regmap_update_bits(pdata->snvs, SNVS_LPCR_REG, SNVS_LPCR_BPT_MASK,
@@ -198,10 +194,8 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
/* input customer action to cancel release timer */
error = devm_add_action(&pdev->dev, imx_snvs_pwrkey_act, pdata);
- if (error) {
- dev_err(&pdev->dev, "failed to register remove action\n");
- return error;
- }
+ if (error)
+ return dev_err_probe(&pdev->dev, error, "failed to register remove action\n");
pdata->input = input;
platform_set_drvdata(pdev, pdata);
@@ -209,16 +203,12 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
error = devm_request_irq(&pdev->dev, pdata->irq,
imx_snvs_pwrkey_interrupt,
0, pdev->name, pdev);
- if (error) {
- dev_err(&pdev->dev, "interrupt not available.\n");
- return error;
- }
+ if (error)
+ return dev_err_probe(&pdev->dev, error, "interrupt not available.\n");
error = input_register_device(input);
- if (error < 0) {
- dev_err(&pdev->dev, "failed to register input device\n");
- return error;
- }
+ if (error < 0)
+ return dev_err_probe(&pdev->dev, error, "failed to register input device\n");
device_init_wakeup(&pdev->dev, pdata->wakeup);
error = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
--
2.37.1
^ permalink raw reply related
* [PATCH 0/3] snvs_pwrkey - code improvements and add report event
From: Joy Zou @ 2026-03-26 10:39 UTC (permalink / raw)
To: Dmitry Torokhov, Frank Li, Peng Fan, Jacky Bai, Ye Li
Cc: imx, linux-input, linux-kernel, Joy Zou
This patch series improves the snvs_pwrkey driver with better code quality
and add report press event.
The main improvements include:
1. Clean up the code by using local device pointers and dev_err_probe() for
better readability and easier debugging.
2. Fix potential event loss during system suspend by reporting key press events
directly in the interrupt handler.
Signed-off-by: Joy Zou <joy.zou@nxp.com>
---
Joy Zou (3):
Input: snvs_pwrkey - make use of dev_err_probe()
Input: snvs_pwrkey - use local device pointer avoid reference platform_device pointer every time
Input: snvs_pwrkey - report press event in interrupt handler
drivers/input/keyboard/snvs_pwrkey.c | 75 ++++++++++++++++++------------------
1 file changed, 38 insertions(+), 37 deletions(-)
---
base-commit: 66ba480978ce390e631e870b740a3406e3eb6b01
change-id: 20260326-pwrkey-cleanup-99d3de61ed6d
Best regards,
--
Joy Zou <joy.zou@nxp.com>
^ permalink raw reply
* [PATCH 2/2] HID: core: use __free(kfree) and __free(kvfree) to clean up temporary buffers
From: Dmitry Torokhov @ 2026-03-26 6:25 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel
In-Reply-To: <20260326062539.750272-1-dmitry.torokhov@gmail.com>
This simplifies error handling and protects against memory leaks.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-core.c | 34 ++++++++++++----------------------
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index bb13dcb116a9..b40953e0f52e 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -924,7 +924,6 @@ static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
*/
static int hid_scan_report(struct hid_device *hid)
{
- struct hid_parser *parser;
struct hid_item item;
const __u8 *start = hid->dev_rdesc;
const __u8 *end = start + hid->dev_rsize;
@@ -936,7 +935,7 @@ static int hid_scan_report(struct hid_device *hid)
hid_parser_reserved
};
- parser = vzalloc(sizeof(struct hid_parser));
+ struct hid_parser *parser __free(kvfree) = vzalloc(sizeof(*parser));
if (!parser)
return -ENOMEM;
@@ -987,7 +986,6 @@ static int hid_scan_report(struct hid_device *hid)
}
kfree(parser->collection_stack);
- vfree(parser);
return 0;
}
@@ -1246,7 +1244,6 @@ EXPORT_SYMBOL_GPL(hid_setup_resolution_multiplier);
static int hid_parse_collections(struct hid_device *device)
{
- struct hid_parser *parser;
struct hid_item item;
const u8 *start = device->rdesc;
const u8 *end = start + device->rsize;
@@ -1259,7 +1256,7 @@ static int hid_parse_collections(struct hid_device *device)
hid_parser_reserved
};
- parser = vzalloc(sizeof(*parser));
+ struct hid_parser *parser __free(kvfree) = vzalloc(sizeof(*parser));
if (!parser)
return -ENOMEM;
@@ -1267,10 +1264,9 @@ static int hid_parse_collections(struct hid_device *device)
device->collection = kzalloc_objs(*device->collection,
HID_DEFAULT_NUM_COLLECTIONS);
- if (!device->collection) {
- ret = -ENOMEM;
- goto out;
- }
+ if (!device->collection)
+ return -ENOMEM;
+
device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
for (unsigned int i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++)
device->collection[i].parent_idx = -1;
@@ -1322,7 +1318,6 @@ static int hid_parse_collections(struct hid_device *device)
out:
kfree(parser->collection_stack);
- vfree(parser);
return ret;
}
@@ -1358,9 +1353,9 @@ int hid_open_report(struct hid_device *device)
* on a copy of our report descriptor so it can
* change it.
*/
- __u8 *buf = kmemdup(start, size, GFP_KERNEL);
+ u8 *buf __free(kfree) = kmemdup(start, size, GFP_KERNEL);
- if (buf == NULL)
+ if (!buf)
return -ENOMEM;
start = device->driver->report_fixup(device, buf, &size);
@@ -1371,8 +1366,7 @@ int hid_open_report(struct hid_device *device)
* needs to be cleaned up or not at the end.
*/
start = kmemdup(start, size, GFP_KERNEL);
- kfree(buf);
- if (start == NULL)
+ if (!start)
return -ENOMEM;
}
@@ -1998,11 +1992,11 @@ static struct hid_report *hid_get_report(struct hid_report_enum *report_enum,
int __hid_request(struct hid_device *hid, struct hid_report *report,
enum hid_class_request reqtype)
{
- char *buf, *data_buf;
+ u8 *data_buf;
int ret;
u32 len;
- buf = hid_alloc_report_buf(report, GFP_KERNEL);
+ u8 *buf __free(kfree) = hid_alloc_report_buf(report, GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@ -2021,17 +2015,13 @@ int __hid_request(struct hid_device *hid, struct hid_report *report,
ret = hid_hw_raw_request(hid, report->id, buf, len, report->type, reqtype);
if (ret < 0) {
dbg_hid("unable to complete request: %d\n", ret);
- goto out;
+ return ret;
}
if (reqtype == HID_REQ_GET_REPORT)
hid_input_report(hid, report->type, buf, ret, 0);
- ret = 0;
-
-out:
- kfree(buf);
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(__hid_request);
--
2.53.0.1018.g2bb0e51243-goog
^ permalink raw reply related
* [PATCH 1/2] HID: core: factor out hid_parse_collections()
From: Dmitry Torokhov @ 2026-03-26 6:25 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel
In preparation to making use of __free(...) cleanup facilities to
clean up temporary buffers, factor out code parsing collections into
a separate function to make the code simpler.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/hid/hid-core.c | 169 ++++++++++++++++++++++-------------------
1 file changed, 89 insertions(+), 80 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 833df14ef68f..bb13dcb116a9 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1244,6 +1244,88 @@ void hid_setup_resolution_multiplier(struct hid_device *hid)
}
EXPORT_SYMBOL_GPL(hid_setup_resolution_multiplier);
+static int hid_parse_collections(struct hid_device *device)
+{
+ struct hid_parser *parser;
+ struct hid_item item;
+ const u8 *start = device->rdesc;
+ const u8 *end = start + device->rsize;
+ const u8 *next;
+ int ret;
+ static typeof(hid_parser_main) (* const dispatch_type[]) = {
+ hid_parser_main,
+ hid_parser_global,
+ hid_parser_local,
+ hid_parser_reserved
+ };
+
+ parser = vzalloc(sizeof(*parser));
+ if (!parser)
+ return -ENOMEM;
+
+ parser->device = device;
+
+ device->collection = kzalloc_objs(*device->collection,
+ HID_DEFAULT_NUM_COLLECTIONS);
+ if (!device->collection) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
+ for (unsigned int i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++)
+ device->collection[i].parent_idx = -1;
+
+ ret = -EINVAL;
+ while ((next = fetch_item(start, end, &item)) != NULL) {
+ start = next;
+
+ if (item.format != HID_ITEM_FORMAT_SHORT) {
+ hid_err(device, "unexpected long global item\n");
+ goto out;
+ }
+
+ if (dispatch_type[item.type](parser, &item)) {
+ hid_err(device, "item %u %u %u %u parsing failed\n",
+ item.format,
+ (unsigned int)item.size,
+ (unsigned int)item.type,
+ (unsigned int)item.tag);
+ goto out;
+ }
+ }
+
+ if (start != end) {
+ hid_err(device, "item fetching failed at offset %u/%u\n",
+ device->rsize - (unsigned int)(end - start),
+ device->rsize);
+ goto out;
+ }
+
+ if (parser->collection_stack_ptr) {
+ hid_err(device, "unbalanced collection at end of report description\n");
+ goto out;
+ }
+
+ if (parser->local.delimiter_depth) {
+ hid_err(device, "unbalanced delimiter at end of report description\n");
+ goto out;
+ }
+
+ /*
+ * fetch initial values in case the device's
+ * default multiplier isn't the recommended 1
+ */
+ hid_setup_resolution_multiplier(device);
+
+ device->status |= HID_STAT_PARSED;
+ ret = 0;
+
+out:
+ kfree(parser->collection_stack);
+ vfree(parser);
+ return ret;
+}
+
/**
* hid_open_report - open a driver-specific device report
*
@@ -1258,21 +1340,9 @@ EXPORT_SYMBOL_GPL(hid_setup_resolution_multiplier);
*/
int hid_open_report(struct hid_device *device)
{
- struct hid_parser *parser;
- struct hid_item item;
unsigned int size;
- const __u8 *start;
- const __u8 *end;
- const __u8 *next;
- int ret;
- int i;
- static int (*dispatch_type[])(struct hid_parser *parser,
- struct hid_item *item) = {
- hid_parser_main,
- hid_parser_global,
- hid_parser_local,
- hid_parser_reserved
- };
+ const u8 *start;
+ int error;
if (WARN_ON(device->status & HID_STAT_PARSED))
return -EBUSY;
@@ -1309,74 +1379,13 @@ int hid_open_report(struct hid_device *device)
device->rdesc = start;
device->rsize = size;
- parser = vzalloc(sizeof(struct hid_parser));
- if (!parser) {
- ret = -ENOMEM;
- goto alloc_err;
- }
-
- parser->device = device;
-
- end = start + size;
-
- device->collection = kzalloc_objs(struct hid_collection,
- HID_DEFAULT_NUM_COLLECTIONS);
- if (!device->collection) {
- ret = -ENOMEM;
- goto err;
- }
- device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
- for (i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++)
- device->collection[i].parent_idx = -1;
-
- ret = -EINVAL;
- while ((next = fetch_item(start, end, &item)) != NULL) {
- start = next;
-
- if (item.format != HID_ITEM_FORMAT_SHORT) {
- hid_err(device, "unexpected long global item\n");
- goto err;
- }
-
- if (dispatch_type[item.type](parser, &item)) {
- hid_err(device, "item %u %u %u %u parsing failed\n",
- item.format, (unsigned)item.size,
- (unsigned)item.type, (unsigned)item.tag);
- goto err;
- }
-
- if (start == end) {
- if (parser->collection_stack_ptr) {
- hid_err(device, "unbalanced collection at end of report description\n");
- goto err;
- }
- if (parser->local.delimiter_depth) {
- hid_err(device, "unbalanced delimiter at end of report description\n");
- goto err;
- }
-
- /*
- * fetch initial values in case the device's
- * default multiplier isn't the recommended 1
- */
- hid_setup_resolution_multiplier(device);
-
- kfree(parser->collection_stack);
- vfree(parser);
- device->status |= HID_STAT_PARSED;
-
- return 0;
- }
+ error = hid_parse_collections(device);
+ if (error) {
+ hid_close_report(device);
+ return error;
}
- hid_err(device, "item fetching failed at offset %u/%u\n",
- size - (unsigned int)(end - start), size);
-err:
- kfree(parser->collection_stack);
-alloc_err:
- vfree(parser);
- hid_close_report(device);
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(hid_open_report);
--
2.53.0.1018.g2bb0e51243-goog
^ permalink raw reply related
* Re: [PATCH v3 9/9] arm64: dts: mt6392: add mt6392 PMIC dtsi
From: Chen-Yu Tsai @ 2026-03-26 5:43 UTC (permalink / raw)
To: AngeloGioacchino Del Regno
Cc: wens, Luca Leonardo Scorcia, linux-mediatek, Val Packett,
Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Sen Chu, Sean Wang, Macpaul Lin, Lee Jones, Matthias Brugger,
Linus Walleij, Liam Girdwood, Mark Brown, Gary Bisson,
Julien Massot, Louis-Alexis Eyraud, Fabien Parent, Chen Zhong,
linux-input, devicetree, linux-kernel, linux-pm, linux-arm-kernel,
linux-gpio
In-Reply-To: <28102417-4a2a-4e29-afbd-d0f2aa76074b@collabora.com>
On Wed, Mar 18, 2026 at 06:22:42PM +0100, AngeloGioacchino Del Regno wrote:
> Il 18/03/26 14:54, Chen-Yu Tsai ha scritto:
> > On Wed, Mar 18, 2026 at 8:39 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:
> > >
> > > Il 17/03/26 19:43, Luca Leonardo Scorcia ha scritto:
> > > > From: Val Packett <val@packett.cool>
> > > >
> > > > Add the dts to be included by all boards using the MT6392 PMIC.
> > > >
> > > > Signed-off-by: Val Packett <val@packett.cool>
> > > > Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
> > > > ---
> > > > arch/arm64/boot/dts/mediatek/mt6392.dtsi | 141 +++++++++++++++++++++++
> > > > 1 file changed, 141 insertions(+)
> > > > create mode 100644 arch/arm64/boot/dts/mediatek/mt6392.dtsi
> > > >
> > > > diff --git a/arch/arm64/boot/dts/mediatek/mt6392.dtsi b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> > > > new file mode 100644
> > > > index 000000000000..fbf6f671524c
> > > > --- /dev/null
> > > > +++ b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> > > > @@ -0,0 +1,141 @@
> > > > +// SPDX-License-Identifier: GPL-2.0
> > > > +/*
> > > > + * Copyright (c) 2019 MediaTek Inc.
> > > > + * Copyright (c) 2024 Val Packett <val@packett.cool>
> > > > + */
> > > > +
> > > > +#include <dt-bindings/input/input.h>
> > > > +
> > > > +&pwrap {
> > > > + pmic: pmic {
> > > > + compatible = "mediatek,mt6392", "mediatek,mt6323";
> > > > + interrupt-controller;
> > > > + #interrupt-cells = <2>;
> > > > +
> > > > + keys {
> > > > + compatible = "mediatek,mt6392-keys";
> > > > +
> > > > + key-power {
> > > > + linux,keycodes = <KEY_POWER>;
> > > > + wakeup-source;
> > > > + };
> > > > +
> > > > + key-home {
> > > > + linux,keycodes = <KEY_HOME>;
> > > > + wakeup-source;
> > > > + };
> > > > + };
> > > > +
> > > > + pio6392: pinctrl {
> > > > + compatible = "mediatek,mt6392-pinctrl";
> > > > +
> > > > + gpio-controller;
> > > > + #gpio-cells = <2>;
> > > > + };
> > > > +
> > > > + rtc {
> > > > + compatible = "mediatek,mt6392-rtc",
> > > > + "mediatek,mt6323-rtc";
> > > > + };
> > > > +
> > > > + regulators {
> > > > + compatible = "mediatek,mt6392-regulator";
> > > > +
> > > > + mt6392_vproc_reg: buck_vproc {
> > >
> > > s/buck//g
> > >
> > > Also, no min/max voltages?!
> >
> > We really shouldn't set min/max voltages in the PMIC dtsi file.
> >
> > The min/max voltages are supposed to be the intersection of the
> > consumers acceptable operating ranges. The min/max of the regulator
> > itself is already implied by the model / compatible.
> >
>
> Your point is fair, but it's also true that some of the regulators are not
> really meant to ever output anything different than what they are supposed
> to, though, with slight variations being possible... I guess the best option
> here is to leave declaring voltages to board DTs instead, which is sensible
> in the end.
>
> Okay, agreed. Let's go with no voltages.
>
> Reminder for myself: there's a bunch of PMIC devicetrees to cleanup in here...
And to be honest, even the default names are not needed. They are again
implied by the compatible, and even the regulator's own node name.
So either we could have a whole bunch of empty regulator nodes with
labels for easy reference, or just have the upper level "regulators"
wrapper node with a "mt63??_regulators" label for board dts files
to reference and add the _used_ regulators to.
If you agree, I can do the cleanup work.
ChenYu
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox