Skip to content

Commit 079a015

Browse files
kaehndAndi Shyti
authored andcommitted
dt-bindings: i2c: Add CP2112 HID USB to SMBus Bridge
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 <danny.kaehn@plexus.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260127-cp2112-dt-v13-1-6448ddd4bf22@plexus.com
1 parent 76b7062 commit 079a015

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/i2c/silabs,cp2112.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: CP2112 HID USB to SMBus/I2C Bridge
8+
9+
maintainers:
10+
- Danny Kaehn <danny.kaehn@plexus.com>
11+
12+
description:
13+
The CP2112 is a USB HID device which includes an integrated I2C controller
14+
and 8 GPIO pins. Its GPIO pins can each be configured as inputs, open-drain
15+
outputs, or push-pull outputs.
16+
17+
properties:
18+
compatible:
19+
const: usb10c4,ea90
20+
21+
reg:
22+
maxItems: 1
23+
description: The USB port number
24+
25+
interrupt-controller: true
26+
"#interrupt-cells":
27+
const: 2
28+
29+
gpio-controller: true
30+
"#gpio-cells":
31+
const: 2
32+
33+
gpio-line-names:
34+
minItems: 1
35+
maxItems: 8
36+
37+
i2c:
38+
description: The SMBus/I2C controller node for the CP2112
39+
$ref: /schemas/i2c/i2c-controller.yaml#
40+
unevaluatedProperties: false
41+
42+
properties:
43+
clock-frequency:
44+
minimum: 10000
45+
default: 100000
46+
maximum: 400000
47+
48+
patternProperties:
49+
"-hog(-[0-9]+)?$":
50+
type: object
51+
52+
required:
53+
- gpio-hog
54+
55+
required:
56+
- compatible
57+
- reg
58+
59+
additionalProperties: false
60+
61+
examples:
62+
- |
63+
#include <dt-bindings/interrupt-controller/irq.h>
64+
#include <dt-bindings/gpio/gpio.h>
65+
66+
usb {
67+
#address-cells = <1>;
68+
#size-cells = <0>;
69+
70+
cp2112: device@1 {
71+
compatible = "usb10c4,ea90";
72+
reg = <1>;
73+
74+
gpio-controller;
75+
interrupt-controller;
76+
#interrupt-cells = <2>;
77+
#gpio-cells = <2>;
78+
gpio-line-names = "CP2112_SDA", "CP2112_SCL", "TEST2",
79+
"TEST3","TEST4", "TEST5", "TEST6";
80+
81+
fan-rst-hog {
82+
gpio-hog;
83+
gpios = <7 GPIO_ACTIVE_HIGH>;
84+
output-high;
85+
line-name = "FAN_RST";
86+
};
87+
88+
i2c {
89+
#address-cells = <1>;
90+
#size-cells = <0>;
91+
sda-gpios = <&cp2112 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
92+
scl-gpios = <&cp2112 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
93+
94+
temp@48 {
95+
compatible = "national,lm75";
96+
reg = <0x48>;
97+
};
98+
};
99+
};
100+
};

0 commit comments

Comments
 (0)