* Re: [PATCH] HID: use standard debug APIs
From: Benjamin Tissoires @ 2023-02-06 15:24 UTC (permalink / raw)
To: Jiri Kosina, Thomas Weißschuh; +Cc: linux-input, linux-kernel
In-Reply-To: <20221223-hid-dbg-v1-1-5dcf8794f7f9@weissschuh.net>
On Fri, 23 Dec 2022 21:30:19 +0000, Thomas Weißschuh wrote:
> The custom "debug" module parameter is fairly inflexible.
> It can only manage debugging for all calls dbg_hid() at the same time.
>
> Furthermore it creates a mismatch between calls to hid_dbg() which can
> be managed by CONFIG_DYNAMIC_DEBUG and dbg_hid() which is managed by the
> module parameter.
>
> [...]
Applied to hid/hid.git (for-6.3/hid-core), thanks!
[1/1] HID: use standard debug APIs
https://git.kernel.org/hid/hid/c/3f16ba1c0768
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH 0/9] HID: Constify lowlevel HID drivers
From: Benjamin Tissoires @ 2023-02-06 15:24 UTC (permalink / raw)
To: Basavaraj Natikar, Jiri Kosina, K. Y. Srinivasan, Haiyang Zhang,
Wei Liu, Dexuan Cui, Filipe Laíns, Srinivas Pandruvada,
Maximilian Luz, Corentin Chary, Hans de Goede, Mark Gross,
Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
Thomas Weißschuh
Cc: linux-input, linux-kernel, linux-hyperv, platform-driver-x86,
acpi4asus-user, greybus-dev, linux-staging
In-Reply-To: <20230130-hid-const-ll-driver-v1-0-3fc282b3b1d0@weissschuh.net>
On Mon, 30 Jan 2023 03:59:36 +0000, Thomas Weißschuh wrote:
> Since 52d225346904 ("HID: Make lowlevel driver structs const") the
> lowlevel HID drivers are only exposed as const.
>
> Take advantage of this to constify the underlying structures, too.
>
>
Applied to hid/hid.git (for-6.3/hid-core), thanks!
[1/9] HID: amd_sfh: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/65b7015bfe16
[2/9] HID: hyperv: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/d38213a911c5
[3/9] HID: logitech-dj: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/662eee8d46df
[4/9] HID: steam: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/ddb6792f0ef2
[5/9] HID: intel-ish-hid: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/3352c3e0bf9b
[6/9] HID: surface-hid: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/dd350afc1757
[7/9] platform/x86: asus-tf103c-dock: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/63509b149f1b
[8/9] platform/x86: asus-tf103c-dock: Constify toprow keymap
https://git.kernel.org/hid/hid/c/783c3394b493
[9/9] staging: greybus: hid: Constify lowlevel HID driver
https://git.kernel.org/hid/hid/c/ff17bb876014
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* [PATCH v5 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-02-06 15:13 UTC (permalink / raw)
To: linux-input
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-kernel,
robh+dt, u.kleine-koenig, mkorpershoek, jiriv
In-Reply-To: <20230206151331.184634-1-jiriv@axis.com>
Add basic support for more CAP1xxx sensors.
All models from CAP1xxx family are register-compatible.
Some advanced features are not used and disabled by default.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
---
Changes in v2:
- Fixed if statement.
Changes in v3:
- Model names sorted alphabetically.
Changes in v4
- No changes.
Changes in v5:
- Fix indentation.
drivers/input/keyboard/cap11xx.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 79afd0386e3f..040696d0e49c 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -98,14 +98,20 @@ enum {
CAP1106,
CAP1126,
CAP1188,
+ CAP1203,
CAP1206,
+ CAP1293,
+ CAP1298
};
static const struct cap11xx_hw_model cap11xx_devices[] = {
[CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false },
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
+ [CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true },
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
+ [CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false },
+ [CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false },
};
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -377,7 +383,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
if (error < 0)
return error;
- dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
+ dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
+ id->name, rev);
node = dev->of_node;
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
@@ -390,7 +397,9 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
- if (id->driver_data != CAP1206) {
+ if (id->driver_data == CAP1106 ||
+ id->driver_data == CAP1126 ||
+ id->driver_data == CAP1188) {
if (of_property_read_bool(node, "microchip,irq-active-high")) {
error = regmap_update_bits(priv->regmap,
CAP11XX_REG_CONFIG2,
@@ -483,7 +492,10 @@ static const struct of_device_id cap11xx_dt_ids[] = {
{ .compatible = "microchip,cap1106", },
{ .compatible = "microchip,cap1126", },
{ .compatible = "microchip,cap1188", },
+ { .compatible = "microchip,cap1203", },
{ .compatible = "microchip,cap1206", },
+ { .compatible = "microchip,cap1293", },
+ { .compatible = "microchip,cap1298", },
{}
};
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
@@ -492,7 +504,10 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
{ "cap1106", CAP1106 },
{ "cap1126", CAP1126 },
{ "cap1188", CAP1188 },
+ { "cap1203", CAP1203 },
{ "cap1206", CAP1206 },
+ { "cap1293", CAP1293 },
+ { "cap1298", CAP1298 },
{}
};
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
--
2.25.1
^ permalink raw reply related
* [PATCH v5 1/2] dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-02-06 15:13 UTC (permalink / raw)
To: linux-input
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-kernel,
robh+dt, u.kleine-koenig, mkorpershoek, jiriv,
Krzysztof Kozlowski
In-Reply-To: <20230206151331.184634-1-jiriv@axis.com>
Add support for cap1203, cap1293 and cap1298.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
---
Changes in v2:
- No changes.
Changes in v3:
- No changes.
Changes in v4
- Model names sorted alphabetically.
Changes in v5:
- No changes.
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
index 67d4d8f86a2d..5fa625b5c5fb 100644
--- a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
+++ b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
@@ -19,7 +19,10 @@ properties:
- microchip,cap1106
- microchip,cap1126
- microchip,cap1188
+ - microchip,cap1203
- microchip,cap1206
+ - microchip,cap1293
+ - microchip,cap1298
reg:
maxItems: 1
--
2.25.1
^ permalink raw reply related
* [PATCH v5 0/2] Input: cap11xx add support for cap1203, cap1293 and cap1298
From: Jiri Valek - 2N @ 2023-02-06 15:13 UTC (permalink / raw)
To: linux-input
Cc: devicetree, dmitry.torokhov, krzysztof.kozlowski+dt, linux-kernel,
robh+dt, u.kleine-koenig, mkorpershoek, jiriv
PATCH 1 - add compatible string for new models
PATCH 2 - add support for new models into driver
Changes in v2:
- Fixed if statement in PATCH 2.
Changes in v3:
- Model names sorted alphabetically in PATCH 2.
Changes in v4:
- Model names sorted alphabetically also in PATCH 1.
Changes in v5:
- Fix indentation in PATCH 2.
Jiri Valek - 2N (2):
dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and
cap1298
Input: cap11xx - add support for cap1203, cap1293 and cap1298
.../bindings/input/microchip,cap11xx.yaml | 3 +++
drivers/input/keyboard/cap11xx.c | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
--
2.25.1
^ permalink raw reply
* Re: (subset) [PATCH 10/35] Documentation: hid: correct spelling
From: Benjamin Tissoires @ 2023-02-06 14:01 UTC (permalink / raw)
To: linux-kernel, Randy Dunlap
Cc: Jiri Kosina, Srinivas Pandruvada, linux-input, Jonathan Corbet,
linux-doc
In-Reply-To: <20230127064005.1558-11-rdunlap@infradead.org>
On Thu, 26 Jan 2023 22:39:40 -0800, Randy Dunlap wrote:
> Correct spelling problems for Documentation/hid/ as reported
> by codespell.
>
>
Applied to hid/hid.git (for-6.3/hid-bpf), thanks!
[10/35] Documentation: hid: correct spelling
https://git.kernel.org/hid/hid/c/2f7f4efb9411
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* [PATCH 3/3] HID: logitech-hidpp: Add myself to authors
From: Bastien Nocera @ 2023-02-06 13:58 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires,
Peter F . Patel-Schneider, Filipe Laíns, Nestor Lopez Casado
In-Reply-To: <20230206135808.8840-1-hadess@hadess.net>
Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
drivers/hid/hid-logitech-hidpp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index ef497a82fe4e..fa0c8d1a89e3 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -30,6 +30,7 @@
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Benjamin Tissoires <benjamin.tissoires@gmail.com>");
MODULE_AUTHOR("Nestor Lopez Casado <nlopezcasad@logitech.com>");
+MODULE_AUTHOR("Bastien Nocera <hadess@hadess.net>");
static bool disable_tap_to_click;
module_param(disable_tap_to_click, bool, 0644);
--
2.39.1
^ permalink raw reply related
* [PATCH 2/3] HID: logitech-hidpp: Retry commands when device is busy
From: Bastien Nocera @ 2023-02-06 13:58 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires,
Peter F . Patel-Schneider, Filipe Laíns, Nestor Lopez Casado
In-Reply-To: <20230206135808.8840-1-hadess@hadess.net>
Handle the busy error coming from the device or receiver. The
documentation says a busy error can be returned when:
"
Device (or receiver) cannot answer immediately to this request
for any reason i.e:
- already processing a request from the same or another SW
- pipe full
"
Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
drivers/hid/hid-logitech-hidpp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 6386d3f023ca..ef497a82fe4e 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -295,6 +295,7 @@ static int hidpp_send_message_sync(struct hidpp_device *hidpp,
*/
*response = *message;
+retry:
ret = __hidpp_send_report(hidpp->hid_dev, message);
if (ret) {
@@ -321,6 +322,10 @@ static int hidpp_send_message_sync(struct hidpp_device *hidpp,
response->report_id == REPORT_ID_HIDPP_VERY_LONG) &&
response->fap.feature_index == HIDPP20_ERROR) {
ret = response->fap.params[1];
+ if (ret == HIDPP20_ERROR_BUSY) {
+ dbg_hid("%s:got busy hidpp 2.0 error %02X, retrying\n", __func__, ret);
+ goto retry;
+ }
dbg_hid("%s:got hidpp 2.0 error %02X\n", __func__, ret);
goto exit;
}
--
2.39.1
^ permalink raw reply related
* [PATCH 1/3] HID: logitech-hidpp: Add more debug statements
From: Bastien Nocera @ 2023-02-06 13:58 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires,
Peter F . Patel-Schneider, Filipe Laíns, Nestor Lopez Casado
This should help us figure out some hairy problems with some devices.
Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
drivers/hid/hid-logitech-hidpp.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index f44ba7be3cc5..6386d3f023ca 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -338,8 +338,12 @@ static int hidpp_send_fap_command_sync(struct hidpp_device *hidpp,
struct hidpp_report *message;
int ret;
- if (param_count > sizeof(message->fap.params))
+ if (param_count > sizeof(message->fap.params)) {
+ hid_dbg(hidpp->hid_dev,
+ "Invalid number of parameters passed to command (%d != %ld)\n",
+ param_count, sizeof(message->fap.params));
return -EINVAL;
+ }
message = kzalloc(sizeof(struct hidpp_report), GFP_KERNEL);
if (!message)
@@ -3440,11 +3444,17 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp)
ret = hidpp10_enable_scrolling_acceleration(hidpp);
multiplier = 8;
}
- if (ret)
+ if (ret) {
+ hid_dbg(hidpp->hid_dev,
+ "Could not enable hi-res scrolling: %d\n", ret);
return ret;
+ }
- if (multiplier == 0)
+ if (multiplier == 0) {
+ hid_dbg(hidpp->hid_dev,
+ "Invalid multiplier 0 from device, setting it to 1\n");
multiplier = 1;
+ }
hidpp->vertical_wheel_counter.wheel_multiplier = multiplier;
hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier);
--
2.39.1
^ permalink raw reply related
* Re: [PATCH] HID: logitech-hidpp: Add constants for HID++ 2.0 error codes
From: Benjamin Tissoires @ 2023-02-06 13:55 UTC (permalink / raw)
To: linux-input, Bastien Nocera
Cc: linux-kernel, Jiri Kosina, Peter F . Patel-Schneider,
Filipe Laíns, Nestor Lopez Casado
In-Reply-To: <20221207100033.64095-1-hadess@hadess.net>
On Wed, 07 Dec 2022 11:00:33 +0100, Bastien Nocera wrote:
> Add constants for HID++ 2.0 error codes listed in "Protocol HID++2.0
> essential features" chapter, page 3, in
> logitech_hidpp_2.0_specification_draft_2012-06-04.pdf
>
>
Applied to hid/hid.git (for-6.3/logitech), thanks!
[1/1] HID: logitech-hidpp: Add constants for HID++ 2.0 error codes
https://git.kernel.org/hid/hid/c/76823bf3d650
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH v2 1/2] HID: logitech-hidpp: Don't restart communication if not necessary
From: Benjamin Tissoires @ 2023-02-06 13:55 UTC (permalink / raw)
To: linux-input, Bastien Nocera
Cc: linux-kernel, Jiri Kosina, Peter F . Patel-Schneider,
Filipe Laíns, Nestor Lopez Casado
In-Reply-To: <20230125121723.3122-1-hadess@hadess.net>
On Wed, 25 Jan 2023 13:17:22 +0100, Bastien Nocera wrote:
> Don't stop and restart communication with the device unless we need to
> modify the connect flags used because of a device quirk.
>
>
Applied to hid/hid.git (for-6.3/logitech), thanks!
[1/2] HID: logitech-hidpp: Don't restart communication if not necessary
https://git.kernel.org/hid/hid/c/1f3c80667df5
[2/2] HID: logitech-hidpp: Remove HIDPP_QUIRK_NO_HIDINPUT quirk
https://git.kernel.org/hid/hid/c/8c1919ab6d33
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH] HID: logitech-hidpp: Add Signature M650
From: Benjamin Tissoires @ 2023-02-06 13:55 UTC (permalink / raw)
To: linux-input, Bastien Nocera; +Cc: Filipe Laíns
In-Reply-To: <20220404100311.3304-1-hadess@hadess.net>
On Mon, 04 Apr 2022 12:03:11 +0200, Bastien Nocera wrote:
> Add support for HID++ over Bluetooth for the Logitech Signature
> M650 mouse. It comes with a dongle but can also be used over Bluetooth
> without one.
>
>
Applied to hid/hid.git (for-6.3/logitech), thanks!
[1/1] HID: logitech-hidpp: Add Signature M650
https://git.kernel.org/hid/hid/c/8d24fa97da85
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* [PATCH v4 4/4] HID: cp2112: Devicetree Support
From: Danny Kaehn @ 2023-02-06 13:50 UTC (permalink / raw)
To: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
In-Reply-To: <20230206135016.6737-1-kaehndan@gmail.com>
Bind i2c and gpio interfaces to subnodes with names
"i2c" and "gpio" if they exist, respectively. This
allows the gpio and i2c controllers to be described
in DT as usual. Additionally, support configuring the
i2c bus speed from the clock-frequency property.
Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
---
drivers/hid/hid-cp2112.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 27cadadda7c9..aa634accdfb0 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1234,6 +1234,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
u8 buf[3];
struct cp2112_smbus_config_report config;
struct gpio_irq_chip *girq;
+ struct i2c_timings timings;
int ret;
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -1292,6 +1293,10 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_power_normal;
}
+ dev->adap.dev.of_node = of_get_child_by_name(hdev->dev.of_node, "i2c");
+ i2c_parse_fw_timings(&dev->adap.dev, &timings, true);
+
+ config.clock_speed = cpu_to_be32(timings.bus_freq_hz);
config.retry_time = cpu_to_be16(1);
ret = cp2112_hid_output(hdev, (u8 *)&config, sizeof(config),
@@ -1300,7 +1305,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
hid_err(hdev, "error setting SMBus config\n");
if (ret >= 0)
ret = -EIO;
- goto err_power_normal;
+ goto err_free_i2c_of;
}
hid_set_drvdata(hdev, (void *)dev);
@@ -1322,7 +1327,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (ret) {
hid_err(hdev, "error registering i2c adapter\n");
- goto err_power_normal;
+ goto err_free_i2c_of;
}
hid_dbg(hdev, "adapter registered\n");
@@ -1336,6 +1341,9 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
dev->gc.ngpio = 8;
dev->gc.can_sleep = 1;
dev->gc.parent = &hdev->dev;
+#if IS_ENABLED(CONFIG_OF_GPIO)
+ dev->gc.of_node = of_get_child_by_name(hdev->dev.of_node, "gpio");
+#endif
dev->irq.name = "cp2112-gpio";
dev->irq.irq_startup = cp2112_gpio_irq_startup;
@@ -1376,7 +1384,12 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
err_gpiochip_remove:
gpiochip_remove(&dev->gc);
err_free_i2c:
+#if IS_ENABLED(CONFIG_OF_GPIO)
+ of_node_put(dev->gc.of_node);
+#endif
i2c_del_adapter(&dev->adap);
+err_free_i2c_of:
+ of_node_put(dev->adap.dev.of_node);
err_power_normal:
hid_hw_power(hdev, PM_HINT_NORMAL);
err_hid_close:
@@ -1391,6 +1404,11 @@ static void cp2112_remove(struct hid_device *hdev)
struct cp2112_device *dev = hid_get_drvdata(hdev);
int i;
+ of_node_put(dev->adap.dev.of_node);
+#if IS_ENABLED(CONFIG_OF_GPIO)
+ of_node_put(dev->gc.of_node);
+#endif
+
sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group);
i2c_del_adapter(&dev->adap);
--
2.25.1
^ permalink raw reply related
* [PATCH v4 3/4] HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
From: Danny Kaehn @ 2023-02-06 13:50 UTC (permalink / raw)
To: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
In-Reply-To: <20230206135016.6737-1-kaehndan@gmail.com>
The CP2112 generates interrupts from a polling routine on a thread,
and can only support threaded interrupts. This patch configures the
gpiochip irq chip with this flag, disallowing consumers to request
a hard IRQ from this driver, which resulted in a segfault previously.
Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
---
drivers/hid/hid-cp2112.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 1e16b0fa310d..27cadadda7c9 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1354,6 +1354,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
girq->parents = NULL;
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_simple_irq;
+ girq->threaded = true;
ret = gpiochip_add_data(&dev->gc, dev);
if (ret < 0) {
--
2.25.1
^ permalink raw reply related
* [PATCH v4 2/4] HID: usbhid: Share USB device devicetree node with child HID device
From: Danny Kaehn @ 2023-02-06 13:50 UTC (permalink / raw)
To: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
In-Reply-To: <20230206135016.6737-1-kaehndan@gmail.com>
USB HID core now shares its devicetree of_node with its child HID device.
Since there can only be one HID device on a USB interface, it is redundant
to specify a hid node under the USB device (and further, binding this way
isn't currently possible, as hid_driver does not support of_match_table).
Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
---
drivers/hid/usbhid/hid-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index be4c731aaa65..b6c968af258f 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -33,6 +33,7 @@
#include <linux/hiddev.h>
#include <linux/hid-debug.h>
#include <linux/hidraw.h>
+#include <linux/device.h>
#include "usbhid.h"
/*
@@ -1369,6 +1370,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
hid->hiddev_report_event = hiddev_report_event;
#endif
hid->dev.parent = &intf->dev;
+ device_set_of_node_from_dev(&hid->dev, &intf->dev);
hid->bus = BUS_USB;
hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
hid->product = le16_to_cpu(dev->descriptor.idProduct);
--
2.25.1
^ permalink raw reply related
* [PATCH v4 1/4] dt-bindings: i2c: Add CP2112 HID USB to SMBus Bridge
From: Danny Kaehn @ 2023-02-06 13:50 UTC (permalink / raw)
To: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
In-Reply-To: <20230206135016.6737-1-kaehndan@gmail.com>
This is a USB HID device which includes an I2C controller and 8 GPIO pins.
The binding allows describing the chip's gpio and i2c controller in DT
using the subnodes named "gpio" and "i2c", respectively. This is
intended to be used in configurations where the CP2112 is permanently
connected in hardware.
Signed-off-by: Danny Kaehn <kaehndan@gmail.com>
---
.../bindings/i2c/silabs,cp2112.yaml | 112 ++++++++++++++++++
1 file changed, 112 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
diff --git a/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml b/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
new file mode 100644
index 000000000000..286e4dbafd69
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/silabs,cp2112.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CP2112 HID USB to SMBus/I2C Bridge
+
+maintainers:
+ - Danny Kaehn <kaehndan@gmail.com>
+
+description:
+ The CP2112 is a USB HID device which includes an integrated I2C controller
+ and 8 GPIO pins. Its GPIO pins can each be configured as inputs, open-drain
+ outputs, or push-pull outputs.
+
+properties:
+ compatible:
+ const: usb10c4,ea90
+
+ reg:
+ maxItems: 1
+ description: The USB port number on the host controller
+
+ i2c:
+ description: The SMBus/I2C controller node for the CP2112
+ $ref: /schemas/i2c/i2c-controller.yaml#
+ unevaluatedProperties: false
+ properties:
+ clock-frequency:
+ minimum: 10000
+ default: 100000
+ maximum: 400000
+
+ gpio:
+ description: The GPIO controller node for the CP2112
+ type: object
+ properties:
+ interrupt-controller: true
+ "#interrupt-cells":
+ const: 2
+
+ gpio-controller: true
+ "#gpio-cells":
+ const: 2
+
+ ngpios:
+ const: 8
+
+ gpio-line-names:
+ minItems: 1
+ maxItems: 8
+
+ patternProperties:
+ "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
+ type: object
+ properties:
+ gpio-hog: true
+ input: true
+ output-high: true
+ output-low: true
+ line-name: true
+ gpios:
+ minItems: 1
+ maxItems: 8
+
+ required:
+ - gpio-hog
+ - gpios
+
+ additionalProperties: false
+
+ unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/input/input.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ usb {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ device@1 {
+ compatible = "usb10c4,ea90";
+ reg = <1>;
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ temp@48 {
+ compatible = "national,lm75";
+ reg = <0x48>;
+ };
+ };
+
+ gpio {
+ gpio-controller;
+ interrupt-controller;
+ #gpio-cells = <2>;
+ gpio-line-names = "TEST0", "TEST1", "TEST2",
+ "TEST3", "TEST4", "TEST5", "TEST6", "TEST7";
+ };
+ };
+ };
--
2.25.1
^ permalink raw reply related
* [PATCH v4 0/4] DeviceTree Support for USB-HID Devices and CP2112
From: Danny Kaehn @ 2023-02-06 13:50 UTC (permalink / raw)
To: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
This patchset allows USB-HID devices to have DeviceTree bindings through sharing
the USB of_node with the HID driver, and adds such a binding and driver
implementation for the CP2112 USB to SMBus Bridge (which necessitated the
USB-HID change). This change allows a CP2112 permanently attached in hardware to
be described in DT and interoperate with other drivers, and exposed the threaded
interrupt bug fixed in patch 0003.
Changes in v4:
- Moved silabs,cp2112.yaml to /Documentation/devicetree/bindings/i2c
Changes in v3:
- Additional fixups to silabs,cp2112.yaml to address comments
Changes in v2:
- Added more detail to silabs,cp2112.yaml dt-binding
- Moved silabs,cp2112.yaml to /Documentation/devicetree/bindings/input
- Added support for setting smbus clock-frequency from DT in hid-cp2112.c
- Added freeing of of_nodes on error paths of _probe in hid-cp2112.c
Danny Kaehn (4):
dt-bindings: i2c: Add CP2112 HID USB to SMBus Bridge
HID: usbhid: Share USB device devicetree node with child HID device
HID: cp2112: Fix driver not registering GPIO IRQ chip as threaded
HID: cp2112: Devicetree Support
.../bindings/i2c/silabs,cp2112.yaml | 112 ++++++++++++++++++
drivers/hid/hid-cp2112.c | 23 +++-
drivers/hid/usbhid/hid-core.c | 2 +
3 files changed, 135 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml
--
2.25.1
^ permalink raw reply
* Re: [PATCH v3 1/4] dt-bindings: input: Add CP2112 HID USB to SMBus Bridge
From: Krzysztof Kozlowski @ 2023-02-06 13:37 UTC (permalink / raw)
To: Daniel Kaehn
Cc: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires,
devicetree, linux-input, ethan.twardy
In-Reply-To: <CAP+ZCCfA4uMMvw9UtcN5TL7faFWgGrVT6U8RKFs=tUB8iGAQMQ@mail.gmail.com>
On 06/02/2023 14:15, Daniel Kaehn wrote:
> On Mon, Feb 6, 2023 at 1:59 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 05/02/2023 15:54, Danny Kaehn wrote:
>>> This is a USB HID device which includes an I2C controller and 8 GPIO pins.
>>
>> I actually wonder - which part of CP2112 is input or HID related? The
>> manufacturer advertises it as USB to SMBus bridge, so it is an I2C
>> controller, thus should be in i2c directory.
>>
>
> That's a great point - - the device is technically a USB HID device,
> and since HID is usually used for input devices, it's lumped in with
> hid and input devices on the driver tree. Though, since dt bindings
> and Linux are separate, I see how it would make sense to classify it
> differently on the bindings side. Though I wonder, since it has both
> an i2c controller and gpio controller, should it go under mfd? Or,
> since i2c is its "primary" use, going under i2c would be fine?
mfd directory is rather Linuxism and we use for strictly multi-function
(not dual-function) devices like PMICs. Manufacturer calls it I2C
bridge, so this looks like the main function of the device.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH] HID: logitech: Disable hi-res scrolling on USB
From: Benjamin Tissoires @ 2023-02-06 13:31 UTC (permalink / raw)
To: linux-input, Bastien Nocera
Cc: linux-kernel, Jiri Kosina, Peter F . Patel-Schneider,
Filipe Laíns, Nestor Lopez Casado, Tobias Klausmann, stable
In-Reply-To: <20230203101800.139380-1-hadess@hadess.net>
On Fri, 03 Feb 2023 11:18:00 +0100, Bastien Nocera wrote:
> On some Logitech mice, such as the G903, and possibly the G403, the HID
> events are generated on a different interface to the HID++ one.
>
> If we enable hi-res through the HID++ interface, the HID interface
> wouldn't know anything about it, and handle the events as if they were
> regular scroll events, making the mouse unusable.
>
> [...]
Applied to hid/hid.git (for-6.2/upstream-fixes), thanks!
[1/1] HID: logitech: Disable hi-res scrolling on USB
https://git.kernel.org/hid/hid/c/690eb7dec72a
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH v2] HID: amd_sfh: if no sensors are enabled, clean up
From: Benjamin Tissoires @ 2023-02-06 13:31 UTC (permalink / raw)
To: Basavaraj Natikar, Jiri Kosina, Mario Limonciello
Cc: Xaver Hugl, Jiri Kosina, linux-input, linux-kernel
In-Reply-To: <20230203220850.13924-1-mario.limonciello@amd.com>
On Fri, 03 Feb 2023 16:08:49 -0600, Mario Limonciello wrote:
> It was reported that commit b300667b33b2 ("HID: amd_sfh: Disable the
> interrupt for all command") had caused increased resume time on HP Envy
> x360.
>
> Before this commit 3 sensors were reported, but they were not actually
> functional. After this commit the sensors are no longer reported, but
> also the resume time increased.
>
> [...]
Applied to hid/hid.git (for-6.2/upstream-fixes), thanks!
[1/1] HID: amd_sfh: if no sensors are enabled, clean up
https://git.kernel.org/hid/hid/c/7bcfdab3f0c6
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH] HID: core: Fix deadloop in hid_apply_multiplier.
From: Benjamin Tissoires @ 2023-02-06 13:31 UTC (permalink / raw)
To: jikos, linux-input, linux-kernel, Xin Zhao
In-Reply-To: <20230130212947.1315941-1-xnzhao@google.com>
On Mon, 30 Jan 2023 21:29:47 +0000, Xin Zhao wrote:
> The initial value of hid->collection[].parent_idx if 0. When
> Report descriptor doesn't contain "HID Collection", the value
> remains as 0.
>
> In the meanwhile, when the Report descriptor fullfill
> all following conditions, it will trigger hid_apply_multiplier
> function call.
> 1. Usage page is Generic Desktop Ctrls (0x01)
> 2. Usage is RESOLUTION_MULTIPLIER (0x48)
> 3. Contain any FEATURE items
>
> [...]
Applied to hid/hid.git (for-6.2/upstream-fixes), thanks!
[1/1] HID: core: Fix deadloop in hid_apply_multiplier.
https://git.kernel.org/hid/hid/c/ea427a222d8b
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH v3 1/4] dt-bindings: input: Add CP2112 HID USB to SMBus Bridge
From: Daniel Kaehn @ 2023-02-06 13:15 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: robh+dt, krzysztof.kozlowski+dt, jikos, benjamin.tissoires,
devicetree, linux-input, ethan.twardy
In-Reply-To: <8eadde99-28b5-5d21-7c15-119797f11951@linaro.org>
On Mon, Feb 6, 2023 at 1:59 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 05/02/2023 15:54, Danny Kaehn wrote:
> > This is a USB HID device which includes an I2C controller and 8 GPIO pins.
>
> I actually wonder - which part of CP2112 is input or HID related? The
> manufacturer advertises it as USB to SMBus bridge, so it is an I2C
> controller, thus should be in i2c directory.
>
That's a great point - - the device is technically a USB HID device,
and since HID is usually used for input devices, it's lumped in with
hid and input devices on the driver tree. Though, since dt bindings
and Linux are separate, I see how it would make sense to classify it
differently on the bindings side. Though I wonder, since it has both
an i2c controller and gpio controller, should it go under mfd? Or,
since i2c is its "primary" use, going under i2c would be fine?
Thanks,
Danny Kaehn
^ permalink raw reply
* Re: [PATCH] HID: quirks: Add quirk for Logitech G923 Xbox steering wheel
From: Benjamin Tissoires @ 2023-02-06 9:51 UTC (permalink / raw)
To: Walt Holman; +Cc: linux-input, linux-kernel, Mattijs Korpershoek
In-Reply-To: <4fc782ec-e1f7-3b89-5be9-d5b7bab5c4d3@gmail.com>
Hi Walt,
On Jan 27 2023, Walt Holman wrote:
> On 1/27/23 16:03, Walt Holman wrote:
> > Hello,
> >
> > This patch adds support for the Logitech G923 Xbox edition steering
> > wheel.
> >
> > -Walt
> >
> > diff -uprN linux-master-source/drivers/hid/hid-ids.h linux-master-target/drivers/hid/hid-ids.h
> > --- linux-master-source/drivers/hid/hid-ids.h 2023-01-27 15:18:14.000000000 -0600
> > +++ linux-master-target/drivers/hid/hid-ids.h 2023-01-27 15:50:24.077639994 -0600
> > @@ -819,6 +819,7 @@
> > #define USB_DEVICE_ID_LOGITECH_G510_USB_AUDIO 0xc22e
> > #define USB_DEVICE_ID_LOGITECH_G29_WHEEL 0xc24f
> > #define USB_DEVICE_ID_LOGITECH_G920_WHEEL 0xc262
> > +#define USB_DEVICE_ID_LOGITECH_G923_XBOX_WHEEL 0xc26e
> > #define USB_DEVICE_ID_LOGITECH_WINGMAN_F3D 0xc283
> > #define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286
> > #define USB_DEVICE_ID_LOGITECH_FLIGHT_SYSTEM_G940 0xc287
> > diff -uprN linux-master-source/drivers/hid/hid-logitech-hidpp.c linux-master-target/drivers/hid/hid-logitech-hidpp.c
> > --- linux-master-source/drivers/hid/hid-logitech-hidpp.c 2023-01-27 15:18:14.000000000 -0600
> > +++ linux-master-target/drivers/hid/hid-logitech-hidpp.c 2023-01-27 15:50:24.077639994 -0600
> > @@ -4347,6 +4347,9 @@ static const struct hid_device_id hidpp_
> > { /* Logitech G920 Wheel over USB */
> > HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL),
> > .driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS},
> > + { /* Logitech G923 Wheel (Xbox version) over USB */
> > + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G923_XBOX_WHEEL),
> > + .driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS },
> > { /* Logitech G Pro Gaming Mouse over USB */
> > HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC088) },
> >
> Signed off by: Walt Holman (waltholman09@gmail.com)
>
Thanks a lot for your submission. I wanted to quickly include it in the
kernel, but it seems that the patch is not following the standards:
- "git am" on your patch refuses to take it, saying it is corrupted
(please use "git format-patch" to generate the proper patch format)
- your patch doesn't have a proper commit description:
please add a description like "adds support for the Logitech G923 Xbox
edition steering wheel in hid-logitech-hidpp. We get the same level
of features than the regular G920". Or anything else as long as we get
a sensible commit description.
As a general rule of thumb, please follow the doc at [1] to submit your
patches.
Cheers,
Benjamin
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst
^ permalink raw reply
* Re: [PATCH v2 0/2] HID: hid-steam: Add Steam Deck support
From: Benjamin Tissoires @ 2023-02-06 9:33 UTC (permalink / raw)
To: Jiri Kosina, Lyude Paul, linux-input, Vicki Pfau
In-Reply-To: <20230126030126.895670-1-vi@endrift.com>
On Wed, 25 Jan 2023 19:01:24 -0800, Vicki Pfau wrote:
> Revised version of this patchset based on received feedback, as well as an
> additional bugfix for the edge case where the driver attempts to schedule the
> alread-scheduled lizard mode heartbeat, leading to a deadlock.
>
> Vicki Pfau (2):
> HID: hid-steam: Add Steam Deck support
> HID: hid-steam: Add rumble on Deck
>
> [...]
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.3/steam), thanks!
[1/2] HID: hid-steam: Add Steam Deck support
https://git.kernel.org/hid/hid/c/9ba9498bff1a
[2/2] HID: hid-steam: Add rumble on Deck
https://git.kernel.org/hid/hid/c/9cd61c817978
Cheers,
--
Benjamin Tissoires <benjamin.tissoires@redhat.com>
^ permalink raw reply
* Re: [PATCH v3 1/4] dt-bindings: input: Add CP2112 HID USB to SMBus Bridge
From: Krzysztof Kozlowski @ 2023-02-06 7:59 UTC (permalink / raw)
To: Danny Kaehn, robh+dt, krzysztof.kozlowski+dt, jikos,
benjamin.tissoires
Cc: devicetree, linux-input, ethan.twardy
In-Reply-To: <20230205145450.3396-2-kaehndan@gmail.com>
On 05/02/2023 15:54, Danny Kaehn wrote:
> This is a USB HID device which includes an I2C controller and 8 GPIO pins.
I actually wonder - which part of CP2112 is input or HID related? The
manufacturer advertises it as USB to SMBus bridge, so it is an I2C
controller, thus should be in i2c directory.
>
> The binding allows describing the chip's gpio and i2c controller in DT
> using the subnodes named "gpio" and "i2c", respectively. This is
> intended to be used in configurations where the CP2112 is permanently
> connected in hardware.
Best regards,
Krzysztof
^ 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