From: Sakari Ailus <sakari.ailus@nokia.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH 1/3] TCM825x: Include invertation of image mirroring in configuration
Date: Tue, 13 May 2008 19:04:21 +0300 [thread overview]
Message-ID: <12106946631016-git-send-email-sakari.ailus@nokia.com> (raw)
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
next reply other threads:[~2008-05-13 16:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 16:04 Sakari Ailus [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12106946631016-git-send-email-sakari.ailus@nokia.com \
--to=sakari.ailus@nokia.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox