summaryrefslogtreecommitdiff
path: root/drivers/hid/i2c-hid
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2022-01-18 10:26:28 +0300
committerJiri Kosina <jkosina@suse.cz>2022-02-14 12:52:29 +0300
commit1c4d6cd4cb48ae5d097c610a5ca4bd15e9f41bfb (patch)
treebf04bfa11bc999a98c7bdbd2c909229697f1f824 /drivers/hid/i2c-hid
parent551117c52237e7d92bc050df961b6a63e86c5bcd (diff)
downloadlinux-1c4d6cd4cb48ae5d097c610a5ca4bd15e9f41bfb.tar.xz
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@gmail.com> Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid-core.c5
1 files 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 f312d2afd319..91b2fa0d33c7 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++;