diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-11-26 12:28:48 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:17:58 -0500 |
commit | fe2b6032513099b82cd19ef8da5050f02a18d3ec (patch) | |
tree | 88a3932ab3eb95c72db3d3fe14885ae10c848286 /drivers/media/video/gspca/pac7302.c | |
parent | 327ae59757f2e56fd3fc2b11acbd0a7c4070f4e8 (diff) |
V4L/DVB (13559): gspca - pac7302: Some webcams are upside-down by default.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/pac7302.c')
-rw-r--r-- | drivers/media/video/gspca/pac7302.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/pac7302.c b/drivers/media/video/gspca/pac7302.c index 74acceea8094..b4049c0c687d 100644 --- a/drivers/media/video/gspca/pac7302.c +++ b/drivers/media/video/gspca/pac7302.c | |||
@@ -90,6 +90,9 @@ struct sd { | |||
90 | unsigned char autogain; | 90 | unsigned char autogain; |
91 | __u8 hflip; | 91 | __u8 hflip; |
92 | __u8 vflip; | 92 | __u8 vflip; |
93 | u8 flags; | ||
94 | #define FL_HFLIP 0x01 /* mirrored by default */ | ||
95 | #define FL_VFLIP 0x02 /* vertical flipped by default */ | ||
93 | 96 | ||
94 | u8 sof_read; | 97 | u8 sof_read; |
95 | u8 autogain_ignore_frames; | 98 | u8 autogain_ignore_frames; |
@@ -552,6 +555,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
552 | sd->autogain = AUTOGAIN_DEF; | 555 | sd->autogain = AUTOGAIN_DEF; |
553 | sd->hflip = HFLIP_DEF; | 556 | sd->hflip = HFLIP_DEF; |
554 | sd->vflip = VFLIP_DEF; | 557 | sd->vflip = VFLIP_DEF; |
558 | sd->flags = id->driver_info; | ||
555 | return 0; | 559 | return 0; |
556 | } | 560 | } |
557 | 561 | ||
@@ -708,10 +712,17 @@ static int sethvflip(struct gspca_dev *gspca_dev) | |||
708 | { | 712 | { |
709 | struct sd *sd = (struct sd *) gspca_dev; | 713 | struct sd *sd = (struct sd *) gspca_dev; |
710 | int ret; | 714 | int ret; |
711 | __u8 data; | 715 | u8 data, hflip, vflip; |
716 | |||
717 | hflip = sd->hflip; | ||
718 | if (sd->flags & FL_HFLIP) | ||
719 | hflip = !hflip; | ||
720 | vflip = sd->vflip; | ||
721 | if (sd->flags & FL_VFLIP) | ||
722 | vflip = !vflip; | ||
712 | 723 | ||
713 | ret = reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ | 724 | ret = reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ |
714 | data = (sd->hflip ? 0x08 : 0x00) | (sd->vflip ? 0x04 : 0x00); | 725 | data = (hflip ? 0x08 : 0x00) | (vflip ? 0x04 : 0x00); |
715 | if (0 <= ret) | 726 | if (0 <= ret) |
716 | ret = reg_w(gspca_dev, 0x21, data); | 727 | ret = reg_w(gspca_dev, 0x21, data); |
717 | /* load registers to sensor (Bit 0, auto clear) */ | 728 | /* load registers to sensor (Bit 0, auto clear) */ |
@@ -1222,8 +1233,8 @@ static __devinitdata struct usb_device_id device_table[] = { | |||
1222 | {USB_DEVICE(0x06f8, 0x3009)}, | 1233 | {USB_DEVICE(0x06f8, 0x3009)}, |
1223 | {USB_DEVICE(0x093a, 0x2620)}, | 1234 | {USB_DEVICE(0x093a, 0x2620)}, |
1224 | {USB_DEVICE(0x093a, 0x2621)}, | 1235 | {USB_DEVICE(0x093a, 0x2621)}, |
1225 | {USB_DEVICE(0x093a, 0x2622)}, | 1236 | {USB_DEVICE(0x093a, 0x2622), .driver_info = FL_VFLIP}, |
1226 | {USB_DEVICE(0x093a, 0x2624)}, | 1237 | {USB_DEVICE(0x093a, 0x2624), .driver_info = FL_VFLIP}, |
1227 | {USB_DEVICE(0x093a, 0x2626)}, | 1238 | {USB_DEVICE(0x093a, 0x2626)}, |
1228 | {USB_DEVICE(0x093a, 0x2628)}, | 1239 | {USB_DEVICE(0x093a, 0x2628)}, |
1229 | {USB_DEVICE(0x093a, 0x2629)}, | 1240 | {USB_DEVICE(0x093a, 0x2629)}, |