Skip to content

Commit 1c4d6cd

Browse files
dtorJiri Kosina
authored andcommitted
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>
1 parent 551117c commit 1c4d6cd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,16 @@ static int i2c_hid_xfer(struct i2c_hid *ihid,
180180
__func__, send_len, send_buf);
181181

182182
msgs[n].addr = client->addr;
183-
msgs[n].flags = client->flags & I2C_M_TEN;
183+
msgs[n].flags = (client->flags & I2C_M_TEN) | I2C_M_DMA_SAFE;
184184
msgs[n].len = send_len;
185185
msgs[n].buf = send_buf;
186186
n++;
187187
}
188188

189189
if (recv_len) {
190190
msgs[n].addr = client->addr;
191-
msgs[n].flags = (client->flags & I2C_M_TEN) | I2C_M_RD;
191+
msgs[n].flags = (client->flags & I2C_M_TEN) |
192+
I2C_M_RD | I2C_M_DMA_SAFE;
192193
msgs[n].len = recv_len;
193194
msgs[n].buf = recv_buf;
194195
n++;

0 commit comments

Comments
 (0)