lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251126-cp2112-dt-v12-3-2cdba6481db3@plexus.com>
Date: Wed, 26 Nov 2025 11:05:26 -0600
From: Danny Kaehn <danny.kaehn@...xus.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Benjamin Tissoires <bentiss@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Danny Kaehn <danny.kaehn@...xus.com>,
        Andi Shyti <andi.shyti@...nel.org>, Conor Dooley <conor+dt@...nel.org>
Cc: Jiri Kosina <jikos@...nel.org>, devicetree@...r.kernel.org,
        linux-input@...r.kernel.org,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
        Ethan Twardy <ethan.twardy@...xus.com>, linux-i2c@...r.kernel.org,
        linux-kernel@...r.kernel.org, Leo Huang <leohu@...dia.com>,
        Arun D Patil <arundp@...dia.com>, Willie Thai <wthai@...dia.com>,
        Ting-Kai Chen <tingkaic@...dia.com>
Subject: [PATCH v12 3/3] 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

Signed-off-by: Danny Kaehn <danny.kaehn@...xus.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 fb301c27c712..801fe3ccad5e 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;
 
@@ -1303,6 +1304,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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