diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 18:55:59 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 18:55:59 (GMT) |
commit | 27c053aa8d18d1fa7b83041e36bad20bcdf55514 (patch) | |
tree | c59dce17a248dd8f4757eca3823032334c626dcd /drivers/media/usb/gspca/ov519.c | |
parent | a09e9a7a4b907f2dfa9bdb2b98a1828ab4b340b2 (diff) | |
parent | f66b2a1c7f2ae3fb0d5b67d07ab4f5055fd3cf16 (diff) | |
download | linux-27c053aa8d18d1fa7b83041e36bad20bcdf55514.tar.xz |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
"This series contains:
- Exynos s5p-mfc driver got support for VP8 encoder
- Some SoC drivers gained support for asynchronous registration
(needed for DT)
- The RC subsystem gained support for RC activity LED;
- New drivers added: a video decoder(adv7842), a video encoder
(adv7511), a new GSPCA driver (stk1135) and support for Renesas
R-Car (vsp1)
- the first SDR kernel driver: mirics msi3101. Due to some troubles
with the driver, and because the API is still under discussion, it
will be merged at staging for 3.12. Need to rework on it
- usual new boards additions, fixes, cleanups and driver
improvements"
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (242 commits)
[media] cx88: Fix regression: CX88_AUDIO_WM8775 can't be 0
[media] exynos4-is: Fix entity unregistration on error path
[media] exynos-gsc: Register v4l2 device
[media] exynos4-is: Fix fimc-lite bayer formats
[media] em28xx: fix assignment of the eeprom data
[media] hdpvr: fix iteration over uninitialized lists in hdpvr_probe()
[media] usbtv: Throw corrupted frames away
[media] usbtv: Fix deinterlacing
[media] v4l2: added missing mutex.h include to v4l2-ctrls.h
[media] DocBook: upgrade media_api DocBook version to 4.2
[media] ml86v7667: fix compile warning: 'ret' set but not used
[media] s5p-g2d: Fix registration failure
[media] media: coda: Fix DT driver data pointer for i.MX27
[media] s5p-mfc: Fix input/output format reporting
[media] v4l: vsp1: Fix mutex double lock at streamon time
[media] v4l: vsp1: Add support for RT clock
[media] v4l: vsp1: Initialize media device bus_info field
[media] davinci: vpif_capture: fix error return code in vpif_probe()
[media] davinci: vpif_display: fix error return code in vpif_probe()
[media] MAINTAINERS: add entries for adv7511 and adv7842
...
Diffstat (limited to 'drivers/media/usb/gspca/ov519.c')
-rw-r--r-- | drivers/media/usb/gspca/ov519.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/media/usb/gspca/ov519.c b/drivers/media/usb/gspca/ov519.c index a3958ee..8937d79 100644 --- a/drivers/media/usb/gspca/ov519.c +++ b/drivers/media/usb/gspca/ov519.c @@ -75,6 +75,8 @@ struct sd { struct v4l2_ctrl *brightness; }; + u8 revision; + u8 packet_nr; char bridge; @@ -3080,8 +3082,8 @@ static void ov518_configure(struct gspca_dev *gspca_dev) }; /* First 5 bits of custom ID reg are a revision ID on OV518 */ - PDEBUG(D_PROBE, "Device revision %d", - 0x1f & reg_r(sd, R51x_SYS_CUST_ID)); + sd->revision = reg_r(sd, R51x_SYS_CUST_ID) & 0x1f; + PDEBUG(D_PROBE, "Device revision %d", sd->revision); write_regvals(sd, init_518, ARRAY_SIZE(init_518)); @@ -3657,7 +3659,11 @@ static void ov518_mode_init_regs(struct sd *sd) reg_w(sd, 0x2f, 0x80); /******** Set the framerate ********/ - sd->clockdiv = 1; + if (sd->bridge == BRIDGE_OV518PLUS && sd->revision == 0 && + sd->sensor == SEN_OV7620AE) + sd->clockdiv = 0; + else + sd->clockdiv = 1; /* Mode independent, but framerate dependent, regs */ /* 0x51: Clock divider; Only works on some cams which use 2 crystals */ @@ -3668,12 +3674,24 @@ static void ov518_mode_init_regs(struct sd *sd) if (sd->bridge == BRIDGE_OV518PLUS) { switch (sd->sensor) { case SEN_OV7620AE: - if (sd->gspca_dev.width == 320) { - reg_w(sd, 0x20, 0x00); - reg_w(sd, 0x21, 0x19); - } else { + /* + * HdG: 640x480 needs special handling on device + * revision 2, we check for device revison > 0 to + * avoid regressions, as we don't know the correct + * thing todo for revision 1. + * + * Also this likely means we don't need to + * differentiate between the OV7620 and OV7620AE, + * earlier testing hitting this same problem likely + * happened to be with revision < 2 cams using an + * OV7620 and revision 2 cams using an OV7620AE. + */ + if (sd->revision > 0 && sd->gspca_dev.width == 640) { reg_w(sd, 0x20, 0x60); reg_w(sd, 0x21, 0x1f); + } else { + reg_w(sd, 0x20, 0x00); + reg_w(sd, 0x21, 0x19); } break; case SEN_OV7620: |