V4L/DVB (11639): gspca - m5602-mt9m111: Correct the hflip/vflip semantics
mt9m111: Hflip and vflip shall always be 0 at start and the image shall be correctly aligned. The mt9m111 is hflipped and vflipped by default. Correct the semantics to make this happen. Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
81b4293ae6
commit
c731e271af
@@ -67,7 +67,7 @@ const static struct ctrl mt9m111_ctrls[] = {
|
|||||||
.minimum = 0,
|
.minimum = 0,
|
||||||
.maximum = 1,
|
.maximum = 1,
|
||||||
.step = 1,
|
.step = 1,
|
||||||
.default_value = 1
|
.default_value = 0
|
||||||
},
|
},
|
||||||
.set = mt9m111_set_vflip,
|
.set = mt9m111_set_vflip,
|
||||||
.get = mt9m111_get_vflip
|
.get = mt9m111_get_vflip
|
||||||
@@ -81,7 +81,7 @@ const static struct ctrl mt9m111_ctrls[] = {
|
|||||||
.minimum = 0,
|
.minimum = 0,
|
||||||
.maximum = 1,
|
.maximum = 1,
|
||||||
.step = 1,
|
.step = 1,
|
||||||
.default_value = 1
|
.default_value = 0
|
||||||
},
|
},
|
||||||
.set = mt9m111_set_hflip,
|
.set = mt9m111_set_hflip,
|
||||||
.get = mt9m111_get_hflip
|
.get = mt9m111_get_hflip
|
||||||
@@ -391,6 +391,9 @@ static int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
|
|||||||
|
|
||||||
sensor_settings[VFLIP_IDX] = val;
|
sensor_settings[VFLIP_IDX] = val;
|
||||||
|
|
||||||
|
/* The mt9m111 is flipped by default */
|
||||||
|
val = !val;
|
||||||
|
|
||||||
/* Set the correct page map */
|
/* Set the correct page map */
|
||||||
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
|
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
@@ -427,6 +430,10 @@ static int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
|
|||||||
PDEBUG(D_V4L2, "Set horizontal flip to %d", val);
|
PDEBUG(D_V4L2, "Set horizontal flip to %d", val);
|
||||||
|
|
||||||
sensor_settings[HFLIP_IDX] = val;
|
sensor_settings[HFLIP_IDX] = val;
|
||||||
|
|
||||||
|
/* The mt9m111 is flipped by default */
|
||||||
|
val = !val;
|
||||||
|
|
||||||
/* Set the correct page map */
|
/* Set the correct page map */
|
||||||
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
|
err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
Reference in New Issue
Block a user