GitHub/moto-9609/android_kernel_motorola_exynos9610.git
11 years ago[media] soc-camera: fix repeated regulator requesting
Guennadi Liakhovetski [Thu, 3 Jan 2013 14:21:02 +0000 (11:21 -0300)]
[media] soc-camera: fix repeated regulator requesting

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>
11 years ago[media] soc-camera: properly fix camera probing races
Guennadi Liakhovetski [Thu, 20 Dec 2012 16:02:51 +0000 (13:02 -0300)]
[media] soc-camera: properly fix camera probing races

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>
11 years ago[media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()
Wei Yongjun [Thu, 29 Nov 2012 02:56:15 +0000 (23:56 -0300)]
[media] mt9v022: fix potential NULL pointer dereference in mt9v022_probe()

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>
11 years ago[media] em28xx: declare em28xx_stop_streaming as static
Mauro Carvalho Chehab [Sat, 5 Jan 2013 03:27:21 +0000 (01:27 -0200)]
[media] em28xx: declare em28xx_stop_streaming as static

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>
11 years ago[media] v4l: Reset subdev v4l2_dev field to NULL if registration fails
Laurent Pinchart [Sun, 25 Nov 2012 00:35:48 +0000 (21:35 -0300)]
[media] v4l: Reset subdev v4l2_dev field to NULL if registration fails

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>
11 years ago[media] em28xx: consider the message length limitation of the i2c adapter when readin...
Frank Schaefer [Thu, 3 Jan 2013 17:27:06 +0000 (14:27 -0300)]
[media] em28xx: consider the message length limitation of the i2c adapter 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>
11 years ago[media] em28xx: fix+improve+unify i2c error handling, debug messages and code comments
Frank Schaefer [Thu, 3 Jan 2013 17:27:05 +0000 (14:27 -0300)]
[media] em28xx: fix+improve+unify i2c error handling, debug messages and 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>
11 years ago[media] em28xx: fix the i2c adapter functionality flags
Frank Schaefer [Thu, 3 Jan 2013 17:27:04 +0000 (14:27 -0300)]
[media] em28xx: fix the i2c adapter functionality flags

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>
11 years ago[media] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes()
Frank Schaefer [Thu, 3 Jan 2013 17:27:03 +0000 (14:27 -0300)]
[media] em28xx: fix two severe bugs in function em2800_i2c_recv_bytes()

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>
11 years ago[media] em28xx: respect the message size constraints for i2c transfers
Frank Schaefer [Thu, 3 Jan 2013 17:27:02 +0000 (14:27 -0300)]
[media] em28xx: respect the message size constraints for i2c transfers

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>
11 years ago[media] em28xx: IR RC: move assignment of get_key functions from *_change_protocol...
Frank Schaefer [Thu, 27 Dec 2012 22:02:47 +0000 (19:02 -0300)]
[media] em28xx: IR RC: move assignment of get_key functions from *_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>
11 years ago[media] em28xx: refactor the code in em28xx_usb_disconnect()
Frank Schaefer [Thu, 27 Dec 2012 22:02:44 +0000 (19:02 -0300)]
[media] em28xx: refactor the code in em28xx_usb_disconnect()

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>
11 years ago[media] em28xx: simplify device state tracking
Frank Schaefer [Thu, 27 Dec 2012 22:02:43 +0000 (19:02 -0300)]
[media] em28xx: simplify device state tracking

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>
11 years ago[media] em28xx: convert to videobuf2
Devin Heitmueller [Fri, 4 Jan 2013 19:16:24 +0000 (16:16 -0300)]
[media] em28xx: convert to videobuf2

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>
11 years ago[media] em28xx: zero vbi_format reserved array and add try_vbi_fmt
Hans Verkuil [Fri, 7 Sep 2012 11:51:32 +0000 (08:51 -0300)]
[media] em28xx: zero vbi_format reserved array and add try_vbi_fmt

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>
11 years ago[media] em28xx: remove sliced VBI support
Hans Verkuil [Fri, 7 Sep 2012 11:45:10 +0000 (08:45 -0300)]
[media] em28xx: remove sliced VBI support

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>
11 years ago[media] em28xx: std fixes: don't implement in webcam mode, and fix std changes
Hans Verkuil [Fri, 7 Sep 2012 10:31:54 +0000 (07:31 -0300)]
[media] em28xx: std fixes: don't implement in webcam mode, and fix std changes

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>
11 years ago[media] tvp5150: remove compat control ops
Hans Verkuil [Fri, 7 Sep 2012 09:34:26 +0000 (06:34 -0300)]
[media] tvp5150: remove compat control ops

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>
11 years ago[media] em28xx: fill in readbuffers and fix incorrect return code
Hans Verkuil [Fri, 7 Sep 2012 09:16:03 +0000 (06:16 -0300)]
[media] em28xx: fill in readbuffers and fix incorrect return code

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>
11 years ago[media] em28xx: add support for control events
Hans Verkuil [Fri, 7 Sep 2012 09:10:12 +0000 (06:10 -0300)]
[media] em28xx: add support for control events

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>
11 years ago[media] em28xx: convert to v4l2_fh, fix priority handling
Hans Verkuil [Fri, 7 Sep 2012 08:52:40 +0000 (05:52 -0300)]
[media] em28xx: convert to v4l2_fh, fix priority handling

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>
11 years ago[media] em28xx: convert to the control framework
Hans Verkuil [Fri, 7 Sep 2012 08:43:59 +0000 (05:43 -0300)]
[media] em28xx: convert 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>
11 years ago[media] v4l2-ctrls: add a notify callback
Hans Verkuil [Fri, 7 Sep 2012 07:46:39 +0000 (04:46 -0300)]
[media] v4l2-ctrls: add a notify callback

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>
11 years ago[media] em28xx: fix tuner/frequency handling
Hans Verkuil [Thu, 6 Sep 2012 13:07:25 +0000 (10:07 -0300)]
[media] em28xx: fix tuner/frequency handling

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>
11 years ago[media] em28xx: fix VIDIOC_DBG_G_CHIP_IDENT compliance errors
Hans Verkuil [Thu, 6 Sep 2012 12:53:08 +0000 (09:53 -0300)]
[media] em28xx: fix VIDIOC_DBG_G_CHIP_IDENT compliance errors

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>
11 years ago[media] em28xx: remove bogus input/audio ioctls for the radio device
Hans Verkuil [Thu, 6 Sep 2012 12:23:03 +0000 (09:23 -0300)]
[media] em28xx: remove bogus input/audio ioctls for the radio device

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>
11 years ago[media] em28xx: fix querycap
Hans Verkuil [Thu, 6 Sep 2012 10:31:04 +0000 (07:31 -0300)]
[media] em28xx: fix querycap

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>
11 years ago[media] em28xx: tell ir-kbd-i2c that WinTV uses an RC5 protocol
Mauro Carvalho Chehab [Fri, 4 Jan 2013 21:01:59 +0000 (18:01 -0300)]
[media] em28xx: tell ir-kbd-i2c that WinTV uses an RC5 protocol

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: simplify IR names on I2C devices
Mauro Carvalho Chehab [Fri, 4 Jan 2013 20:37:26 +0000 (17:37 -0300)]
[media] em28xx: simplify IR names on I2C devices

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>
11 years ago[media] em28xx: autoload em28xx-rc if the device has an I2C IR
Mauro Carvalho Chehab [Fri, 4 Jan 2013 20:32:58 +0000 (17:32 -0300)]
[media] em28xx: autoload em28xx-rc if the device has an I2C IR

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>
11 years ago[media] em28xx: initialize button/I2C IR earlier
Mauro Carvalho Chehab [Fri, 4 Jan 2013 20:27:47 +0000 (17:27 -0300)]
[media] em28xx: initialize button/I2C IR earlier

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>
11 years ago[media] get_dvb_firmware: Fix the location of firmware for Terratec HTC
Martin Blumenstingl [Tue, 1 Jan 2013 11:54:26 +0000 (08:54 -0300)]
[media] get_dvb_firmware: Fix the location of firmware for Terratec HTC

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>
11 years ago[media] lmedm04: correct I2C values to 7 bit addressing
Malcolm Priestley [Sat, 29 Dec 2012 10:34:24 +0000 (07:34 -0300)]
[media] lmedm04: correct I2C values to 7 bit addressing

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>
11 years ago[media] stk1160: Replace BUG_ON with WARN_ON
Ezequiel Garcia [Fri, 23 Nov 2012 11:12:35 +0000 (08:12 -0300)]
[media] stk1160: Replace BUG_ON with WARN_ON

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>
11 years ago[media] m88rs2000: make use ts2020
Igor M. Liplianin [Fri, 28 Dec 2012 22:40:33 +0000 (19:40 -0300)]
[media] m88rs2000: make use ts2020

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>
11 years ago[media] ds3000: lock led procedure added
Igor M. Liplianin [Fri, 28 Dec 2012 22:40:24 +0000 (19:40 -0300)]
[media] ds3000: lock led procedure added

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>
11 years ago[media] m88rs2000: SNR, BER implemented
Igor M. Liplianin [Fri, 28 Dec 2012 22:40:16 +0000 (19:40 -0300)]
[media] m88rs2000: SNR, BER implemented

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>
11 years ago[media] dw2102: autoselect DVB_M88RS2000
Igor M. Liplianin [Fri, 28 Dec 2012 22:40:04 +0000 (19:40 -0300)]
[media] dw2102: autoselect DVB_M88RS2000

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>
11 years ago[media] vivi: Constify structures
Kirill Smelkov [Wed, 26 Dec 2012 15:23:26 +0000 (12:23 -0300)]
[media] vivi: Constify structures

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>
11 years ago[hid] usb hid quirks for Masterkit MA901 usb radio
Alexey Klimov [Mon, 12 Nov 2012 05:57:03 +0000 (02:57 -0300)]
[hid] usb hid quirks for Masterkit MA901 usb radio

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>
11 years ago[media] media: add driver for Masterkit MA901 usb radio
Alexey Klimov [Mon, 12 Nov 2012 05:56:37 +0000 (02:56 -0300)]
[media] media: add driver for Masterkit MA901 usb radio

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>
11 years ago[media] blackfin Kconfig: select is evil; use, instead depends on
Mauro Carvalho Chehab [Thu, 27 Dec 2012 23:21:14 +0000 (21:21 -0200)]
[media] blackfin Kconfig: select is evil; use, instead depends on

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>
11 years ago[media] s3c-camif: Add missing version.h header file
Sachin Kamat [Mon, 3 Dec 2012 05:44:31 +0000 (02:44 -0300)]
[media] s3c-camif: Add missing version.h header file

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>
11 years ago[media] mantis: cleanup NULL checking in mantis_ca_exit()
Dan Carpenter [Sun, 2 Dec 2012 09:43:13 +0000 (06:43 -0300)]
[media] mantis: cleanup NULL checking in mantis_ca_exit()

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>
11 years ago[media] TeVii DVB-S s421 and s632 cards support, rs2000 part
Igor M. Liplianin [Tue, 8 May 2012 07:08:04 +0000 (04:08 -0300)]
[media] TeVii DVB-S s421 and s632 cards support, rs2000 part

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>
11 years ago[media] TeVii DVB-S s421 and s632 cards support
Igor M. Liplianin [Tue, 8 May 2012 06:53:17 +0000 (03:53 -0300)]
[media] TeVii DVB-S s421 and s632 cards support

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>
11 years ago[media] ds3000: bail out early on i2c failures during firmware load
Rémi Cardona [Fri, 28 Sep 2012 11:59:29 +0000 (08:59 -0300)]
[media] ds3000: bail out early on i2c failures during firmware load

- 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>
11 years ago[media] em28xx: rename module parameter prefer_bulk to usb_xfer_mode
Frank Schaefer [Wed, 26 Dec 2012 18:12:37 +0000 (15:12 -0300)]
[media] em28xx: rename module parameter prefer_bulk to usb_xfer_mode

Since we have now 3 modes (auto/isoc/bulk), usb_xfer_mode is more suitable than prefer_bulk.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ts2020: fix two warnings added by changeset 73f0af4
Mauro Carvalho Chehab [Thu, 27 Dec 2012 21:35:44 +0000 (19:35 -0200)]
[media] ts2020: fix two warnings added by changeset 73f0af4

drivers/media/dvb-frontends/ts2020.c: In function 'ts2020_set_params':
drivers/media/dvb-frontends/ts2020.c:126:47: warning: variable 'div4' set but not used [-Wunused-but-set-variable]
drivers/media/dvb-frontends/ts2020.c: At top level:
drivers/media/dvb-frontends/ts2020.c:262:5: warning: no previous prototype for 'ts2020_get_signal_strength' [-Wmissing-prototypes]

Cc: Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Cc: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] make the other drivers take use of the new ts2020 driver
Konstantin Dimitrov [Sun, 23 Dec 2012 22:25:38 +0000 (19:25 -0300)]
[media] make the other drivers take use of the new ts2020 driver

