mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danny Kaehn <danny.kaehn@plexus.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Danny Kaehn <danny.kaehn@plexus.com>
Subject: [PATCH 2/2] Documentation: ACPI: Add Silicon Labs CP2112 enumeration document
Date: Tue, 01 Dec 2026 12:35:04 -0600	[thread overview]
Message-ID: <20261201-cp2112-docs-v1-2-92156113ac84@plexus.com> (raw)
In-Reply-To: <20261201-cp2112-docs-v1-0-92156113ac84@plexus.com>

The hid-cp2112 driver supports describing the CP2112 and its I2C and GPIO
functions via ACPI, but there is no documentation of how the device is
expected to be described.

Document that the CP2112 is described as a child of the USB port it is
attached to, with child device nodes for its I2C controller (_ADR 0) and
GPIO controller (_ADR 1), and that the I2C bus speed can be set with the
"clock-frequency" property. Include an example ASL showing an LM75
temperature sensor on the CP2112 I2C bus and a hog on a CP2112 GPIO.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/linux-input/autpMnQT8t0Ecu-m@ashevche-desk.local/
Signed-off-by: Danny Kaehn <danny.kaehn@plexus.com>
---
 .../firmware-guide/acpi/i2c/silabs,cp2112.rst      | 123 +++++++++++++++++++++
 Documentation/firmware-guide/acpi/index.rst        |   1 +
 2 files changed, 124 insertions(+)

diff --git a/Documentation/firmware-guide/acpi/i2c/silabs,cp2112.rst b/Documentation/firmware-guide/acpi/i2c/silabs,cp2112.rst
new file mode 100644
index 000000000000..efc218bb6a5a
--- /dev/null
+++ b/Documentation/firmware-guide/acpi/i2c/silabs,cp2112.rst
@@ -0,0 +1,123 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+================================================
+Silicon Labs CP2112 HID USB to SMBus/I2C Bridge
+================================================
+
+The CP2112 is a USB HID device which includes an integrated I2C controller
+and 8 GPIO pins. When the CP2112 is permanently attached to a USB port, it
+can be described in ACPI so that devices connected to its I2C bus or GPIO
+pins can be enumerated and reference it like any other I2C or GPIO
+controller.
+
+The CP2112 is described by a Device () node under the USB port to which it
+is attached, with its ``_ADR`` set to the USB port number. The USB HID
+driver shares this firmware node with the hid-cp2112 driver.
+
+The I2C controller and GPIO controller are each described by a child
+Device () node of the CP2112, identified by their ``_ADR``:
+
+========  ====================
+``_ADR``  Function
+========  ====================
+0         I2C controller
+1         GPIO controller
+========  ====================
+
+I2C controller
+==============
+
+The I2C controller node (``_ADR`` 0) acts as the parent of any I2C client
+devices on the CP2112 bus. I2C clients reference it as the ResourceSource
+of their I2cSerialBus () resource.
+
+The bus speed can be configured with the ``clock-frequency`` device property
+in Hz, from 10000 to 400000. The default is 100000.
+
+GPIO controller
+===============
+
+The GPIO controller node (``_ADR`` 1) is referenced as the ResourceSource of
+GpioIo () and GpioInt () resources of consumer devices. The GPIO controller
+is also an interrupt controller, so its pins may be used with GpioInt ().
+
+The ``gpio-line-names`` property and GPIO hogs are supported as described in
+Documentation/firmware-guide/acpi/gpio-properties.rst.
+
+Example
+=======
+
+The following ASL describes a CP2112 attached to port 1 of the root hub of
+a USB host controller, with:
+
+- the I2C bus configured for 400 kHz,
+- an LM75 temperature sensor at address 0x48 on the I2C bus,
+- GPIO 7 hogged high and named "FAN_RST".
+
+::
+
+    Scope (\_SB.PCI0)
+    {
+        Device (SE9)
+        {
+            Name (_ADR, 0x001D0001)
+
+            Device (RHUB)
+            {
+                Name (_ADR, Zero)
+
+                Device (CP2)
+                {
+                    Name (_ADR, One)
+
+                    Device (I2C0)
+                    {
+                        Name (_ADR, Zero)
+                        Name (_DSD, Package () {
+                            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+                            Package () {
+                                Package () { "clock-frequency", 400000 },
+                            }
+                        })
+
+                        Device (TMP0)
+                        {
+                            Name (_HID, "PRP0001")
+                            Name (_CRS, ResourceTemplate () {
+                                I2cSerialBusV2 (0x48, ControllerInitiated,
+                                                400000, AddressingMode7Bit,
+                                                "\\_SB.PCI0.SE9.RHUB.CP2.I2C0")
+                            })
+                            Name (_DSD, Package () {
+                                ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+                                Package () {
+                                    Package () { "compatible", "national,lm75" },
+                                }
+                            })
+                        }
+                    }
+
+                    Device (GPIO)
+                    {
+                        Name (_ADR, One)
+                        Name (_DSD, Package () {
+                            ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
+                            Package () {
+                                Package () { "fan-rst-hog", "FRST" },
+                            }
+                        })
+
+                        Name (FRST, Package () {
+                            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+                            Package () {
+                                Package () { "gpio-hog", 1 },
+                                Package () { "gpios", Package () { 7, 0 } },
+                                Package () { "output-high", 1 },
+                                Package () { "line-name", "FAN_RST" },
+                            }
+                        })
+                    }
+                }
+            }
+        }
+    }
diff --git a/Documentation/firmware-guide/acpi/index.rst b/Documentation/firmware-guide/acpi/index.rst
index cd29e180410e..4235afa2b0d0 100644
--- a/Documentation/firmware-guide/acpi/index.rst
+++ b/Documentation/firmware-guide/acpi/index.rst
@@ -23,6 +23,7 @@ ACPI Support
    apei/einj
    gpio-properties
    i2c/i2c-muxes
+   i2c/silabs,cp2112
    acpi-lid
    lpit
    video_extension

-- 
2.25.1


      parent reply	other threads:[~2026-12-01 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 18:35 [PATCH 0/2] Documentation: ACPI: Document CP2112 enumeration Danny Kaehn
2026-12-01 18:35 ` [PATCH 1/2] Documentation: ACPI: Move i2c-muxes to i2c/ subdirectory Danny Kaehn
2026-12-01 18:35 ` Danny Kaehn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201-cp2112-docs-v1-2-92156113ac84@plexus.com \
    --to=danny.kaehn@plexus.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®