summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [media] soc-camera: use devm_kzalloc in subdevice driversGuennadi Liakhovetski2013-01-0515-151/+51
| | | | | | | | I2C drivers can use devm_kzalloc() too in their .probe() methods. Doing so simplifies their clean up paths. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] soc-camera: split struct soc_camera_link into host and subdevice partsGuennadi Liakhovetski2013-01-0518-208/+279
| | | | | | | | | struct soc_camera_link currently contains fields, used both by sensor and bridge drivers. To make subdevice driver re-use simpler, split it into a host and a subdevice parts. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] soc-camera: remove struct soc_camera_device::video_lockGuennadi Liakhovetski2013-01-059-45/+35
| | | | | | | | | | | Currently soc-camera has a per-device node lock, used for video operations and a per-host lock for code paths, modifying host's pipeline. Manipulating the two locks increases complexity and doesn't bring any advantages. This patch removes the per-device lock and uses the per-host lock for all operations. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] soc-camera: fix repeated regulator requestingGuennadi Liakhovetski2013-01-051-6/+6
| | | | | | | | | | | | Currently devm_regulator_bulk_get() is called by soc-camera during host driver probing, but regulators are attached to the camera platform device, that is staying, independent whether the host probed successfully or not. This can lead to repeated regulator requesting, if the host driver is re-probed. Move the call to platform device probing to avoid this. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] soc-camera: properly fix camera probing racesGuennadi Liakhovetski2013-01-052-4/+20
| | | | | | | | | | | | | | | | The recently introduced host_lock causes lockdep warnings, besides, list enumeration in scan_add_host() must be protected by holdint the list_lock. OTOH, holding .video_lock in soc_camera_open() isn't enough to protect the host during its building of the pipeline, because .video_lock is per soc-camera device. If, e.g. more than one sensor can be attached to a host and the user tries to open both device nodes simultaneously, host's .add() method can be called simultaneously for both sensors. Fix these problems by holding list_lock instead of .host_lock in scan_add_host() and taking it shortly at the beginning of soc_camera_open(), and using .host_lock to protect host's .add() and .remove() operations only. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()Wei Yongjun2013-01-051-1/+2
| | | | | | | | | The dereference to 'icl' should be moved below the NULL test. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: declare em28xx_stop_streaming as staticMauro Carvalho Chehab2013-01-051-1/+1
| | | | | | | That fixes the following warning: drivers/media/usb/em28xx/em28xx-video.c:611:5: warning: no previous prototype for 'em28xx_stop_streaming' [-Wmissing-prototypes] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l: Reset subdev v4l2_dev field to NULL if registration failsLaurent Pinchart2013-01-051-16/+14
| | | | | | | | | | | | | | When subdev registration fails the subdev v4l2_dev field is left to a non-NULL value. Later calls to v4l2_device_unregister_subdev() will consider the subdev as registered and will module_put() the subdev module without any matching module_get(). Fix this by setting the subdev v4l2_dev field to NULL in v4l2_device_register_subdev() when the function fails. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@vger.kernel.org Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: consider the message length limitation of the i2c adapter ↵Frank Schaefer2013-01-051-3/+9
| | | | | | | | | | | | | | | | when reading the eeprom EEPROMs are currently read in blocks of 16 bytes, but the em2800 is limited to 4 bytes per read. All other chip variants support reading of max. 64 bytes at once (according to the em258x datasheet; also verified with em2710, em2882, and em28174). Since em2800_i2c_recv_bytes() has been fixed to return with -EOPNOTSUPP when more than 4 bytes are requested, EEPROM reading with this chip is broken. It was actually broken before that change, too, it just didn't throw an error because the i2c adapter silently returned trash data (for all reads >1 byte !). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix+improve+unify i2c error handling, debug messages and ↵Frank Schaefer2013-01-052-32/+89
| | | | | | | | | | | | | | code comments - do not pass USB specific error codes to userspace/i2c-subsystem - unify the returned error codes and make them compliant with the i2c subsystem spec - check number of actually transferred bytes (via USB) everywehere - fix/improve debug messages - improve code comments Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix the i2c adapter functionality flagsFrank Schaefer2013-01-051-1/+5
| | | | | | | | | | | I2C_FUNC_SMBUS_EMUL includes flag I2C_FUNC_SMBUS_WRITE_BLOCK_DATA which signals that up to 31 data bytes can be written to the ic2 client. But the EM2800 supports only i2c messages with max. 4 data bytes. I2C_FUNC_IC2 should be set if a master_xfer function pointer is provided in struct i2c_algorithm. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes()Frank Schaefer2013-01-052-48/+58
| | | | | | | | | | | | | | | Function em2800_i2c_recv_bytes() has 2 severe bugs: 1) It does not wait for the i2c read to complete before reading the received message content from the bridge registers. 2) Reading more than 1 byte doesn't work The former can result in data corruption, the latter always does. The rewritten code also superseds the content of function em2800_i2c_check_for_device(). Tested with device "Terratec Cinergy 200 USB". [mchehab@redhat.com: Fix CodingStyle issues] Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: respect the message size constraints for i2c transfersFrank Schaefer2013-01-051-26/+18
| | | | | | | | | | | | | | The em2800 can transfer up to 4 bytes per i2c message. All other em25xx/em27xx/28xx chips can transfer at least 64 bytes per message. I2C adapters should never split messages transferred via the I2C subsystem into multiple message transfers, because the result will almost always NOT be the same as when the whole data is transferred to the I2C client in a single message. If the message size exceeds the capabilities of the I2C adapter, -EOPNOTSUPP should be returned. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: IR RC: move assignment of get_key functions from ↵Frank Schaefer2013-01-051-4/+2
| | | | | | | | | | | | *_change_protocol() functions to em28xx_ir_init() The get_key functions are independent from the selected protocol, so assign them once only at device initialization. [mchehab@redhat.com: fix a merge conflict] Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: refactor the code in em28xx_usb_disconnect()Frank Schaefer2013-01-051-15/+11
| | | | | | | | | | | | The main purpose of this patch is to move the call of em28xx_release_resources() after the call of em28xx_close_extension(). This is necessary, because some resources might be needed/used by the extensions fini() functions when they get closed. Also mark the device as disconnected earlier in this function and unify the em28xx_uninit_usb_xfer() calls for analog and digital mode. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: simplify device state trackingFrank Schaefer2013-01-055-26/+11
| | | | | | | | | DEV_INITIALIZED of enum em28xx_dev_state state is used nowhere and there is no need for DEV_MISCONFIGURED, so remove this enum and use a boolean field 'disconnected' in the device struct instead. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: convert to videobuf2Devin Heitmueller2013-01-056-589/+338
| | | | | | | | | | | | This patch converts the em28xx driver over to videobuf2. It is likely that em28xx_fh can go away entirely, but that will come in a separate patch. [mchehab@redhat.com: fix a non-trivial merge conflict with some VBI patches; CodingStyle fixes] Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: zero vbi_format reserved array and add try_vbi_fmtHans Verkuil2013-01-051-0/+3
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: remove sliced VBI supportHans Verkuil2013-01-051-47/+2
| | | | | | | | | | | | The sliced VBI support in the tvp5150 is completely broken. And there is no support for the saa7115 sliced VBI implementation in the em28xx driver. So we remove the sliced VBI support completely. It should be possible to get it to work with the tvp5150, but that will require someone to really dig into that driver. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: std fixes: don't implement in webcam mode, and fix std changesHans Verkuil2013-01-051-4/+21
| | | | | | | | | | When in webcam mode the STD API shouldn't be implemented. When changing the standard the resolution wasn't updated, and there was no check against streaming-in-progress. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] tvp5150: remove compat control opsHans Verkuil2013-01-051-7/+0
| | | | | | | | No longer needed now that em28xx has been converted to the control framework. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fill in readbuffers and fix incorrect return codeHans Verkuil2013-01-051-1/+3
| | | | | | | | | g/s_parm should fill in readbuffers. For non-webcams s_parm should return -ENOTTY instead of -EINVAL. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: add support for control eventsHans Verkuil2013-01-051-12/+26
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: convert to v4l2_fh, fix priority handlingHans Verkuil2013-01-052-0/+7
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: convert to the control frameworkHans Verkuil2013-01-053-225/+53
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] v4l2-ctrls: add a notify callbackHans Verkuil2013-01-053-8/+57
| | | | | | | | | | | Sometimes platform/bridge drivers need to be notified when a control from a sub-device changes value. In order to support this a notify callback was added. [dheitmueller@kernellabs.com: fix merge conflict in v4l2-ctrls.c] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix tuner/frequency handlingHans Verkuil2013-01-051-8/+5
| | | | | | | | | | | v4l2-compliance found problems with frequency clamping that wasn't reported correctly and missing tuner index checks. Also removed unnecessary tuner type checks (these are now done by the v4l2 core). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix VIDIOC_DBG_G_CHIP_IDENT compliance errorsHans Verkuil2013-01-051-0/+8
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: remove bogus input/audio ioctls for the radio deviceHans Verkuil2013-01-051-35/+0
| | | | | | | | Radio devices should not implement those ioctls. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: fix querycapHans Verkuil2013-01-051-23/+19
| | | | | | Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: tell ir-kbd-i2c that WinTV uses an RC5 protocolMauro Carvalho Chehab2013-01-041-0/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: simplify IR names on I2C devicesMauro Carvalho Chehab2013-01-041-4/+4
| | | | | | | | | | | The ir-i2c-kbd already adds I2C IR before the name. The way it is, the devices are named as: "i2c IR (i2c IR (EM2840 Hauppaug" With is ugly and incorrect. After this patch, it is now properly displayed as: "i2c IR (WinTV USB2)" Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: autoload em28xx-rc if the device has an I2C IRMauro Carvalho Chehab2013-01-041-1/+1
| | | | | | | | If the device has an I2C IR, em28xx-rc should be loaded by default, except if the user explicitly requested to not load, via modprobe option. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] em28xx: initialize button/I2C IR earlierMauro Carvalho Chehab2013-01-041-9/+11
| | | | | | | | | | | | | | | | The em28xx-input is used by 3 different types of input devices: - devices with buttons (like cameras and grabber devices); - devices with I2C remotes; - em2860 or latter chips with RC support embedded. When the device has an I2C remote, all it needs to do is to call the proper I2C driver (ir-i2c-kbd), passing the proper data to it, and just leave the code. Also, button devices have its own init code that doesn't depend on having an IR or not (as a general rule, they don't have). So, move its init code to fix bugs introduced by earlier patches that prevent them to work. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] get_dvb_firmware: Fix the location of firmware for Terratec HTCMartin Blumenstingl2013-01-011-1/+1
| | | | | | | | Fix firmware download for the Terratec Cinergy HTC Stick HD. The file was moved on the server. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] lmedm04: correct I2C values to 7 bit addressingMalcolm Priestley2013-01-011-14/+15
| | | | | | | | | | The separation the lmedm04 fails on the ts2020 portion because the correct I2C addressing. So, it's time to correct the addressing in the remainder of lmedm04. Tested all tuners. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] stk1160: Replace BUG_ON with WARN_ONEzequiel Garcia2013-01-011-1/+1
| | | | | | | | | This situation is not even an error condition so it's stupid to BUG_ON. Learn the lesson: http://permalink.gmane.org/gmane.linux.kernel/1347333 Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] m88rs2000: make use ts2020Igor M. Liplianin2012-12-2810-513/+373
| | | | | | | | | | Tuner part of Montage rs2000 chip is similar to ts2020 tuner. Patch to use ts2020 code. [mchehab@redhat.com: a few CodingStyle fixes] Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] ds3000: lock led procedure addedIgor M. Liplianin2012-12-283-1/+20
| | | | | | | | TeVii s660 and others have LED for lock indication. Let's use it in right order. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] m88rs2000: SNR, BER implementedIgor M. Liplianin2012-12-281-8/+36
| | | | | | | Trivial patch to implement SNR, BER, UCB counter for Montage rs2000 demod. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] dw2102: autoselect DVB_M88RS2000Igor M. Liplianin2012-12-281-0/+1
| | | | | | | | Patch to select rs2000 module to compile automatically for TeVii S421 and S632 cards. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] vivi: Constify structuresKirill Smelkov2012-12-281-13/+13
| | | | | | | | | | | | | Most of *_ops and other structures in vivi.c were already declared const but some have not. Constify and code/data will take less space: $ size drivers/media/platform/vivi.o text data bss dec hex filename before: 12569 248 8 12825 3219 drivers/media/platform/vivi.o after: 12308 20 8 12336 3030 drivers/media/platform/vivi.o i.e. vivi.o is now ~500 bytes less. Signed-off-by: Kirill Smelkov <kirr@navytux.spb.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [hid] usb hid quirks for Masterkit MA901 usb radioAlexey Klimov2012-12-282-0/+4
| | | | | | | | | | Don't let Masterkit MA901 USB radio be handled by usb hid drivers. This device will be handled by radio-ma901.c driver. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: add driver for Masterkit MA901 usb radioAlexey Klimov2012-12-283-0/+473
| | | | | | | | | | | This patch creates a new usb-radio driver, radio-ma901.c, that supports Masterkit MA 901 USB FM radio devices. This device plugs into both the USB and an analog audio input or headphones, so this thing only deals with initialization and frequency setting. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] blackfin Kconfig: select is evil; use, instead depends onMauro Carvalho Chehab2012-12-271-1/+2
| | | | | | | | | | Select is evil as it has issues with dependencies. Better to convert it to use depends on. That fixes a breakage with out-of-tree compilation of the media tree. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s3c-camif: Add missing version.h header fileSachin Kamat2012-12-271-0/+1
| | | | | | | | versioncheck script complains about missing linux/version.h header file. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mantis: cleanup NULL checking in mantis_ca_exit()Dan Carpenter2012-12-271-2/+3
| | | | | | | | | Smatch complainst that the call to mantis_evmgr_exit() dereferences "ca" but then we check it for NULL on the next line. I've moved the NULL check forward to avoid that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] TeVii DVB-S s421 and s632 cards support, rs2000 partIgor M. Liplianin2012-12-271-1/+5
| | | | | | | | One register needs to be changed to TS to work. So we use separate inittab. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Acked-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] TeVii DVB-S s421 and s632 cards supportIgor M. Liplianin2012-12-271-7/+99
| | | | | | | DVB-S chip is Montage m88rs2000, so initial patch is simple. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] ds3000: bail out early on i2c failures during firmware loadRémi Cardona2012-12-271-5/+7
| | | | | | | | | | | | - if kmalloc() returns NULL, we can return immediately without trying to kfree() a NULL pointer. - if i2c_transfer() fails, error out immediately instead of trying to upload the remaining bytes of the firmware. - the error code is then properly propagated down to ds3000_initfe(). Signed-off-by: Rémi Cardona <remi.cardona@smartjog.com> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
OpenPOWER on IntegriCloud