linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: video-i2c: add mlx90640 subpage data to output
@ 2019-08-11  7:10 Matt Ranostay
  2019-08-12 13:05 ` Hans Verkuil
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Ranostay @ 2019-08-11  7:10 UTC (permalink / raw)
  To: linux-media; +Cc: Matt Ranostay

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.ranostay@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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-21  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-11  7:10 [PATCH] media: video-i2c: add mlx90640 subpage data to output Matt Ranostay
2019-08-12 13:05 ` Hans Verkuil
2019-08-15  6:23   ` Matt Ranostay
2019-08-16  7:57     ` Hans Verkuil
2019-08-21  5:59   ` Matt Ranostay
2019-08-21  8:14     ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).