diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-13 09:21:06 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-13 09:21:06 +0000 |
commit | e04e1ce41be652e866b0e82d7ecc7d60f10b1f41 (patch) | |
tree | ae08ca270cbffc2acb093ff277327426fb663b77 /linux/drivers/media | |
parent | b0911c1c5c58cedafe9ce4f70d82282b590bfe21 (diff) | |
download | mediapointer-dvb-s2-e04e1ce41be652e866b0e82d7ecc7d60f10b1f41.tar.gz mediapointer-dvb-s2-e04e1ce41be652e866b0e82d7ecc7d60f10b1f41.tar.bz2 |
TCM825x: Include invertation of image mirroring in configuration
From: Sakari Ailus <sakari.ailus@nokia.com>
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 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/tcm825x.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/tcm825x.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/linux/drivers/media/video/tcm825x.c b/linux/drivers/media/video/tcm825x.c index e57a64605..216638e00 100644 --- a/linux/drivers/media/video/tcm825x.c +++ b/linux/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/linux/drivers/media/video/tcm825x.h b/linux/drivers/media/video/tcm825x.h index 966765b66..770ebacfa 100644 --- a/linux/drivers/media/video/tcm825x.h +++ b/linux/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 |