[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220118072628.1617172-13-dmitry.torokhov@gmail.com>
Date: Mon, 17 Jan 2022 23:26:28 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc: Angela Czubak <acz@...ihalf.com>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 12/12] HID: i2c-hid: note that I2C xfer buffers are DMA-safe
All I2C communications in the driver use driver-private buffers that are
DMA-safe, so mark them as such.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
drivers/hid/i2c-hid/i2c-hid-core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index aa7c573b35bc..92dd86c42975 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -180,7 +180,7 @@ static int i2c_hid_xfer(struct i2c_hid *ihid,
__func__, send_len, send_buf);
msgs[n].addr = client->addr;
- msgs[n].flags = client->flags & I2C_M_TEN;
+ msgs[n].flags = (client->flags & I2C_M_TEN) | I2C_M_DMA_SAFE;
msgs[n].len = send_len;
msgs[n].buf = send_buf;
n++;
@@ -188,7 +188,8 @@ static int i2c_hid_xfer(struct i2c_hid *ihid,
if (recv_len) {
msgs[n].addr = client->addr;
- msgs[n].flags = (client->flags & I2C_M_TEN) | I2C_M_RD;
+ msgs[n].flags = (client->flags & I2C_M_TEN) |
+ I2C_M_RD | I2C_M_DMA_SAFE;
msgs[n].len = recv_len;
msgs[n].buf = recv_buf;
n++;
--
2.34.1.703.g22d0c6ccf7-goog
Powered by blists - more mailing lists