summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2014-04-23[media] smiapp: Make PLL (quirk) flags a functionSakari Ailus
This is more flexible. Quirk flags may be affected by configuration. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Make PLL flags unsigned longSakari Ailus
No reason to keep this u8, really. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Make PLL flags separate from regular quirk flagsSakari Ailus
It doesn't make sense to just copy the information to the PLL flags. Add a new fields for the quirks to contain the PLL flags. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Use I2C adapter ID and address in the sub-device nameSakari Ailus
The sub-device names should be unique. Should two identical sensors be present in the same media device they would be indistinguishable. The names will change e.g. from "vs6555 pixel array" to "vs6555 1-0010 pixel array". Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Add a macro for constructing 8-bit quirk registersSakari Ailus
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Fix determining the need for 8-bit read accessSakari Ailus
8-bit reads are needed in some cases; however the condition used was wrong. Regular access (register width) was used if: len == SMIAPP_REG_8BIT && !only8 This causes 8-bit read access to be used always. The operator should be || instead: regular access can be used for 8-bit reads OR if allowed otherwise. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Rename SMIA_REG to SMIAPP_REG for consistencySakari Ailus
SMIAPP_REG_ is the common prefix used in the driver for register related definitions. Use it consistently. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] smiapp: Remove unused quirk register functionalitySakari Ailus
The quirk registers mechanism which allows register to have a static read access value from the sensor specific quirks, is not used. Remove it. It is to be replaced by a more generic register diversion quirk soon. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] vb2: fix compiler warningHans Verkuil
When compiling this for older kernels using the compatibility build the compiler complains about uninitialized variables: In file included from include/linux/kernel.h:20:0, from include/linux/cache.h:4, from include/linux/time.h:7, from include/linux/input.h:13, from /home/hans/work/build/media_build/v4l/compat.h:9, from <command-line>:0: /home/hans/work/build/media_build/v4l/videobuf2-core.c: In function 'vb2_mmap': include/linux/dynamic_debug.h:60:9: warning: 'plane' may be used uninitialized in this function [-Wmaybe-uninitialized] printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ ^ /home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:23: note: 'plane' was declared here unsigned int buffer, plane; ^ In file included from include/linux/kernel.h:20:0, from include/linux/cache.h:4, from include/linux/time.h:7, from include/linux/input.h:13, from /home/hans/work/build/media_build/v4l/compat.h:9, from <command-line>:0: include/linux/dynamic_debug.h:60:9: warning: 'buffer' may be used uninitialized in this function [-Wmaybe-uninitialized] printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ ^ /home/hans/work/build/media_build/v4l/videobuf2-core.c:2381:15: note: 'buffer' was declared here unsigned int buffer, plane; ^ While these warnings are bogus (the call to __find_plane_by_offset will set buffer and plane), it doesn't hurt to initialize these variables. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] bfin_capture: drop unnecessary vb2_is_streaming checkHans Verkuil
The stop_streaming op is only called if streaming is in progress, so drop the unnecessary 'if (!vb2_is_streaming(vq))' check. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] vb2: stop_streaming should return voidHans Verkuil
The vb2 core ignores any return code from the stop_streaming op. And there really isn't anything it can do anyway in case of an error. So change the return type to void and update any drivers that implement it. The int return gave drivers the idea that this operation could actually fail, but that's really not the case. The pwc amd sdr-msi3101 drivers both had this construction: if (mutex_lock_interruptible(&s->v4l2_lock)) return -ERESTARTSYS; This has been updated to just call mutex_lock(). The stop_streaming op expects this to really stop streaming and I very much doubt this will work reliably if stop_streaming just returns without really stopping the DMA. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] media:gspca:dtcs033 Clean sparse check warnings on endianessRobert Butora
Warnings due to __le16 / u16 conversions. Replace offending struct and so stay on cpu domain. Signed-off-by: Robert Butora <robert.butora.fi@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] em28xx: PCTV tripleStick (292e) LNA supportAntti Palosaari
External LNA between antenna connector and RF tuner is controlled by EM28178 GPIO 0. GPIO value 1 is LNA active and value 0 is LNA disabled. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2168: relax demod lock checks a littleAntti Palosaari
bit3 was not cleared always leaving driver reporting demod is not fully locked. Do not check bit0 as it seems to be always 0. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2168: add copyright and licenseAntti Palosaari
Add copyright and license for each file. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2157: add copyright and licenseAntti Palosaari
Add copyright and license for each file. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2168: add support for DVB-C (annex A version)Antti Palosaari
Add support for DVB-C (annex A version). Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2157: extend frequency range for DVB-CAntti Palosaari
DVB-C uses lower frequencies than DVB-T. Extend frequency range down to 110 MHz in order to support DVB-C. 110 - 862 MHz range is defined by NorDig Unified 2.2 specification. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2168: add support for DVB-T2Antti Palosaari
Add support for DVB-T2. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] em28xx: add [2013:025f] PCTV tripleStick (292e)Antti Palosaari
Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2168: Silicon Labs Si2168 DVB-T/T2/C demod driverAntti Palosaari
Silicon Labs Si2168 DVB-T/T2/C demod driver. That driver version supports only DVB-T. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] si2157: Silicon Labs Si2157 silicon tuner driverAntti Palosaari
Silicon Labs Si2157 silicon tuner driver. Currently it supports only DVB-T. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: Add videobuf2-dvb supportHans Verkuil
With the new vb2_thread_start/stop core code it is very easy to implement videobuf2-dvb. This should simplify converting existing videobuf drivers to vb2. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: add thread supportHans Verkuil
In order to implement vb2 DVB support you need to be able to start a kernel thread that queues and dequeues buffers, calling a callback function for every buffer. This patch adds support for that. It's based on drivers/media/v4l2-core/videobuf-dvb.c, but with all the DVB specific stuff stripped out, thus making it much more generic. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: start messages with a lower-case for consistencyHans Verkuil
The kernel debug messages produced by vb2 started either with a lower or an upper case character. Switched all to use lower-case which seemed to be what was used in the majority of the messages. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: allow read/write as long as the format is single planarHans Verkuil
It was impossible to read() or write() a frame if the queue type was multiplanar. Even if the current format is single planar. Change this to just check whether the number of planes is 1 or more. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: add vb2_fileio_is_active and check it more oftenHans Verkuil
Added a vb2_fileio_is_active inline function that returns true if fileio is in progress. Check for this too in mmap() (you don't want apps mmap()ing buffers used by fileio) and expbuf() (same reason). In addition drivers should be able to check for this in queue_setup() to return an error if an attempt is made to read() or write() with V4L2_FIELD_ALTERNATE being configured. This is illegal (there is no way to pass the TOP/BOTTOM information around using file I/O). However, in order to be able to check for this the init_fileio function needs to set q->fileio early on, before the buffers are allocated. So switch to using internal functions (__reqbufs, vb2_internal_qbuf and vb2_internal_streamon) to skip the fileio check. Well, that's why the internal functions were created... Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: simplify a confusing conditionHans Verkuil
q->start_streaming_called is always true, so the WARN_ON check against it being false can be dropped. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: reject output buffers with V4L2_FIELD_ALTERNATEHans Verkuil
This is not allowed by the spec and does in fact not make any sense. Return -EINVAL if this is the case. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: set timestamp when using write()Hans Verkuil
When using write() to write data to an output video node the vb2 core should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody else is able to provide this information with the write() operation. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: move __qbuf_mmap before __qbuf_userptrHans Verkuil
__qbuf_mmap was sort of hidden in between the much larger __qbuf_userptr and __qbuf_dmabuf functions. Move it before __qbuf_userptr which is also conform the usual order these memory models are implemented: first mmap, then userptr, then dmabuf. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: use correct prefixHans Verkuil
Many dprintk's in vb2 use a hardcoded prefix with the function name. In many cases that is now outdated. To keep things consistent the dprintk macro has been changed to print the function name in addition to the "vb2:" prefix. Superfluous prefixes elsewhere in the code have been removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: if bytesused is 0, then fill with output buffer lengthHans Verkuil
The application should really always fill in bytesused for output buffers, unfortunately the vb2 framework never checked for that. So for single planar formats replace a bytesused of 0 by the length of the buffer, and for multiplanar format do the same if bytesused is 0 for ALL planes. This seems to be what the user really intended if v4l2_buffer was just memset to 0. I'm afraid that just checking for this and returning an error would break too many applications. Quite a few drivers never check for bytesused at all and just use the buffer length instead. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] vb2: fix handling of data_offset and v4l2_plane.reserved[]Hans Verkuil
The videobuf2-core did not zero the 'planes' array in __qbuf_userptr() and __qbuf_dmabuf(). That's now memset to 0. Without this the reserved array in struct v4l2_plane would be non-zero, causing v4l2-compliance errors. More serious is the fact that data_offset was not handled correctly: - for capture devices it was never zeroed, which meant that it was uninitialized. Unless the driver sets it it was a completely random number. With the memset above this is now fixed. - __qbuf_dmabuf had a completely incorrect length check that included data_offset. - in __fill_vb2_buffer in the DMABUF case the data_offset field was unconditionally copied from v4l2_buffer to v4l2_plane when this should only happen in the output case. - in the single-planar case data_offset was never correctly set to 0. The single-planar API doesn't support data_offset, so setting it to 0 is the right thing to do. This too is now solved by the memset. All these issues were found with v4l2-compliance. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] v4l2-dv-timings.c: add the new 4K timings to the listHans Verkuil
Add the new CEA-861-F and DMT 4K timings to the list of predefined timings. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] staging: media: davinci: vpfe: release buffers in case ↵Lad, Prabhakar
start_streaming call back fails this patch releases the buffer by calling vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED if start_streaming() call back fails. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] staging: media: davinci: vpfe: use v4l2_fh for priority handlingLad, Prabhakar
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] sn9c102_hv7131r: fix style warnings flagged by checkpatch.plMike Sampson
Signed-off-by: Mike Sampson <mike@sambodata.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] media: davinci: vpfe: use v4l2_fh for priority handlingLad, Prabhakar
This patch migrates the vpfe driver to use v4l2_fh for priority handling. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] media: davinci: vpbe: use v4l2_fh for priority handlingLad, Prabhakar
This patch migrates the vpbe driver to use v4l2_fh for priority handling. This also fixes v4l2-compliance test. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] bttv: Add support for PCI-8604PWDaniel Glöckner
This patch adds support for the PCI-8604PW card equipped with four 878A. It is unknown who the manufacturer of this card is and no drivers were available during development of the patch. According to images found online, the card is originally sold with Linux DVR software. A CPLD on the card prevents the 878A from requesting access to the bus until an initialization sequence has been issued via GPIOs. The implemented sequence uses the minimum number of GPIOs needed to successfully unlock bus access. As there are many more GPIOs connected to the CPLD, it is very likely that some of the others have an influence on the bus arbitration scheduling. This should be investigated further in case of performance issues. The tested card contains an EEPROM on one of the 878A, but it is completely empty (i.e. contains only 0xff), so it is not possible to detect the card. Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net> Tested-by: Robert Longbottom <rongblor@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] adv7842: Disable access to EDID DDC lines before chip power upMartin Bugge
In core_init make sure access to EDID DDC lines are disabled before chip is powered up. Also DISABLE_AUTO_EDID before power up. The correct setting is applied later when setting the EDID. Some sources (MAC) kept on reading EDID even when Hotplug was low and in the short period in core_init before the DDC lines was enabled read a corrupt EDID. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] adv7842: update RGB quantization range on HDMI/DVI-D mode irqMartin Bugge
This was the reason for enabling the HDMI/DVI-D mode irq in the first place. Signed-off-by: Martin Bugge <marbugge@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] staging: omap24xx: fix coding styleileana@telecom-paristech.fr
Fix missing parentheses in macros Errors found by checkpatch.pl Signed-off-by: Ioana Ileana <ileana@enst.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] v4l2-ioctl.c: fix sparse __user-related warningsHans Verkuil
Fix the use of __user in the check_array_args() prototype: instead of using 'void * __user *' you should use 'void __user **' for sparse to understand this correctly. This also required the use of __force in the '*kernel_ptr = user_ptr' assignment. Also replace a wrong cast (void *) with the correct one (void **) in check_array_args(). This fixes these sparse warnings: drivers/media/v4l2-core/v4l2-ioctl.c:2284:35: warning: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-ioctl.c:2301:35: warning: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-ioctl.c:2319:35: warning: incorrect type in assignment (different address spaces) drivers/media/v4l2-core/v4l2-ioctl.c:2386:57: warning: incorrect type in argument 4 (different address spaces) drivers/media/v4l2-core/v4l2-ioctl.c:2420:29: warning: incorrect type in assignment (different address spaces) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] videobuf2-core: fix sparse errorsHans Verkuil
Sparse generated a bunch of errors like this: drivers/media/v4l2-core/videobuf2-core.c:2045:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:136:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:151:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:168:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:183:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:185:9: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:385:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1115:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1268:33: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1270:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1315:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1324:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1396:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1457:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1482:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1484:9: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1523:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1525:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1815:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1828:17: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1914:25: error: incompatible types in conditional expression (different base types) drivers/media/v4l2-core/videobuf2-core.c:1944:9: error: incompatible types in conditional expression (different base types) These are caused by the call*op defines which do something like this: (ops->op) ? ops->op(args) : 0 which is OK as long as op is not a void function, because in that case one part of the conditional expression returns void, the other an integer. Hence the sparse errors. I've replaced this by introducing three variants of the call_ macros: call_*op for int returns, call_void_*op for void returns and call_ptr_*op for pointer returns. That's the bad news. The good news is that the fail_*op macros could be removed since the call_*op macros now have enough information to determine if the op succeeded or not and can increment the op counter only on success. This at least makes it more robust w.r.t. future changes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-16[media] gspca_gl860: Clean up idxdata structsIsmael Luceno
Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15[media] media/usb/gspca: Add support for Scopium astro webcam (0547:7303)Robert Butora
This patch does not modify existing drivers. It adds subdriver to gspca for DTCS033 (Scopium) webcam for astrophotography. The patch adds dtcs033.c and modifies Kconfig and Makefile. Signed-off-by: Robert Butora <robert.butora.fi@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15[media] Prefer gspca_sonixb over sn9c102 for all devicesJean Delvare
The sn9c102 driver is deprecated. It was moved to staging in anticipation of its removal in a future kernel version. However, USB devices 0C45:6024 and 0C45:6025 are still handled by sn9c102 when both sn9c102 and gspca_sonixb are enabled. We must migrate all the users of these devices to the gspca_sonixb driver now, so that it gets sufficient testing before the sn9c102 driver is finally phased out. Signed-off-by: Jean Delvare <jdelvare@suse.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15[media] media: davinci: vpfe: make sure all the buffers unmapped and releasedLad, Prabhakar
this patch makes sure that it terminates if any IO in progress and also makes sure that all the buffers are unmapped. It was observed that with several runs of application the application sometimes failed to allocate memory, This patch makes sure it all the buffers are released. Using kmemleak it was found that buffer were not released, this patch fixes following issue, echo scan > /sys/kernel/debug/kmemleak Kernel message reads: memleak: 3 new suspected memory leaks (see /sys/kernel/debug/kmemleak) Then, cat /sys/kernel/debug/kmemleak unreferenced object 0xc564a480 (size 192): comm "mttest", pid 764, jiffies 4294945878 (age 487.160s) hex dump (first 32 bytes): 00 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00 ....(.. ........ 00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00 .....d.......... backtrace: [<c00a98dc>] create_object+0x10c/0x28c [<c03ba8ec>] kmemleak_alloc+0x3c/0x70 [<c00a67c0>] __kmalloc+0x11c/0x1d4 [<c02b6f48>] __videobuf_alloc+0x1c/0x3c [<c02b6194>] videobuf_alloc_vb+0x38/0x80 [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108 [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c [<c02be2c4>] vpfe_reqbufs+0xcc/0x130 [<c02aae90>] v4l_reqbufs+0x50/0x54 [<c02aab54>] __video_do_ioctl+0x260/0x2c4 [<c02a9dd4>] video_usercopy+0xf0/0x310 [<c02aa008>] video_ioctl2+0x14/0x1c [<c02a562c>] v4l2_ioctl+0x104/0x14c [<c00bd320>] do_vfs_ioctl+0x80/0x2d0 [<c00bd5b4>] SyS_ioctl+0x44/0x64 unreferenced object 0xc564ac00 (size 192): comm "mttest", pid 764, jiffies 4294945878 (age 487.160s) hex dump (first 32 bytes): 01 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00 ....(.. ........ 00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00 .....d.......... backtrace: [<c00a98dc>] create_object+0x10c/0x28c [<c03ba8ec>] kmemleak_alloc+0x3c/0x70 [<c00a67c0>] __kmalloc+0x11c/0x1d4 [<c02b6f48>] __videobuf_alloc+0x1c/0x3c [<c02b6194>] videobuf_alloc_vb+0x38/0x80 [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108 [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c [<c02be2c4>] vpfe_reqbufs+0xcc/0x130 [<c02aae90>] v4l_reqbufs+0x50/0x54 [<c02aab54>] __video_do_ioctl+0x260/0x2c4 [<c02a9dd4>] video_usercopy+0xf0/0x310 [<c02aa008>] video_ioctl2+0x14/0x1c [<c02a562c>] v4l2_ioctl+0x104/0x14c [<c00bd320>] do_vfs_ioctl+0x80/0x2d0 [<c00bd5b4>] SyS_ioctl+0x44/0x64 unreferenced object 0xc564a180 (size 192): comm "mttest", pid 764, jiffies 4294945880 (age 487.140s) hex dump (first 32 bytes): 02 00 00 00 28 07 07 20 d0 02 00 00 e0 01 00 00 ....(.. ........ 00 00 00 00 00 64 05 00 01 00 00 00 01 00 00 00 .....d.......... backtrace: [<c00a98dc>] create_object+0x10c/0x28c [<c03ba8ec>] kmemleak_alloc+0x3c/0x70 [<c00a67c0>] __kmalloc+0x11c/0x1d4 [<c02b6f48>] __videobuf_alloc+0x1c/0x3c [<c02b6194>] videobuf_alloc_vb+0x38/0x80 [<c02b6638>] __videobuf_mmap_setup+0x9c/0x108 [<c02b6da0>] videobuf_reqbufs.part.10+0x12c/0x1bc [<c02b6e9c>] videobuf_reqbufs+0x6c/0x8c [<c02be2c4>] vpfe_reqbufs+0xcc/0x130 [<c02aae90>] v4l_reqbufs+0x50/0x54 [<c02aab54>] __video_do_ioctl+0x260/0x2c4 [<c02a9dd4>] video_usercopy+0xf0/0x310 [<c02aa008>] video_ioctl2+0x14/0x1c [<c02a562c>] v4l2_ioctl+0x104/0x14c [<c00bd320>] do_vfs_ioctl+0x80/0x2d0 [<c00bd5b4>] SyS_ioctl+0x44/0x64 Reported-by: Jimmy Ho <jimmygge@gmail.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>