diff options
| author | Danny Kaehn <danny.kaehn@plexus.com> | 2026-05-20 19:13:07 +0300 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-06-10 18:34:39 +0300 |
| commit | efab84c398c17d2575e8a308c243915baae3affa (patch) | |
| tree | 46503c6455779c62116b21dd323fac24a37aeb32 | |
| parent | c0be05f68a2145d566a44805f22896f141316cf1 (diff) | |
| download | linux-efab84c398c17d2575e8a308c243915baae3affa.tar.xz | |
HID: cp2112: Configure I2C bus speed from firmware
Now that the I2C adapter on the CP2112 can have an associated firmware
node, set the bus speed based on firmware configuration
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Danny Kaehn <danny.kaehn@plexus.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
| -rw-r--r-- | drivers/hid/hid-cp2112.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index e960fc988058..04379db93571 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c @@ -1223,6 +1223,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) struct fwnode_handle *cp2112_fwnode; struct fwnode_handle *child; struct gpio_irq_chip *girq; + struct i2c_timings timings; u32 addr; int ret; @@ -1308,6 +1309,9 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) goto err_power_normal; } + 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), |
