From 79ce00eaa49d76e435f432a50cb0d4a9b1182aa6 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 1 Mar 2017 09:38:29 +1000 Subject: i2c/g94-: return REPLY_M value on reads This value represents the actual number of bytes recieved on the AUX channel as the result of a read transaction. Signed-off-by: Ben Skeggs --- drm/nouveau/nvkm/subdev/i2c/auxg94.c | 1 + drm/nouveau/nvkm/subdev/i2c/auxgm200.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drm/nouveau/nvkm/subdev/i2c/auxg94.c b/drm/nouveau/nvkm/subdev/i2c/auxg94.c index dc96afb77..ab8cb196c 100644 --- a/drm/nouveau/nvkm/subdev/i2c/auxg94.c +++ b/drm/nouveau/nvkm/subdev/i2c/auxg94.c @@ -152,6 +152,7 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, AUX_TRACE(&aux->base, "rd %08x", xbuf[i / 4]); } memcpy(data, xbuf, *size); + *size = stat & 0x0000001f; } out: diff --git a/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drm/nouveau/nvkm/subdev/i2c/auxgm200.c index 50e79a910..ee091fa79 100644 --- a/drm/nouveau/nvkm/subdev/i2c/auxgm200.c +++ b/drm/nouveau/nvkm/subdev/i2c/auxgm200.c @@ -152,6 +152,7 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry, AUX_TRACE(&aux->base, "rd %08x", xbuf[i / 4]); } memcpy(data, xbuf, *size); + *size = stat & 0x0000001f; } out: -- cgit v1.2.1