Add current subpage data via the status register to the video
frame in the last word of data, which seems to be unused
undocumented reserved data.

Signed-off-by: Matt Ranostay <matt.ranos...@konsulko.com>
---
 drivers/media/i2c/video-i2c.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 078141712c88..8bc7b228ba40 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -168,8 +168,16 @@ static int amg88xx_xfer(struct video_i2c_data *data, char 
*buf)
 
 static int mlx90640_xfer(struct video_i2c_data *data, char *buf)
 {
-       return regmap_bulk_read(data->regmap, 0x400, buf,
-                               data->chip->buffer_size);
+       int ret = regmap_bulk_read(data->regmap, 0x400, buf,
+                                  data->chip->buffer_size);
+       int size = data->chip->bpp / 8;
+
+       if (ret)
+               return ret;
+
+       /* read status register, which contains subpage that is read */
+       return regmap_bulk_read(data->regmap, 0x8000,
+                               &buf[data->chip->buffer_size - size], size);
 }
 
 static int amg88xx_setup(struct video_i2c_data *data)
-- 
2.20.1

Reply via email to