Frank Schaefer [Sat, 13 Sep 2014 08:56:46 +0000 (05:56 -0300)]
[media] em28xx: remove dead code line from em28xx_audio_setup()
Setting the value of the chip config register to EM28XX_CHIPCFG_AC97 in
case of a read error is a leftover from the past which is no longer
needed.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Frank Schaefer [Sat, 13 Sep 2014 08:52:21 +0000 (05:52 -0300)]
[media] em28xx: get rid of field has_audio in struct em28xx_audio_mode
Field has_audio in struct em28xx_audio_mode is used together with value
EM28XX_NO_AC97 of field ac97 to determine the internal type of audio
(none/i2s/ac97). This makes the code difficult to understand:
!audio_mode.has_audio && audio_mode.ac97 == EM28XX_NO_AC97 => no audio
!audio_mode.has_audio && audio_mode.ac97 != EM28XX_NO_AC97 => BUG
audio_mode.has_audio && audio_mode.ac97 == EM28XX_NO_AC97 => AC97 audio
audio_mode.has_audio && audio_mode.ac97 != EM28XX_NO_AC97 => I2S audio
Simplify the whole thing by introducing an enum em28xx_int_audio_type
which describes the internal audio type (none, ac97, i2s) and is hooked
directly to the device struct. Then get rid of field has_audio in struct
em28xx_audio_mode.
A follow-up patch will then remove struct em28xx_ac97_mode and finally
the whole struct em28xx_audio_mode.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Frank Schaefer [Sat, 13 Sep 2014 08:52:20 +0000 (05:52 -0300)]
[media] em28xx: simplify usb audio class handling
As far as we know devices can either have audio class or vendor class
usb interfaces but not both at the same time. Even if both interface
types could be provided by devices at the same time, the current code is
totally broken for that case.
So clean up and simplify the usb audio class handling by replacing
fields "has_audio_class" (device has usb audio class compliant
interface) and "has_alsa_audio" (device has vendor audio interface) in
struct em28xx with a single enum em28xx_usb_audio_type.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Frank Schaefer [Sat, 13 Sep 2014 08:52:19 +0000 (05:52 -0300)]
[media] em28xx: remove some unnecessary fields from struct em28xx_audio_mode
Fields "ac97_feat", "ac97_vendor_id" and "i2s_samplerates" of struct
em28xx_audio_mode are used nowhere, except in function
em28xx_audio_setup(). So get rid of them and use local variables
instead.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Laurent Pinchart [Thu, 11 Sep 2014 22:43:46 +0000 (19:43 -0300)]
[media] v4l: videobuf2: Fix typos in comments
The buffer flags are incorrectly referred to as V4L2_BUF_FLAGS_* instead
of V4L2_BUF_FLAG_* in comments. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Olli Salonen [Thu, 11 Sep 2014 20:01:38 +0000 (17:01 -0300)]
[media] si2157: Add support for Si2147-A30 tuner
This patch adds support for Si2147-A30 tuner. Fairly trivial, no firmware needed for this tuner. However, command 14 00 02 07 01 00 seems to be mandatory. On Si2157 and Si2158 the value 0x0100 is the default value, so this patch does not impact the existing tuners/devices. On Si2147 the default is 0x0000 and I can't get a lock with that value.
While here, fix the return length of the previous set command to 4 bytes.
Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Dan Carpenter [Tue, 9 Sep 2014 12:11:23 +0000 (09:11 -0300)]
[media] firewire: firedtv-avc: fix more potential buffer overflow
"program_info_length" is user controlled and can go up to 4095. The
operand[] array has 509 bytes so we need to add a limit here to prevent
buffer overflows.
The " - 4" in the limit check is because we have 4 bytes more data to
add after the memcpy().
[mchehab@osg.samsung.com: as I merged the version 1 of the patch, I needed
to rebase to apply just the differences between v1 and v2]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Dan Carpenter [Tue, 9 Sep 2014 12:05:28 +0000 (09:05 -0300)]
[media] dvb: si21xx: buffer overflow in si21_writeregs()
"len" is user controlled and can be up to 255. Anything more than 59
will cause a buffer overflow so we need to add a test for that.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Alexey Khoroshilov [Mon, 8 Sep 2014 22:10:43 +0000 (19:10 -0300)]
[media] mceusb: fix usbdev leak
mceusb_init_rc_dev() does usb_get_dev(), but there is no any
usb_put_dev() in the driver.
The patch tries to straighten logic. It moves usb_get_dev()
directly to mceusb_dev_probe() and adds usb_put_dev() to an error path
and to mceusb_dev_disconnect().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Dan Carpenter [Mon, 8 Sep 2014 11:18:43 +0000 (08:18 -0300)]
[media] firewire: firedtv-avc: potential buffer overflow
"program_info_length" is user controlled and can go up to 4095. The
operand[] array has 509 bytes so we need to add a limit here to prevent
buffer overflows.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Dan Carpenter [Fri, 5 Sep 2014 12:09:28 +0000 (09:09 -0300)]
[media] ttusb-dec: buffer overflow in ioctl
We need to add a limit check here so we don't overflow the buffer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Andy Shevchenko [Thu, 4 Sep 2014 13:04:38 +0000 (10:04 -0300)]
[media] hdpvr: reduce memory footprint when debugging
There is no need to use hex_dump_to_buffer() since we have a kernel helper to
dump up to 64 bytes just via printk().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Dan Carpenter [Thu, 4 Sep 2014 11:10:05 +0000 (08:10 -0300)]
[media] staging: lirc: freeing ERR_PTRs
We call kfree(data_buf) in the error handling and that will oops if this
is an error pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Frank Schaefer [Fri, 27 Dec 2013 03:16:13 +0000 (00:16 -0300)]
[media] em28xx: check if a device has audio earlier"
GIT_AUTHOR_DATE=
1409603039
This reverts
commit
b99f0aadd33fad269c8e62b5bec8b5c012a44a56
Author: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] em28xx: check if a device has audio earlier
Better to split chipset detection from the audio setup. So, move the
detection code to em28xx_init_dev().
It broke analog audio of the Hauppauge winTV HVR 900 and very likely many other
em28xx devices.
Background:
The local variable has_audio in em28xx_usb_probe() describes if the currently
probed _usb_interface_ has an audio endpoint, while dev->audio_mode.has_audio
means that the _device_ as a whole provides analog audio.
Hence it is wrong to set dev->audio_mode.has_audio = has_audio in em28xx_usb_probe().
As result, audio support is no longer detected and configured on devices which
have the audio endpoint on a separate interface, because em28xx_audio_setup()
bails out immediately at the beginning.
Revert the faulty commit to restore the old audio detection procedure, which checks
the chip configuration register to determine if the device has analog audio.
Cc: <stable@vger.kernel.org> # 3.14 to 3.16
Reported-by: Oravecz Csaba <oravecz@nytud.mta.hu>
Tested-by: Oravecz Csaba <oravecz@nytud.mta.hu>
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Matthias Schwarzott [Sun, 31 Aug 2014 11:35:10 +0000 (08:35 -0300)]
[media] mceusb: add support for more cx231xx devices
Add support for the si2161-based cx231xx devices:
[2040:b138] Hauppauge WinTV HVR-900-H (model 111xxx)
[2040:b139] Hauppauge WinTV HVR-901-H (model 1114xx)
They're similar to the already supported:
[2040:b130] Hauppauge WinTV 930C-HD (model 1113xx)
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Matthias Schwarzott [Sun, 31 Aug 2014 11:35:09 +0000 (08:35 -0300)]
[media] cx231xx: Add support for Hauppauge WinTV-HVR-901H (1114xx)
Add support for:
[2040:b139] Hauppauge WinTV HVR-901H (1114xx)
According to the inf file, the hardware is similar to [2040:b131] Hauppauge WinTV 930C-HD (model 1114xx)
The only difference is the demod Si2161 instead of Si2165 (but both are
supported by the si2165 driver).
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Matthias Schwarzott [Sun, 31 Aug 2014 11:35:08 +0000 (08:35 -0300)]
[media] cx231xx: Add support for Hauppauge WinTV-HVR-900H (111xxx)
Add support for:
[2040:b138] Hauppauge WinTV HVR-900H (111xxx)
The hardware is similar to [2040:b130] Hauppauge WinTV 930C-HD (model 1113xx)
The only difference is the demod Si2161 instead of Si2165 (but both are
supported by the si2165 driver).
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Matthias Schwarzott [Sun, 31 Aug 2014 11:35:07 +0000 (08:35 -0300)]
[media] si2165: enable Si2161 support
Additionally print chip name with revision symbolically.
This is a preparation for supporting new Hauppauge WinTV-HVR-900-H based
on cx231xx.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Matthias Schwarzott [Sun, 31 Aug 2014 11:35:06 +0000 (08:35 -0300)]
[media] si2165: Load driver for all hardware revisions
Current firmware is only for revision D.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Jingoo Han [Fri, 29 Aug 2014 03:49:43 +0000 (00:49 -0300)]
[media] v4l: ti-vpe: Remove casting the return value which is a void pointer
Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Fengguang Wu [Thu, 28 Aug 2014 01:12:43 +0000 (22:12 -0300)]
[media] vpfe_standards[] can be static
make vpfe_standards[] static.
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Olli Salonen [Fri, 22 Aug 2014 16:50:42 +0000 (13:50 -0300)]
[media] MAINTAINERS: add sp2 entry
Add a maintainer for the new CIMaX SP2 driver.
Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 22 Sep 2014 21:57:45 +0000 (18:57 -0300)]
[media] dib0700_devices: Use c99 initializers for structures.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@
struct i1 {
fs
T fld;
...};
@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@
struct i1 i2 = { is,
+ .fld = e
- e
,...};
// </smpl>
Not sure why, but some tables are still using the old way,
but at least several of them got fixed.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Julia Lawall [Sat, 23 Aug 2014 11:20:23 +0000 (08:20 -0300)]
[media] v4l: ti-vpe: use c99 initializers in structures
Use c99 initializers for structures.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@
struct i1 {
fs
T fld;
...};
@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@
struct i1 i2 = { is,
+ .fld = e
- e
,...};
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 18 Aug 2014 11:51:29 +0000 (08:51 -0300)]
[media] au0828: fill tuner type on all boards
This is used by the I2C code in order to slow down the
speed to 20 kHz on devices with xc5000 or xc5000c.
So, it needs to be filled for all devices that use either
xc5000 or xc5000c.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 18 Aug 2014 11:51:28 +0000 (08:51 -0300)]
[media] au0828: explicitly identify boards with analog TV
Right now, the au0828 driver uses .tuner to detect if analog
tv is being used or not. By not filling .tuner fields at the
board struct, the I2C core can't do decisions based on it.
So, add a field to explicitly tell when analog TV is supported.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 22 Sep 2014 20:48:01 +0000 (17:48 -0300)]
[media] au0828-cards: remove a comment about i2c clock stretching
This comment is already at the au0828-i2c where it belongs.
So, remove it from a board's entry. It doesn't make any sense
there, as we're setting the clock to 250kHz there, slowing it
down only at the au0828-i2c.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Mon, 22 Sep 2014 20:36:53 +0000 (17:36 -0300)]
[media] stv0367: Remove an unused parameter
cab_state->modulation is initialized with a wrong value:
drivers/media/dvb-frontends/stv0367.c:3000:42: warning: mixing different enum types
drivers/media/dvb-frontends/stv0367.c:3000:42: int enum fe_modulation versus
drivers/media/dvb-frontends/stv0367.c:3000:42: int enum stv0367cab_mod
as it was declared as "enum stv0367cab_mod". While it could be fixed,
there's no value on it, as this is never used.
So, just remove the modulation from cab_state structure.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Maks Naumov [Fri, 15 Aug 2014 19:23:20 +0000 (16:23 -0300)]
[media] media: stv0367: fix frontend modulation initialization with FE_CAB_MOD_QAM256
It was using the wrong constant for QAM256 on get_frontend.
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Frank Schaefer [Fri, 15 Aug 2014 18:16:58 +0000 (15:16 -0300)]
[media] em28xx-input: i2c IR decoders: improve i2c_client handling
Instead of using a temporary stack allocated i2c_client in em28xx_i2c_ir_handle_key(),
allocate/free the i2c_client at module init/uninit and hook it into struct em28xx_IR
(if the device has an i2c IR decoder).
This reduces the frame size of function em28xx_i2c_ir_handle_key() and speeds
it up a bit.
Also make sure that all fields of struct i2c_client are initialized properly.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Himangi Saraogi [Fri, 15 Aug 2014 16:22:35 +0000 (13:22 -0300)]
[media] rc-core: use USB API functions rather than constants
This patch introduces the use of !usb_endpoint_dir_in(epd) and
!usb_endpoint_xfer_int(epd).
The Coccinelle semantic patch that makes these changes is as follows:
- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) !=
- \(USB_DIR_IN\|0x80\))
+ !usb_endpoint_dir_in(epd)
@@ struct usb_endpoint_descriptor *epd; @@
- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) !=
- \(USB_ENDPOINT_XFER_INT\|3\))
+ !usb_endpoint_xfer_int(epd)
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Himangi Saraogi [Fri, 15 Aug 2014 16:18:53 +0000 (13:18 -0300)]
[media] media/rc/imon.c: use USB API functions rather than constants
This patch introduces the use of the function usb_endpoint_type.
The Coccinelle semantic patch that makes these changes is as follows:
@@ struct usb_endpoint_descriptor *epd; @@
- (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
+ usb_endpoint_type(epd)
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Wennborg [Thu, 7 Aug 2014 05:42:04 +0000 (02:42 -0300)]
[media] dvb: return the error from i2c_transfer if negative
Just returns whatever error that was returned by the i2c core,
in the case of errors, only returning -EREMOTEIO if the transfer size
is not what it was expected.
Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Wennborg [Thu, 7 Aug 2014 05:41:45 +0000 (02:41 -0300)]
[media] dvb: remove 0x prefix from decimal value in printf
The returned code is 0, 1 or an error. It doesn't make sense to
print it in hexadecimal.
Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Andrey Utkin [Mon, 4 Aug 2014 20:04:52 +0000 (17:04 -0300)]
[media] drivers/media/dvb-frontends/stv0900_sw.c: Fix break placement
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81621
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Fri, 19 Sep 2014 16:02:11 +0000 (13:02 -0300)]
[media] em28xx: Get rid of some unused modprobe parameters at vbi code
There are two modprobe parameters for VBI that aren't used
anywhere (one for debug, the other one related to the buffer
size). Get rid of them!
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Morgan Phillips [Mon, 8 Sep 2014 12:49:47 +0000 (09:49 -0300)]
[media] sn9c20x: fix checkpatch warning: sizeof cmatrix should be sizeof(cmatrix)
Signed-off-by: Morgan Phillips <winter2718@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Morgan Phillips [Mon, 8 Sep 2014 12:32:22 +0000 (09:32 -0300)]
[media] sn9c20x.c: fix checkpatch error: that open brace { should be on the previous line
Signed-off-by: Morgan Phillips <winter2718@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 20 Sep 2014 13:19:33 +0000 (10:19 -0300)]
[media] cx23885: fix size helper functions
The norm_swidth function was unused and is dropped. It's not clear
what the purpose of that function was.
The norm_maxh function was changed so it tests for 60 Hz standards
rather than for 50 Hz standards. The is the preferred order.
The norm_maxw function was poorly written and used: it gives the maximum
allowed line width for the given standard. For 60 Hz that's 720, but
for 50 Hz that's 768 which allows for 768x576 which gives you square
pixels. For 60 Hz formats it is 640x480 that gives square pixels, so
there is no need to go beyond 720.
The initial width was set using norm_maxh(), which was wrong. Just set
to 720, that's what you normally use. Since the initial standard was
NTSC anyway the initial width was always 720 anyway.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 20 Sep 2014 13:19:32 +0000 (10:19 -0300)]
[media] cx23885: fix VBI support
Tested VBI support and discovered that the wrong offset was used.
After this change it is now working. Verified with CC/XDS for NTSC
and WSS/Teletext on PAL.
It also reported the wrong start lines for the second field. That's
now fixed as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 20 Sep 2014 10:36:39 +0000 (07:36 -0300)]
[media] adv7604/adv7842: fix il_vbackporch typo and zero the struct
Both adv7604 and adv7842 had the same typo in the code that sets
the vertical backporch for the second interlaced field: it was
assigned to vbackporch instead of il_vbackporch.
In addition, the timings struct wasn't zeroed in the adv7842 driver,
leaving several fields to undefined values causing the timing match
function to fail.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 20 Sep 2014 10:36:38 +0000 (07:36 -0300)]
[media] v4l2-dv-timings: only check standards if non-zero
If one or both of the timings being compared have the standards field
with value 0, then accept that. Only check for matching standards if
both timings have actually filled in that field.
Otherwise no match will ever be found since when timings are detected
the standards field will typically be set to 0 by the driver.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 20 Sep 2014 09:11:44 +0000 (06:11 -0300)]
[media] vivid: add teletext support to VBI capture
This is useful to test teletext capture applications like alevt and mtt.
It also fixes a previously undetected bug where the PAL VBI start line
of the second field was off by one. Using the new field start defines
helps a lot fixing such bugs.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Sat, 13 Sep 2014 09:28:02 +0000 (06:28 -0300)]
[media] DocBook media: fix wrong prototype
G_EDID is an RW ioctl, so the struct v4l2_edid isn't const.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Guennadi Liakhovetski [Tue, 9 Sep 2014 07:42:43 +0000 (04:42 -0300)]
[media] v4l2: uvcvideo: Allow using larger buffers
A test in uvc_video_decode_isoc() checks whether an image has been
received from the camera completely. For this the data amount is compared
to the buffer length, which, however, doesn't have to be equal to the
image size. Switch to using formats .sizeimage field for an exact
expected image size.
[Renamed image_size to frame_size]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Mauro Carvalho Chehab [Sun, 21 Sep 2014 23:35:05 +0000 (20:35 -0300)]
[media] hackrf: Fix a long constant
drivers/media/usb/hackrf/hackrf.c:64:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
.rangehigh =
4294967294, /* max u32, hw goes over 7GHz */
^
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Wed, 10 Sep 2014 07:20:15 +0000 (04:20 -0300)]
[media] MAINTAINERS: add HackRF SDR driver
HackRF SDR driver. Video4Linux USB device.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sat, 23 Aug 2014 07:40:01 +0000 (04:40 -0300)]
[media] hackrf: HackRF SDR driver
V4L2 driver for HackRF SDR. Very basic version, with reduced
feature set. Driver implements receiver only, hardware supports
also transmitter.
USB ID 1d50:6089. Model HackRF One
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Laurent Pinchart [Mon, 21 Jul 2014 22:36:58 +0000 (19:36 -0300)]
[media] v4l: Fix ARGB32 fourcc value in the documentation
The ARGB32 pixel format's fourcc value is defined to 'BA24' in the
videodev2.h header, but documented as 'AX24'. Fix the documentation.
Reported-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Laurent Pinchart [Mon, 21 Jul 2014 20:06:33 +0000 (17:06 -0300)]
[media] v4l: Add ARGB555X and XRGB555X pixel formats
The existing RGB555X pixel format is ill-defined in respect to its alpha
bit and its meaning is driver dependent. Create new standard ARGB555X
and XRGB555X variants with clearly defined meanings and make the
existing variant deprecated.
The new pixel formats 4CC values have been selected to match the DRM
4CCs for the same in-memory formats.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Laurent Pinchart [Thu, 17 Jul 2014 11:52:08 +0000 (08:52 -0300)]
[media] media: Use strlcpy instead of custom code
Replace strncpy + manually setting the terminating '\0' with an strlcpy
call.
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Paul Fertser [Sun, 8 Jun 2014 15:16:48 +0000 (12:16 -0300)]
[media] media: usb: uvc: add a quirk for Dell XPS M1330 webcam
As reported on [1], this device needs this quirk to be able to
reliably initialise the webcam.
[1] http://ubuntuforums.org/showthread.php?t=
2145996
Cc: stable@vger.kernel.org
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
William Manley [Thu, 13 Mar 2014 12:38:48 +0000 (09:38 -0300)]
[media] uvcvideo: Work around buggy Logitech C920 firmware
The uvcvideo webcam driver exposes the v4l2 control "Exposure (Absolute)"
which allows the user to control the exposure time of the webcam,
essentially controlling the brightness of the received image. By default
the webcam automatically adjusts the exposure time automatically but the
if you set the control "Exposure, Auto"="Manual Mode" the user can fix
the exposure time.
Unfortunately it seems that the Logitech C920 has a firmware bug where
it will forget that it's in manual mode temporarily during initialisation.
This means that the camera doesn't respect the exposure time that the user
requested if they request it before starting to stream video. They end up
with a video stream which is either too bright or too dark and must reset
the controls after video starts streaming.
This patch introduces the quirk UVC_QUIRK_RESTORE_CTRLS_ON_INIT which
causes the cached controls to be re-uploaded to the camera immediately
after initialising the camera. This quirk is applied to the C920 to work
around this camera bug.
Signed-off-by: William Manley <will@williammanley.net>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Vincent Palatin [Thu, 4 Sep 2014 00:47:48 +0000 (21:47 -0300)]
[media] v4l: uvcvideo: Add support for pan/tilt speed controls
Map V4L2_CID_TILT_SPEED and V4L2_CID_PAN_SPEED to the standard UVC
CT_PANTILT_RELATIVE_CONTROL terminal control request.
Tested by plugging a Logitech ConferenceCam C3000e USB camera
and controlling pan/tilt from the userspace using the VIDIOC_S_CTRL ioctl.
Verified that it can pan and tilt at the same time in both directions.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Vincent Palatin [Wed, 3 Sep 2014 19:38:39 +0000 (16:38 -0300)]
[media] v4l: Add camera pan/tilt speed controls
The V4L2_CID_PAN_SPEED and V4L2_CID_TILT_SPEED controls allow to move the
camera by setting its rotation speed around its axis.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 16 Aug 2014 20:33:18 +0000 (17:33 -0300)]
[media] media: davinci: remove unneeded dependency ARCH_OMAP3
this patch removes unneeded dependency of ARCH_OMAP3
on VIDEO_DM6446_CCDC.
Also the top level platform Makefile descended into
davinci/ without any dependency so just drop the
dependency obj-y, as obj-$(CONFIG_ARCH_DAVINCI)
already exists.
Reported-by: Andreas Ruprecht <rupran@einserver.de>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 6 Sep 2014 15:26:51 +0000 (12:26 -0300)]
[media] media: davinci: vpif_capture: fix the check on suspend/resume callbacks
It is possible to call STREAMON without having any buffers queued.
So vb2_is_streaming() can return true without start_streaming()
having been called. Only after at least one buffer has been
queued will start_streaming be called.
The check vb2_is_streaming() is incorrect as this would start
the DMA without having proper DMA pointers set up. this patch
uses vb2_start_streaming_called() instead to check is streaming
was called.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 6 Sep 2014 15:26:50 +0000 (12:26 -0300)]
[media] media: davinci: vpif_display: fix the check on suspend/resume callbacks
It is possible to call STREAMON without having any buffers queued.
So vb2_is_streaming() can return true without start_streaming()
having been called. Only after at least one buffer has been
queued will start_streaming be called.
The check vb2_is_streaming() is incorrect as this would start
the DMA without having proper DMA pointers set up. this patch
uses vb2_start_streaming_called() instead to check is streaming
was called.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 6 Sep 2014 15:26:49 +0000 (12:26 -0300)]
[media] media: videobuf2-core.h: add a helper to get status of start_streaming()
this patch adds a helper to get the status if start_streaming()
was called successfully.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 6 Sep 2014 15:26:48 +0000 (12:26 -0300)]
[media] media: davinci: vpif_capture: drop setting of vb2 buffer state to ACTIVE
this patch drops setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE,
as any buffer queued to the driver is marked ACTIVE by the vb2 core.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Prabhakar Lad [Sat, 6 Sep 2014 15:26:47 +0000 (12:26 -0300)]
[media] media: davinci: vpif_display: drop setting of vb2 buffer state to ACTIVE
this patch drops setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE,
as any buffer queued to the driver is marked ACTIVE by the vb2 core.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans de Goede [Sun, 31 Aug 2014 10:19:21 +0000 (07:19 -0300)]
[media] videobuf: Allow reqbufs(0) to free current buffers
All the infrastructure for this is already there, and despite our desires for
the old videobuf code to go away, it is currently still in use in 18 drivers.
Allowing reqbufs(0) makes these drivers behave consistent with modern drivers,
making live easier for userspace, see e.g. :
https://bugzilla.gnome.org/show_bug.cgi?id=735660
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Hans Verkuil [Mon, 25 Aug 2014 11:57:59 +0000 (08:57 -0300)]
[media] videobuf2-core: take mmap_sem before calling __qbuf_userptr
(Changes since v2: dropped local variable as suggested by Laurent)
Commit
f035eb4e976ef5a059e30bc91cfd310ff030a7d3 (videobuf2: fix lockdep warning)
unfortunately removed the mmap_sem lock that is needed around the call to
__qbuf_userptr. Amazingly nobody noticed this (especially me as the author)
until Jan Kara pointed this out to me.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Jan Kara <jack@suse.cz>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Rasmus Villemoes [Fri, 22 Aug 2014 16:45:17 +0000 (13:45 -0300)]
[media] drivers: media: i2c: adv7343_regs.h: Fix typo in #ifndef
Test for definedness of the macro which is actually defined, and which
matches the name of the file.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Rasmus Villemoes [Fri, 22 Aug 2014 16:41:56 +0000 (13:41 -0300)]
[media] drivers: media: b2c2: flexcop.h: Fix typo in include guard
Three trailing underscores is one too many.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Axel Lin [Sat, 16 Aug 2014 06:57:30 +0000 (03:57 -0300)]
[media] tvp7002: Don't update device->streaming if write to register fails
This ensures device->streaming has correct status.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Himangi Saraogi [Fri, 15 Aug 2014 16:21:15 +0000 (13:21 -0300)]
[media] radio-si470x-usb: use USB API functions rather than constants
This patch introduces the use of the function usb_endpoint_is_int_in.
The Coccinelle semantic patch that makes these changes is as follows:
@@ struct usb_endpoint_descriptor *epd; @@
- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
- \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)
@@ struct usb_endpoint_descriptor *epd; @@
- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_INT\|3\))
+ usb_endpoint_xfer_int(epd)
@@ struct usb_endpoint_descriptor *epd; @@
- (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd))
+ usb_endpoint_is_int_in(epd)
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 04:00:46 +0000 (01:00 -0300)]
[media] tda18212: convert to RegMap API
Use RegMap API to handle all the boring I2C register access
boilerplate stuff.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 02:40:23 +0000 (23:40 -0300)]
[media] tda18212: rename state from 'priv' to 'dev'
foo_dev seems to be most correct term for the structure holding data
of each device instance. It is most used term in Kernel codebase and also
examples from book Linux Device Drivers, Third Edition, uses it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 02:26:27 +0000 (23:26 -0300)]
[media] tda18212: clean logging
There is no need to print module name nor function name as those
are done by kernel logging system when dev_xxx logging is used and
driver is proper I2C driver.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 02:05:31 +0000 (23:05 -0300)]
[media] tda18212: convert driver to I2C binding
Convert driver from DVB proprietary model to common I2C model.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 01:35:03 +0000 (22:35 -0300)]
[media] em28xx: convert tda18212 tuner to I2C client
Used tda18212 tuner is implemented as a I2C driver. Use em28xx
tuner I2C client for tda18212 driver.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 00:47:10 +0000 (21:47 -0300)]
[media] anysee: convert tda18212 tuner to I2C client
Used tda18212 tuner is implemented as I2C driver. Implement I2C
client to anysee and use it for tda18212.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 4 Aug 2014 01:43:26 +0000 (22:43 -0300)]
[media] tda18212: prepare for I2C client conversion
We need carry pointer to frontend via config struct
(I2C platform_data ptr) when I2C model is used. Add that pointer
first in order to keep build unbreakable during conversion.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sat, 6 Sep 2014 14:24:14 +0000 (11:24 -0300)]
[media] af9033: init DVBv5 statistics
We need to init supported stats here in order signal app which
stats are supported.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 21:35:59 +0000 (18:35 -0300)]
[media] af9035: remove I2C client differently
It crash kernel when device was removed while it was streaming.
That is because we removed driver and frontend thread was still
running. Use new callback which allows I2C driver removal just
after frontend is unregistered.
V2: fixed by reported by Daniel
Reported-by: Daniel Glöckner <daniel-gl@gmx.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 21:31:40 +0000 (18:31 -0300)]
[media] dvb-usb-v2: add tuner_detach callback
Add tuner_detach callback in order to allow custom detach. It is
needed when tuner driver is implemented I2C client or some other
kernel bus, but not proprietary dvb_attach / dvb_detach.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 20:04:44 +0000 (17:04 -0300)]
[media] dvb-usb-v2: add frontend_detach callback
Add frontend_detach callback in order to allow custom detach. It is
needed when demod driver is implemented I2C client or some other
kernel bus, but not proprietary dvb_attach / dvb_detach.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 02:30:44 +0000 (23:30 -0300)]
[media] af9033: remove all DVBv3 stat calculation logic
Statistics are now calculated for DVBv5 and those DVBv5 values are
returned for legacy DVBv3 calls also. So we could remove all old
statistics calculation logic.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 02:22:53 +0000 (23:22 -0300)]
[media] af9033: wrap DVBv3 BER to DVBv5 BER
DVBv5 BER is calculated anyway, so just return it for legacy
read_ber() API too.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 4 Sep 2014 02:07:39 +0000 (23:07 -0300)]
[media] af9033: wrap DVBv3 UCB to DVBv5 UCB stats
Remove 'duplicate' DVBv3 read UCB implementation and return value,
calculated already for DVBv5 statistics.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 2 Sep 2014 11:29:46 +0000 (08:29 -0300)]
[media] af9033: implement DVBv5 post-Viterbi BER
Implement following DTV API commands:
DTV_STAT_POST_ERROR_BIT_COUNT
DTV_STAT_POST_TOTAL_BIT_COUNT
These will provide post-Viterbi bit error rate reporting.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 2 Sep 2014 11:01:10 +0000 (08:01 -0300)]
[media] af9033: implement DVBv5 stat block counters
Implement following API commands:
DTV_STAT_ERROR_BLOCK_COUNT
DTV_STAT_TOTAL_BLOCK_COUNT
These returns total and uncorrected error packets from outer FEC.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 2 Sep 2014 08:03:21 +0000 (05:03 -0300)]
[media] af9033: wrap DVBv3 read SNR to DVBv5 CNR
Remove 'duplicate' DVBv3 read SNR implementation and return value,
calculated already by DVBv5 CNR, from the cache.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 2 Sep 2014 07:24:41 +0000 (04:24 -0300)]
[media] af9033: implement DVBv5 statistics for CNR
Return CNR via DVBv5 statistics API.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Tue, 2 Sep 2014 06:55:21 +0000 (03:55 -0300)]
[media] af9033: implement DVBv5 statistics for signal strength
Let the demod firmware estimate RF signal strength and return it
to the app as a dBm. To handle that, use thread which reads signal
strengths from firmware in 2 sec intervals when device is active.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 1 Sep 2014 22:44:59 +0000 (19:44 -0300)]
[media] MAINTAINERS: IT913X driver filenames
I removed tuner_ prefix from the driver file names. Update
maintainers entry according to that.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 1 Sep 2014 03:38:01 +0000 (00:38 -0300)]
[media] af9035: replace PCTV device model numbers with name
Use device names for recent PCTV Systems devices:
PCTV AndroiDTV (78e)
PCTV microStick (79e)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 1 Sep 2014 01:57:26 +0000 (22:57 -0300)]
[media] af9033: remove I2C addr from config
I2C driver address is passed as a i2c_new_device() parameter when
device is created. Thus no need to keep it in config struct.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 1 Sep 2014 01:17:12 +0000 (22:17 -0300)]
[media] af9035: few small I2C master xfer changes
Biggest problem of that function is complexity. Try reduce complexity:
* define macros to detect all 3 supported xfers
* remove duplicate message maximum size checks
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Mon, 1 Sep 2014 00:08:09 +0000 (21:08 -0300)]
[media] af9033: clean up logging
It uses I2C client so logging system prints module name
automatically. Function name is also added automatically, if it is
requested from dynamic debug by setting proper format.
Because of that, we could simplify logging in our driver.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sun, 31 Aug 2014 23:57:05 +0000 (20:57 -0300)]
[media] af9033: convert to I2C client
Convert driver to kernel I2C model.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sun, 31 Aug 2014 05:18:34 +0000 (02:18 -0300)]
[media] af9033: rename 'state' to 'dev'
foo_dev seems to be most correct term for the structure holding data
of each device instance. It is most used term in Kernel codebase and also
examples from book Linux Device Drivers, Third Edition, uses it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sun, 31 Aug 2014 05:03:05 +0000 (02:03 -0300)]
[media] af9033: fix firmware version logging
AF9030 and IT9130 series has different memory location for firmware
version. Choose correct location according to chip type.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sun, 31 Aug 2014 03:29:33 +0000 (00:29 -0300)]
[media] it913x: replace udelay polling with jiffies
udelay based I/O polling loop is a bad idea, especially system
performance point of view. Kernel jiffies are preferred solution
for such situations. Use it instead.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Sun, 31 Aug 2014 02:52:48 +0000 (23:52 -0300)]
[media] it913x: refactor code largely
Refactor code largely.
Try to keep order of register read/write same as windows driver does as
it makes comparing sniffs easier.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 28 Aug 2014 05:07:08 +0000 (02:07 -0300)]
[media] it913x: get rid of script loader and and private header file
Used script loader is quite useless and hides register numbers
making code hard to understand. Get rid of it and use standard
RegMap register write functions directly.
it913x_priv.h file leaves empty after that change and is also
removed.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Thu, 28 Aug 2014 04:45:52 +0000 (01:45 -0300)]
[media] it913x: remove dead code
Remove unused tuner set template.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Wed, 27 Aug 2014 06:59:27 +0000 (03:59 -0300)]
[media] it913x: re-implement sleep
Re-implement sleep. Based USB sniffs taken from the latest Hauppauge
windows driver version 07/10/2014, 14.6.23.32191.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Antti Palosaari [Wed, 27 Aug 2014 00:45:33 +0000 (21:45 -0300)]
[media] it913x: convert to RegMap API
Use RegMap API to cover I2C register access routines.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>