From 1bba29603a2812e7b3dbb4ec1558ecb626ee933e Mon Sep 17 00:00:00 2001 From: Nicolas Nobelis Date: Sat, 16 Nov 2024 19:24:19 +0100 Subject: [PATCH 1/3] Input: xpad - add support for Nacon Pro Compact Add Nacon Pro Compact to the list of supported devices. These are the ids of the "Colorlight" variant. The buttons, sticks and vibrations work. The decorative LEDs on the other hand do not (they stay turned off). Signed-off-by: Nicolas Nobelis Link: https://lore.kernel.org/r/20241116182419.33833-1-nicolas@nobelis.eu Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/xpad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index ff9bc87f2f70..2f2500ade166 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -383,6 +383,7 @@ static const struct xpad_device { { 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 }, { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 }, + { 0x3285, 0x0646, "Nacon Pro Compact", 0, XTYPE_XBOXONE }, { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, From 55b75306c3edf369285ce22ba1ced45e335094c2 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 12 Dec 2024 11:03:22 +0800 Subject: [PATCH 2/3] Input: bbnsm_pwrkey - add remove hook Without remove hook to clear wake irq, there will be kernel dump when doing module test. "bbnsm_pwrkey 44440000.bbnsm:pwrkey: wake irq already initialized" Add remove hook to clear wake irq and set wakeup to false. Signed-off-by: Peng Fan Fixes: 40e40fdfec3f ("Input: bbnsm_pwrkey - add bbnsm power key support") Link: https://lore.kernel.org/r/20241212030322.3110017-1-peng.fan@oss.nxp.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/misc/nxp-bbnsm-pwrkey.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c index eb4173f9c820..7ba8d166d68c 100644 --- a/drivers/input/misc/nxp-bbnsm-pwrkey.c +++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c @@ -187,6 +187,12 @@ static int bbnsm_pwrkey_probe(struct platform_device *pdev) return 0; } +static void bbnsm_pwrkey_remove(struct platform_device *pdev) +{ + dev_pm_clear_wake_irq(&pdev->dev); + device_init_wakeup(&pdev->dev, false); +} + static int __maybe_unused bbnsm_pwrkey_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -223,6 +229,8 @@ static struct platform_driver bbnsm_pwrkey_driver = { .of_match_table = bbnsm_pwrkey_ids, }, .probe = bbnsm_pwrkey_probe, + .remove = bbnsm_pwrkey_remove, + }; module_platform_driver(bbnsm_pwrkey_driver); From 1863f213d3e878d10589ebc0aae1c861c3b0f0c3 Mon Sep 17 00:00:00 2001 From: Luwei Zhou Date: Mon, 16 Dec 2024 10:28:51 -0800 Subject: [PATCH 3/3] Input: mma8450 - add chip ID check in probe Prevent continuous polling error logs by adding a chip ID check in the probe function. This ensures the driver only proceeds when the mma8450 is present, avoiding issues in scenarios like missing add-on cards. Signed-off-by: Luwei Zhou Signed-off-by: Fugang Duan Signed-off-by: Vipul Kumar Signed-off-by: Dong Aisheng Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20241216173205.211058-1-Frank.Li@nxp.com Signed-off-by: Dmitry Torokhov --- drivers/input/misc/mma8450.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c index 08412239b8e6..0c661140fb88 100644 --- a/drivers/input/misc/mma8450.c +++ b/drivers/input/misc/mma8450.c @@ -38,6 +38,8 @@ #define MMA8450_CTRL_REG1 0x38 #define MMA8450_CTRL_REG2 0x39 +#define MMA8450_ID 0xc6 +#define MMA8450_WHO_AM_I 0x0f static int mma8450_read(struct i2c_client *c, unsigned int off) { @@ -148,8 +150,20 @@ static void mma8450_close(struct input_dev *input) */ static int mma8450_probe(struct i2c_client *c) { + struct i2c_adapter *adapter = c->adapter; struct input_dev *input; - int err; + int err, client_id; + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA)) + return dev_err_probe(&c->dev, -EINVAL, + "I2C adapter doesn't support SMBUS BYTE"); + + client_id = i2c_smbus_read_byte_data(c, MMA8450_WHO_AM_I); + if (client_id != MMA8450_ID) + return dev_err_probe(&c->dev, -EINVAL, + "unexpected chip ID 0x%x (vs 0x%x)\n", + client_id, MMA8450_ID); input = devm_input_allocate_device(&c->dev); if (!input)