Skip to content

Commit

Permalink
HID: i2c-hid: note that I2C xfer buffers are DMA-safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Jiri Kosina committed Feb 14, 2022
1 parent 551117c commit 1c4d6cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/hid/i2c-hid/i2c-hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ 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++;
}

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++;
Expand Down

0 comments on commit 1c4d6cd

Please sign in to comment.