make the other drivers take use of the separate ts2020 driver

Signed-off-by: Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ts2020: add ts2020 tuner driver
Konstantin Dimitrov [Sun, 23 Dec 2012 22:25:27 +0000 (19:25 -0300)]
[media] ts2020: add ts2020 tuner driver

add separate ts2020 tuner driver

Signed-off-by: Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ds3000: remove ts2020 tuner related code
Konstantin Dimitrov [Sun, 23 Dec 2012 22:25:09 +0000 (19:25 -0300)]
[media] ds3000: remove ts2020 tuner related code

remove ts2020 tuner related code from ds3000 driver
prepare ds3000 driver for using external tuner driver

Signed-off-by: Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] it913x: add support for Avermedia A835B
Eddi De Pieri [Sat, 22 Dec 2012 12:41:49 +0000 (09:41 -0300)]
[media] it913x: add support for Avermedia A835B

Add support for Avermedia A835B and variants.

Signed-off-by: Eddi De Pieri <eddi@depieri.net>
Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m2m-deinterlace: use correct check for kzalloc failure
Sasha Levin [Thu, 20 Dec 2012 18:11:18 +0000 (15:11 -0300)]
[media] m2m-deinterlace: use correct check for kzalloc failure

There is no point in PTR_ERR()ing a NULL pointer, use a real error
instead.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] wl128x: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:26 +0000 (15:57 -0300)]
[media] wl128x: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] radio-wl1273: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:25 +0000 (15:57 -0300)]
[media] radio-wl1273: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb-frontends: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:24 +0000 (15:57 -0300)]
[media] dvb-frontends: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb-core: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:23 +0000 (15:57 -0300)]
[media] dvb-core: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] bttv: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:22 +0000 (15:57 -0300)]
[media] bttv: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx18: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:21 +0000 (15:57 -0300)]
[media] cx18: Replace memcpy with struct assignment

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>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx23885: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:20 +0000 (15:57 -0300)]
[media] cx23885: Replace memcpy with struct assignment

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>
11 years ago[media] cx88: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:19 +0000 (15:57 -0300)]
[media] cx88: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ivtv: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:18 +0000 (15:57 -0300)]
[media] ivtv: Replace memcpy with struct assignment

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>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tuners/tda18271: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:17 +0000 (15:57 -0300)]
[media] tuners/tda18271: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tuners/xc2028: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:16 +0000 (15:57 -0300)]
[media] tuners/xc2028: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] tuners/xc4000: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:15 +0000 (15:57 -0300)]
[media] tuners/xc4000: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] au0828: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:14 +0000 (15:57 -0300)]
[media] au0828: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb-usb/friio-fe: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:13 +0000 (15:57 -0300)]
[media] dvb-usb/friio-fe: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] zr36067: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:12 +0000 (15:57 -0300)]
[media] zr36067: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx25840: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:11 +0000 (15:57 -0300)]
[media] cx25840: Replace memcpy with struct assignment

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>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] hdpvr: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:10 +0000 (15:57 -0300)]
[media] hdpvr: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] pvrusb2: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:09 +0000 (15:57 -0300)]
[media] pvrusb2: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] pwc: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:08 +0000 (15:57 -0300)]
[media] pwc: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] sn9c102: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:07 +0000 (15:57 -0300)]
[media] sn9c102: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] usbvision: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:06 +0000 (15:57 -0300)]
[media] usbvision: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: Replace memcpy with struct assignment
Ezequiel Garcia [Tue, 23 Oct 2012 18:57:05 +0000 (15:57 -0300)]
[media] cx231xx: Replace memcpy with struct assignment

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] Improve media Kconfig menu
Hans Verkuil [Sat, 22 Dec 2012 10:48:58 +0000 (07:48 -0300)]
[media] Improve media Kconfig menu

