Changes: SAM: - Move lid/GPE workaround into separate independent module. - A bus and device type has been implemented for SAM devices. - Detach devices attached to the base when the cliboard is being detached on the Surface Book 3. - Internal restructuring. Links: - kernel:233bcf2785
- SAM:08bbb7272a
66 lines
1.8 KiB
Diff
66 lines
1.8 KiB
Diff
From eae6ff101dcc0ee68ee9d891553bf557ca54b59e Mon Sep 17 00:00:00 2001
|
|
From: Maximilian Luz <luzmaximilian@gmail.com>
|
|
Date: Sat, 25 Jul 2020 17:19:53 +0200
|
|
Subject: [PATCH 5/6] surface-sam-over-hid
|
|
|
|
---
|
|
drivers/i2c/i2c-core-acpi.c | 35 +++++++++++++++++++++++++++++++++++
|
|
1 file changed, 35 insertions(+)
|
|
|
|
diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
|
|
index 2ade99b105b91..60b9cb51d5f7e 100644
|
|
--- a/drivers/i2c/i2c-core-acpi.c
|
|
+++ b/drivers/i2c/i2c-core-acpi.c
|
|
@@ -574,6 +574,28 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client,
|
|
return (ret == 1) ? 0 : -EIO;
|
|
}
|
|
|
|
+static int acpi_gsb_i2c_write_raw_bytes(struct i2c_client *client,
|
|
+ u8 *data, u8 data_len)
|
|
+{
|
|
+ struct i2c_msg msgs[1];
|
|
+ int ret = AE_OK;
|
|
+
|
|
+ msgs[0].addr = client->addr;
|
|
+ msgs[0].flags = client->flags;
|
|
+ msgs[0].len = data_len + 1;
|
|
+ msgs[0].buf = data;
|
|
+
|
|
+ ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
|
|
+
|
|
+ if (ret < 0) {
|
|
+ dev_err(&client->adapter->dev, "i2c write failed: %d\n", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ /* 1 transfer must have completed successfully */
|
|
+ return (ret == 1) ? 0 : -EIO;
|
|
+}
|
|
+
|
|
static acpi_status
|
|
i2c_acpi_space_handler(u32 function, acpi_physical_address command,
|
|
u32 bits, u64 *value64,
|
|
@@ -675,6 +697,19 @@ i2c_acpi_space_handler(u32 function, acpi_physical_address command,
|
|
}
|
|
break;
|
|
|
|
+ case ACPI_GSB_ACCESS_ATTRIB_RAW_BYTES:
|
|
+ if (action == ACPI_READ) {
|
|
+ dev_warn(&adapter->dev,
|
|
+ "protocol 0x%02x not supported for client 0x%02x\n",
|
|
+ accessor_type, client->addr);
|
|
+ ret = AE_BAD_PARAMETER;
|
|
+ goto err;
|
|
+ } else {
|
|
+ status = acpi_gsb_i2c_write_raw_bytes(client,
|
|
+ gsb->data, info->access_length);
|
|
+ }
|
|
+ break;
|
|
+
|
|
default:
|
|
dev_warn(&adapter->dev, "protocol 0x%02x not supported for client 0x%02x\n",
|
|
accessor_type, client->addr);
|
|
--
|
|
2.28.0
|
|
|