Commit 34cb6169 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

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: default avatarSakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 4cbeb371
...@@ -523,6 +523,9 @@ static int ioctl_g_ctrl(struct v4l2_int_device *s, ...@@ -523,6 +523,9 @@ static int ioctl_g_ctrl(struct v4l2_int_device *s,
if (val < 0) if (val < 0)
return val; return val;
if (vc->id == V4L2_CID_HFLIP || vc->id == V4L2_CID_VFLIP)
val ^= sensor->platform_data->is_upside_down();
vc->value = val; vc->value = val;
return 0; return 0;
} }
...@@ -556,6 +559,9 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s, ...@@ -556,6 +559,9 @@ static int ioctl_s_ctrl(struct v4l2_int_device *s,
if (lvc == NULL) if (lvc == NULL)
return -EINVAL; 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; val = val << lvc->start_bit;
if (tcm825x_write_reg_mask(client, lvc->reg, val)) if (tcm825x_write_reg_mask(client, lvc->reg, val))
return -EIO; return -EIO;
......
...@@ -182,6 +182,7 @@ struct tcm825x_platform_data { ...@@ -182,6 +182,7 @@ struct tcm825x_platform_data {
int (*needs_reset)(struct v4l2_int_device *s, void *buf, int (*needs_reset)(struct v4l2_int_device *s, void *buf,
struct v4l2_pix_format *fmt); struct v4l2_pix_format *fmt);
int (*ifparm)(struct v4l2_ifparm *p); int (*ifparm)(struct v4l2_ifparm *p);
int (*is_upside_down)(void);
}; };
/* Array of image sizes supported by TCM825X. These must be ordered from /* Array of image sizes supported by TCM825X. These must be ordered from
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment