[PATCH v13 3/3] HID: cp2112: Configure I2C Bus Speed from Firmware

Danny Kaehn posted 3 patches 1 week, 5 days ago
[PATCH v13 3/3] HID: cp2112: Configure I2C Bus Speed from Firmware
Posted by Danny Kaehn 1 week, 5 days ago
Now that the I2C adapter on the CP2112 can have an associated firmware
node, set the bus speed based on firmware configuration

Signed-off-by: Danny Kaehn <danny.kaehn@plexus.com>
---
 drivers/hid/hid-cp2112.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index ea19b5cb58f9..4c5957e0a5cc 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1220,6 +1220,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	struct cp2112_smbus_config_report config;
 	struct fwnode_handle *child;
 	struct gpio_irq_chip *girq;
+	struct i2c_timings timings;
 	u32 addr;
 	int ret;
 
@@ -1304,6 +1305,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),

-- 
2.25.1
Re: [PATCH v13 3/3] HID: cp2112: Configure I2C Bus Speed from Firmware
Posted by Danny Kaehn 1 week, 5 days ago
On Tue, Jan 27, 2026 at 08:47:50AM -0600, Danny Kaehn wrote:
> Now that the I2C adapter on the CP2112 can have an associated firmware
> node, set the bus speed based on firmware configuration
>

Apologies, realized post-send that I never addressed Andy's comment
asking for a period at the end here and expressing his sign-off. Will
address with the next send if there is one; else I'll re-send this one
after other approvals.