From nobody Mon Dec 1 22:36:55 2025 Received: from mx0a-0046e701.pphosted.com (mx0a-0046e701.pphosted.com [67.231.149.93]) (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 1702B30BF69; Wed, 26 Nov 2025 17:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.93 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178703; cv=none; b=kKP8E13xjIkxevhAPsRHPPd4zyVEn+VlWy80KZsgqnMw1bOk7X7yJpnYZO1wtXOZkaVoN1AYlooRrou1NHslw5bM08aiPTP/KhoRNF/2mbK7+d/5aGaA1aVlwlfpESH8h7lBaDNtq5g1N7pVBRJ1h1Fdn9T30c7SxENcOsFu/DA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178703; c=relaxed/simple; bh=HZ2zj59plR7MYLmDD2b/Zaq0ljbWALyTUquIne+xL34=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PxjD1kUNsdgAtlC74nInjznti52frsBfUCo3ytrBTq+cIsqA9jFSK1iruc/bVcLsjYAzVMWV0wt8NrWBwnaaONVlvqeC8OuQbSnKDnWCEyGAHEiAQgE2y2am7WQ7zX9aLxZi2VWYIzoOdIKS2/YngT+STXVSzNzGi/44LaUZsEU= 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=m/lsqM84; arc=none smtp.client-ip=67.231.149.93 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="m/lsqM84" Received: from pps.filterd (m0425991.ppops.net [127.0.0.1]) by mx0a-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQ458PV250655; Wed, 26 Nov 2025 11:09:19 -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=8NKQD 5aYefUuHwkSV+4b+jV4DhbhWIKxz42punywKYM=; b=m/lsqM84k5PCEj3Z3RiQ6 p2PWEg/Aly4f8MfxC6cZLWIXfciZsmeBkuqxyK5yyTqTl72DEQIjiklUPj9GZwTV qit7cM7aDZRYv9LP3FOND3Tk92AvJmQgvEWkI/1Ii6w7JP5PuRuY1NZ8NBHSlV9v LmXEl4sC2pPo4jEb7AWvwUdUj17iZxgPB/MKdzNrLFtkBIYwEffthZpCjcze25HE ywllpW/W3SCqF10Xkfycl+aQDdj7Sk9ZYtDbZFVQDroKL8jGWt7Z5lCfji/Nvfo3 Z/wCLfQiqzenf5qEKoazXlwFybfPSP0+9QyKrTCEcV0bM8bj4Z41UMEIazDIZMfH A== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0a-0046e701.pphosted.com (PPS) with ESMTPS id 4ant7as5wp-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Nov 2025 11:09:18 -0600 (CST) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id C26643C87C; Wed, 26 Nov 2025 11:09:17 -0600 (CST) From: Danny Kaehn Date: Wed, 26 Nov 2025 11:05:24 -0600 Subject: [PATCH v12 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: <20251126-cp2112-dt-v12-1-2cdba6481db3@plexus.com> References: <20251126-cp2112-dt-v12-0-2cdba6481db3@plexus.com> In-Reply-To: <20251126-cp2112-dt-v12-0-2cdba6481db3@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=1764176728; l=3253; i=danny.kaehn@plexus.com; s=20251118; h=from:subject:message-id; bh=HZ2zj59plR7MYLmDD2b/Zaq0ljbWALyTUquIne+xL34=; b=VD4OjURPCEgERc8EF6mzw97eyqSHUJubgm0tITKiI4zxnIh+sW0Uf3hpdjNnIwWIlUz8Elu4n FEUkOqb8rPrAOPSnu884oaaVfPbg6GWFPyU7NWTtI5sRFWqEemVJ7E5 X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=br2sOmMe9QhpVp1uJw6IxgSNRKZO5khHotS2b+/bX14= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDE0MCBTYWx0ZWRfX03utHbD5tBuS Banwmn9XkEa1l0sszAchQDYAF1BrR7hmgzZeV2Pspl30zXmbdYqJ2Z8nCixe2+wemZNHn30k3C0 V3BaEQGSIzJVa6cfbrsihMLH167kal6RqD8CaZEQKwYiDIyMf5mkiEeJ6Nd8MZ2a7rhupkahGjz ri39PDwZ+2hr1LDLBk8/P3rv4GQc7FKfsKAeXLrWPHOa69Zv3Mr3kRlvU6+t4OR156UH5ZaJPJT zmNMEyOmRSNh2BPYi130qw1OAPIIWOIxrzkHP6frsvW5B3VJBj9JLYXOA+X1U3lveUGRY4yXdtb iAcHIr4mLA+1pA4g4z372Dc7//8RymjgI5NH7AK3A7AfiuaXIgluMwkdL47Ce8UsqtH9rbnYOx8 9qSyBsmmN32yDhYoblOPpU80yMisQA== X-Proofpoint-ORIG-GUID: hEQQiYXl4UGJ1d4CHNIvQqyKu6z2NDfl X-Authority-Analysis: v=2.4 cv=BouQAIX5 c=1 sm=1 tr=0 ts=6927343f cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA: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: WJpUYwx2AWcUYNKq3XPwZAvWHEMJyc4J 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 --- .../devicetree/bindings/i2c/silabs,cp2112.yaml | 107 +++++++++++++++++= ++++ 1 file changed, 107 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..4b5c1af3673d --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/silabs,cp2112.yaml @@ -0,0 +1,107 @@ +# 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: + sda-gpios: + maxItems: 1 + + scl-gpios: + maxItems: 1 + + 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_DRAIN)>; + scl-gpios =3D <&cp2112 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + temp@48 { + compatible =3D "national,lm75"; + reg =3D <0x48>; + }; + }; + + }; + }; --=20 2.25.1 From nobody Mon Dec 1 22:36:55 2025 Received: from mx0a-0046e701.pphosted.com (mx0a-0046e701.pphosted.com [67.231.149.93]) (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 6004F33EAE9; Wed, 26 Nov 2025 17:38:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.93 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178708; cv=none; b=XdqcWPCa0K+WEXNMaH77WjHaAx7ZgVloDLEax43mGhpAIw+fwDA2DvgH6/QhOLgfimKubxHNPiWEMKhKzf1eFCjRCCqubN4gw3m0yy+Ob9Yo46vZrvmz6mHM2ZN4OQaV2s5Lgr6vVxvfvJ5BM/jJXkdIL5rNHKKlDFogoV8dnWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178708; c=relaxed/simple; bh=0IRL/KZKIkCUzko0p+KHG0Dpw0ySQ73NnN9NN9WR1Qg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fUbt6znghfiC9VQXdGNCGugcYUjgL7b56HUkR+v4cySboywWK+/nA6CtOhFNlorNaNpIP4CsDIr3wDy8Q1SmI3vB59A/JO9ewjMZc5XIdjOLOOVE01JJu1zlgyPmgNsleovtZKp0BtDDakayfqS2eUfDc7KvwhdJCHWKIp7Nmbc= 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=hIEYUvEt; arc=none smtp.client-ip=67.231.149.93 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="hIEYUvEt" Received: from pps.filterd (m0341554.ppops.net [127.0.0.1]) by mx0a-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQE1a85021314; Wed, 26 Nov 2025 11:09:29 -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=zjPHr QUxOOypAqLuK9n8ZhvUnMRLW2qZBpJn384T9dU=; b=hIEYUvEtVM5Gar4AOlXt7 pAYvhOKzejWnPcP3r7PTEcQed9T/w+8GdGQu82ffBXDB+b4RKfdgLthFAI88NYCr wm2VUdOAVYf2ocXmVdES+zJH1DTBetUtvSf2Wd8iRGitZrG89ok+rz88ffEbZxlm KQ36+ruikS1vhLymLOxqRTlqCqtqCcdu2Mav/c5MSz6NMK4pL+CBOBnMUmLw3hRY 56Iz3DGCen8EAT/MRMCgYHq/yHQyYGBlt478oZ0wC4TFArZuCPDTxgnjD0u05G6G On+706Rdd7jiWopSlN3O5ScCg0INYEpmrTXOQ0W4aIHTxNxnbb5mRZep8vFCrbzk A== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0a-0046e701.pphosted.com (PPS) with ESMTPS id 4ap2xyg9tu-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Nov 2025 11:09:28 -0600 (CST) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id CBCB43C8BC; Wed, 26 Nov 2025 11:09:17 -0600 (CST) From: Danny Kaehn Date: Wed, 26 Nov 2025 11:05:25 -0600 Subject: [PATCH v12 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: <20251126-cp2112-dt-v12-2-2cdba6481db3@plexus.com> References: <20251126-cp2112-dt-v12-0-2cdba6481db3@plexus.com> In-Reply-To: <20251126-cp2112-dt-v12-0-2cdba6481db3@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=1764176728; l=2302; i=danny.kaehn@plexus.com; s=20251118; h=from:subject:message-id; bh=0IRL/KZKIkCUzko0p+KHG0Dpw0ySQ73NnN9NN9WR1Qg=; b=GsLW7NB+s5hC0D6uqsMxBidFqs35NMD9b7cN/ECWSE4/Q8nmM/9u8+yePB4SupReByKJBRjoX 0k3kIhXJGTxAbvsYBJylRWRy2cxiQE50s+880U4eJxx3JZBi9Zjl5qL X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=br2sOmMe9QhpVp1uJw6IxgSNRKZO5khHotS2b+/bX14= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: huGVKRwXk-MVYTYgZJEwmkSwi6MDYbD4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDE0MCBTYWx0ZWRfX/ztTRW1ycnK7 S4AlpotJuqq4S9JHHetp6ies2EPlt5URl6zI+Ph1AebXriNm6h+hLmXuJVw1tuNc5hUlLfRxyGi TKWSrmElmVOjFA/HGF5rqQox2tDGqILKM1ocSQRJVUKpcOxPQdDfeOQEeH4x0Jy/RkSru5Fyfp2 cRm1RsBwe9sF0g2xCiMSkzUnbJZOe9TmX995zJvT3NzANzl3jHZVBjN9r9HlPcnhlxMAEIx07h/ WZj+pFm1WhmS2EmO+a6BFjcraBNRKBtgZHKKwYt4l2cz8bhfQGWdgDMVPIFU7LphZHlOTRkF6mv gynKHCRqaevpmBTkjE3BPFCITYHq6MU79ofIJkaQb5acJOzMqbWzDRqyhDIOQ4yQWt4314atImr 5ETy274J+2Rk+f9qz2VVKUmnWGxMuA== X-Proofpoint-GUID: iA_526lU68Rvr7yAXR0fJvoS-a7ayUn4 X-Authority-Analysis: v=2.4 cv=HZsZjyE8 c=1 sm=1 tr=0 ts=69273449 cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Y_joWELsAAAA:8 a=pVqXFfmJREZmDo3ecgYA:9 a=QEXdDO2ut3YA:10 a=g_BQsM8wYJVSTWLOHH1t:22 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 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 803b883ae875..fb301c27c712 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,26 @@ static int cp2112_probe(struct hid_device *hdev, con= st struct hid_device_id *id) return ret; } =20 + if (is_acpi_device_node(hdev->dev.fwnode)) { + 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 { + device_set_node(&dev->adap.dev, + device_get_named_child_node(&hdev->dev, "i2c")); + } + ret =3D hid_parse(hdev); if (ret) { hid_err(hdev, "parse failed\n"); --=20 2.25.1 From nobody Mon Dec 1 22:36:55 2025 Received: from mx0a-0046e701.pphosted.com (mx0a-0046e701.pphosted.com [67.231.149.93]) (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 17136313534; Wed, 26 Nov 2025 17:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.93 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178703; cv=none; b=IxUVsbMN3h+WcEmStB5rJO0Wv57qwg2fIXZT+v9up5mjUo0L+A7bY1yreYc/shnrDLXhS2WIFnhYK25kesNfjk/qgAxuc8gqdATYLt9tXgScgwOoAXlneo+I+/3s6gfM9qAA9rrv1Qxlo92I+vHQKQWQ+nq3/T2JjFyCiANmhB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764178703; c=relaxed/simple; bh=gsyNbq2B3XGClE1K3VOnUs1PbaCF6eos3UvTrdx8nxQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gq0C848NYtMM8D6AEvFov4Fi43Hxt5V0nu/eSw9TVmOSztONXAocNzoAvwAQT2+jtNtMh3D2i4WE+j+loVSchWu+3JwUyzI/5bLLp6qM0CPuKd1HlPsiCo1nMM3mbUMKZ+z76i0LLxm3MAqa3mnwnVSKqdwowzSfSV4IP3X0LrI= 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=NJm30bmM; arc=none smtp.client-ip=67.231.149.93 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="NJm30bmM" Received: from pps.filterd (m0425991.ppops.net [127.0.0.1]) by mx0a-0046e701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AQ45UAE251347; Wed, 26 Nov 2025 11:09:19 -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=43rzL uZz/EbI+/ZiVJh+WEBQravA7urDgrNbx3ckJVg=; b=NJm30bmMYL1FmzRM8XIQx MnXp9DnbAqW6g6byi3UeQ6eEuP/8FEqyIXjd4FpcxUsqES5JFixYD8PuzIKnyA5j mDWaOBNPXrM+/t4op2km4ZHP4GQ0/vLfGwmEujQzCWLgfvHlavtnnK8YnTbeopAE b/gU/zU/SzwAjHtnPrO50rqsHSaGHufzI/bwfwiBAyB9+CK9sxxh6E0M4jVRV0/n 2GqV0uBprRYR7CIipvxqLfoZZGRFUUDINE5Jbz5cDwbi3R5z1gSbN0niN3Euz80d dtPkadZ2s0+R+T80RCq5pj7lBcnhORzft5JUIPxLxZpEI6XkenUVk5aDsGH2HrLk g== Received: from intranet-smtp.plexus.com ([64.215.193.254]) by mx0a-0046e701.pphosted.com (PPS) with ESMTPS id 4ant7as5wq-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Nov 2025 11:09:18 -0600 (CST) Received: from LNDCL34533.neenah.na.plexus.com (unknown [10.255.48.203]) by intranet-smtp.plexus.com (Postfix) with ESMTP id D46EC3C8B8; Wed, 26 Nov 2025 11:09:17 -0600 (CST) From: Danny Kaehn Date: Wed, 26 Nov 2025 11:05:26 -0600 Subject: [PATCH v12 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: <20251126-cp2112-dt-v12-3-2cdba6481db3@plexus.com> References: <20251126-cp2112-dt-v12-0-2cdba6481db3@plexus.com> In-Reply-To: <20251126-cp2112-dt-v12-0-2cdba6481db3@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=1764176728; l=1081; i=danny.kaehn@plexus.com; s=20251118; h=from:subject:message-id; bh=gsyNbq2B3XGClE1K3VOnUs1PbaCF6eos3UvTrdx8nxQ=; b=kht4Cqh1OZVd3gYVdQFwn9naXfnEoiY2Y8fBvZVXVINsj0J0igYsSdaaR9YI/0L9lqAHzkkGn OQGGzH3ZgqcAYC6GKGUsaLQBCbp2g8MXb2uqSM86DXVKK3M4YBFgEEv X-Developer-Key: i=danny.kaehn@plexus.com; a=ed25519; pk=br2sOmMe9QhpVp1uJw6IxgSNRKZO5khHotS2b+/bX14= X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI2MDE0MCBTYWx0ZWRfX35rlfaX+Sjdn SwP920A7SLTA9M2C+Y0Xiw5L5gRYvwKxkiAYkPWtsjPZdXtn4UYybY9AY76tOURmZFLzbw8CMyq Cu5sbHyEd4+pmI66TzCSS2Xfi8CkUWLesDGMN3PYI8IM5uq5T6/vDOBa4H8Nwg3f7UHK7BVSnEO z2e8s5K3zYJcnEzHJqfNtWD189ZL+UJ8iJrwWX8EIZAZrG2PaXRqIDsuZBQ9Z+79Xswm4iJh0jp kSF9VwZuKYCx0LyznGjmExBEuY/ATyl09O9Teby4WZpGvS1G1lwMpPSlWT7awl1qVg2QDDzPmqb SYQTHPrlevTtaP+TcAbeIIjSS0HMn10maIVWpBPYM6dofQCWAOOHIvE/v+AyV9b3L8UXUkoWsbC U5Mb67vcpWrUSMwQWu+TsOn5CGB0XA== X-Proofpoint-ORIG-GUID: CrDDBZxl-eYhUa3eAsLA3RlEk9ywaRLY X-Authority-Analysis: v=2.4 cv=BouQAIX5 c=1 sm=1 tr=0 ts=6927343f cx=c_pps a=356DXeqjepxy6lyVU6o3hA==:117 a=356DXeqjepxy6lyVU6o3hA==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Y_joWELsAAAA:8 a=B4QkrQ5K2Q0oYPUHz0oA:9 a=QEXdDO2ut3YA:10 a=g_BQsM8wYJVSTWLOHH1t:22 X-Proofpoint-GUID: HzGEIQjWvmaPWXxmcxP8h6AOtU9Gc2Tv 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 Reviewed-by: Andy Shevchenko --- 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, 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 @@ -1303,6 +1304,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