aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* [media] mt9p031: Implement black level compensation controlLaurent Pinchart2012-05-14
| | | | | | | | | | | | Add four new controls to configure black level compensation (BLC): - V4L2_CID_BLC_AUTO selects between manual and auto BLC - V4L2_CID_BLC_TARGET_LEVEL sets the target level for auto BLC - V4L2_CID_BLC_ANALOG_OFFSET sets the analog offset for manual BLC - V4L2_CID_BLC_DIGITAL_OFFSET sets the digital offset for manual BLC Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mt9p031: Replace the reset board callback by a GPIO numberLaurent Pinchart2012-05-14
| | | | | | | | Use the GPIO from the sensor driver instead of calling back to board code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mt9p031: Identify color/mono models using I2C device nameLaurent Pinchart2012-05-14
| | | | | | | | Instead of passing a color/monochrome flag through platform data, rely on the I2C device name to identify the chip model. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: add few new reference design USB IDsAntti Palosaari2012-05-14
| | | | | | | | Add all known reference design USB IDs. Rename two earlier reference design USB IDs. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: remove one config parameterAntti Palosaari2012-05-14
| | | | | | | | We can use tuner ID instead of HW not supported flag. Lesser code is better code. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: move device configuration to the stateAntti Palosaari2012-05-14
| | | | | | | | Fixes most problems when having more than one device connected as demod and tuner configurations are not shared. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9033: implement ber and ucb functionsHans-Frieder Vogt2012-05-14
| | | | | | | | | | | | | | | | | af9033: implement read_ber and read_ucblocks functions. Version 2 of patch that reflects my findings on the behaviour of abort_cnt, err_cnt and bit_cnt: - bit_cnt is always 0x2710 (10000) - abort_cnt is between 0 and 0x2710 - err_cnt is between 0 and 640000 (= 0x2710 * 8 * 8) in the current implementation BER is calculated as the number of bit errors per processed bits, ignoring those bits that are already discarded and counted in abort_cnt, i.e. UCBLOCKS. Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: add remote control supportHans-Frieder Vogt2012-05-14
| | | | | | Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: remove unused structAntti Palosaari2012-05-14
| | | | | | | | Not used anymore since new firmware downloader. I forget to remove those earlier when changed firmware downloader. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] af9035: various small changes for af9035_ctrl_msg()Antti Palosaari2012-05-14
| | | | | | | | | Fix USB buffer len to maximum possible. Various log writing fixes, remove extra new lines and excessive type casts. Rename and type change some variables. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] pms: update to the latest V4L2 frameworksHans Verkuil2012-05-14
| | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-fimc: Fix locking in subdev set_crop opSylwester Nawrocki2012-05-14
| | | | | | | | | | | When setting TRY crop on the sub-device the mutex was erroneously acquired rather than released on exit path. This bug is present in kernels starting from v3.2. Cc: stable@vger.kernel.org Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca - ov534: Add Hue controlAntonio Ospite2012-05-14
| | | | | Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] Input: move drivers/input/fixp-arith.h to include/linuxAntonio Ospite2012-05-14
| | | | | | | | | | | Move drivers/input/fixp-arith.h to include/linux so that the functions defined there can be used by other subsystems, for instance some video devices ISPs can control the output HUE value by setting registers for sin(HUE) and cos(HUE). Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca - ov534: Add Saturation controlAntonio Ospite2012-05-14
| | | | | | | | Also merge the "COLORS" control into it as it was V4L2_CID_SATURATION anyway. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_pac7311: Remove vflip controlHans de Goede2012-05-14
| | | | | | | | | | | | | | | Enabling vflip leads to a much better image, with vflip disabled the image looks washed out as if there is a too high brightness setting. Since we don't know how to lower the brightness setting when not vflipping, simply always vflip and tell userspace to flip the image back, resulting in a much better (less washed out) image. Since the image is now no longer too bright, also modify the luminance level the auto-gain algorithm aims for. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_pac7311: Set register page at start of initHans de Goede2012-05-14
| | | | | | | | | | Our init sequence was not setting the register page to point to bank 1 before setting what should be the control reg. This causes the camera to sometimes have its LED on after init. First selecting register bank 1, rather then assuming the current register bank is bank 1, fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_pac7311: Convert to the control frameworkHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Remove gspca_auto_gain_n_exposure functionHans de Goede2012-05-14
| | | | | | | | Now that the pac207 driver has been converted to the control framework, there are no remaining users. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gscpa_pac207: Switch to coarse_grained_expo auto gain algorithmHans de Goede2012-05-14
| | | | | | | | The pac207's exposure control is a clock-divider, so it goes with quite big steps. So lets use an autogain algorithm optimised for that. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_pac207: Convert to the control frameworkHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gscpa_pac207: use usb_err for error handlingHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gscpa: Move ctrl_handler to gspca_devHans de Goede2012-05-14
| | | | | | | | | | 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>
* [media] gspca_mars: Convert to the control frameworkHans Verkuil2012-05-14
| | | | | | 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>
* [media] gscpa_stv06xx: Make sd_desc constHans de Goede2012-05-14
| | | | | | | | Now that stv06xx is using the control framework it is no longer necessary to have a (non const) copy of sd_desc inside the sd specific data struct. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_stv06xx: Convert to the control frameworkHans Verkuil2012-05-14
| | | | | | | | | | | | | HdG: 1) Let the gspca-core cleanup the controls on control-init error, like with the other converted sub drivers 2) Note this also fixes a bug in the hdcs1020 support which was wrongly reporting an exposure range of 0-65535, even though the effective range was only 0-255 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>
* [media] gspca_sn9c20x: Whitespace fixesHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gcpca_sn9c20x: Convert to the control frameworkHans Verkuil2012-05-14
| | | | | | | | | 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>
* [media] gspca_zc3xx: Convert to the control frameworkHans Verkuil2012-05-14
| | | | | | | | | The initial version was done by HV, corrections were made by HdG, and some final small changes again by HV. 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>
* [media] gspca_zc3xx: Disable the highest quality setting as it is not usableHans de Goede2012-05-14
| | | | | | | | | | Even with BRC the highest quality setting is not usable, BRC strips so much data from each MCU that the quality becomes worse then using a lower quality setting to begin with. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_zc3xx: Always automatically adjust BRC as neededHans de Goede2012-05-14
| | | | | | | | | | | | | | | | Always automatically adjust the Bit Rate Control setting as needed, independent of the sensor type. BRC is needed to not run out of bandwidth with higher quality settings independent of the sensor. Also only automatically adjust BRC, and don't adjust the JPEG quality control automatically, as that is not needed and leads to ugly flashes when it is changed. Note that before this patch-set the quality was never changed either due to the bugs in the quality handling fixed in previous patches in this set. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_zc3xx: Fix JPEG quality setting codeHans de Goede2012-05-14
| | | | | | | | | | | | | | | | | | | The current code is using bits 0-1 of register 8 of the zc3xx controller to set the JPEG quality, but the correct bits are bits 1-2. Bit 0 selects between truncation or rounding in the quantization phase of the compression, since rounding generally gives better results it should thus always be 1. This patch also corrects the quality percentages which belong to the 4 different settings. Last this patch removes the different reg 8 defaults depending on the sensor type. Some of them where going for a default quality setting of 50%, which generally is not necessary in any way and results in poor image quality. 75% is a good default to use for all scenarios. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_zc3xx: Fix setting of jpeg quality while streamingHans de Goede2012-05-14
| | | | | | | | | | When the user changes the JPEG quality while the camera is streaming, the driver should not only change the JPEG headers send to userspace, but also actually tell the camera to use a different quantization table. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca_gl860: Add a present check to sd_stop0Hans de Goede2012-05-14
| | | | | | | | | The sensor specific dev_post_unset_alt functions all try to write to the bridge, and none free any memory, so they should be skipped if stop0 is called on disconnection. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Add autogain functions for use with control framework driversHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Set gspca_dev->usb_err to 0 at the begin of gspca_stream_offHans de Goede2012-05-14
| | | | | | | Just a small cleanup. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Call sd_stop0 on disconnectHans de Goede2012-05-14
| | | | | | | | | | | | | | | This is necessary to ensure that worker-threads accessing the device are stopped before our disconnect handler returns. This causes a problem with stream_off calling sd_stop0 a second time when the device handle is closed. This is fixed by setting gscpa_dev->streaming to 0 on disconnect. Note that now stream_off will never be called on a disconnected device, and the present check can thus be removed from stream_off. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Use req_events in pollHans de Goede2012-05-14
| | | | | | | | So that we don't start a read stream when an app is only polling for control events. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gscpa: Clear usb_err before calling sd methods from suspend/resumeHans de Goede2012-05-14
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] gspca: Switch to V4L2 core locking, except for the buffer queuing ioctlsHans Verkuil2012-05-14
| | | | | | | | | | | | | | | | Due to latency concerns the VIDIOC_QBUF, DQBUF and QUERYBUF do not use the core lock, instead they rely only on queue_lock. Changes by HdG: 1) Change release from the video_device to the v4l2_device, to avoid a race on disconnect. 2) Adjust for the V4L2 core changes which cause non ioctl fops to no longer take the V4L2 core lock. [mchehab@redhat.com: fix a merge conflict] 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>
* [media] gspca: Fix locking issues related to suspend/resumeHans Verkuil2012-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | There are two bugs here: first the calls to stop0 (in gspca_suspend) and gspca_init_transfer (in gspca_resume) need to be called with the usb_lock held. That's true for the other places they are called and it is what subdrivers expect. Quite a few will unlock the usb_lock in stop0 while waiting for a worker thread to finish, and if usb_lock isn't held then that can cause a kernel oops. The other problem is that a worker thread needs to detect that it has to halt due to a suspend. Otherwise it will just go on looping. So add tests against gspca_dev->frozen in the worker threads that need it. Hdg, 2 minor changes: 1) The finepix device is ok with stopping reading a frame halfway through, so add frozen checks in all places where we also check if we're still streaming 2) Use gspca_dev->dev instead of gspca_dev->present to check for disconnect in all touched drivers. I plan to do this everywhere in the future, and most relevant lines in the touched drivers are already modified by this patch. 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>
* [media] gspca: Fix querycap and incorrect return codesHans Verkuil2012-05-14
| | | | | | | | | Add V4L2_CAP_DEVICE_CAPS support to querycap and replace -EINVAL by -ENOTTY whenever an ioctl is not supported. 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>
* [media] gspca: Add support for control eventsHans Verkuil2012-05-14
| | | | | | 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>
* [media] gscpa: Use v4l2_fh and add G/S_PRIORITY supportHans Verkuil2012-05-14
| | | | | | | | | In order to support control event gspca has to use struct v4l2_fh. As a bonus feature this also gives priority handling for free. 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>
* [media] gspca: Use video_drvdata(file) instead of file->private_dataHans Verkuil2012-05-14
| | | | | | | | | | Prepare for control events: free up file->private_data by using video_drvdata(file) to get to the gspca_dev struct. [mchehab@redhat.com: fix a compile error: ‘file’ undeclared] 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>
* [media] gspca: Allow subdrivers to use the control frameworkHans Verkuil2012-05-14
| | | | | | | | | | | | | | | | Make the necessary changes to allow subdrivers to use the control framework. This does not add control event support, that comes later. It add a init_control cam_op that is called after init in probe that allows the subdriver to set up the controls. HdG: Call v4l2_ctrl_handler_setup from resume instead of gspca_set_default_mode, as we just want to resend the current ctrl values to the device. 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>
* [media] pwc: Fix lockingHans de Goede2012-05-14
| | | | | | | | | | My last locking rework for pwc mistakenly assumed that videbuf2 does its own locking, but it does not! This patch fixes the missing locking by moving over the the video_device lock, and introducing a separate lock for the videobuf2_queue. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] videobuf2: Fix a bug in fileio emulation error handlingHans de Goede2012-05-14
| | | | | | | | Various error paths in fileio_init where not setting the request-count to 0 when unrequesting the buffers on error to init the fileio emulation. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2-framework.txt: document v4l2_dont_use_cmdHans Verkuil2012-05-14
| | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2-dev: add flag to have the core lock all file operationsHans Verkuil2012-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This used to be the default if the lock pointer was set, but now that lock is by default only used for ioctl serialization. Those drivers that already used core locking have this flag set explicitly, except for some drivers where it was obvious that there was no need to serialize any file operations other than ioctl. The drivers that didn't need this flag were: drivers/media/radio/dsbr100.c drivers/media/radio/radio-isa.c drivers/media/radio/radio-keene.c drivers/media/radio/radio-miropcm20.c drivers/media/radio/radio-mr800.c drivers/media/radio/radio-tea5764.c drivers/media/radio/radio-timb.c drivers/media/video/vivi.c sound/i2c/other/tea575x-tuner.c The other drivers that use core locking and where it was not immediately obvious that this flag wasn't needed were changed so that the flag is set together with a comment that that driver needs work to avoid having to set that flag. This will often involve taking the core lock in the fops themselves. Eventually this flag should go and it should not be used in new drivers. There are a few reasons why we want to avoid core locking of non-ioctl fops: in the case of mmap this can lead to a deadlock in rare situations since when mmap is called the mmap_sem is held and it is possible for other parts of the code to take that lock as well (copy_from_user()/copy_to_user() perform a down_read(&mm->mmap_sem) when a page fault occurs). It is very unlikely that that happens since the core lock serializes all fops, but the kernel warns about it if lock validation is turned on. For poll it is also undesirable to take the core lock as that can introduce increased latency. The same is true for read/write. While it was possible to make flags or something to turn on/off taking the core lock for each file operation, in practice it is much simpler to just not take it at all except for ioctl and leave it to the driver to take the lock. There are only a handful fops compared to the zillion ioctls we have. I also wanted to make it obvious which drivers still take the lock for all fops, so that's why I chose to have drivers set it explicitly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>