public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration
@ 2008-05-13 16:04 Sakari Ailus
  2008-05-13 16:04 ` [PATCH 2/3] N810: Don't export camera orientation Sakari Ailus
  2008-05-13 19:53 ` [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration Felipe Balbi
  0 siblings, 2 replies; 17+ messages in thread
From: Sakari Ailus @ 2008-05-13 16:04 UTC (permalink / raw)
  To: linux-omap

Add invertation of image mirroring register bits to default
configuration.

This is useful when the camera module is e.g. mounted upside down.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
---
 drivers/media/video/tcm825x.c |    6 ++++++
 drivers/media/video/tcm825x.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c
index e57a646..216638e 100644
--- a/drivers/media/video/tcm825x.c
+++ b/drivers/media/video/tcm825x.c
@@ -523,6 +523,9 @@ static int ioctl_g_ctrl(struct v4l2_int_device *s,
 	if (val < 0)
 		return val;
 
+	if (vc->id == V4L2_CID_HFLIP || vc->id == V4L2_CID_VFLIP)
+		val ^= sensor->platform_data->is_upside_down();
+
 	vc->value = val;
 	return 0;
 }
@@ -556,6 +559,9 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s,
 	if (lvc == NULL)
 		return -EINVAL;
 
+	if (vc->id == V4L2_CID_HFLIP || vc->id == V4L2_CID_VFLIP)
+		val ^= sensor->platform_data->is_upside_down();
+
 	val = val << lvc->start_bit;
 	if (tcm825x_write_reg_mask(client, lvc->reg, val))
 		return -EIO;
diff --git a/drivers/media/video/tcm825x.h b/drivers/media/video/tcm825x.h
index 966765b..770ebac 100644
--- a/drivers/media/video/tcm825x.h
+++ b/drivers/media/video/tcm825x.h
@@ -182,6 +182,7 @@ struct tcm825x_platform_data {
 	int (*needs_reset)(struct v4l2_int_device *s, void *buf,
 			   struct v4l2_pix_format *fmt);
 	int (*ifparm)(struct v4l2_ifparm *p);
+	int (*is_upside_down)(void);
 };
 
 /* Array of image sizes supported by TCM825X.  These must be ordered from
-- 
1.5.0.6


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

end of thread, other threads:[~2008-05-16 17:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13 16:04 [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration Sakari Ailus
2008-05-13 16:04 ` [PATCH 2/3] N810: Don't export camera orientation Sakari Ailus
2008-05-13 16:04   ` [PATCH 3/3] N800: Select tcm825x only if wanted Sakari Ailus
2008-05-13 20:01   ` [PATCH 2/3] N810: Don't export camera orientation Felipe Balbi
2008-05-14 12:04     ` Sakari Ailus
2008-05-14 12:05       ` [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration Sakari Ailus
2008-05-14 12:05         ` [PATCH 2/3] N810: Don't export camera orientation Sakari Ailus
2008-05-14 12:05           ` [PATCH 3/3] N800: Select tcm825x only if wanted Sakari Ailus
2008-05-16 17:44             ` Tony Lindgren
2008-05-16 17:44           ` [PATCH 2/3] N810: Don't export camera orientation Tony Lindgren
2008-05-16 17:42         ` [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration Tony Lindgren
2008-05-14 22:58       ` [PATCH 2/3] N810: Don't export camera orientation Felipe Balbi
2008-05-15  6:54         ` andrzej zaborowski
2008-05-15  7:57           ` Felipe Balbi
2008-05-15  8:11             ` andrzej zaborowski
2008-05-15  8:17               ` Felipe Balbi
2008-05-13 19:53 ` [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox