From: Konstantin Aladyshev <aladyshev22@gmail.com>
To: andriy.shevchenko@linux.intel.com
Cc: aladyshev22@gmail.com, Jean Delvare <jdelvare@suse.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] docs: i2c: piix4: Add ACPI section
Date: Mon, 11 Nov 2024 14:56:52 +0300 [thread overview]
Message-ID: <20241111115652.10831-1-aladyshev22@gmail.com> (raw)
Provide information how to reference I2C busses created by the PIIX4
chip driver from the ACPI code.
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
---
Documentation/i2c/busses/i2c-piix4.rst | 56 ++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/Documentation/i2c/busses/i2c-piix4.rst b/Documentation/i2c/busses/i2c-piix4.rst
index 07fe6f6f4b18..2a00158b508a 100644
--- a/Documentation/i2c/busses/i2c-piix4.rst
+++ b/Documentation/i2c/busses/i2c-piix4.rst
@@ -109,3 +109,59 @@ which can easily get corrupted due to a state machine bug. These are mostly
Thinkpad laptops, but desktop systems may also be affected. We have no list
of all affected systems, so the only safe solution was to prevent access to
the SMBus on all IBM systems (detected using DMI data.)
+
+
+Description in the ACPI code
+----------------------------
+
+Device driver for the PIIX4 chip creates a separate I2C bus for each of its ports::
+
+ $ i2cdetect -l
+ ...
+ i2c-7 unknown SMBus PIIX4 adapter port 0 at 0b00 N/A
+ i2c-8 unknown SMBus PIIX4 adapter port 2 at 0b00 N/A
+ i2c-9 unknown SMBus PIIX4 adapter port 1 at 0b20 N/A
+ ...
+
+Therefore if you want to access one of these busses in the ACPI code, you need to
+declare port subdevices inside the PIIX device::
+
+ Scope (\_SB_.PCI0.SMBS)
+ {
+ Name (_ADR, 0x00140000)
+
+ Device (SMB0) {
+ Name (_ADR, 0)
+ }
+ Device (SMB1) {
+ Name (_ADR, 1)
+ }
+ Device (SMB2) {
+ Name (_ADR, 2)
+ }
+ }
+
+As an example of usage here is the ACPI snippet code that would assign jc42 driver
+to the 0x1C device on the I2C bus created by the PIIX port 0::
+
+ Device (JC42) {
+ Name (_HID, "PRP0001")
+ Name (_DDN, "JC42 Temperature sensor")
+ Name (_CRS, ResourceTemplate () {
+ I2cSerialBusV2 (
+ 0x001c,
+ ControllerInitiated,
+ 100000,
+ AddressingMode7Bit,
+ "\\_SB.PCI0.SMBS.SMB0",
+ 0
+ )
+ })
+
+ Name (_DSD, Package () {
+ ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package () {
+ Package () { "compatible", Package() { "jedec,jc-42.4-temp" } },
+ }
+ })
+ }
--
2.43.0
next reply other threads:[~2024-11-11 11:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 11:56 Konstantin Aladyshev [this message]
2024-11-11 12:52 ` [PATCH] docs: i2c: piix4: Add ACPI section Andy Shevchenko
2024-11-11 12:53 ` Andy Shevchenko
2024-11-11 14:02 ` [PATCH v2] " Konstantin Aladyshev
2024-11-11 14:15 ` Andy Shevchenko
2024-11-11 22:35 ` Andi Shyti
2024-11-12 0:51 ` Bagas Sanjaya
2024-11-13 22:50 ` Andi Shyti
2024-11-14 8:01 ` Konstantin Aladyshev
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=20241111115652.10831-1-aladyshev22@gmail.com \
--to=aladyshev22@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jdelvare@suse.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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