summaryrefslogtreecommitdiff
path: root/drivers/media/video/gspca/sn9c20x.c
AgeCommit message (Collapse)Author
2012-08-15[media] rename most media/video usb drivers to media/usbMauro Carvalho Chehab
Rename all USB drivers with their own directory under drivers/media/video into drivers/media/usb and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-09gspca_sn9c20x: Fix NULL pointer dereferenceHans de Goede
Don't call v4l2_ctrl_g_ctrl on ctrls which the model cam in question does not have. Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> [ Taken directly, since Mauro is on vacation ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-06-11[media] gscpa_sn9c20x: Move clustering of controls to after error checkingHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] gscpa: Move ctrl_handler to gspca_devHans de Goede
We intend to eventually port all sub-drivers to the control-framework. At which point it will make more sense to have the ctrl_handler in gspca_dev then to have it in the subdrivers. Lets move it there now, to avoid a lot of work to move it later. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] gspca_sn9c20x: Whitespace fixesHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] gcpca_sn9c20x: Convert to the control frameworkHans Verkuil
HdG: Small fix: don't register some controls for sensors which don't have an implementation for them. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Change the exposure setting of Omnivision sensorsJean-François Moine
The exposure of Omnivision sensors is defined by the registers 07, 10 and 04. This patch updates the registers 10 and 04 before using the registers 2d and 2e (dummy lines). Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Don't do sensor update before the capture is startedJean-François Moine
Telling the bridge to update the sensor when setting the exposure or the gain is not needed when the image transfer is not started. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Set the i2c interface speedJean-François Moine
The i2c interface speed was set to 400 Kb/s while it is 100 Kb/s for most sensors. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Define more tables as constantJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Add the sensor mt9vprb to the sensor ident tableJean-François Moine
The table did not contain the sensor mt9vprb. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-03[media] gspca - sn9c20x: Change the number of the sensor mt9vprbJean-François Moine
This avoid skips in switch statements. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Cleanup sourceJean-François Moine
- copyright change - use the kbuild module name for messages - remove useless code - add/remove blank lines, parenthesis, braces - add/change some information messages Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Simplify register write for capture start/stopJean-François Moine
The bridge register 1061 may take only the values 01 (stop) or 03 (start). Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Add automatic JPEG compression mechanismJean-François Moine
The JPEG compression may be adjusted from the packet fill ratio and from the flag 'USB FIFO full' returned in each frame. The code is adapted from the one in gspca sonixj and uses a workqueue. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Greater delay in case of sensor no responseJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Optimize the code of write sequencesJean-François Moine
The new functions i2c_w1_buf() and i2c_w2_buf() handle the write loops. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Add the JPEG compression quality controlJean-François Moine
The JPEG compression quality was hardcoded to 95%. This value was too big, raising often buffer overflows. This quality is now 80% by default and is settable. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Add a delay after Omnivision sensor resetJean-François Moine
The reset of the Omnivision sensors takes a long time (200ms). Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Propagate USB errors to higher levelJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Use the new video control mechanismJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19[media] gspca - sn9c20x: Fix loss of frame startJean-François Moine
The frame header was checked on packets of size 64 bytes only, while the webcams may put a frame header at the beginning of bigger packets. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-15Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (655 commits) [media] revert patch: HDIC HD29L2 DMB-TH USB2.0 reference design driver mb86a20s: Add a few more register settings at the init seq mb86a20s: Group registers into the same line [media] [PATCH] don't reset the delivery system on DTV_CLEAR [media] [BUG] it913x-fe fix typo error making SNR levels unstable [media] cx23885: Query the CX25840 during enum_input for status [media] cx25840: Add support for g_input_status [media] rc-videomate-m1f.c Rename to match remote controler name [media] drivers: media: au0828: Fix dependency for VIDEO_AU0828 [media] convert drivers/media/* to use module_platform_driver() [media] drivers: video: cx231xx: Fix dependency for VIDEO_CX231XX_DVB [media] Exynos4 JPEG codec v4l2 driver [media] doc: v4l: selection: choose pixels as units for selection rectangles [media] v4l: s5p-tv: mixer: fix setup of VP scaling [media] v4l: s5p-tv: mixer: add support for selection API [media] v4l: emulate old crop API using extended crop/compose API [media] doc: v4l: add documentation for selection API [media] doc: v4l: add binary images for selection API [media] v4l: add support for selection api [media] hd29l2: fix review findings ...
2012-01-06[media] gscpa - sn9c20x: Add sd_isoc_init ensuring enough bw when i420 fmtHans de Goede
When using the SN9C20X_I420 fmt the sn9c20x needs more bandwidth than our regular bandwidth calculations reserve. This patch adds a sd_isoc_init function, which forces the use of a specific altsetting when using the SN9C20X_I420 fmt. This fixes the bottom 10-30% of the image getting corrupted when using the SN9C20X_I420 fmt (which is the default fmt). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06[media] gspca: Add a need_max_bandwidth flag to sd_descHans de Goede
Some cameras will pretty much entirely fill all the image buffers all the time even though they are using compression. This patch adds a flag to sd_desc, which drivers for such cameras can set. When this flag is set the bandwidth calculation code will no longer assume that the image buffer size is a worst case and less bandwidth than imagebufsize * fps will be used on average. This patch sets this new flag for 3 drivers: * For spca561 (for rev12a cameras) and nw80x cams as these simply don't work when given less bandwidth than imagebufsize * fps. * For sn9c20x cameras, because these show severy jpeg artifacts when given less bandwidth than imagebufsize * fps and since these are usb2 cameras there is plenty bandwidth anyways. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-18USB: convert drivers/media/* to use module_usb_driver()Greg Kroah-Hartman
This converts the drivers in drivers/media/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Luca Risolia <luca.risolia@studio.unibo.it> Cc: Jean-Francois Moine <moinejf@free.fr> Cc: Frank Zago <frank@zago.net> Cc: Olivier Lorin <o.lorin@laposte.net> Cc: Erik Andren <erik.andren@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Brian Johnson <brijohn@gmail.com> Cc: Leandro Costantino <lcostantino@gmail.com> Cc: Antoine Jacquet <royale@zerezo.com> Cc: Jarod Wilson <jarod@redhat.com> Cc: Florian Mickler <florian@mickler.org> Cc: Antti Palosaari <crope@iki.fi> Cc: Michael Krufky <mkrufky@kernellabs.com> Cc: "David Härdeman" <david@hardeman.nu> Cc: Florent Audebert <florent.audebert@anevia.com> Cc: Sam Doshi <sam@metal-fish.co.uk> Cc: Manu Abraham <manu@linuxtv.org> Cc: Olivier Grenie <olivier.grenie@dibcom.fr> Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr> Cc: "Igor M. Liplianin" <liplianin@me.by> Cc: Derek Kelly <user.vdr@gmail.com> Cc: Malcolm Priestley <tvboxspy@gmail.com> Cc: Steven Toth <stoth@kernellabs.com> Cc: "André Weidemann" <Andre.Weidemann@web.de> Cc: Martin Wilks <m.wilks@technisat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Jose Alberto Reguero <jareguero@telefonica.net> Cc: David Henningsson <david.henningsson@canonical.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Joe Perches <joe@perches.com> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi> Cc: Hans Verkuil <hans.verkuil@cisco.com> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Anssi Hannula <anssi.hannula@iki.fi> Cc: Rafi Rubin <rafi@seas.upenn.edu> Cc: Dan Carpenter <error27@gmail.com> Cc: Paul Bender <pebender@gmail.com> Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: "Márcio A Alves" <froooozen@gmail.com> Cc: Julia Lawall <julia@diku.dk> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Chris Rankin <rankincj@yahoo.com> Cc: Lee Jones <lee.jones@canonical.com> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Dean Anderson <linux-dev@sensoray.com> Cc: Pete Eberlein <pete@sensoray.com> Cc: Arvydas Sidorenko <asido4@gmail.com> Cc: Andrea Anacleto <andreaanacleto@libero.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-23[media] gspca - sn9c20x: Fix status LED device 0c45:62b3Frank Schaefer
Tested with webcam "SilverCrest WC2130". Signed-off-by: Frank Schaefer <fschaefer.oss@googlemail.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-09-03[media] sn9c20x: Use current logging stylesJoe Perches
Add pr_fmt. Convert usb style logging macros to pr_<level>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] gspca_sn9c20x: Add another MSI laptop to the sn9c20x upside down listHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] gspca_sn9c20x: Make buffers slightly larger for JPEG framesHans de Goede
In good lighting conditions (lots of details visible) the current buffers are sometimes too small. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] gspca_sn9c20x: Add LED_REVERSE flag for 0c45:62bbHans de Goede
This fixes the led not working on this camera Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] gspca_sn9c20x: Add hflip and vflip controls for the ov7660 sensorHans de Goede
Tested with a camera with usb-id: 0c45:62bb Also enable dmi based flopped laptop detection for the 0c45:627b ov7660 model. Some of the MSI laptops with upside down camera have this one instead of the 0c45:624f. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] gspca_sn9c20x: Fix colored borders with ov7660 sensorHans de Goede
Tested with a camera with usb-id: 0c45:62bb Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-01-19[media] gspca: Remove __devinit, __devinitconst and __devinitdataJean-François Moine
__devinit* must not be used in USB drivers. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29[media] gspca/sn9c20x: Fix support for mt9m001 (mi1300) sensorMauro Carvalho Chehab
Support for mt9m001 (mi1300) is broken: - Table is incomplete; - Only one resolution is currently supported by the driver; - Resolution is incomplete; - it complains about broken JPEG headers. Use the same init found on em28xx driver, and properly report the output format as 8-bits GRAY. Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29[media] gspca/sn9c20x: Get rid of scale "magic" numbersMauro Carvalho Chehab
Use macros for the supported scales, instead of using magic numbers from 0 to 3. Code become cleaner by using macros for it. Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29[media] gspca/sn9c20x: Test if sensor is a OV sensorMauro Carvalho Chehab
Instead of just assuming a ov9650 sensor based on USB ID, double-check it, by reading the sensor ID. Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21[media] gspca: Fix coding style issuesJean-François Moine
The errors were found by checkpatch.pl. Most fixes are: - remove spaces followed by TAB(s), - split lines greater than 80 characters, - move most '{'s from start of line to end of previous line. (Some '{'s at start of line remain when the '}'s are on the same line) Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: gspca - many subdrivers: Handle the buttons when CONFIG_INPUT=mJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: gspca - sn9c20x: Better image sizesJean-François Moine
When compressed, the images take less than one byte per pixel. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: gspca - sn9c20x: Fix the number of bytes per lineJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: gspca - all modules: Remove useless module load/unload messagesJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-09-27V4L/DVB: gspca - sn9c20x: Bad transfer size of Bayer imagesJean-François Moine
As the end of frame marker does not contain any pixel, it must not be transferred. Reported-by: Ivo Jager <ivo.jager@siliconfields.net> Signed-off-by: Jean-François Moine <moinejf@free.fr> Cc: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: gspca: Remove/move useless inclusions of slab.hJean-François Moine
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: gspca - JPEG subdrivers: Don't allocate the JPEG headerJean-François Moine
The JPEG header is now included in the subdriver structure instead of being allocated and freed at capture start and stop. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: gspca - sn9c20x: Fix non working mt9v111 sensorBrian Johnson
Signed-off-by: Brian Johnson <brijohn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: gspca - sn9c20x: HAS_BUTTON flag -> HAS_NO_BUTTON flagBrian Johnson
Reverse HAS_BUTTON logic since most webcams either have a button or if they don't don't bother to send any interrupts. However I have at least one model that appears to leave the button GPIO floating and can send a bogus interrupt. Signed-off-by: Brian Johnson <brijohn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: gspca - sn9c20x: Add another MSI laptop to upsidedown device listBrian Johnson
Signed-off-by: Brian Johnson <brijohn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: gspca - sn9c20x: Add another laptop to upsidedown device listBrian Johnson
Signed-off-by: Brian Johnson <brijohn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18V4L/DVB: gspca - sn9c20x: Fix bug with OV9655 codeBrian Johnson
Fixed buggy init sequence for the OV9655 sensor. Tested with a 0c45:6288 and 0c45:62b3. Signed-off-by: Brian Johnson <brijohn@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>