summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tcm825x.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@nokia.com>2008-05-13 09:21:06 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 07:06:01 -0300
commit34cb61693e204897a6ae37d56a1e07d0cdd8cdbf (patch)
tree9af06b896785b7778ea47ec3b9452cb3ae3bbaa3 /drivers/media/video/tcm825x.c
parent4cbeb3711481a7e563fe4c61888986c4aa1cb22e (diff)
V4L/DVB (7897): TCM825x: Include invertation of image mirroring in configuration
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tcm825x.c')
-rw-r--r--drivers/media/video/tcm825x.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/tcm825x.c b/drivers/media/video/tcm825x.c
index 8f0100f67a9..29991d1cf13 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;