git: 67677a654aa7 - main - acpi_iicbus: Shift slave address

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 19 Apr 2024 22:48:59 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=67677a654aa7456f18077ccbaa9c40f39a36d21a

commit 67677a654aa7456f18077ccbaa9c40f39a36d21a
Author:     Ahmad Khalifa <ahmadkhalifa570@gmail.com>
AuthorDate: 2024-04-19 22:43:19 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-19 22:44:57 +0000

    acpi_iicbus: Shift slave address
    
    The address is expected to need shifting.
    see https://uefi.org/specs/ACPI/6.5/13_System_Mgmt_Bus_Interface_Specification.html#smbus-slave-addresses
    
    Reviewed by: imp, markj, Elliott Mitchell
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1125
---
 sys/dev/iicbus/acpi_iicbus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/iicbus/acpi_iicbus.c b/sys/dev/iicbus/acpi_iicbus.c
index 2cff0cde9e48..4b61387b0ed6 100644
--- a/sys/dev/iicbus/acpi_iicbus.c
+++ b/sys/dev/iicbus/acpi_iicbus.c
@@ -254,6 +254,9 @@ acpi_iicbus_space_handler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address,
 	sc = __containerof(info, struct acpi_iicbus_softc, space_handler_info);
 	dev = sc->super_sc.dev;
 
+	/* the address is expected to need shifting */
+	sb->SlaveAddress <<= 1;
+
 	switch (Function) {
 	case AML_FIELD_ATTRIO(AML_FIELD_ATTRIB_SEND_RECEIVE, ACPI_READ):
 		val = acpi_iicbus_recvb(dev, sb->SlaveAddress, gsb->data);