I've always found it very confusing that the "Media ancillary drivers (tuners,
sensors, i2c, frontends)" comment came after the "Autoselect" option. This patch
moves it up and changes the "Autoselect" text to correspond more closely to
the "Media ancillary drivers" comment.
It also fixes two typos.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] bttv: avoid flooding the kernel log when i2c debugging is disabled
John Törnblom [Mon, 17 Dec 2012 11:53:54 +0000 (08:53 -0300)]
[media] bttv: avoid flooding the kernel log when i2c debugging is disabled

When the bttv driver is running without i2c_debug being set, the kernel
log is being flooded with the string ">". This string is really a part of
a debug message that is logged using several substrings protected by a
conditional check.
This patch adds the same conditional check to the leaked substring.

Signed-off-by: John Törnblom <john.tornblom@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] omap3isp: ispqueue: Fix uninitialized variable compiler warnings
Laurent Pinchart [Mon, 17 Dec 2012 07:52:48 +0000 (04:52 -0300)]
[media] omap3isp: ispqueue: Fix uninitialized variable compiler warnings

drivers/media/platform/omap3isp/ispqueue.c:399:18: warning: 'pa' may be
used uninitialized in this function [-Wuninitialized]
This is a false positive but the compiler has no way to know about it,
so initialize the variable to 0.
drivers/media/platform/omap3isp/ispqueue.c:445:6: warning:
'vm_page_prot' may be used uninitialized in this function
[-Wuninitialized]
This is a false positive and the compiler should know better. Use
uninitialized_var().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] ngene: separate demodulator and tuner attach
Patrice Chotard [Sat, 15 Dec 2012 22:11:43 +0000 (19:11 -0300)]
[media] ngene: separate demodulator and tuner attach

