mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Documentation: ACPI: Document CP2112 enumeration
@ 2026-12-01 18:35 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 ` [PATCH 2/2] Documentation: ACPI: Add Silicon Labs CP2112 enumeration document Danny Kaehn
  0 siblings, 2 replies; 3+ messages in thread
From: Danny Kaehn @ 2026-12-01 18:35 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Andy Shevchenko
  Cc: linux-acpi, linux-kernel, Danny Kaehn

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. Andy requested such documentation in [1].

Following Andy's suggestion in [2], the first patch moves the existing ACPI
I2C muxes document into a new i2c/ subdirectory of the ACPI firmware guide,
and the second patch adds the CP2112 document there, named after its
DeviceTree compatible string.

The example ASL in the CP2112 document compiles with iasl without errors
or warnings, and the firmware-guide htmldocs build without new warnings.

[1]: https://lore.kernel.org/linux-input/autpMnQT8t0Ecu-m@ashevche-desk.local/
[2]: https://lore.kernel.org/linux-input/avN2zfSvXs3OOFX4@ashevche-desk.local/

Signed-off-by: Danny Kaehn <danny.kaehn@plexus.com>
---
Danny Kaehn (2):
      Documentation: ACPI: Move i2c-muxes to i2c/ subdirectory
      Documentation: ACPI: Add Silicon Labs CP2112 enumeration document

 .../firmware-guide/acpi/{ => i2c}/i2c-muxes.rst    |   0
 .../firmware-guide/acpi/i2c/silabs,cp2112.rst      | 123 +++++++++++++++++++++
 Documentation/firmware-guide/acpi/index.rst        |   3 +-
 3 files changed, 125 insertions(+), 1 deletion(-)
---
base-commit: 756a3f9e02913ca1616ee8ed4598b1208ab8e9fb
change-id: 20261117-cp2112-docs-cf947049641e

Best regards,
-- 
Danny Kaehn <danny.kaehn@plexus.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Documentation: ACPI: Move i2c-muxes to i2c/ subdirectory
  2026-12-01 18:35 [PATCH 0/2] Documentation: ACPI: Document CP2112 enumeration Danny Kaehn
@ 2026-12-01 18:35 ` Danny Kaehn
  2026-12-01 18:35 ` [PATCH 2/2] Documentation: ACPI: Add Silicon Labs CP2112 enumeration document Danny Kaehn
  1 sibling, 0 replies; 3+ messages in thread
From: Danny Kaehn @ 2026-12-01 18:35 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Andy Shevchenko
  Cc: linux-acpi, linux-kernel, Danny Kaehn

Move the ACPI I2C muxes document into a new i2c/ subdirectory of the ACPI
firmware guide, and update the index accordingly. This provides a place
for upcoming documents describing how to enumerate specific I2C-related
hardware via ACPI, which will follow the DeviceTree naming scheme.

No content changes.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/linux-input/avN2zfSvXs3OOFX4@ashevche-desk.local/
Signed-off-by: Danny Kaehn <danny.kaehn@plexus.com>
---
 Documentation/firmware-guide/acpi/{ => i2c}/i2c-muxes.rst | 0
 Documentation/firmware-guide/acpi/index.rst               | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/firmware-guide/acpi/i2c-muxes.rst b/Documentation/firmware-guide/acpi/i2c/i2c-muxes.rst
similarity index 100%
rename from Documentation/firmware-guide/acpi/i2c-muxes.rst
rename to Documentation/firmware-guide/acpi/i2c/i2c-muxes.rst
diff --git a/Documentation/firmware-guide/acpi/index.rst b/Documentation/firmware-guide/acpi/index.rst
index db9eb7229948..cd29e180410e 100644
--- a/Documentation/firmware-guide/acpi/index.rst
+++ b/Documentation/firmware-guide/acpi/index.rst
@@ -22,7 +22,7 @@ ACPI Support
    apei/output_format
    apei/einj
    gpio-properties
-   i2c-muxes
+   i2c/i2c-muxes
    acpi-lid
    lpit
    video_extension

-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Documentation: ACPI: Add Silicon Labs CP2112 enumeration document
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Danny Kaehn @ 2026-12-01 18:35 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Andy Shevchenko
  Cc: linux-acpi, linux-kernel, Danny Kaehn

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] Documentation: ACPI: Add Silicon Labs CP2112 enumeration document Danny Kaehn

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®