summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-driver.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB (10135): v4l2: introduce v4l2_file_operations.Hans Verkuil2009-01-021-12/+8
| | | | | | | | | | | | | | | | Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9327): v4l: use video_device.num instead of minor in video%dHans Verkuil2008-10-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now independent of the minor number. So instead of using the minor field of the video_device struct one has to use the num field: this always contains the kernel number of the device node. I forgot about this when I did the v4l2 core change, so this patch converts all drivers that use it in one go. Luckily the change is trivial. Cc: michael@mihu.de Cc: mchehab@infradead.org Cc: corbet@lwn.net Cc: luca.risolia@studio.unibo.it Cc: isely@pobox.com Cc: pe1rxq@amsat.org Cc: royale@zerezo.com Cc: mkrufky@linuxtv.org Cc: stoth@linuxtv.org Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9160): v4l: remove vidioc_enum_fmt_vbi_capHans Verkuil2008-10-131-13/+0
| | | | | | | | | Remove the vidioc_enum_fmt_vbi_cap ops: it was scheduled for removal in 2.6.28 since the v4l2 specification says that V4L2_BUF_TYPE_VBI_CAPTURE should not support VIDIOC_ENUM_FMT. It's also pretty pointless. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8956): bttv: Turn video_nr, vbi_nr and radio_nr into arraysJean Delvare2008-10-121-10/+16
| | | | | | | | | | | | With video_nr, vbi_nr and radio_nr being simple integers, it is not possible to use these parameters on a system with multiple bttv adapters (which happens to be my case.) video_register_device() will always fail on the second and later adapters. Turn these parameters into arrays, as many other V4L drivers are already doing, so that they can be used on such systems. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8879): bttv: Don't unmask VPRES interruptJean Delvare2008-10-121-1/+1
| | | | | | | | | | | | When the input is set to tuner and no antenna is connected, the BT848 can flood VPRES interrupts. So we don't want to enable this type of interrupts when the input it set to tuner. As we don't do anything when receiving such an interrupt anyway, the easiest fix is to simply not unmask this specific interrupt. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8627): Fix mute on bttv driverMauro Carvalho Chehab2008-10-121-0/+5
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8613): v4l: move BKL down to the driver level.Hans Verkuil2008-10-121-4/+16
| | | | | | | | | | | The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8955): bttv: Prevent NULL pointer dereference in radio_openJean Delvare2008-10-041-1/+1
| | | | | | | | | | | | | | | | | Fix the following crash in the bttv driver: BUG: unable to handle kernel NULL pointer dereference at 000000000000036c IP: [<ffffffffa037860a>] radio_open+0x3a/0x170 [bttv] This happens because radio_open assumes that all present bttv devices have a radio function. If a bttv device without radio and one with radio are installed on the same system, and the one without radio is registered first, then radio_open checks for the radio device number of a bttv device that has no radio function, and this breaks. All we have to do to fix it is to skip bttv devices without a radio function. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8757): v4l-dvb: fix a bunch of sparse warningsHans Verkuil2008-09-031-1/+0
| | | | | | | | Fixed a lot of sparse warnings: mostly warnings about shadowed variables and signed/unsigned mismatches. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil2008-07-271-18/+5
| | | | | | | | | The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops ↵Hans Verkuil2008-07-261-10/+16
| | | | | | | | | | | | | struct All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it. This ensures a clean separation between the const ops struct and the non-const video_device struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8430): videodev: move some functions from v4l2-dev.h to ↵Hans Verkuil2008-07-231-0/+1
| | | | | | | | | | | | | v4l2-common.h or v4l2-ioctl.h The functions in a header should not belong to another module. The prio functions belong to v4l2-common.c, so move them to v4l2-common.h. The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header and move those functions to it. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev'Hans Verkuil2008-07-231-2/+2
| | | | | | | | | The class_dev field is a normal device, not a class device. This is very confusing and now that the old 'dev' field has been renamed to 'parent' we can rename 'class_dev' to just 'dev'. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8428): videodev: rename 'dev' to 'parent'Hans Verkuil2008-07-231-2/+2
| | | | | | | | The field 'dev' is not the video device, but the parent of the video device. Rename accordingly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8132): bt8xx endianness annotations and fixesAl Viro2008-07-201-3/+3
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8110): bttv: allow debug ioctl'sMauro Carvalho Chehab2008-07-201-0/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacksHans Verkuil2008-07-201-22/+22
| | | | | | | | | The naming for the callbacks that handle the VIDIOC_ENUM_FMT and VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match the v4l2_buf_type name. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* Fix a deadlock in the bttv driverArjan van de Ven2008-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | vidiocgmbuf() does this: mutex_lock(&fh->cap.vb_lock); retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize, V4L2_MEMORY_MMAP); and videobuf_mmap_setup() then just does mutex_lock(&q->vb_lock); ret = __videobuf_mmap_setup(q, bcount, bsize, memory); mutex_unlock(&q->vb_lock); which is an obvious double-take deadlock. This patch fixes this by having vidiocgmbuf() just call the __videobuf_mmap_setup function instead. Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Reported-by: Koos Vriezen <koos.vriezen@gmail.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* V4L/DVB (7579): bttv: Fix memory leak in radio_releaseRobert Fitzsimons2008-04-241-0/+3
| | | | | | | | Fix the leak of the bttv_fh structure allocated in radio_open which was introduced by commit 5cd3955cb8adfc1edf481e9e1cb2289db50ccacb. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7462): bttv: Fix some API non-compliances for some audio/input V4L2 ↵Mauro Carvalho Chehab2008-04-241-3/+14
| | | | | | | calls Thanks to Cyrill Gorcunov <gorcunov@gmail.com> for pointing this Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7237): Convert videobuf-dma-sg to generic DMA APIGuennadi Liakhovetski2008-04-241-8/+8
| | | | | | | | | videobuf-dma-sg does not need to depend on PCI. Switch it to using generic DMA API, convert all affected drivers, relax Kconfig restriction, improve compile-time type checking, fix some Coding Style violations while at it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7461): bttv: fix missed index checkCyrill Gorcunov2008-04-011-0/+4
| | | | | | | We should check for proper index first Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7400): bttv: Add a radio compat_ioctl file operationRobert Fitzsimons2008-04-011-0/+1
| | | | | Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7278): bttv: Re-enable radio tuner support for ↵Robert Fitzsimons2008-04-011-2/+3
| | | | | | | VIDIOCGFREQ/VIDIOCSFREQ ioctls Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7277): bttv: Re-enabling radio support requires the use of struct ↵Robert Fitzsimons2008-04-011-5/+16
| | | | | | | | | | | bttv_fh A number of the radio tuner ioctl functions are shared with the TV tuner, these functions require a struct bttv_fh data structure to be allocated and initialized. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7236): bttv: struct member initialized twiceHarvey Harrison2008-03-201-1/+0
| | | | | | | | | | fixes sparse warning: drivers/media/video/bt8xx/bttv-driver.c:3391:3: warning: Initializer entry defined twice drivers/media/video/bt8xx/bttv-driver.c:3392:3: also defined here Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7197): bttv: Fix overlay divide errorRobert Fitzsimons2008-02-181-0/+1
| | | | | | | | | | | The initial work to convert the bttv driver to V4L2 "Partial conversion from V4L1 to V4L2" (e84619b17440ccca4e4db7583d126c4189b987e5), missed the line which set the appropriate overlay crop structure in the newly allocated bttv_buffer. This then causes a divide error in the bttv_calc_geo function. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7121): Renames videobuf lock to vb_lockMauro Carvalho Chehab2008-02-181-26/+24
| | | | | | | This helps to identify where vb_lock is being used, and find missusages of the locks. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7037): Fix build breakage of the bttv driver, when advanced ↵Zoltan Devai2008-01-251-0/+2
| | | | | | | debugging is not enabled Signed-off-by: Zoltan Devai <zdevai@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6914): Fix a few issues at the bttv conversionMauro Carvalho Chehab2008-01-251-37/+83
| | | | | | | | | | | | | bttv driver is working as previously. An additional gain of about 1,5Kb were obtained with the driver conversion to vidioc_ioctl2: text data bss dec hex filename 89208 40244 57556 187008 2da80 old/bttv.ko 88960 38740 57556 185256 2d3a8 new/bttv.ko (measured on a x86_64) Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6913): Preserve the previous order to make easier to check the ↵Mauro Carvalho Chehab2008-01-251-177/+178
| | | | | | conversion Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6912): Replace vidioc_ to bttv_Mauro Carvalho Chehab2008-01-251-93/+93
| | | | | | | | | Since there are a few vidioc_ functions that were exported, rename those functions to bttv_ in order to avoid poluting namespace. The other functions were also renamed, to standardize inside the driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6911): Converted bttv to use video_ioctl2Douglas Schilling Landgraf2008-01-251-901/+1070
| | | | | Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6848): bttv: check pci_register_driver() errorAkinobu Mita2008-01-251-2/+5
| | | | | | | Check pci_register_driver() error in module_init. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to ↵Brandon Philips2008-01-251-13/+13
| | | | | | | | | | | | | | | VIDEOBUF_ s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6416): Split hooks on volume and audio mode and rework their handlingNickolay V. Shmyrev2008-01-251-76/+21
| | | | | | | Also convert audio_mode_gpio functions from audio_hook Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6415): Restructurize volume hook and drop unused mute hookNickolay V. Shmyrev2008-01-251-28/+3
| | | | | Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6414): Remove bass, treble and balance from audio hook since they ↵Nickolay V. Shmyrev2008-01-251-30/+0
| | | | | | | are unused Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6413): Forward VIDIOCGAUDIO and VIDIOCSAUDIO through v4l1-compatNickolay V. Shmyrev2008-01-251-41/+0
| | | | | Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6411): remove V4L1 from being compiled when V4L2 only is selectedMauro Carvalho Chehab2008-01-251-71/+24
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6410): Partial conversion from V4L1 to V4L2Nickolay V. Shmyrev2008-01-251-533/+130
| | | | | | | | This is part of the old V4L1->V4L2 bttv patch, ported to current tree by Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6409): Cleanup: removed i2c_vidiocschanNickolay V. Shmyrev2008-01-251-13/+5
| | | | | | | | This is part of the old V4L1->V4L2 bttv patch, ported to current tree by Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6944a): Fix Regression VIDIOCGMBUF ioctl hangs on bttv driverGregor Jasny2008-01-071-3/+1
| | | | | | | | Fix bttv VIDIOCGMBUF locking like done in commit 820eacd84cff23b76693f4be1e28feb672f4488f. Signed-off-by: Gregor Jasny <gjasny@web.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6797): bt8xx/ section fixesAdrian Bunk2007-12-111-2/+2
| | | | | | | | | | | | | | This patch fixes the following section mismatch with CONFIG_HOTPLUG=n: <-- snip --> ... ... <-- snip --> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stopBrandon Philips2007-12-111-4/+1
| | | | | | | | Drivers were using cookie cutter code for stopping the read/stream. Use the new videobuf_stop function which is lock safe. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6392): bttv: Update initial image size when set via V4L1 VIDIOCMCAPTURETrent Piepho2007-11-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The V4L1 spec says that the image size should be with with VIDIOCSWIN before requesting buffers with VIDIOCGMBUF and capturing into them with VIDIOCMCAPTURE. But it seems that many apps don't do this. They set the size using the fields in the VIDIOCMCAPTURE ioctl. The driver doesn't know what size to capture until it actually starts to capture. In particular, it doesn't know what size to capture until it has already mmap the captured buffers. Which is quite stupid. Why V4L1 has size and format fields for VIDIOCMCAPTURE I have no idea. Many drivers don't support this, including those using v4l1-compat. The bttv does, which is probably the only reason such broken software is so prevalent. But, the driver doesn't adjust its idea of what size is being captured when it is set this way. If you try to query the driver's current setting with v4l2-ctl, it won't be correct. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6391): bttv: SPICT ioctl doesn't work with vlcTrent Piepho2007-11-041-4/+0
| | | | | | | | | | | | | | | | The bttv driver instists that the depth specified in the call to VIDIOCSPICT match the pixel format specified in the same call. vlc doesn't set the depth field, which makes the SPICT ioctl always fail. The V4L1 standard is not clear on how most operation are supposed to work, and this is no exception. The depth field would appear to be entirely redundant, as the pixel format specifies a specific depth. It could be that this field was only meant for output from the *G*PICT ioctl and should be ignored in *S*PICT. This is in fact what the v4l1-compat wrapper does. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6320): v4l core: remove the unused .hardware V4L1 fieldMauro Carvalho Chehab2007-10-221-3/+0
| | | | | | | | | | | struct video_device used to define a .hardware field. While initialized on severl drivers, this field is never used inside V4L. However, drivers using it need to include the old V4L1 header. This seems to cause compilation troubles with some random configs. Better just to remove it from all drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6305): V4L: videobuf-core.c avoid NULL dereferences in videobuf-coreBrandon Philips2007-10-101-0/+2
| | | | | | | | | | | | | | | The return value of videobuf_alloc() is unchecked but this function will return NULL on an error. Check for NULL and make videobuf_reqbufs() return the number of successfully allocated buffers. Also, fix saa7146_video.c and bttv-driver.c to use this returned buffer count. Tested against the vivi driver. Not tested against saa7146 or bt8xx devices. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6293): V4L: convert struct class_device to struct deviceKay Sievers2007-10-101-5/+6
| | | | | | | | | | | | The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
OpenPOWER on IntegriCloud