diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-02-18 02:12:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:03 -0500 |
commit | f6b22e5e8e93d03046d3878664a9ba375ccded96 (patch) | |
tree | e17241ef7886549e648dc4096236dd8c0a2d7959 /drivers/media/video | |
parent | bee527f97963ece5e3f6e6587402197af889865b (diff) |
V4L/DVB: gspca - sonixj: Add vertical flip control for sensor hv7131r
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 4ece1109d399..fea807574425 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -282,7 +282,7 @@ static const struct ctrl sd_ctrls[] = { | |||
282 | static __u32 ctrl_dis[] = { | 282 | static __u32 ctrl_dis[] = { |
283 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX) | | 283 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX) | |
284 | (1 << AUTOGAIN_IDX), /* SENSOR_ADCM1700 0 */ | 284 | (1 << AUTOGAIN_IDX), /* SENSOR_ADCM1700 0 */ |
285 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 285 | (1 << INFRARED_IDX) | (1 << FREQ_IDX), |
286 | /* SENSOR_HV7131R 1 */ | 286 | /* SENSOR_HV7131R 1 */ |
287 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), | 287 | (1 << INFRARED_IDX) | (1 << VFLIP_IDX) | (1 << FREQ_IDX), |
288 | /* SENSOR_MI0360 2 */ | 288 | /* SENSOR_MI0360 2 */ |
@@ -1780,23 +1780,34 @@ static void setautogain(struct gspca_dev *gspca_dev) | |||
1780 | sd->ag_cnt = -1; | 1780 | sd->ag_cnt = -1; |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | /* ov7630/ov7648 only */ | 1783 | /* hv7131r/ov7630/ov7648 only */ |
1784 | static void setvflip(struct sd *sd) | 1784 | static void setvflip(struct sd *sd) |
1785 | { | 1785 | { |
1786 | u8 comn; | 1786 | u8 comn; |
1787 | 1787 | ||
1788 | if (sd->gspca_dev.ctrl_dis & (1 << VFLIP_IDX)) | 1788 | if (sd->gspca_dev.ctrl_dis & (1 << VFLIP_IDX)) |
1789 | return; | 1789 | return; |
1790 | if (sd->sensor == SENSOR_OV7630) { | 1790 | switch (sd->sensor) { |
1791 | case SENSOR_HV7131R: | ||
1792 | comn = 0x18; /* clkdiv = 1, ablcen = 1 */ | ||
1793 | if (sd->vflip) | ||
1794 | comn |= 0x01; | ||
1795 | i2c_w1(&sd->gspca_dev, 0x01, comn); /* sctra */ | ||
1796 | break; | ||
1797 | case SENSOR_OV7630: | ||
1791 | comn = 0x02; | 1798 | comn = 0x02; |
1792 | if (!sd->vflip) | 1799 | if (!sd->vflip) |
1793 | comn |= 0x80; | 1800 | comn |= 0x80; |
1794 | } else { | 1801 | i2c_w1(&sd->gspca_dev, 0x75, comn); |
1802 | break; | ||
1803 | default: | ||
1804 | /* case SENSOR_OV7648: */ | ||
1795 | comn = 0x06; | 1805 | comn = 0x06; |
1796 | if (sd->vflip) | 1806 | if (sd->vflip) |
1797 | comn |= 0x80; | 1807 | comn |= 0x80; |
1808 | i2c_w1(&sd->gspca_dev, 0x75, comn); | ||
1809 | break; | ||
1798 | } | 1810 | } |
1799 | i2c_w1(&sd->gspca_dev, 0x75, comn); | ||
1800 | } | 1811 | } |
1801 | 1812 | ||
1802 | static void setsharpness(struct sd *sd) | 1813 | static void setsharpness(struct sd *sd) |