Linux I2C development
 help / color / mirror / Atom feed
From: Hans de Goede <johannes.goede@oss.qualcomm.com>
To: Andi Shyti <andi.shyti@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Hans de Goede <johannes.goede@oss.qualcomm.com>,
	linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH 2/2] i2c: acpi: Add AttribRawBytes accessor-type support to OpRegion handler
Date: Sat, 19 Sep 2026 21:36:42 +0200	[thread overview]
Message-ID: <20260919193642.43058-2-johannes.goede@oss.qualcomm.com> (raw)
In-Reply-To: <20260919193642.43058-1-johannes.goede@oss.qualcomm.com>

Add AttribRawBytes accessor-type support to OpRegion handler, this is used
by the ACPI tables on a ThinkPad T14s gen6 Snapdragon laptop.

Looking at the AML it seems the expected behavior is to simply read or
write accessor-length bytes and this implementation allows successful
communication with the EC on a T14s gen6 Snapdragon laptop.

Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
 drivers/i2c/i2c-core-acpi.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 583d89c626e3..31fd88e63bf5 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -766,6 +766,18 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command,
 		}
 		break;
 
+	case ACPI_GSB_ACCESS_ATTRIB_RAW_BYTES:
+		if (action == ACPI_READ)
+			status = i2c_master_recv(client, gsb->data, info->access_length);
+		else
+			status = i2c_master_send(client, gsb->data, info->access_length);
+
+		if (status >= 0) {
+			gsb->len = status;
+			status = 0;
+		}
+		break;
+
 	default:
 		dev_warn(&adapter->dev, "protocol 0x%02x not supported for client 0x%02x\n",
 			 accessor_type, client->addr);
-- 
2.55.0


  reply	other threads:[~2026-09-19 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 19:36 [PATCH 1/2] i2c: acpi: Use I2C_M_DMA_SAFE in acpi_gsb_i2c_[read|write]_bytes() Hans de Goede
2026-09-19 19:36 ` Hans de Goede [this message]
2026-09-21  5:18   ` [PATCH 2/2] i2c: acpi: Add AttribRawBytes accessor-type support to OpRegion handler Mika Westerberg
2026-09-21  5:17 ` [PATCH 1/2] i2c: acpi: Use I2C_M_DMA_SAFE in acpi_gsb_i2c_[read|write]_bytes() Mika Westerberg

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=20260919193642.43058-2-johannes.goede@oss.qualcomm.com \
    --to=johannes.goede@oss.qualcomm.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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