Commit graph

413021 commits

Author SHA1 Message Date
Frank Schaefer 5ad10de6ff [media] em28xx: move v4l2_device_disconnect() call from the core to the v4l extension
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14 14:31:40 -02:00
Frank Schaefer 23e8642cc4 [media] em28xx: move usb transfer uninit on device disconnect from the core to the v4l-extension
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14 14:31:32 -02:00
Frank Schaefer 27ba0dac2d [media] em28xx: move usb buffer pre-allocation and transfer uninit from the core to the dvb extension
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14 14:30:00 -02:00
Frank Schaefer 4e1702402e [media] em28xx-v4l: fix device initialization in em28xx_v4l2_open() for radio and VBI mode
- bail out on unsupported VFL_TYPE
- em28xx_set_mode() needs to be called for VBI and radio mode, too
- em28xx_wake_i2c() needs to be called for VBI and radio mode, too
- em28xx_resolution_set() also needs to be called for VBI

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14 14:29:46 -02:00
Mauro Carvalho Chehab eab924d0e2 [media] tea575x: Fix build with ARCH=c6x
In file included from /devel/v4l/temp/include/asm-generic/page.h:23:0,
                 from /devel/v4l/temp/arch/c6x/include/asm/page.h:9,
                 from /devel/v4l/temp/include/asm-generic/io.h:14,
                 from arch/c6x/include/generated/asm/io.h:1,
                 from /devel/v4l/temp/drivers/media/radio/tea575x.c:23:
/devel/v4l/temp/arch/c6x/include/asm/setup.h:17:27: error: unknown type name ‘phys_addr_t’
 extern int c6x_add_memory(phys_addr_t start, unsigned long size);

It seems that, on such arch, the includes from asm/ should be
after the ones from linux/.

The proper fix would be to patch the arch files, but, as
this fix is trivial, apply it. Also, we generally put the
asm includes after the linux ones, anyway.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:23 -02:00
Mauro Carvalho Chehab 986058e1ef [media] lirc_parallel: avoid name conflict on mn10300 arch
The "irq_handler" name is already defined there on a header
file:

/devel/v4l/temp/drivers/staging/media/lirc/lirc_parallel.c:223:13: error: conflicting types for ‘irq_handler’
 static void irq_handler(void *blah)
             ^
In file included from /devel/v4l/temp/arch/mn10300/include/asm/reset-regs.h:16:0,
                 from /devel/v4l/temp/arch/mn10300/include/asm/irq.h:18,
                 from /devel/v4l/temp/include/linux/irq.h:24,
                 from /devel/v4l/temp/arch/mn10300/include/asm/hardirq.h:16,
                 from /devel/v4l/temp/include/linux/preempt_mask.h:5,
                 from /devel/v4l/temp/include/linux/sched.h:25,
                 from /devel/v4l/temp/include/linux/utsname.h:5,
                 from /devel/v4l/temp/arch/mn10300/include/asm/elf.h:15,
                 from /devel/v4l/temp/include/linux/elf.h:4,
                 from /devel/v4l/temp/include/linux/module.h:14,
                 from /devel/v4l/temp/drivers/staging/media/lirc/lirc_parallel.c:29:
/devel/v4l/temp/arch/mn10300/include/asm/exceptions.h:107:24: note: previous declaration of ‘irq_handler’ was here
 extern asmlinkage void irq_handler(void);

/devel/v4l/patchwork/drivers/staging/media/lirc/lirc_serial.c:653:20: error: conflicting types for ‘irq_handler’
 static irqreturn_t irq_handler(int i, void *blah)
                    ^
In file included from /devel/v4l/patchwork/arch/mn10300/include/asm/reset-regs.h:16:0,
                 from /devel/v4l/patchwork/arch/mn10300/include/asm/irq.h:18,
                 from /devel/v4l/patchwork/include/linux/irq.h:24,
                 from /devel/v4l/patchwork/arch/mn10300/include/asm/hardirq.h:16,
                 from /devel/v4l/patchwork/include/linux/preempt_mask.h:5,
                 from /devel/v4l/patchwork/include/linux/sched.h:25,
                 from /devel/v4l/patchwork/include/linux/utsname.h:5,
                 from /devel/v4l/patchwork/arch/mn10300/include/asm/elf.h:15,
                 from /devel/v4l/patchwork/include/linux/elf.h:4,
                 from /devel/v4l/patchwork/include/linux/module.h:14,
                 from /devel/v4l/patchwork/drivers/staging/media/lirc/lirc_serial.c:53:
