From nobody Sat Feb 7 08:45:23 2026 Received: from mx0b-0046e701.pphosted.com (mx0b-0046e701.pphosted.com [67.231.157.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECC2F35CB88; Tue, 27 Jan 2026 14:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.157.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525523; cv=none; b=ZgsuySeSIAgB4PqldY9FCxXG4mIzi39EiBUyvX7EbV3pubqjgFseqMZCn3Ams9MpXkQpb8AJGt1ouEFsZRDH2/3xFCQzJSBS9t6s6CBYttypmyZqKf/FDdMQUerGFbrVt5KDUc3eh0DflyKjCWSDz2AtqSg2Ll11VLWvtUtBr/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525523; c=relaxed/simple; bh=Y1aTGrj+T5ew/r2tekQVQC4kuyZlpaq34RSWtkkdDXM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kNrpQgD4rIJvTG0qOm8TBxFRil5iFLGiRojyjFxcryAqgjSm8Ae9Qiym2eClvyVXYtwIIc8DuLvZ4y8d4hAg1A1sZK1OzikM3JYZ3bN8dt3iOuuu2aIud6e40NO9veHxnNHZ22VzDvVjPeoiem+xMrkYinyEt6xRZqpE3EDef20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com; spf=pass smtp.mailfrom=plexus.com; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b=Vv2bJrFl; arc=none smtp.client-ip=67.231.157.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=plexus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b="Vv2bJrFl" Received: from pps.filterd (m0341555.ppops.net [127.0.0.1]) by mx0b-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60R3xtne2168300; Tue, 27 Jan 2026 14:51:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pps1; bh=pTdiG SQWR8CoFPJB6g5SSv9kU6UpFlXRfiZeFiLJKnI=; b=Vv2bJrFliFYR1YzKi1gQz q0dxpNSENzQIlxKZ+mSyXGq6cX2FcNwY3BkKR1Qom+4J/QFnMUiKLoiS3G0/4Bby Nw1+gWkTPbWust+AIboOKHilLSDXx3MT2SP3LLNulxRExKjY7457Pzq/tAwbEroG tF9YriZjdvBYN+k+VpGn6VF4Na8kQ5lehqU4E1JC68jkPYKVeiInrMcscOAFL9Uc r4kSWwytj08cNuhJjGx92m9V1chpMkQ2aNsE0VDccLtBYxAv+N45TVYIz2xJJv55 QE02eBSu/KU2/tzV5L61Ic9SHOf8puGSJVsyk75IBJGUBDJmdrD9NcPhF0tZaxet g== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0b-0046e701.pphosted.com (PPS) with ESMTPS id 4bwcb144b0-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 14:51:42 +0000 (GMT) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id CD0E8580C2; Tue, 27 Jan 2026 08:51:41 -0600 (CST) From: Danny Kaehn Date: Tue, 27 Jan 2026 08:47:48 -0600 Subject: [PATCH v13 1/3] dt-bindings: i2c: Add CP2112 HID USB to SMBus Bridge Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-cp2112-dt-v13-1-6448ddd4bf22@plexus.com> References: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> In-Reply-To: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> To: Rob Herring , Krzysztof Kozlowski , Benjamin Tissoires , Andy Shevchenko , Danny Kaehn , Andi Shyti , Conor Dooley Cc: Jiri Kosina , devicetree@vger.kernel.org, linux-input@vger.kernel.org, Dmitry Torokhov , Bartosz Golaszewski , Ethan Twardy , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Leo Huang , Arun D Patil , Willie Thai , Ting-Kai Chen X-Mailer: b4 0.14-dev-d4707 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769525272; l=3302; i=danny.kaehn@plexus.com; s=20260127; h=from:subject:message-id; bh=Y1aTGrj+T5ew/r2tekQVQC4kuyZlpaq34RSWtkkdDXM=; b=GVlGDiAHZohuzcYIs33doTgqxsMtx5zMpDCYeRY3IOKd1yjcPFOVOVTIXDD+Fv7ewRgcVhrMG 5JWvDWk9noZBN7amoQryflE1nWGphjF/aSMM2vkNnmQ1u/QQ7HYyUMZ X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=cbcR30mXg2VNyXtpE2SxVSXEDWLYwrxgnPCjJZn6A8s= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=QvVTHFyd c=1 sm=1 tr=0 ts=6978d0fe cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gEfo2CItAAAA:8 a=Y_joWELsAAAA:8 a=a1k9qEM8g4OboYts1TMA:9 a=QEXdDO2ut3YA:10 a=sptkURWiP4Gy88Gu7hUp:22 a=g_BQsM8wYJVSTWLOHH1t:22 X-Proofpoint-GUID: vqOdFnRwUQZaWRMpHF6wECOKh_D6q8h3 X-Proofpoint-ORIG-GUID: 1oZbHwha7lLEgM-L5EbAbnAff3ljd7f5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyMSBTYWx0ZWRfX2qCt9E6HStZo /XxuEBiAO/OsdOKa7H3nnw/xEHZ4tensWGvYaABcvejpaiSaL7tpL+ZDSOG+6hnySUqkBtBZOsb XRnv7OKo9OR9fnGK7J1gvoga6gcGAylmDhPAuv1k3yG1gUDBAUAXaeQtWJDc7uGXw2+ZEzjHYjT N45lLLcQvNkFZpKnEkvCWz52+AGfPINKRH3juCCEwbApQf0x67VzH5EHh9Ji0eDKXWrC2HbxyA5 fF2j5HWutHqgzPxF6d+Ou2ZY751ZvU7krliFElJ9E5m6fqTSX+qxfu6TdprJ3o1Y8NCKyYoHPbh nFyUg7cp87fn91z6YyMeyIftDd/MRDiM1NqlAXclvu83GgLKOjnTb9cWy1W8ZIt0TLhy89IPbDS GNiMJPP31hkCuFhIZzpxq7gFOw5sLSmHP5KYHuoMc98N3N06+oY5Se7QxR17lB4g1s1iL7EcT5+ 3u8IUBfNLartnyUTBtQ== X-Proofpoint-Spam-Reason: orgsafe 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, with the i2c controller being bound to a subnode named "i2c". This is intended to be used in configurations where the CP2112 is permanently connected in hardware. Signed-off-by: Danny Kaehn Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/i2c/silabs,cp2112.yaml | 100 +++++++++++++++++= ++++ 1 file changed, 100 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml b/Doc= umentation/devicetree/bindings/i2c/silabs,cp2112.yaml new file mode 100644 index 000000000000..a204adfe57b3 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml @@ -0,0 +1,100 @@ +# 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 + +description: + The CP2112 is a USB HID device which includes an integrated I2C controll= er + and 8 GPIO pins. Its GPIO pins can each be configured as inputs, open-dr= ain + outputs, or push-pull outputs. + +properties: + compatible: + const: usb10c4,ea90 + + reg: + maxItems: 1 + description: The USB port number + + interrupt-controller: true + "#interrupt-cells": + const: 2 + + gpio-controller: true + "#gpio-cells": + const: 2 + + gpio-line-names: + minItems: 1 + maxItems: 8 + + 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 + +patternProperties: + "-hog(-[0-9]+)?$": + type: object + + required: + - gpio-hog + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + #include + + usb { + #address-cells =3D <1>; + #size-cells =3D <0>; + + cp2112: device@1 { + compatible =3D "usb10c4,ea90"; + reg =3D <1>; + + gpio-controller; + interrupt-controller; + #interrupt-cells =3D <2>; + #gpio-cells =3D <2>; + gpio-line-names =3D "CP2112_SDA", "CP2112_SCL", "TEST2", + "TEST3","TEST4", "TEST5", "TEST6"; + + fan-rst-hog { + gpio-hog; + gpios =3D <7 GPIO_ACTIVE_HIGH>; + output-high; + line-name =3D "FAN_RST"; + }; + + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + sda-gpios =3D <&cp2112 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRA= IN)>; + scl-gpios =3D <&cp2112 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRA= IN)>; + + temp@48 { + compatible =3D "national,lm75"; + reg =3D <0x48>; + }; + }; + }; + }; --=20 2.25.1 From nobody Sat Feb 7 08:45:23 2026 Received: from mx0b-0046e701.pphosted.com (mx0b-0046e701.pphosted.com [67.231.157.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDC4D2264A9; Tue, 27 Jan 2026 14:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.157.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525522; cv=none; b=Rpf5j7XXp0S9ZZsmxCTzM9PBKJ8yifbOIMawvr0OAkYbCtRgnxFqiCn5+MtzrjLZxAe1ZhzT4k4jefR5qdShZeP3jOiGZ99SSI6/SgjjiUiSdNKGCbSv62MS7bpwkz3CB+8aT8ZGlaWAxobkYPH2DdWUPHFvpZsFfGUmznF96yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525522; c=relaxed/simple; bh=HJJYRUvdMmPuj3Cq1bg3W40kKCjYk5QhoGsJqhjfatA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uAJGJ52sEVhZ9Y8k4b9BDx6KK6qU7d8DJ+k2rnMrEw2kUoHAjM7D4cOzYf9RrarkPPDconTitoANL7tuYKDIF8L7ftQ0ap/lerdSPUW+s9yUBfxwA39qQbIFeWxHzw6xy7mbnabj+6/F9xwPDT0Zof+h7TYMDp4m2O3jmB8sXO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com; spf=pass smtp.mailfrom=plexus.com; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b=Iz2iEN4D; arc=none smtp.client-ip=67.231.157.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=plexus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b="Iz2iEN4D" Received: from pps.filterd (m0425993.ppops.net [127.0.0.1]) by mx0b-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60R3F5U82411442; Tue, 27 Jan 2026 08:51:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pps1; bh=U25PI jG5bqh7F5nJn+Y7T5LroIAB8LxvKkGQPhyfsWA=; b=Iz2iEN4DvZiTvofdkhN0g K4B0gP5KSFfMAcUuBL9pflkWOQByj5KaYeQksRMgaRIoOaTcDcNwXuPYm+8TnNVT WsH5lA8omV6hZXfIVOR11YSjrwUnOxPvEqZ7ZCjq9OtcxdgjX2YlXlIihqjRm6S0 t0U8C554KomNS8+HYuzjWwR4HeJ9Z9udwJRZvCLCFVyRp+COpnPaJh318vumagwU q7Z8CdTQ+J9xOiyeY4HDFHfou6JN13SRTGG65LJxXzAgDqkf9ZKZbzOuWu2Z/2i4 8esXhVaTN6wTwK61WBAXleVGl4p/rVUeuODrRItvmYYzOr2tqGEnPBaBMG8ifkZ2 Q== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0b-0046e701.pphosted.com (PPS) with ESMTPS id 4bwe1vc1d4-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 08:51:42 -0600 (CST) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id D538D580C3; Tue, 27 Jan 2026 08:51:41 -0600 (CST) From: Danny Kaehn Date: Tue, 27 Jan 2026 08:47:49 -0600 Subject: [PATCH v13 2/3] HID: cp2112: Fwnode Support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-cp2112-dt-v13-2-6448ddd4bf22@plexus.com> References: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> In-Reply-To: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> To: Rob Herring , Krzysztof Kozlowski , Benjamin Tissoires , Andy Shevchenko , Danny Kaehn , Andi Shyti , Conor Dooley Cc: Jiri Kosina , devicetree@vger.kernel.org, linux-input@vger.kernel.org, Dmitry Torokhov , Bartosz Golaszewski , Ethan Twardy , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Leo Huang , Arun D Patil , Willie Thai , Ting-Kai Chen X-Mailer: b4 0.14-dev-d4707 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769525272; l=2353; i=danny.kaehn@plexus.com; s=20260127; h=from:subject:message-id; bh=HJJYRUvdMmPuj3Cq1bg3W40kKCjYk5QhoGsJqhjfatA=; b=xzI4ZRgrlQqV0JVhyBQ7Q4uFNrhbhHRGp7pO74y518o8JVQakCnxoU4lvhiLnjPgkfurnqihv 5zE0P+hXYGDDSIXNVHDlVuBL/FH5rMyHd0ZjJKwA0f/7Hj0Dv+2P7c8 X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=cbcR30mXg2VNyXtpE2SxVSXEDWLYwrxgnPCjJZn6A8s= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=c6CmgB9l c=1 sm=1 tr=0 ts=6978d0fe cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Y_joWELsAAAA:8 a=pVqXFfmJREZmDo3ecgYA:9 a=QEXdDO2ut3YA:10 a=g_BQsM8wYJVSTWLOHH1t:22 X-Proofpoint-ORIG-GUID: Oh2C83xSz3kiHDDvzEIhShc8oqOXaTK0 X-Proofpoint-GUID: 7DoEXa_cFaXPT2pe2V1CZnQLggOD5Hl9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyMSBTYWx0ZWRfX6hNtwZmSblaP obyqZ/0c7v3uqzOI/nOhWljJTbr0I65e5qfFdoAV+OtCdTKOuDz/BJffz1/yEZ0VGHB1jnn9Srf t73cqZNzNqdD8sFUrBksaF2AASH6Aab38G+UGHmUBw3t0U3QG6xnzIolldHebKkc9qkBQgOiIrg qDqgFLtnnbA/g46JGg3v5fsV5+018QLtqof/DBR+ZIX0HKVVKserTvxFXJhvkBPAUmdWPXxIWVI +Sz7s8KGTdp3CEYKAoAvIPaZzXmto5UGp2BpLpPUvG6IAKAv8zItDgXolOOL1UQAZOEdWmuUb+h X+6bWbMRNZfkGqZnyh2CglU4SJccTZ7uYRVXBOzOQhk7oaIzhZVzF5HhuYK/54bb+2p06zlkjsY OdrUV/JBYqKtIdblploU+tlLICZpepOGZNmSuIfE3X/l7k1IuUHq/lLkTiXbbpGYd13jS5paI64 ubNDcsjWmqCwStc2a3g== X-Proofpoint-Spam-Reason: orgsafe Support describing the CP2112's I2C and GPIO interfaces in firmware. Bindings between the firmware nodes and the functions of the device are distinct between ACPI and DeviceTree. For ACPI, the i2c_adapter will use the child with _ADR Zero and the gpio_chip will use the child with _ADR One. For DeviceTree, the i2c_adapter will use the child with name "i2c", but the gpio_chip will share a firmware node with the CP2112. Signed-off-by: Danny Kaehn --- drivers/hid/hid-cp2112.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 803b883ae875..ea19b5cb58f9 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c @@ -29,6 +29,16 @@ #include #include "hid-ids.h" =20 +/** + * enum cp2112_child_acpi_cell_addrs - Child ACPI addresses for CP2112 sub= -functions + * @CP2112_I2C_ADR: Address for I2C node + * @CP2112_GPIO_ADR: Address for GPIO node + */ +enum cp2112_child_acpi_cell_addrs { + CP2112_I2C_ADR =3D 0, + CP2112_GPIO_ADR =3D 1, +}; + #define CP2112_REPORT_MAX_LENGTH 64 #define CP2112_GPIO_CONFIG_LENGTH 5 #define CP2112_GPIO_GET_LENGTH 2 @@ -1208,7 +1218,9 @@ static int cp2112_probe(struct hid_device *hdev, cons= t struct hid_device_id *id) struct cp2112_device *dev; u8 buf[3]; struct cp2112_smbus_config_report config; + struct fwnode_handle *child; struct gpio_irq_chip *girq; + u32 addr; int ret; =20 dev =3D devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL); @@ -1226,6 +1238,27 @@ static int cp2112_probe(struct hid_device *hdev, con= st struct hid_device_id *id) return ret; } =20 + if (is_acpi_device_node(dev_fwnode(&hdev->dev))) { + device_for_each_child_node(&hdev->dev, child) { + ret =3D acpi_get_local_address(ACPI_HANDLE_FWNODE(child), &addr); + if (ret) + continue; + + switch (addr) { + case CP2112_I2C_ADR: + device_set_node(&dev->adap.dev, child); + break; + case CP2112_GPIO_ADR: + dev->gc.fwnode =3D child; + break; + } + } + } else { + child =3D device_get_named_child_node(&hdev->dev, "i2c"); + device_set_node(&dev->adap.dev, child); + fwnode_handle_put(child); + } + ret =3D hid_parse(hdev); if (ret) { hid_err(hdev, "parse failed\n"); --=20 2.25.1 From nobody Sat Feb 7 08:45:23 2026 Received: from mx0b-0046e701.pphosted.com (mx0b-0046e701.pphosted.com [67.231.157.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEE0E35CBB4; Tue, 27 Jan 2026 14:52:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.157.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525525; cv=none; b=M76D34AOnlYEqrSCxfzF3aPopfhAc4MWpoP7RyT7MjSM/hxkb4V319Vtl8hGsnooDatTKm09GFk8JqNSCeE8qM6kGHM0eU3VKpRBOWAPFOAh+y7N54ofTsB4Z7ODBWURPPGHq0oN+LVMyd8/Ih4hBN1zgI8/gZ27FsYV2fHFzgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769525525; c=relaxed/simple; bh=sTuKmKs+MqyixoLYvUkl/qsU9H4HeSU66GDIdTbkekA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tutASzhPeq182CVbBWxNOoWRbgruGc8l7N77fujNnvHcM6oryf7RpAdWXA81DctUZFxQDL7B+GZCY1tScoezotuuYESEEQu1KMxR2T4zMLdYNZJrq4S0shgGnIuJNo1fWsRzmaAJeWfOyRJFIogNNhSu3gKwp6AdxeAT7Dp1cBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com; spf=pass smtp.mailfrom=plexus.com; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b=NuI4A0aw; arc=none smtp.client-ip=67.231.157.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=plexus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=plexus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=plexus.com header.i=@plexus.com header.b="NuI4A0aw" Received: from pps.filterd (m0341555.ppops.net [127.0.0.1]) by mx0b-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60R44AVk2151983; Tue, 27 Jan 2026 14:51:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexus.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pps1; bh=AMs/I eyIbZy1nwXxcGTgvzvyBjW0gzBr8/WuXtGmG0o=; b=NuI4A0awuhB+HIx4HmfF/ KwAMn8tfWafeUTjWx2EGw05oKT7D2Gs8gmQPjc9SL7kkW9h1nV/C5fCkPryMT7hl 9FDn4CCnlWWEk/W08uKQe7I/LW8QAVlS3YKgVMVSpO8tuB6h7QuI87GadpeVDu+S jvcCn2b+SWmhIvgVWjO83fnqzpMB0jnyfO/ntS6cf+sr51HhgqT9XT1mRTFSjlCI EmV+iMWyjMZbWqE6SZ3GZug8FBqYLcCSr6WJncdpssvyGNZXv2MCXnIxLdmYSiZP 7fMM+1o6Wl5scZ4xKI8NCdDXv5L+OOKBmkQncv/UnI0doD07b6kwRrLGBDqEmBL9 A== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0b-0046e701.pphosted.com (PPS) with ESMTPS id 4bwcb144b1-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 14:51:42 +0000 (GMT) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id DCD14580C4; Tue, 27 Jan 2026 08:51:41 -0600 (CST) From: Danny Kaehn Date: Tue, 27 Jan 2026 08:47:50 -0600 Subject: [PATCH v13 3/3] HID: cp2112: Configure I2C Bus Speed from Firmware Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260127-cp2112-dt-v13-3-6448ddd4bf22@plexus.com> References: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> In-Reply-To: <20260127-cp2112-dt-v13-0-6448ddd4bf22@plexus.com> To: Rob Herring , Krzysztof Kozlowski , Benjamin Tissoires , Andy Shevchenko , Danny Kaehn , Andi Shyti , Conor Dooley Cc: Jiri Kosina , devicetree@vger.kernel.org, linux-input@vger.kernel.org, Dmitry Torokhov , Bartosz Golaszewski , Ethan Twardy , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Leo Huang , Arun D Patil , Willie Thai , Ting-Kai Chen X-Mailer: b4 0.14-dev-d4707 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769525272; l=1081; i=danny.kaehn@plexus.com; s=20260127; h=from:subject:message-id; bh=sTuKmKs+MqyixoLYvUkl/qsU9H4HeSU66GDIdTbkekA=; b=4MODlWIYOuNwLzbSsNQer/HmwNaiys0dMZu9GCrVS3Ro409Uu25RlmMtdM/VYgOGM/M2eRHMe OIngCA196C1BfkEH6QUdaj4dam1Dp26MZLXGZIy+6KKJ49qJJSnZvxs X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=cbcR30mXg2VNyXtpE2SxVSXEDWLYwrxgnPCjJZn6A8s= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=QvVTHFyd c=1 sm=1 tr=0 ts=6978d0fe cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Y_joWELsAAAA:8 a=B4QkrQ5K2Q0oYPUHz0oA:9 a=QEXdDO2ut3YA:10 a=g_BQsM8wYJVSTWLOHH1t:22 X-Proofpoint-GUID: NeWbfRo8c_k6o4E1Y-ByzzzFqSMYkONn X-Proofpoint-ORIG-GUID: 5tlxGXixyJ4R1ECK3t9AjI4UWh8Wy9yP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyMSBTYWx0ZWRfX0uXa69E2uI/z rLgB6vxR+4mcSjWBQbTvgQk7sEH7sPN8uwBbArZHtkmuTyynYuoubMTX9d/866qH3dCyrHJpHDM a31LLswEnU4H+qB9UZOluH0lo5oHntVeiHqFzEolMsu/8+Xt1qJ+N5xpTRkMzDauYx86aLP5ZA2 O17//OT4Xr0VLf/9qaBQsjfpMuQZPiKWYc9EHYk3QhmN4gvC4ye8FuLxK/ooQCl+5KwoHuIMzeT cvDzqzK9hNDqRh41EYXSAEKDqYFH1CbvICBwAJNO7z6obWsTWAWZ3hfYBiEWLK+1FTlbpy2rkBY GwUiEbonBG2QOnqeXnnnhPlSMr/N17/jLPNogAX5/8bwQ9/xLdSd50eTGuHRTkP7m9nZNjJ93Nf L2xlueX2LT/NoHlGYaNPunUVbFkIWEbUNlo5DDHmeTqb12rrFEwYQYbtsDzDJSGrT5sjqB3H24V +vctiY+xj2hdchw0y6A== X-Proofpoint-Spam-Reason: orgsafe 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 --- 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, cons= t 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; =20 @@ -1304,6 +1305,9 @@ static int cp2112_probe(struct hid_device *hdev, cons= t struct hid_device_id *id) goto err_power_normal; } =20 + i2c_parse_fw_timings(&dev->adap.dev, &timings, true); + + config.clock_speed =3D cpu_to_be32(timings.bus_freq_hz); config.retry_time =3D cpu_to_be16(1); =20 ret =3D cp2112_hid_output(hdev, (u8 *)&config, sizeof(config), --=20 2.25.1