]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
TCM825x: Include invertation of image mirroring in configuration
authorSakari Ailus <sakari.ailus@nokia.com>
Wed, 14 May 2008 12:05:31 +0000 (15:05 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 16 May 2008 17:41:45 +0000 (10:41 -0700)
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: Tony Lindgren <tony@atomide.com>
drivers/media/video/tcm825x.c
drivers/media/video/tcm825x.h

index 8f0100f67a91ea21bec97b6f708d337c18da1428..29991d1cf13e185fae6090f7a0467b490e2689a9 100644 (file)
@@ -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;
index 966765b66b3ad89de2913a6469ed9f9cc944e163..770ebacfa344a109663d533f9dc049a226409bd1 100644 (file)
@@ -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