Previously, demodulator and tuner attach was done in the
demod_attach callback. Migrate the tuner part in the
tuner_attach callback in ngene_info to do thing in right place.

Signed-off-by: Patrice Chotard <patricechotard@free.fr>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] drxd: allow functional gate control after, attach
Patrice Chotard [Sat, 15 Dec 2012 22:11:28 +0000 (19:11 -0300)]
[media] drxd: allow functional gate control after, attach

Previously, gate control didn't work until drxd_init()
execution. Migrate necessary set of commands in drxd_attach
to allow gate control to be used by tuner which are
accessible through i2c gate.

Reported-by: frederic.mantegazza@gbiloba.org
Signed-off-by: Patrice Chotard <patricechotard@free.fr>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] marvell-ccic: use internal variable replace global frame stats variable
Libin Yang [Sat, 15 Dec 2012 08:57:50 +0000 (05:57 -0300)]
[media] marvell-ccic: use internal variable replace global frame stats variable

This patch replaces the global frame stats variables by using
internal variables in mcam_camera structure.

Signed-off-by: Albert Wang <twang13@marvell.com>
Signed-off-by: Libin Yang <lbyang@marvell.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media/rc: fix oops on unloading module rc-core
Konstantin Khlebnikov [Fri, 14 Dec 2012 10:02:48 +0000 (07:02 -0300)]
[media] media/rc: fix oops on unloading module rc-core