/devel/v4l/patchwork/arch/mn10300/include/asm/exceptions.h:107:24: note: previous declaration of ‘irq_handler’ was here
 extern asmlinkage void irq_handler(void);

So, rename it, to avoid namespace conflicts.

This patch fixes building media drivers with allyesconfig/almodconfig on
mn10300 arch.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:20 -02:00
Mauro Carvalho Chehab c61c3094a6 [media] go7007-usb: only use go->dev after allocated
Fixes those warnings:
	drivers/staging/media/go7007/go7007-usb.c: In function 'go7007_usb_probe':
	drivers/staging/media/go7007/go7007-usb.c:1060: warning: 'go' is used uninitialized in this function

While here, comment a code that will never run.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:17 -02:00
Mauro Carvalho Chehab e4a3bc1c2c [media] dib8000: Fix a few warnings when compiled for avr32
drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_get_time_us':
	drivers/media/dvb-frontends/dib8000.c:3957: warning: 'interleaving' may be used uninitialized in this function
	drivers/media/dvb-frontends/dib8000.c:3956: warning: 'rate_denum' may be used uninitialized in this function

Those are actually false positives, but it doesn't hurt cleaning them.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:13 -02:00
Mauro Carvalho Chehab 5dc8526b90 [media] dib8000: Properly represent long long integers
When compiling with avr32, it gets those errors:

	drivers/media/dvb-frontends/dib8000.c: In function 'dib8000_get_stats':
	drivers/media/dvb-frontends/dib8000.c:4121: warning: integer constant is too large for 'long' type

Fix integer representation to avoid overflow.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:12 -02:00
Mauro Carvalho Chehab 6fcd3b619c [media] radio-usb-si4713: make si4713_register_i2c_adapter static
This function isn't used nowhere outside the same .c file.
Fixes this warning:

drivers/media/radio/si4713/radio-usb-si4713.c:418:5: warning: no previous prototype for 'si4713_register_i2c_adapter' [-Wmissing-prototypes]
 int si4713_register_i2c_adapter(struct si4713_usb_device *radio)
     ^

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 16:28:08 -02:00
Mauro Carvalho Chehab a622cc5187 [media] sh_vou: comment unused vars
Fix two warns below, by commenting the unused code:

drivers/media/platform/sh_vou.c: In function 'sh_vou_configure_geometry':
drivers/media/platform/sh_vou.c:446:49: warning: variable 'height_max' set but not used [-Wunused-but-set-variable]
  unsigned int black_left, black_top, width_max, height_max,
                                                 ^
drivers/media/platform/sh_vou.c: In function 'sh_vou_isr':
drivers/media/platform/sh_vou.c:1056:13: warning: variable 'side' set but not used [-Wunused-but-set-variable]
  static int side;
             ^

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 11:30:26 -02:00
Hans Verkuil 429df502d4 [media] solo6x10: fix broken PAL support
The video_type was never set correctly for PAL: it's not a bool, instead
it is a register value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: tomdev@freenet.de
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 11:21:56 -02:00
Tim Mester f251b3e78c [media] au0828: Add option to preallocate digital transfer buffers
Added command line parameter preallocate_big_buffers so that the digital
transfer buffers can be allocated when the driver is registered. They
do not have to be allocated every time a feed is started.

Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 11:11:11 -02:00
Tim Mester 4609981f84 [media] au8028: Fix cleanup on kzalloc fail
Free what was allocated if there is a failure allocating
transfer buffers.

Stop the feed on a start feed error.  The stop feed is not always called
if start feed fails.  If the feed is not stopped on error, then the driver
will be stuck so that it can never start feeding again.

