summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
AgeCommit message (Collapse)Author
2008-01-27[PATCH] static memoryDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-01-24em28xx: remove has_tunerMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> has_tuner flag doesn't make much sense, since tuner_type=TUNER_ABSENT means the same thing. Having two ways to say that a tuner is not present is not nice, since it may lead to bad setups. In fact, with the previous code, if a device were using has_tuner=0, but the user forces a tuner, with modprobe option tuner=type, the modprobe option won't work. Also, tveeprom returns TUNER_ABSENT, when tuner is unknown or absent. So, with the previous logic, in this case, the driver should set has_tuner=0, or has_tuner=1 otherwise. Instead of adding several additional tests and setups, better just to remove .has_tuner. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-06Request snd-usb-audio for devices with Audio Class supportMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Before this patch, only Vendor Class audio support were loaded. This means that older em28xx devices won't have digital audio support loaded. This patch changes the logic to auto load eighter snd-usb-audio, for devices with USB Audio Class or em28xx-alsa, for devices with USB Vendor Class. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Add Radio support for em28xxMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Properly implement 12MHz I2S supportMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Add code for autoloading em28xx-alsa, if neededMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Older em28xx devices does implement standard Audio Class. However, on newer devices, this were replaced by a Vendor Class. This patch autodetects that an em28xx lacks Audio Class and auto-loads em28xx-alsa, for the devices that implements only a Vendor Class. For devices with Audio Class, snd-usb-audio module will provide an ALSA interface. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Integrates em28xx-audio.c into em28xx kernel moduleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Also fixes the remaining CodingStyle issues that Lindent didn't fix. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05Improve audio setup handlingMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> It is possible to select audio inputs via em28xx or via ac97 functions. This patch allows configuring a board to use either one way. It also do some cleanups at audio setup configurations. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-11Cleanup at tv norm selectionMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> With the conversion to the vidio_ioctl2, tvnorms array is not required anymore. Also, removed some code from V4L1 time (VIDEO_MODE_foo), specied at the non-used video_decoder.h. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-11Remove some dead code and make drive fully V4L2 compatibleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> There were some vestiges of an old V4L1 I2C driver that were called by em28xx. This patch removes this dead code, and replaces videodev.h to videodev2.h Now, this driver doesn't require V4L1 anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-11Convert em28xx to video_ioctl2Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Uses the newer ioctl handler at videodev. This patch also cleans up some bad logic at the driver and do CodingStyle and other cleanups at the resulting driver. Also, since VIDIOCMBUF were not working, the V4L1 compat code were removed. The compat code will eventually be re-inserted, if we find a clean way for implementing compatibility with the old API. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-11Fix read() methodMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport read() fixes from Markus Reichberger. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-11Fix em28xx read stream lockingMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> On some situations, closing an streaming application and re-opening were returning -EBUSY. Uses the same locking schema also present on cx88. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-10Fix em28xx to allow multiple openMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Allows shared access support for em28xx. Just one userspace application is allowed to get stream. The other(s) application(s) can change V4L2 controls, set video standards, etc. This patch were splited from Markus Rechberger's tree and backported to 2.6.17 by Pádraig Brady. The original patch were ported to the latest em28xx version and had CodingStyle corrected to solve the issues pointed by scripts/checkpatch.pl. Thanks to Pádraig Brady <P@draigBrady.com> for pointing this. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-10Fix: avoids negative vma usage countMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-04em28xx: autodetect Cinergy 200 USB and VGear PocketTVMauro Carvalho Chehab
From: Sascha Sommer <saschasommer@freenet.de> Adds autodetection support for the Cinergy200 USB and the VGear PocketTV. Whenever a usb device with generic empia em2800 usb ids is detected the device gets scanned for connected i2c devices. If the device list matches an em2800 device in the device list the model id gets changed accordingly. Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-03 em28xx: fix failing autodetection after the rebootMauro Carvalho Chehab
From: Sascha Sommer <saschasommer@freenet.de> the attached patch is required so that the autodetecion code also works after a reboot. Setting the I2C speed does not seem to be supported for em2800. Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-03em28xx: fix locking to allow accesses from 2 different threads at the same timeMauro Carvalho Chehab
From: Sascha Sommer <saschasommer@freenet.de> The attached patch modifies the em28xx driver so that there can be ioctls from multiple different threads. This is necessary for capture apps like MPlayer that use different threads for capturing and channel tuning. Now the locking is only done for the ioctls that change properties of the device or access the i2c bus. It also removes some locks that look unnecessary: In em28xx_init_dev: the videodevice is not registered yet so nothing can access the hardware meanwhile, the device struct is not assigned to the interface yet so no race with disconnect is possible In em28xx_release_resources: it gets only called when dev->lock is already held Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-03Add a hint for boards without unique USB IDMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> This patch adds a function to allow trying to detect boards that shares the generic IDs. The current detection method is based at eeprom checksum. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-03Fix: Adds the generic PCI IDs for em28xxMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-02backport changeset 3a4fa0a25da81600ea0bcd75692ae8ca6050d165Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: Robert P. J. Day <rpjday@mindspring.com> Date: Fri Oct 19 23:10:43 2007 +0200 Fix misspellings of "system", "controller", "interrupt" and "necessary". Fix the various misspellings of "system", controller", "interrupt" and "[un]necessary". Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-31em28xx: Include linux/mm.hTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> This em28xx-video.c uses functions from this header, but doesn't include it. It depends on some v4l headers included two levels down including poll.h, which includes mm.h. These v4l headers might change, so it's best to include the headers needed directly. It also causes problems for the out of core build system's backward compatibility with older kernels, which is the real reason I bothered to create a patch for something that would otherwise be so minor that it would hardly be worth the trouble. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-10-18Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIGMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Currently, the only tuner-specific device that allows special configurations is tda9887. However, tea5767 also may require some special configurations (for example, to specify a different Xtal freq). This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl (TUNER_SET_CONFIG). The newer one allows specifying what tuner is appliable to a configuration set, and allows an arbitrary configuration struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-15v4l core: remove the unused .hardware V4L1 fieldMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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>
2007-10-10Change list_for_each+list_entry to list_for_each_entryTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The rest of V4L files. There is one list_for_each+list_entry in cpia_pp.c that wasn't changed because it expects the loop iterator to remain NULL if the list is empty. A bug in vivi is fixed; the 'safe' version needs to be used because the loop deletes the list entries. Simplify a second loop in vivi and get rid if an un-used variable in that loop. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-15Fix a memory leak in em28xx_usb_probe()Mauro Carvalho Chehab
From: Jesper Juhl <jesper.juhl@gmail.com> If, in em28xx_usb_probe() the memory allocation dev->alt_max_pkt_size = kmalloc(32* dev->num_alt,GFP_KERNEL); fails, then we'll bail out and return -ENOMEM. The problem is that in that case we don't free the storage allocated to 'dev', thus causing a memory leak. This patch fixes the leak by freeing 'dev' before we return -ENOMEM. This fixes Coverity bug #647. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-13Initialize filp->private_data only once in em28xx_v4l2_openMauro Carvalho Chehab
From: Rolf Eike Beer <eike-kernel@sf-tec.de> Some lines later filp->private_data is initialized to dev again. Since there are some checks that might fail in the mean time keep the later version. Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-13Backport kernel changeset 59c51591a0ac7568824f541f57de967e88adaa07Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: The original patch is from Michael Opdenacker <michael@free-electrons.com> Fix occurrences of "the the " Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-21Backport: make file_operations constMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Backport a kernel patch by Arjan van de Ven <arjan@linux.intel.com> that made all file_operations instances const. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-19compat: Add compat code for vm_insert_page()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add an inline versin of vm_insert_page() that uses remap_pfn_range() to compat.h. Remove compat code from em28xx-video.c, sn9c102_core.c, and usbvision-video.c since compat.h is now doing the same thing. USB_ZC0301, USB_ET61X251, and USB_ZR364XX will now compile under 2.6.12. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-12-27Allyesconfig build fixes on some non x86 archMauro Carvalho Chehab
From: David Brownell <david-b@pacbell.net> - CAFE_CCIC needs to depend on PCI, else "allyesconfig" breaks on systems without PCI - em28xx-video can't udelay(2500) else "allyesconfig" breaks on systems that refuse to spin that long (I saw it on ARM) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-10-21Two cleanups made at kernel treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-08-26Add u32 argument to VIDIOC_INT_RESET.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The extra argument makes it possible to reset subsystems of a chip if that is supported. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-06-26Remove all instances of request_module("tda9887")Michael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> We should no longer try to load the tda9887 module, because it no longer exists. The tda9887 driver has been merged into the tuner module. This patch removes all instances of request_module("tda9887") from the following video4linux drivers: bttv, cx88, em28xx and saa7134. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-11Use after free in drivers/media/video/em28xx/em28xx-video.cMauro Carvalho Chehab
From: Eric Sesterhenn <snakebyte@gmx.de> In several places we use dev->devno right after we kfree() dev. This fixes coverity bug id #1065 Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-03Change all emails to the currently used one.Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-02Fix video input setting of em28xx, use _INT_S_VIDEO_ROUTING in tvp5150Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - Use new routing input defines in em28xx-cards.c - Fix S-Video settings for tvp5150-based cards (input was copied from saa7115 based cards and worked only because S-Video was selected in the default: case) - Replace VIDIOC_S_INPUT by VIDIOC_INT_S_VIDEO_ROUTING in em28xx-video.c - Remove the now obsolete VIDIOC_S_INPUT handler in saa7115.c - Add VIDIOC_INT_G/S_VIDEO_ROUTING in tvp5150.c - Add new media/tvp5150.h with the routing defines. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-04-01Make msp3400 routing defines more consistentHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Renamed various msp3400 routing defines to be more consistent and less confusing. Esp. the MSP_DSP_OUT defines were confusing since it is really a DSP input. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-04-01Remove obsolete commands from tvp5150.cHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - Remove old DECODER_ commands from tvp5150.c, replacing them with newer ones if appropriate. - Small VIDIOC_G_TUNER fixes in msp3400 and tuner. - Fix VIDIOC_S_TUNER support in em28xx. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Implement correct msp3400 input/output routingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - implement VIDIOC_INT_S_AUDIO_ROUTING for msp3400 and tvaudio - use the new command in bttv, pvrusb2 and em28xx. - remove the now obsolete MSP_SET_MATRIX from msp3400 (yeah!) - remove the obsolete VIDIOC_S_AUDIO from msp3400. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-15Merging mchehab saa7115 treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> merge: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-14Fix a bug when more than MAXBOARDS were plugged on em28xxMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Coverity reported a bug at checking max number of supported boards by em28xx init code. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-13Remove saa711x driverMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Now, em28xx uses saa7115 instead of saa711x. saa7115 driver is capable of handling saa 7113, 7114 and 7115. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-06sem2mutex: drivers/media/, #2Mauro Carvalho Chehab
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Kernel-sync from patch 3318b Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-02-05Fixed em28xx based system lockup Markus Rechberger
From: Markus Rechberger <mrechberger@gmail.com> fixed em28xx based system lockup, device needs to be initialized before starting the isoc transfer otherwise the system will completly lock up. Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
2006-02-01fixed amux hauppauge hvr900/terratec hybrid xsMarkus Rechberger
From: Markus Rechberger <mrechberger@gmail.com> fixed amux hauppauge hvr900/terratec hybrid xs Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
2006-01-22Hauppauge HVR 900 Composite supportMarkus Rechberger
From: Markus Rechberger <mrechberger@gmail.com> Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
2006-01-22CodingStyle fixes.Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> - CodingStyle fixes. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-22Implemented VIDIOC_G_FMT/S_FMT for sliced VBIMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> - Implemented VIDIOC_G_FMT/S_FMT for sliced VBI - VIDIOC_S_FMT now calls a function Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>