During modiles initialization rc-core schedules work which calls
request_module() several times to load ir-*-decoder modules, but
it does not wait or cancel this work on module unloading.
rc-core should use request_module_nowait() instead, because it
anyway cannot load modules synchronously or cancel/wait pending
work on unloading, because this leads to deadlock on modules_mutex
between several "modprobe" processes.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] omap3isp: csiphy: Fix an uninitialized variable compiler warning
Laurent Pinchart [Tue, 11 Dec 2012 12:11:52 +0000 (09:11 -0300)]
[media] omap3isp: csiphy: Fix an uninitialized variable compiler warning

drivers/media/platform/omap3isp/ispcsiphy.c: In function
‘csiphy_routing_cfg’:
drivers/media/platform/omap3isp/ispcsiphy.c:71:57: warning: ‘shift’
may be used uninitialized in this function [-Wuninitialized]
drivers/media/platform/omap3isp/ispcsiphy.c:40:6: note: ‘shift’ was
declared here
The warning is a false positive but the compiler is right in
complaining. Fix it by using the correct enum data type for the iface
argument and adding a default case in the switch statement.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] media: saa7146: don't use mutex_lock_interruptible() in device_release()
Cyril Roelandt [Tue, 11 Dec 2012 02:05:28 +0000 (23:05 -0300)]
[media] media: saa7146: don't use mutex_lock_interruptible() in device_release()