[m.chehab@samsung.com: CodingStyle cleanup]
Signed-off-by: Tim Mester <tmester@ieee.org>
Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com>

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 11:05:57 -02:00
Kiran AVND bbd8f3fef9 [media] s5p-mfc: Add controls to set vp8 enc profile
Add v4l2 controls to set desired profile for VP8 encoder.
Acceptable levels for VP8 encoder are
0: Version 0
1: Version 1
2: Version 2
3: Version 3

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Pawel Osciak <posciak@chromium.org>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 10:59:11 -02:00
Marek Szyprowski b80cb8dc41 [media] media: s5p_mfc: remove s5p_mfc_get_node_type() function
s5p_mfc_get_node_type() relies on get_index() helper function, which in
turn relies on video_device index numbers assigned on driver
registration. All this code is not really needed, because there is
already access to respective video_device structures via common
s5p_mfc_dev structure. This fixes the issues introduced by patch
1056e4388b ("v4l2-dev: Fix race condition
on __video_register_device"), which has been merged in v3.12-rc1.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 10:56:17 -02:00
Arun Kumar K 4773ab99aa [media] s5p-mfc: Add QP setting support for vp8 encoder
Adds v4l2 controls to set MIN, MAX QP values and
I, P frame QP for vp8 encoder.

Signed-off-by: Kiran AVND <avnd.kiran@samsung.com>
Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 10:55:27 -02:00
Mauro Carvalho Chehab ee97207c6e [media] em28xx: fix xc3028 demod and firmware setup on DVB
Now that em28xx can be compiled without V4L support, we should
call em28xx_setup_xc3028() on both em28xx-v4l and em28xx-dvb
modules.

Reported-by: Chris Lee <updatelee@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 10:30:30 -02:00
Mauro Carvalho Chehab fa1e1de6bb [media] nxt200x: increase write buffer size
The buffer size on nxt200x is not enough:

	...
	> Dec 20 10:52:04 rich kernel: [   31.747949] nxt200x: nxt200x_writebytes: i2c wr reg=002c: len=255 is too big!
	...

Increase it to 256 bytes.

Reported-by: Rich Freeman <rich0@gentoo.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13 10:29:47 -02:00
Mauro Carvalho Chehab 8b1fa5798d [media] em28xx-audio: return -ENODEV when the device is disconnected
If em28xx is disconnected, return -ENODEV to all PCM callbacks.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:57:06 -02:00
Mauro Carvalho Chehab 966f416375 [media] em28xx-audio: split URB initialization code
The URB calculus code may eventually be moved to some other
place, like at pcm open, if it ends by needing more setups, like
working with different bit rates, or different audio latency.

So, move it into a separate routine. That also makes the code
more readable.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:57:05 -02:00
Mauro Carvalho Chehab 34906633fa [media] em28xx-audio: don't wait for lock in non-block mode
Pulseaudio has the bad habit of stopping a streaming audio if
a device, opened in non-block mode, waits.

It is impossible to avoid em28xx to wait, as it will send commands
via I2C, and other I2C operations may be happening (firmware
transfers, Remote Controller polling, etc). Yet, as each em28xx
subdriver locks em28xx-dev to protect the access to the hardware,
it is possible to minimize the audio glitches by returning -EAGAIN
to pulseaudio, if the lock is already taken by another subdriver.

Reported-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:57:05 -02:00
Mauro Carvalho Chehab 49677aef90 [media] em28xx-audio: fix the period size in bytes
If the period size is wrong, userspace will assume a wrong delay
any may negociate an inadequate value.

The em28xx devices use 8 for URB interval, in microframes,
and the driver programs it to have 64 packets.

That means that the IRQ sampling period is 125 * 8 * 64,
with is equal to 64 ms.

So, that's the minimal latency with the current settings. It is
possible to program a lower latency, by using less than 64 packets,
but that increases the amount of bandwitdh used, and the number of
IRQ events per second.

In any case, in order to support it, the driver logic should be
changed to fill those parameters in realtime.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:57:04 -02:00
Mauro Carvalho Chehab 1b3fd2d342 [media] em28xx-audio: don't hardcode audio URB calculus
The current code hardcodes the number of audio URBs, the number
of packets per URB and the maximum URB size.

This is not a good idea, as it:

- wastes more bandwidth than necessary, by using a very
  large number of packets;

- those constants are bound to an specific scenario, with
  a bandwidth of 48 kHz;

- don't take the maximum endpoint size into account;

- with urb->interval = 1 on xHCI, those constraints cause a "funny"
  setup: URBs with 64 packets inside, with only 24 bytes total. E. g.
  a complete waste of space.

Change the code to do dynamic URB audio calculus and allocation.

For now, use the same constraints as used before this patch, to
avoid regressions.

A good scenario (tested) seems to use those defines, instead:

	#define EM28XX_MAX_AUDIO_BUFS          8
	#define EM28XX_MIN_AUDIO_PACKETS       2

But let's not do such change here, letting the optimization to
happen on latter patches, after more tests.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:56:59 -02:00
Mauro Carvalho Chehab 439c491c4c [media] em28xx-audio: Fix error path
De-allocate memory and free sound if an error happens.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:56:59 -02:00
Mauro Carvalho Chehab d2849fa59d [media] em28xx-audio: use bInterval on em28xx-audio
Just filling urb->interval with 1 is wrong, and causes a different
behaviour with xHCI.

With EHCI, the URB size is typically 192 bytes. However, as
xHCI specifies intervals in microframes, the URB size becomes
too short (24 bytes).

With this patch, the interval will be properly initialized, and
the device will behave the same if connected into a xHCI or an
EHCI device port.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:56:53 -02:00
Mauro Carvalho Chehab d845fb3ae5 [media] em28xx-i2c: add timeout debug information if i2c_debug enabled
If i2c_debug is enabled, we splicitly want to know when a
device fails with timeout.

If i2c_debug==2, this is already provided, for each I2C transfer
that fails.

However, most of the time, we don't need to go that far. We just
want to know that I2C transfers fail.

So, add such errors for normal (ret == 0x10) I2C aborted timeouts.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:56:46 -02:00
Mauro Carvalho Chehab 50f0a9df27 [media] em28xx-i2c: cleanup I2C debug messages
The I2C output messages is too polluted. Clean it a little
bit, by:
	- use the proper core support for memory dumps;
	- hide most stuff under the i2c_debug umbrella;
	- add the missing KERN_CONT where needed;
	- use 2 levels or verbosity. Only the second one
	  will show the I2C transfer data.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:56:40 -02:00
Mauro Carvalho Chehab e63b009d6e [media] em28xx-i2c: Fix error code for I2C error transfers
Follow the error codes for I2C as described at Documentation/i2c/fault-codes.

In the case of the I2C status register (0x05), this is mapped into:

	- ENXIO - when reg 05 returns 0x10
	- ETIMEDOUT - when the device is not temporarily not responding
		      (e. g. reg 05 returning something not 0x10 or 0x00)
	- EIO - for generic I/O errors that don't fit into the above.

In the specific case of 0-byte reads, used only during I2C device
probing, it keeps returning -ENODEV.

TODO: return EBUSY when reg 05 returns 0x20 on em2874 and upper.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12 11:54:14 -02:00
Mauro Carvalho Chehab d20e4ed6d3 [media] em28xx: use a better value for I2C timeouts
In the lack of a better spec, let's assume the timeout
values compatible with SMBus spec:
	http://smbus.org/specs/smbus110.pdf

at chapter 8 - Electrical Characteristics of SMBus devices

Ok, SMBus is a subset of I2C, and not all devices will be
following it, but the timeout value before this patch was not
even following the spec.

So, while we don't have a better guess for it, use 35 + 1
ms as the timeout.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:10:07 -02:00
Mauro Carvalho Chehab d1b7213b48 [media] em28xx: rename I2C timeout to EM28XX_I2C_XFER_TIMEOUT
This macro is used by all em28xx devices, and not just em2800.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:09:26 -02:00
Mauro Carvalho Chehab 4b83626ac2 [media] em28xx: convert i2c wait completion logic to use jiffies
The I2C wait completion/timeout logic currently assumes that
msleep(5) will wait exaclty 5 ms. This is not true at all,
as it depends on CONFIG_HZ.

Convert it to use jiffies, in order to not wait for more time
than needed.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:08:46 -02:00
Mauro Carvalho Chehab 5022a20886 [media] em28xx: properly implement AC97 wait code
Instead of assuming that msleep() is precise, use a jiffies
based code to wait for AC97 to be available.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:06:20 -02:00
Mauro Carvalho Chehab 2276bf70a7 [media] tuner-xc2028: Don't read status if device is powered down
That removes those timeout errors:

[ 3675.930940] xc2028 19-0061: Device is Xceive 3028 version 1.0, firmware version 2.7
[ 3676.060487] xc2028 19-0061: divisor= 00 00 8d d0 (freq=567.250)
[ 3676.349449] xc2028 19-0061: Putting xc2028/3028 into poweroff mode.
[ 3698.247645] xc2028 19-0061: xc2028_get_reg 0002 called
[ 3698.253276] em2860 #0: I2C transfer timeout on writing to addr 0xc2
[ 3698.253301] xc2028 19-0061: i2c input error: rc = -121 (should be 2)
[ 3698.253327] xc2028 19-0061: xc2028_signal called
[ 3698.253339] xc2028 19-0061: xc2028_get_reg 0002 called
[ 3698.259283] em2860 #0: I2C transfer timeout on writing to addr 0xc2
[ 3698.259312] xc2028 19-0061: i2c input error: rc = -121 (should be 2)

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:05:13 -02:00
Mauro Carvalho Chehab ebf044f46f [media] tuner-xc2028: Don't try to sleep twice
Only send a power down command for the device if it is not already
in power down state. That prevents a timeout when trying to talk
with the device.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:04:48 -02:00
Mauro Carvalho Chehab f5f894d19e [media] em28xx-audio: allocate URBs at device driver init
Instead of allocating/deallocating URBs and transfer buffers
every time stream is started/stopped, just do it once.

That reduces the memory allocation pressure and makes the
code that start/stop streaming a way simpler.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:01:47 -02:00
Mauro Carvalho Chehab 46c704d77f [media] em28xx: use usb_alloc_coherent() for audio
Instead of allocating transfer buffers with kmalloc() use
usb_alloc_coherent().

This patch should make it work also with ARM CPUs.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10 06:00:25 -02:00
Links (Markus) dad4c41827 [media] cx231xx: add support for a CX23103 Video Grabber USB
Add a new USB ID to the driver.

Signed-off-by: Links (Markus) <help.markus+git@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:46:36 -02:00
Laurent Pinchart 6f546c5ff9 [media] vb2: Fix comment in __qbuf_dmabuf
The comment incorrectly explains that the code verifies information
provided by userspace, while verification has been performed earlier in
reality. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:46:29 -02:00
Malcolm Priestley a6d8e68b60 [media] m88rs2000: Correct m88rs2000_get_fec
Value of fec is achieved by the upper nibble bits 6,7 & 8.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:40:34 -02:00
Malcolm Priestley 49c44802a7 [media] m88rs2000: Correct m88rs2000_set_fec settings
Register 0x70 is used to set fec, register 0x76 is used to get fec

Register 0x76 is set to 0x8.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:40:04 -02:00
Malcolm Priestley 7a9d6b43f8 [media] m88rs2000: correct read status lock value
The correct lock values is when bits of the value 0xee are set.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:38:01 -02:00
Malcolm Priestley dd4491dfb9 [media] m88rs2000: set symbol rate accurately
Current setting of symbol rate is not very actuate causing
loss of lock.

Covert temp to u64 and use mclk to calculate from big number.

Calculate symbol rate by dividing symbol rate by 1000 times
1 << 24 and dividing sum by mclk.

Add other symbol rate settings to function registers 0xa0-0xa3.

In set_frontend add changes to register 0xf1 this must be done
prior call to fe_reset. Register 0x00 doesn't need a second
write of 0x1

Applied after patch
m88rs2000: add m88rs2000_set_carrieroffset

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:37:29 -02:00
Malcolm Priestley 06af15d1b6 [media] m88rs2000: add m88rs2000_set_carrieroffset
Set the carrier offset correctly using the default mclk values.

Add function m88rs2000_get_mclk to calculate the mclk value
against crystal frequency which will later be used for
other functions.

Add function m88rs2000_set_carrieroffset to calculate
and set the offset value.

variable offset becomes a signed value.

Register 0x86 is set the appropriate value according to
remainder value of frequency % 192857 calculation as
shown.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: stable@vger.kernel.org # v3.9+
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:35:58 -02:00
Julia Lawall 58f087c9b6 [media] e4000: fix error return code
Set the return variable to an error code as done elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:34:05 -02:00
Julia Lawall 6c49d79381 [media] ec168: fix error return code
The rest of the function uses ret to store the return value, even setting
ret to i a few lines before this, so return ret instead of i.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 09:19:03 -02:00
Alexey Khoroshilov cd19f7d3e3 [media] as102: fix leaks at failure paths in as102_usb_probe()
Failure handling is incomplete in as102_usb_probe().
The patch implements proper resource deallocations.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:55:58 -02:00
Hans Verkuil 42f8f39e27 [media] [for,v3.14] sn9c102: fix build dependency
This driver should only build if MEDIA_USB_SUPPORT is set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Jim Davis <jim.epost@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:49:01 -02:00
Sachin Kamat c0ee62734e [media] s5k5baf: Fix potential NULL pointer dereferencing
Dereference 'fw' after the NULL check.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:48:46 -02:00
Sachin Kamat 7296e158b5 [media] s5k5baf: Fix checkpatch error
Fixes the following error:
ERROR: return is not a function, parentheses are not required
FILE: drivers/media/i2c/s5k5baf.c:1353:

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07 08:48:29 -02:00