summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx23885/cx23885-video.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] cx23885: convert it to use pr_foo() macrosMauro Carvalho Chehab2016-11-181-11/+12
| | | | | | | | | | | Instead of calling printk() directly, use pr_foo() macros, as suggested at the Kernel's coding style. Please notice that a conversion to dev_foo() is not trivial, as several parts on this driver uses pr_cont(). Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] cx23885: don't break long linesMauro Carvalho Chehab2016-10-211-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. </script> use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } </script> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pci: constify vb2_ops structuresJulia Lawall2016-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for vb2_ops structures that are only stored in the ops field of a vb2_queue structure. That field is declared const, so vb2_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil2016-07-081-1/+1
| | | | | | | | | | | | | | | | Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media/pci: convert drivers to use the new vb2_queue dev fieldHans Verkuil2016-07-081-1/+2
| | | | | | | | Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Federico Vaga <federico.vaga@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: videobuf2: Move timestamp to vb2_bufferJunghak Sung2015-12-181-1/+1
| | | | | | | | | | | | | | Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vb2: drop v4l2_format argument from queue_setupHans Verkuil2015-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | The queue_setup callback has a void pointer that is just for V4L2 and is the pointer to the v4l2_format struct that was passed to VIDIOC_CREATE_BUFS. The idea was that drivers would use the information from that struct to buffers suitable for the requested format. After the vb2 split series this pointer is now a void pointer, which is ugly, and the reality is that all existing drivers will effectively just look at the sizeimage field of v4l2_format. To make this more generic the queue_setup callback is changed: the void pointer is dropped, instead if the *num_planes argument is 0, then use the current format size, if it is non-zero, then it contains the number of requested planes and the sizes array contains the requested sizes. If either is unsupported, then return -EINVAL, otherwise use the requested size(s). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885: add support for ViewCast 260e and 460eHans Verkuil2015-12-181-1/+3
| | | | | | | | | | | Add support for these two new cards. Based upon Devin's initial patch made for an older kernel which I cleaned up and rebased. Thanks to Kernel Labs for that work. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885: fix format/crop handlingHans Verkuil2015-12-181-1/+38
| | | | | | | | | | | | | | | | While testing the cx23885 driver with various TV standards I found a number of bugs: 1) norm_maxw() returned 768 instead of 720 for PAL formats. This should always be 720, so drop this inline function and just always use 720. 2) cropcap() was missing, so the pixelaspect was never known and qv4l2 would scale the image incorrectly. Add cropcap support. 3) cx23885_set_tvnorm() should just return 0 if the same standard was set again. If another standard is set, then reset the width/height and call set_fmt for the subdevs. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] include/media: move driver interface headers to a separate dirMauro Carvalho Chehab2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's not mix headers used by the core with those headers that are needed by some driver-specific interface header. The headers used on drivers were manually moved using: mkdir include/media/drv-intf/ git mv include/media/cx2341x.h include/media/cx25840.h \ include/media/exynos-fimc.h include/media/msp3400.h \ include/media/s3c_camif.h include/media/saa7146.h \ include/media/saa7146_vv.h include/media/sh_mobile_ceu.h \ include/media/sh_mobile_csi2.h include/media/sh_vou.h \ include/media/si476x.h include/media/soc_mediabus.h \ include/media/tea575x.h include/media/drv-intf/ And the references for those headers were corrected using: MAIN_DIR="media/" PREV_DIR="media/" DIRS="drv-intf/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
* [media] media: videobuf2: Change queue_setup argumentJunghak Sung2015-10-201-1/+1
| | | | | | | | | | | | | | | Replace struct v4l2_format * with void * to make queue_setup() for common use. And then, modify all device drivers related with this change. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix missing const in fimc-lite.c] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: videobuf2: Restructure vb2_bufferJunghak Sung2015-10-011-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer. Add new member variables - bytesused, length, offset, userptr, fd, data_offset - to struct vb2_plane in order to cover all information of v4l2_plane. struct vb2_plane { <snip> unsigned int bytesused; unsigned int length; union { unsigned int offset; unsigned long userptr; int fd; } m; unsigned int data_offset; } Replace v4l2_buf with new member variables - index, type, memory - which are common fields for buffer management. struct vb2_buffer { <snip> unsigned int index; unsigned int type; unsigned int memory; unsigned int num_planes; struct vb2_plane planes[VIDEO_MAX_PLANES]; <snip> }; v4l2 specific fields - flags, field, timestamp, timecode, sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c struct vb2_v4l2_buffer { struct vb2_buffer vb2_buf; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; }; Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2: replace s_mbus_fmt by set_fmt in bridge driversHans Verkuil2015-05-011-5/+7
| | | | | | | | | | | | | | Replace all calls to s_mbus_fmt in bridge drivers by calls to the set_fmt pad op. Remove the old try/s_mbus_fmt video ops since they are now no longer used. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885: Always initialise dev->slock spinlockDavid Howells2015-04-081-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The slock spinlock in the cx23885_dev struct is only initialised if analogue video is being used, but is used in other places too, leading to the attached lockdep complaint. Move the lock initialisation so that it is done unconditionally. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 1 PID: 4413 Comm: scandvb Tainted: G W 4.0.0-rc1-fsdevel+ #25 Hardware name: System manufacturer System Product Name/P5Q PRO TURBO, BIOS 0701 10/08/2012 0000000000000000 ffff880129d779d8 ffffffff8162bbdf 0000000000000006 0000000000000000 ffff880129d77aa8 ffffffff810780e3 0000000000000001 0000000000000046 0000000000000004 ffffffff81c3f180 0000000000000000 Call Trace: [<ffffffff8162bbdf>] dump_stack+0x4c/0x65 [<ffffffff810780e3>] __lock_acquire+0x7b5/0x1a0e [<ffffffff810799ee>] lock_acquire+0x97/0x10c [<ffffffffa006494e>] ? cx23885_buf_queue+0x69/0x142 [cx23885] [<ffffffff8102e9bc>] ? amd_set_subcaches+0x19b/0x19b [<ffffffff816313b4>] _raw_spin_lock_irqsave+0x36/0x4a [<ffffffffa006494e>] ? cx23885_buf_queue+0x69/0x142 [cx23885] [<ffffffffa006494e>] cx23885_buf_queue+0x69/0x142 [cx23885] [<ffffffffa00662cb>] buffer_queue+0x17/0x19 [cx23885] [<ffffffffa00382d5>] __enqueue_in_driver+0x6a/0x6f [videobuf2_core] [<ffffffffa0038ead>] vb2_start_streaming+0x37/0x129 [videobuf2_core] [<ffffffffa003a6c0>] vb2_internal_streamon+0xc5/0x105 [videobuf2_core] [<ffffffffa003b889>] __vb2_init_fileio+0x224/0x286 [videobuf2_core] [<ffffffffa003bcc0>] ? vb2_thread_start+0x7b/0x15f [videobuf2_core] [<ffffffffa0050182>] ? vb2_dvb_start_feed+0x86/0x86 [videobuf2_dvb] [<ffffffffa003bd06>] vb2_thread_start+0xc1/0x15f [videobuf2_core] [<ffffffff8150d393>] ? dmx_section_feed_start_filtering+0x2f/0x14f [<ffffffffa0050157>] vb2_dvb_start_feed+0x5b/0x86 [videobuf2_dvb] [<ffffffff8150d461>] dmx_section_feed_start_filtering+0xfd/0x14f [<ffffffff8150afc7>] dvb_dmxdev_filter_start+0x23f/0x315 [<ffffffff8150b6ad>] dvb_demux_do_ioctl+0x1fb/0x556 [<ffffffff81509e94>] dvb_usercopy+0xb4/0x11c [<ffffffff8150b4b2>] ? dvb_dmxdev_ts_callback+0xd0/0xd0 [<ffffffff8150a11a>] dvb_demux_ioctl+0x10/0x14 [<ffffffff81144ac4>] do_vfs_ioctl+0x3c1/0x474 [<ffffffff8126f181>] ? file_has_perm+0x5b/0x7f [<ffffffff810bf6ca>] ? __audit_syscall_entry+0xbc/0xde [<ffffffff81144bcc>] SyS_ioctl+0x55/0x7a [<ffffffff81631d52>] system_call_fastpath+0x12/0x17 Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vb2-dma-sg: move dma_(un)map_sg hereHans Verkuil2014-11-251-9/+0Star
| | | | | | | | | | | | | | | | | | | | | | | This moves dma_(un)map_sg to the get_userptr/put_userptr and alloc/put memops of videobuf2-dma-sg.c and adds dma_sync_sg_for_device/cpu to the prepare/finish memops. Now that vb2-dma-sg will sync the buffers for you in the prepare/finish memops we can drop that from the drivers that use dma-sg. For the solo6x10 driver that was a bit more involved because it needs to copy JPEG or MPEG headers to the buffer before returning it to userspace, and that cannot be done in the old place since the buffer there is still setup for DMA access, not for CPU access. However, the buf_finish op is the ideal place to do this. By the time buf_finish is called the buffer is available for CPU access, so copying to the buffer is fine. [mchehab@osg.samsung.com: Fix a compilation breakage: drivers/media/v4l2-core/videobuf2-dma-sg.c:150:19: error: 'struct vb2_dma_sg_buf' has no member named 'dma_sgt'] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vb2-dma-sg: add allocation context to dma-sgHans Verkuil2014-11-251-0/+1
| | | | | | | | | Require that dma-sg also uses an allocation context. This is in preparation for adding prepare/finish memops to sync the memory between DMA and CPU. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pci: Make use of MEDIA_BUS_FMT definitionsBoris BREZILLON2014-11-141-1/+1
| | | | | | | | | | | | | | In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in pci drivers. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885: fix size helper functionsHans Verkuil2014-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | The norm_swidth function was unused and is dropped. It's not clear what the purpose of that function was. The norm_maxh function was changed so it tests for 60 Hz standards rather than for 50 Hz standards. The is the preferred order. The norm_maxw function was poorly written and used: it gives the maximum allowed line width for the given standard. For 60 Hz that's 720, but for 50 Hz that's 768 which allows for 768x576 which gives you square pixels. For 60 Hz formats it is 640x480 that gives square pixels, so there is no need to go beyond 720. The initial width was set using norm_maxh(), which was wrong. Just set to 720, that's what you normally use. Since the initial standard was NTSC anyway the initial width was always 720 anyway. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] cx23885: Add busy checks before changing formatsHans Verkuil2014-09-081-3/+12
| | | | | | | | | | | | Before you can change the standard or the capture format, make sure the various vb2_queues aren't in use since you cannot change the buffer size from underneath a a busy vb2_queue. Also make sure that the return code of cx23885_set_tvnorm is returned correctly, otherwise the -EBUSY will be lost. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fix field handlingHans Verkuil2014-09-081-1/+6
| | | | | | | | | Add missing SEQ_BT/TB support, bottom field is first for all 60 Hz formats, not just NTSC, restore an overwritten field value and initialize dev->field correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: convert to vb2Hans Verkuil2014-09-081-597/+213Star
| | | | | | | | | | | | | | | | | | | | | | | | As usual, this patch is very large due to the fact that half a vb2 conversion isn't possible. And since this affects 417, alsa, core, dvb, vbi and video the changes are all over. What made this more difficult was the peculiar way the risc program was setup. The driver allowed for running out of buffers in which case the DMA would stop and restart when the next buffer was queued. There was also a complicated timeout system for when buffers weren't filled. This was replaced by a much simpler scheme where there is always one buffer around and the DMA will just cycle that buffer until a new buffer is queued. In that case the previous buffer will be chained to the new buffer. An interrupt is generated at the start of the new buffer telling the driver that the previous buffer can be passed on to userspace. Much simpler and more robust. The old code seems to be copied from the cx88 driver. But it didn't fit the vb2 ops very well and replacing it with the new scheme made the code easier to understand. Not to mention that this patch removes 600 lines of code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: remove FSF address as per checkpatchHans Verkuil2014-09-031-5/+0Star
| | | | | | | | These addresses are usually out-of-date and the top-level license will always have the right address. So drop it from these sources. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: use video_drvdata to get cx23885_dev pointerHans Verkuil2014-09-031-31/+29Star
| | | | | | | | | Use video_drvdata(file) instead of fh->dev to get the cx23885_dev pointer. This prepares for the vb2 conversion where fh->dev (renamed to fh->q_dev in this patch) will be removed completely. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fmt, width and height are global, not per-fhHans Verkuil2014-09-031-95/+30Star
| | | | | | | Move these fields from cx23885_fh to cx23885_dev. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: drop type field from struct cx23885_fhHans Verkuil2014-09-031-49/+40Star
| | | | | | | This information is available elsewhere as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: drop radio-related dead codeHans Verkuil2014-09-031-12/+3Star
| | | | | | | | Currently no radio device nodes are ever created, so remove the dead radio code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: map invalid fields to a valid fieldHans Verkuil2014-09-031-1/+2
| | | | | | | | If field format is not valid, map it as V4L2_FIELD_INTERLACED, instead of pretending to support an invalid format. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fix format colorspace compliance errorHans Verkuil2014-09-031-0/+2
| | | | | | | Fix v4l2-compliance failure relating to formatting. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: convert 417 to the control frameworkHans Verkuil2014-09-031-6/+0Star
| | | | | | | Convert the -417 source to the control framework as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: convert to the control frameworkHans Verkuil2014-09-031-211/+35Star
| | | | | | | | | | This is part 1, converting the uncompressed video/vbi nodes to use the control framework. The next patch converts the compressed video node as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: use core locking, switch to unlocked_ioctlHans Verkuil2014-09-031-33/+10Star
| | | | | | | Enable core locking which allows us to safely switch to unlocked_ioctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: support v4l2_fh and g/s_priorityHans Verkuil2014-09-031-1/+5
| | | | | | | Add support for struct v4l2_fh and priority handling. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fix audio input handlingHans Verkuil2014-09-031-11/+20
| | | | | | | Fix a bunch of v4l2-compliance errors relating to audio input handling. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fix querycapHans Verkuil2014-09-031-6/+9
| | | | | | | Set device_caps to fix the v4l2-compliance QUERYCAP complaints. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: fix UNSET/TUNER_ABSENT confusionHans Verkuil2014-08-011-5/+5
| | | | | | | | | | Sometimes dev->tuner_type is compared to UNSET, sometimes to TUNER_ABSENT, but these defines have different values. Standardize to TUNER_ABSENT. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: add support for Hauppauge ImpactVCB-eHans Verkuil2014-07-181-0/+1
| | | | | | | | Add support for Hauppauge model 71100: WinTV-ImpactVCB-e (PCIe, Retail, half height) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart2014-05-241-2/+2
| | | | | | | | | | | | The g_std and s_std operations are video-related, move them to the video ops where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: Add Leadtek Winfast PxPVR2200Anca Emanuel2013-10-141-1/+2
| | | | | | | | | | | | | | | | Tested: Composite: http://imgur.com/Rb1TCF3 TV: http://imgur.com/KNrfsmv Firmware used: xc3028-v27.fw Not tested: audio, component, s-video, mpeg2 encoder, FM radio. For audio, it uses an CD style cable to connect to the analog "CD_IN" on the motherboard. I didn't found how to unmute it (alsamixer do not show an CD or AUX channel). Signed-off-by: Anca Emanuel <anca.emanuel@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885-video: fix two warningsMauro Carvalho Chehab2013-08-011-0/+1
| | | | | | | | | | drivers/media/pci/cx23885/cx23885-video.c:420:5: warning: no previous prototype for 'cx23885_flatiron_write' [-Wmissing-prototypes] int cx23885_flatiron_write(struct cx23885_dev *dev, u8 reg, u8 data) ^ drivers/media/pci/cx23885/cx23885-video.c:431:4: warning: no previous prototype for 'cx23885_flatiron_read' [-Wmissing-prototypes] u8 cx23885_flatiron_read(struct cx23885_dev *dev, u8 reg) Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885[v4]: Fix interrupt storm when enabling IR receiverLuis Alves2013-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | Apparently the Flatiron genereates an interrupt after the built-in self test for each of its left and right channels has completed. Apparently Conexant wire-OR'ed the Flatiron's interrupt output with the interrupt output of the CX23885 A/V core. Those interrupts need to be handled, otherwise, they generate an interrrupt request storm. So: - Add flatiron readreg and writereg functions prototypes on a new header file; - Modify the av interrupt handler to cleanup flatiron IRQs if no other interrupt handling happens. Signed-off-by: Luis Alves <ljalvs@gmail.com> Acked-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] cx23885: remove use of deprecated current_normHans Verkuil2013-06-171-5/+2Star
| | | | | | | | | The use of current_norm can be dropped. The g_std ioctl was already implemented, so current_norm didn't do anything useful anyway. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] cx23885: remove g_chip_identHans Verkuil2013-06-171-1/+1
| | | | | | | | Replace g_chip_ident by g_chip_info. Note that the IR support is implemented as a subdev, so this part no longer needs to be handled as a 'bridge' chip. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2: pass std by value to the write-only s_std ioctlHans Verkuil2013-03-241-2/+2
| | | | | | | | | | | | | This ioctl is defined as IOW, so pass the argument by value instead of by reference. I could have chosen to add const instead, but this is 1) easier to handle in drivers and 2) consistent with the s_std subdev operation. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jonathan Corbet <corbet@lwn.net> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2: add const to argument of write-only s_tuner ioctlHans Verkuil2013-03-241-1/+1
| | | | | | | | | This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2: add const to argument of write-only s_frequency ioctlHans Verkuil2013-03-241-4/+4
| | | | | | | This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] cx23885: Replace memcpy with struct assignmentEzequiel Garcia2012-12-271-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | This kind of memcpy() is error-prone. Its replacement with a struct assignment is prefered because it's type-safe and much easier to read. Found by coccinelle. Hand patched and reviewed. Tested by compilation only. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier struct_name; struct struct_name to; struct struct_name from; expression E; @@ -memcpy(&(to), &(from), E); +to = from; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Reviewed-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] Added support for AVerTV Hybrid Express Slim HC81ROleh Kravchenko2012-12-271-1/+14
| | | | | | | | | This patch provide only analog support. The device is based on AF9013 demodulator, XC3028 tuner and CX23885 chipset; subsystem id: 1461:d939 Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l: Convert drivers to use monotonic timestampsSakari Ailus2012-12-211-1/+1
| | | | | | | | | Convert drivers using wall clock time (CLOCK_REALTIME) to timestamp from the monotonic timer (CLOCK_MONOTONIC). Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] Mygica X8507 audio for YPbPr, AV and S-VideoAlfredo Jesús Delaiti2012-10-061-1/+2
| | | | | | | | | Adds audio support for input YPbPr, AV and S-Video on Mygica X8507 card. Remains to be done: IR, FM and ISDBT Signed-off-by: Alfredo J. Delaiti <alfredodelaiti@netscape.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2: make vidioc_s_audio constHans Verkuil2012-09-261-1/+1
| | | | | | | | | Write-only ioctls should have a const argument in the ioctl op. Do this conversion for vidioc_s_audio. Adding const for write-only ioctls was decided during the 2012 Media Workshop. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>