Use uninterruptible mutex_lock in the release() file op to make sure all
resources are properly freed when a process is being terminated. Returning
-ERESTARTSYS has no effect for a terminating process and this may cause driver
resources not to be released.
This was found using the following semantic patch (http://coccinelle.lip6.fr/):
<spml>
@r@
identifier fops;
identifier release_func;
@@
static const struct v4l2_file_operations fops = {
.release = release_func
};
@depends on r@
identifier r.release_func;
expression E;
@@
static int release_func(...)
{
...
- if (mutex_lock_interruptible(E)) return -ERESTARTSYS;
+ mutex_lock(E);
...
}
</spml>

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] MAINTAINERS: Add an entry for the ad3645a LED flash controller driver
Laurent Pinchart [Mon, 10 Dec 2012 23:38:24 +0000 (20:38 -0300)]
[media] MAINTAINERS: Add an entry for the ad3645a LED flash controller driver

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] MAINTAINERS: Add entries for Aptina sensor drivers
Laurent Pinchart [Mon, 10 Dec 2012 23:38:23 +0000 (20:38 -0300)]
[media] MAINTAINERS: Add entries for Aptina sensor drivers

Add an entry for the mt9m032, mt9p031, mt9t001 and mt9v032 Aptina sensor
drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick
Antonio Ospite [Mon, 10 Dec 2012 20:37:17 +0000 (17:37 -0300)]
[media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick

This device was originally made by Twinhan/Azurewave[1] and sometimes
named DTV-DVB UDTT7049, it could be also found in Italy under the name
of Digicom Digitune-S[2], or Think Xtra Hollywood DVB-T USB2.0[3].
Components:
  Usb bridge: ULi M9206
  Frontend: MT352CG
  Tuner: MT2060F
The firmware can be downloaded with:
$ ./Documentation/dvb/get_dvb_firmware vp7049
[1] http://www.azurewave.com/Support_Utility_Driver.asp
[2] http://www.digicom.it/digisit/driver_link.nsf/driverprodotto?openform&prodotto=DigiTuneS
[3] http://www.txitalia.it/prodotto.asp?prodotto=txhollywooddvttv

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] get_dvb_firmware: add entry for the vp7049 firmware
Antonio Ospite [Mon, 10 Dec 2012 20:37:16 +0000 (17:37 -0300)]
[media] get_dvb_firmware: add entry for the vp7049 firmware

Add an entry to download the dvb-usb-vp7049-0.95.fw firmware for the
Twinhan vp7049 and similar devices.
Known devices of this kind are:
  Twinhan/Azurewave DTV-DVB UDTT7049
  Digicom Digitune-S
  Think Xtra Hollywood DVB-T USB2.0

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: send the RC init sequence also when rc.core is used
Antonio Ospite [Mon, 10 Dec 2012 20:37:15 +0000 (17:37 -0300)]
[media] m920x: send the RC init sequence also when rc.core is used

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: Fix CodingStyle issues
Mauro Carvalho Chehab [Thu, 27 Dec 2012 18:32:58 +0000 (16:32 -0200)]
[media] m920x: Fix CodingStyle issues

Fix CodingStyle issues introduced by the last patch

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: introduce m920x_rc_core_query()
Antonio Ospite [Mon, 10 Dec 2012 20:37:14 +0000 (17:37 -0300)]
[media] m920x: introduce m920x_rc_core_query()

