All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MT9T031: write xskip and yskip at each set_params call
@ 2010-01-20 18:54 Valentin Longchamp
  2010-01-20 19:11 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 6+ messages in thread
From: Valentin Longchamp @ 2010-01-20 18:54 UTC (permalink / raw)
  To: g.liakhovetski; +Cc: linux-media, Valentin Longchamp

This prevents the registers to be different to the computed values
the second time you open the same camera with the sames parameters.

The images were different between the first device open and the
second one with the same parameters.

Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
---
 drivers/media/video/mt9t031.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
index a9061bf..e4a9095 100644
--- a/drivers/media/video/mt9t031.c
+++ b/drivers/media/video/mt9t031.c
@@ -17,6 +17,7 @@
 #include <media/v4l2-chip-ident.h>
 #include <media/soc_camera.h>
 
+
 /*
  * mt9t031 i2c address 0x5d
  * The platform has to define i2c_board_info and link to it from
@@ -337,15 +338,13 @@ static int mt9t031_set_params(struct i2c_client *client,
 	if (ret >= 0)
 		ret = reg_write(client, MT9T031_VERTICAL_BLANKING, vblank);
 
-	if (yskip != mt9t031->yskip || xskip != mt9t031->xskip) {
-		/* Binning, skipping */
-		if (ret >= 0)
-			ret = reg_write(client, MT9T031_COLUMN_ADDRESS_MODE,
-					((xbin - 1) << 4) | (xskip - 1));
-		if (ret >= 0)
-			ret = reg_write(client, MT9T031_ROW_ADDRESS_MODE,
-					((ybin - 1) << 4) | (yskip - 1));
-	}
+	/* Binning, skipping */
+	if (ret >= 0)
+		ret = reg_write(client, MT9T031_COLUMN_ADDRESS_MODE,
+				((xbin - 1) << 4) | (xskip - 1));
+	if (ret >= 0)
+		ret = reg_write(client, MT9T031_ROW_ADDRESS_MODE,
+				((ybin - 1) << 4) | (yskip - 1));
 	dev_dbg(&client->dev, "new physical left %u, top %u\n",
 		rect->left, rect->top);
 
-- 
1.6.3.3


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

end of thread, other threads:[~2010-02-08 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 18:54 [PATCH] MT9T031: write xskip and yskip at each set_params call Valentin Longchamp
2010-01-20 19:11 ` Guennadi Liakhovetski
2010-01-21  8:27   ` Valentin Longchamp
2010-02-04 19:28     ` Guennadi Liakhovetski
2010-02-08 18:43       ` Valentin Longchamp
2010-02-08 19:33         ` Guennadi Liakhovetski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.