]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/tcm825x.c
V4L/DVB (7897): TCM825x: Include invertation of image mirroring in configuration
[linux-2.6-omap-h63xx.git] / drivers / media / video / tcm825x.c
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;