Add an m920x_rc_core_query() function for drivers which want to use the
linux RC core infrastructure.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: avoid repeating RC state parsing at each keycode
Antonio Ospite [Mon, 10 Dec 2012 20:37:13 +0000 (17:37 -0300)]
[media] m920x: avoid repeating RC state parsing at each keycode

Parsing the RC press state is invariant wrt. the keycode, take it out of
the keycode scanning loop.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: factor out a m920x_parse_rc_state() function
Antonio Ospite [Mon, 10 Dec 2012 20:37:12 +0000 (17:37 -0300)]
[media] m920x: factor out a m920x_parse_rc_state() function

This is in preparation to using RC core infrastructure for some devices,
the RC button state parsing logic can be shared berween rc.legacy and
rc.core callbacks as it is independent from the mechanism used for RC
handling.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: factor out a m920x_write_seq() function
Antonio Ospite [Mon, 10 Dec 2012 20:37:11 +0000 (17:37 -0300)]
[media] m920x: factor out a m920x_write_seq() function

This is in preparation for the vp7049 frontend attach function which is
going to set a sequence of registers as well.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] m920x: fix a typo in a comment
Antonio Ospite [Mon, 10 Dec 2012 20:37:10 +0000 (17:37 -0300)]
[media] m920x: fix a typo in a comment

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] dvb-usb: fix indentation of a for loop
Antonio Ospite [Mon, 10 Dec 2012 20:37:09 +0000 (17:37 -0300)]
[media] dvb-usb: fix indentation of a for loop

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] saa7134: Add pm_qos_request to fix video corruption
Simon Farnsworth [Mon, 10 Dec 2012 11:35:09 +0000 (08:35 -0300)]
[media] saa7134: Add pm_qos_request to fix video corruption

The SAA7134 appears to have trouble buffering more than one line of video
when doing DMA. Rather than try to fix the driver to cope (as has been done
by Andy Walls for the cx18 driver), put in a pm_qos_request to limit deep
sleep exit latencies.
The visible effect of not having this is that seemingly random lines are
only partly transferred - if you feed in a static image, you see a portion
of the image "flicker" into place.

[mchehab@redhat.com: Fix ABI breakage due to some renames at pm_qos]
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] Added support for AVerTV Hybrid Express Slim HC81R
Oleh Kravchenko [Sat, 8 Dec 2012 21:20:59 +0000 (18:20 -0300)]
[media] Added support for AVerTV Hybrid Express Slim HC81R

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>
11 years ago[media] dvb: push down ioctl lock in dvb_usercopy
Nikolaus Schulz [Sun, 23 Dec 2012 21:49:07 +0000 (18:49 -0300)]
[media] dvb: push down ioctl lock in dvb_usercopy

Since most dvb ioctls wrap their real work with dvb_usercopy, the static mutex
used in dvb_usercopy effectively is a global lock for dvb ioctls.
Unfortunately, frontend ioctls can be blocked by the frontend thread for
several seconds; this leads to unacceptable lock contention.  Mitigate that by
pushing the mutex from dvb_usercopy down to the individual, device specific
ioctls.
There are 10 such ioctl functions using dvb_usercopy, either calling it
directly, or via the trivial wrapper dvb_generic_ioctl. The following already
employ their own locking and look safe:
    • dvb_demux_ioctl           (as per dvb_demux_do_ioctl)
    • dvb_dvr_ioctl             (as per dvb_dvr_do_ioctl)
    • dvb_osd_ioctl             (as per single non-trivial callee)
    • fdtv_ca_ioctl             (as per callees)
    • dvb_frontend_ioctl
The following functions do not, and are thus changed to use a device specific
mutex:
    • dvb_net_ioctl             (as per dvb_net_do_ioctl)
    • dvb_ca_en50221_io_ioctl   (as per dvb_ca_en50221_io_do_ioctl)
    • dvb_video_ioctl
    • dvb_audio_ioctl
    • dvb_ca_ioctl

Signed-off-by: Nikolaus Schulz <schulz@macnetix.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>