Commit Graph

13363 Commits (7cbc353540c31ffaf65ad44d89b955be0f1d04dc)

Author SHA1 Message Date
Laurent Pinchart 0b27c81ba3 [media] v4l: Aptina-style sensor PLL support
Add a generic helper function to compute PLL parameters for PLL found in
several Aptina sensors.

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>
2012-03-19 18:53:39 -03:00
Laurent Pinchart c0f9976662 [media] mt9p031: Remove unused xskip and yskip fields in struct mt9p031
The fields are set but never used, remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 18:53:02 -03:00
Akihiro Tsukada cd7334d6d6 [media] dvb: earth-pt1: remove unsupported net subdevices
PT1 and PT2 do not have net functions.

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:48:13 -03:00
Akihiro Tsukada 7ff04760f7 [media] dvb: earth-pt1: decrease the too large DMA buffer size
Current default value of "nr_tables" option corresponds to the DMA
buffer of about 10 to 48 seconds long, which is obviously too much.

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:47:38 -03:00
Akihiro Tsukada 6988111098 [media] dvb: earth-pt1: add an error check/report on the incoming data
This patch adds a data integrity check using the sequence counter and
error flags added by the bridge chip.

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:47:15 -03:00
Akihiro Tsukada 847e876596 [media] dvb: earth-pt1: stop polling data when no one accesses the device
The driver started a kthread to poll the DMA buffers soon after probing,
which relsuleted in 1000/sec sleeps and wakeups of the thread doing nothing
useful until someone started feeding.
This patch changes the creation and destruction of the kthread depending on the number of users.

Signed-off-by: Akihiro Tsukada <tskd2@yahoo.co.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:46:36 -03:00
Ezequiel García 2321acf296 [media] media: em28xx: Remove unused urb arrays from device struct
These arrays were embedded in the struct itself, but they weren't
used by anyone, since urbs are now dinamically allocated
at em28xx_usb_isoc_ctl struct.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:45:49 -03:00
Dan Carpenter 955b44304a [media] gpio-ir-recv: a couple signedness bugs
There are couple places where we check unsigned values for negative.  I
changed ->gpin_nr to signed because in gpio_ir_recv_probe() we do:
        if (pdata->gpio_nr < 0)
                return -EINVAL;
I also change gval to a signed int in gpio_ir_recv_irq() because that's
the type that gpio_get_value_cansleep() returns and we test for negative
returns.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:45:01 -03:00
Sylwester Nawrocki 68a6bb5465 [media] s5p-csis: Fix compilation with PM_SLEEP disabled
Fix following compilation error when CONFIG_PM_SLEEP is disabled:

  CC      drivers/media/video/s5p-fimc/mipi-csis.o
drivers/media/video/s5p-fimc/mipi-csis.c: In function ‘s5pcsis_remove’:
drivers/media/video/s5p-fimc/mipi-csis.c:956: error: implicit declaration of function ‘s5pcsis_suspend’

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:42:24 -03:00
Mauro Carvalho Chehab c9e7252c62 [media] /w9966: Fix a build warning
drivers/media/video/w9966.c: In function ‘__check_pardev’:
drivers/media/video/w9966.c:136:1: warning: return from incompatible pointer type [enabled by default]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:37:59 -03:00
Fabio Estevam 0c22affeba [media] video: Kconfig: Select VIDEOBUF2_DMA_CONTIG for VIDEO_MX2
Fix the following build error:

LD      .tmp_vmlinux1
drivers/built-in.o: In function `mx2_camera_init_videobuf':
clkdev.c:(.text+0xcfaf4): undefined reference to `vb2_dma_contig_memops'
drivers/built-in.o: In function `mx2_camera_probe':
clkdev.c:(.devinit.text+0x5734): undefined reference to `vb2_dma_contig_init_ctx'
clkdev.c:(.devinit.text+0x5778): undefined reference to `vb2_dma_contig_cleanup_ctx'
drivers/built-in.o: In function `mx2_camera_remove':
clkdev.c:(.devexit.text+0x89c): undefined reference to `vb2_dma_contig_cleanup_ctx'

commit c6a41e3271 ([media] media i.MX27 camera: migrate driver to videobuf2)
missed to select VIDEOBUF2_DMA_CONTIG in Kconfig.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:34:56 -03:00
Malcolm Priestley 1d53160111 [media] lmedm04 - support for m88rs2000 missing kconfig option
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:32:48 -03:00
Scott Jiang 63b1a90da9 [media] add blackfin capture bridge driver
This is a v4l2 bridge driver for Blackfin video capture device, support ppi and eppi interface.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:08:20 -03:00
Scott Jiang f877ed9780 [media] vs6624: add vs6624 sensor driver
This is a v4l2 sensor-level driver for the ST VS6624 camera.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:04:26 -03:00
Scott Jiang 202ea1f05b [media] adv7183: add adv7183 decoder driver
This driver is a v4l2 subdevice driver to support Analog Devices ADV7183 SDTV video decoder.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 15:04:10 -03:00
Malcolm Priestley 4f3b7fed46 [media] lmedm04 ver 1.99 support for m88rs2000 v2
Support for m88rs2000 module.

The driver also attempts to overcome occasional lock problems.

Call backs are now used for read_status, signal level and SNR.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:55:37 -03:00
Mauro Carvalho Chehab 40841e7469 [media] m88rs2000: Don't fill info.type
This field is handled internally by the DVB core, with uses the
selected delivery system to fill it, when a DVBv3 call is
handled. So, drivers should not touch on it.

Cc: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:55:27 -03:00
Malcolm Priestley ae8dc8ee2b [media] m88rs2000 1.12 v2 DVB-S frontend and tuner module
Support for m88rs2000 chip used in lmedm04 driver.

Note there are still lock problems.

Slow channel change due to the large block of registers sent in set_frontend.

Version 2 differences.
Front end is completely shut down when in sleep mode. This allow user to regain
control of device.
Kaffeine scan problem solved by removing register calls from get_frontend.
Kaffeine seems to call get_frontend when updating signal data. This can happen
in the middle of a tune stalling the driver.
Change calculations to those in the DS3000 driver.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:52:59 -03:00
Malcolm Priestley 77c2402dc6 [media] lmedm04 v1.98 Remove clear halt
These were in the original lme2510 device driver.

Removing them significantly speeds up the driver.

All tuners tested.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:48:33 -03:00
Santosh Nayak 3caaa20121 [media] dvb: negative value assigned to unsigned int in CDRXD()
In CDRXD(), Negative number is assigned to unsigned variable
'state->noise_cal.tdCal2.

Members of 'SNoiseCal' should be 'signed short'.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:39:14 -03:00
Alexey Khoroshilov f3033aecf2 [media] dib9000: implement error handling for DibAcquireLock
DibAcquireLock() is implemented as mutex_lock_interruptible()
but the driver does not handle unsuccessful locking.
As a result it may lead to unlock of an unheld mutex.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:36:24 -03:00
Alexey Khoroshilov 9bb24a7e49 [media] dib9000: fix explicit lock mismatches
There are several error paths, where &state->platform.risc.mem_mbx_lock
is not unlocked. The patch fixes it.

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

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:36:17 -03:00
Jose Alberto Reguero 962f8f67e4 [media] Add CI support to az6007 driver
This patch add CI support to az6007 driver.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:15:16 -03:00
Jesper Juhl 266e8ae37d [media] media, cx231xx: Fix double free on close
In cx231xx_v4l2_close() there are two calls to
cx231xx_release_resources(dev) followed by kfree(dev). That is a
problem since cx231xx_release_resources() already kfree()'s its
argument, so we end up doing a double free.

Easily resolved by just removing the redundant kfree() calls after the
calls to cx231xx_release_resources().

I also changed the 'dev = NULL' assignments (which are rather
pointless since 'dev' is about to go out of scope), to 'fh->dev = NULL'
since it looks to me that that is what was actually intended.
And I removed the 'dev = NULL' assignment at the end of
cx231xx_release_resources() since it is pointless.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:13:51 -03:00
Malcolm Priestley 1a611d8cd0 [media] lmedm04 ver 1.97 Remove delays required for STV0288
Remove delays added for STV0288 frontend.

This patch significantly speeds up channel change and scan.

It requires patch 10161-STV0288 increase delay between carrier search.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:12:53 -03:00
Malcolm Priestley 77768e4b75 [media] STV0288 increase delay between carrier search
The current delay of 30uS is too short to recover any carrier.

In the lmedm04 driver delays were added to overcome carrier lock
problems. The typical delay was 30mS (2 x 15ms register write
0x2c and read 0x24).

Other drivers that use STV0288 don't appear to have any delay are
likely to have also suffered this problem.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:12:32 -03:00
Andrew Morton 66ede038aa [media] uvcvideo: uvc_driver.c: use linux/atomic.h
There's no known problem here, but this is one of only two non-arch files
in the kernel which use asm/atomic.h instead of linux/atomic.h.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:08:34 -03:00
Laurent Pinchart 3efe2f1b12 [media] uvcvideo: Add support for Dell XPS m1530 integrated webcam
The camera requires the PROBE_DEF quirk. Add a corresponding entry in
the device IDs list.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:07:41 -03:00
Javier Martin ab86e9e03d [media] uvcvideo: Allow userptr IO mode
Userptr can be very useful if a UVC camera is requested to use video
buffers allocated by another processing device. So that buffers don't
need to be copied.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:07:13 -03:00
Laurent Pinchart 1a5e4c867c [media] uvcvideo: Implement compat_ioctl32 for custom ioctls
Support 32-bit/64-bit compatibility for the the UVCIOC_ ioctls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:07:01 -03:00
Laurent Pinchart a3ec69b707 [media] uvcvideo: Return -ENOTTY in case of unknown ioctl
-EINVAL is the wrong error code in that case, replace it with -ENOTTY.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:06:27 -03:00
Laurent Pinchart b9d0aa6e21 [media] v4l: Add custom compat_ioctl32 operation
Drivers implementing custom ioctls need to handle 32-bit/64-bit
compatibility themselves. Provide them with a way to do so.

To avoid circular module dependencies, merge the v4l2-compat-ioctl32
module into videodev. There is no point in keeping them separate, as the
v4l2_compat_ioctl32() function is required by videodev if CONFIG_COMPAT
is set anyway.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:06:12 -03:00
Hans Verkuil f769c26085 [media] Two small string fixes in v4l2-ctrls.c
Fix one typo and use 'Microseconds' instead of 'useconds' in the pre-emphasis
descriptions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 14:03:35 -03:00
Mauro Carvalho Chehab 9ce28d827f Merge tag 'v3.3' into staging/for_v3.4
* tag 'v3.3': (1646 commits)
  Linux 3.3
  Don't limit non-nested epoll paths
  netfilter: ctnetlink: fix race between delete and timeout expiration
  ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
  nilfs2: fix NULL pointer dereference in nilfs_load_super_block()
  nilfs2: clamp ns_r_segments_percentage to [1, 99]
  afs: Remote abort can cause BUG in rxrpc code
  afs: Read of file returns EBADMSG
  C6X: remove dead code from entry.S
  wimax/i2400m: fix erroneous NETDEV_TX_BUSY use
  net/hyperv: fix erroneous NETDEV_TX_BUSY use
  net/usbnet: reserve headroom on rx skbs
  bnx2x: fix memory leak in bnx2x_init_firmware()
  bnx2x: fix a crash on corrupt firmware file
  sch_sfq: revert dont put new flow at the end of flows
  ipv6: fix icmp6_dst_alloc()
  MAINTAINERS: Add Serge as maintainer of capabilities
  drivers/video/backlight/s6e63m0.c: fix corruption storing gamma mode
  MAINTAINERS: add entry for exynos mipi display drivers
  MAINTAINERS: fix link to Gustavo Padovans tree
  ...
2012-03-19 13:41:24 -03:00
Mauro Carvalho Chehab f074ff92b5 [media] radio-sf16fmr2: fix session mismatches
WARNING: drivers/media/radio/built-in.o(.data+0x284): Section mismatch in reference from the variable fmr2_driver to the function .init.text:fmr2_probe()
The variable fmr2_driver references
the function __init fmr2_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: drivers/media/built-in.o(.data+0x48200): Section mismatch in reference from the variable fmr2_driver to the function .init.text:fmr2_probe()
The variable fmr2_driver references
the function __init fmr2_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 13:32:37 -03:00
Hans Verkuil cfb19b0ab1 [media] radio-maxiradio: use the tea575x framework
This card is based on the tea575x receiver. Use the tea575x-tuner framework
instead of reinventing the wheel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 11:29:09 -03:00
Hans Verkuil d4ecc83b79 [media] tea575x-tuner: update to latest V4L2 framework requirements
The tea575x-tuner module has been updated to use the latest V4L2 framework
functionality. This also required changes in the drivers that rely on it.

The tea575x changes are:

- The drivers must provide a v4l2_device struct to the tea module.
- The radio_nr module parameter must be part of the actual radio driver,
  and not of the tea module.
- Changed the frequency range to the normal 76-108 MHz range instead of
  50-150.
- Add hardware frequency seek support.
- Fix broken rxsubchans/audmode handling.
- The application can now select between stereo and mono.
- Support polling for control events.
- Add V4L2 priority handling.

And radio-sf16fmr2.c now uses the isa bus kernel framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks-to: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 11:27:21 -03:00
Hans Verkuil 9f1dfccf66 [media] Add missing slab.h to fix linux-next compile errors
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 11:25:12 -03:00
Andreas Regel ef3d23de05 [media] stb0899: fixed reading of IF_AGC_GAIN register
When reading IF_AGC_GAIN register a wrong value for the base address
register was used (STB0899_DEMOD instead of STB0899_S2DEMOD). That
lead to a wrong signal strength value on DVB-S2 transponders.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Acked-by: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 11:22:52 -03:00
Andreas Regel 91caad3195 [media] stb0899: set FE_HAS_SIGNAL flag in read_status
In stb0899_read_status the FE_HAS_SIGNAL flag was not set in case of a
successful carrier lock. This change fixes that.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Acked-by: Klaus Schmidinger <Klaus.Schmidinger@tvdr.de>
Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 11:22:19 -03:00
Antti Palosaari 2b49fad595 [media] tda10071: fix the delivery system
Commit b2a29b578d sets accidentally
supported delivery systems as DVB-T/T2 whilst it should be
DVB-S/S2. Due to that frontend cannot be used at all.

Reported-by: Jiří Zelenka <klacek@bubakov.net>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-19 10:47:50 -03:00
Linus Torvalds 72c79bdbda Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
 "For 4 fixes for 3.3 (all trivial):
       - uvc video driver: fixes a division by zero;
       - davinci: add module.h to fix compilation;
       - smsusb: fix the delivery system setting;
       - smsdvb: the get_frontend implementation there is broken.

  The smsdvb patch has 127 lines, but it is trivial: instead of
  returning a cache of the set_frontend (with is wrong, as it doesn't
  have the updated values for the data, and the implementation there is
  buggy), it copies the information of the detected DVB parameters from
  the smsdvb private structures into the corresponding DVBv5 struct
  fields."

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] smsdvb: fix get_frontend
  [media] smsusb: fix the default delivery system setting
  [media] media: davinci: added module.h to resolve unresolved macros
  [media] [FOR,v3.3] uvcvideo: Avoid division by 0 in timestamp calculation
2012-03-15 17:06:05 -07:00
Jesper Juhl f1ed321944 [media] [trivial] DiB0090: remove redundant '; ' from dib0090_fw_identify()
One semi-colon is enough.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-11 09:40:44 -03:00
Greg Kroah-Hartman 263a5c8e16 Merge 3.3-rc6 into driver-core-next
This was done to resolve a conflict in the drivers/base/cpu.c file.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-09 12:35:53 -08:00
Sander Eikelenboom 632fba4d01 [media] cx25821: Add a card definition for "No brand" cards that have: subvendor = 0x0000 subdevice = 0x0000
Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 12:42:28 -03:00
Javier Martin 0f67a03ff6 [media] media: tvp5150: support g_mbus_fmt callback
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 12:07:14 -03:00
Javier Martin 963ddc63e2 [media] media: tvp5150: Add cropping support
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 12:06:56 -03:00
Paolo Pantò 9d1760059f [media] rtl28xxu: add another Freecom usb id
Besides sticks with the usb id 14AA:0160, there exists also some
with 14AA:0161 - this is the output in /var/log/messages:

usb 1-1: new high-speed USB device number 2 using ehci_hcd
usb 1-1: New USB device found, idVendor=14aa, idProduct=0161
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Freecom DVB-T
usb 1-1: Manufacturer: Freecom DVB-T
usb 1-1: SerialNumber: 00000000000036742

The patch is based on the code at
http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/realtek

Signed-off-by: Paolo Pantò <munix9@googlemail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:26:10 -03:00
Santosh Nayak 3907b01997 [media] Driver: video: Use the macro DMA_BIT_MASK()
Use the macro DMA_BIT_MASK instead of the constant  0xffffffff.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:25:41 -03:00
Gianluca Gennari d138210ffa [media] smsdvb: fix get_frontend
In the get_frontend function, an internal copy of the dtv_frontend_properties
struct (which is never initialized) is copied over the frontend property cache
data structure, resetting everything to 0.
In particular, the delivery system is reset to 0 (which is an invalid value)
so the driver stops working as soon as a DVBv3 application calls the
get_frontend function, giving this error:

dvb_frontend_ioctl_legacy: doesn't know how to handle a DVBv3 call to delivery
system 0

This patch eliminates the unused internal copy of the dtv_frontend_properties
struct, and gives a proper implementation of the get_frontend function.

The original author of the patch is Panagiotis Malakoudis, who also tested
this new version on Ubuntu 11.10 with the latest media_build tree installed.
The original patch has been used on MIPS set-top-boxes for over one year,
but it was never posted on the linux-media list.
I ported the code to the current media_build tree (converting it to use the
dtv_frontend_properties struct) and added basic support for ISDB-T (untested).

Signed-off-by: Panagiotis Malakoudis <malakudi@gmail.com>
Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:20:12 -03:00
James Hogan ec9ee8e2dd [media] media: ir-sony-decoder: 15bit function decode fix
The raw Sony IR decoder decodes 15bit messages slightly incorrectly.
To decode the function number, it shifts the bits right by 7 so that the
function is in bits 7:1, masks with 0xFD (0b11111101), and does an 8 bit
reverse so it ends up in bits 6:0. The mask should be 0xFE to correspond
with bits 7:1 (0b11111110).

The old mask had the effect of dropping the MSB of the function number
from bit 6, and leaving the LSB of the device number in bit 7.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:16:21 -03:00
Ravi Kumar V fd0f6851eb [media] rc: Add support for GPIO based IR Receiver driver
Adds GPIO based IR Receiver driver. It decodes signals using decoders
available in rc framework.

Signed-off-by: Ravi Kumar V <kumarrav@codeaurora.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:14:10 -03:00
Masanari Iida c5f79f6a0c [media] [trivial] davinci: Fix typo in dm355_ccdvc.c
Correct spelling "thresold" to "threshold" in
drivers/media/video/davinci/dm355_ccdc.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:09:29 -03:00
Danny Kukawka b3f5badaa1 [media] cx18-driver: fix handling of 'radio' module parameter
Reverse cx18-driver part of commit
90ab5ee941 and change
module_param_array() type from bool to int to fix
compiler warning:

In function ‘__check_radio’:
113:1: warning: return from incompatible pointer type [enabled by default]
At top level:
113:1: warning: initialization from incompatible pointer type [enabled by default]
113:1: warning: (near initialization for ‘__param_arr_radio.num’) [enabled by default]

v2: corrected version, don't change to module_param_named(), change
    all to int/uint

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:07:45 -03:00
Larry Finger 0d47bf5585 [media] ivtv: Fix build warning
In driver ivtv, there is a mismatch between the type of the radio module
parameter and the storage variable, which leads to the following
warning:

  CC [M]  drivers/media/video/ivtv/ivtv-driver.o
drivers/media/video/ivtv/ivtv-driver.c: In function ‘__check_radio’:
drivers/media/video/ivtv/ivtv-driver.c:142: warning: return from incompatible pointer type
drivers/media/video/ivtv/ivtv-driver.c: At top level:
drivers/media/video/ivtv/ivtv-driver.c:142: warning: initialization from incompatible pointer type

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:05:20 -03:00
Hans Verkuil eb2ba85547 [media] ivtv: simplify how the decoder controls are set up
The code was unnecessarily complex, introducing a hdl_out handler that was
not needed. Instead just add the controls to the cxhdl.hdl handler directly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:03:51 -03:00
Hans Verkuil 072e660257 [media] v4l2-ctrls: v4l2_ctrl_add_handler should add all refs
Currently v4l2_ctrl_add_handler adds only the controls that are owned
by the handler. This is wrong. Instead all controls, whether owned or
not, should be added.

This is also implied by the v4l2-controls.txt documentation and it is
clearly the right thing to do. The only reason this was never noticed
before is because we never did this. Only recent changes in ivtv made
this error visible because there a third handler layer was added (handler
A inherits from handler B which inherits from C, D and E). Without this
change handler A only sees the controls owned by handler B and the controls
from C, D and E are missing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:03:26 -03:00
Kyle Strickland 25fa207157 [media] Add support for KWorld PC150-U ATSC hybrid tuner card
[mchehab@redhat.com: CodingStyle fixes]
Signed-off-by: Kyle Strickland <kyle@kyle.strickland.name>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 11:01:25 -03:00
Andy Shevchenko 8d834b526a [media] media: gspca: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:42:08 -03:00
Andy Shevchenko d377cfcc42 [media] media: ivtv: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:42:03 -03:00
Andy Shevchenko 30fc78bad1 [media] media: saa7164: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:41:57 -03:00
Andy Shevchenko f0d81f728e [media] media: saa7134: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:41:52 -03:00
Andy Shevchenko 6797e7ad9c [media] media: dvb: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:41:22 -03:00
Andy Shevchenko 0b1876b288 [media] media: tuners: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
  cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:41:15 -03:00
Andy Shevchenko d94a2c0341 [media] media: video: append $(srctree) to -I parameters
Without this we have got the warnings like following if build with "make W=1
O=/var/tmp":
   CHECK   drivers/media/video/videobuf-vmalloc.c
   CC [M]  drivers/media/video/videobuf-vmalloc.o
 +cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]
 +cc1: warning: drivers/media/dvb/frontends: No such file or directory [enabled by default]
 +cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default]
 +cc1: warning: drivers/media/dvb/frontends: No such file or directory [enabled by default]
   LD      drivers/media/built-in.o

Some details could be found in [1] as well.

[1] http://comments.gmane.org/gmane.linux.kbuild.devel/7733

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:40:51 -03:00
Dan Carpenter 3b2a63061e [media] s2255drv: fix some endian bugs
I don't have this hardware and I don't know the subsystem very well.  So
please review this patch carefully.  The original code definitely looks
buggy though.

Sparse complains about some endian bugs where little endian bugs are
treated as cpu endian.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:39:56 -03:00
Dan Carpenter 6c61ac6355 [media] s2255drv: cleanup vidioc_enum_fmt_cap()
"f" wasn't checked consistently, so static checkers complain.  This
function is always called with a valid "f" pointer, so I have removed
the check.

Also the indenting was messed up.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:39:56 -03:00
Danny Kukawka da0af4788c [media] mt9p031.c included media/v4l2-subdev.h twice
drivers/media/video/mt9p031.c included 'media/v4l2-subdev.h' twice,
remove the duplicate.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:39:55 -03:00
Danny Kukawka cf51674000 [media] adp1653: included linux/module.h twice
drivers/media/video/adp1653.c included 'linux/module.h' twice,
remove the duplicate.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:39:54 -03:00
James Hogan df1caa587a [media] rc/ir-raw: use kfifo_rec_ptr_1 instead of kfifo
Raw IR events are passed to the raw event thread through a kfifo. The
size of the event struct is 12 bytes, and space for 512 events is
reserved in the kfifo (6144 bytes), however this is rounded down to 4096
bytes (the next power of 2) by __kfifo_alloc().

4096 bytes is not divisible by 12 therefore if the fifo fills up a third
of a record will be written in the end of the kfifo by
ir_raw_event_store() because the recsize of the fifo is 0 (it doesn't
have records). When this is read by ir_raw_event_thread() a corrupted or
partial record will be read, and in the case of a partial record the
BUG_ON(retval != sizeof(ev)) gets hit too.

According to samples/kfifo/record-example.c struct kfifo_rec_ptr_1 can
handle records of a length between 0 and 255 bytes, so change struct
ir_raw_event_ctrl to use that instead of struct kfifo.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:39:53 -03:00
Javier Martin 750a6dff6e [media] media: i.MX27 camera: Add resizing support
If the attached video sensor cannot provide the
requested image size, try to use resizing engine
included in the eMMa-PrP IP.

This patch supports both averaging and bilinear
algorithms.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:06:44 -03:00
Fabio Estevam e9de6167fb [media] media: video: mx2_camera.c: Remove unneeded dev_dbg
csi clock frequency is already shown by:

dev_info(&pdev->dev, "MX2 Camera (CSI) driver probed, clock frequency: %ld\n",
		clk_get_rate(pcdev->clk_csi));

,so no need to have the dev_dbg call to present the same information.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:05:51 -03:00
Fabio Estevam d867be1cc4 [media] media: video: mx2_camera.c: Provide error message if clk_get fails
Provide error message if clk_get fails.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:04:39 -03:00
Javier Martin 560fab62fa [media] media: i.MX27 camera: more efficient discard buffer handling
Some elements of 'mx2_buffer' are grouped together in another
auxiliary structure. This way we don't need to have unused
'vb2_buffer' structures for both discard buffers.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 10:04:10 -03:00
Javier Martin 8886a881e2 [media] media: i.MX27 camera: fix compilation warning
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:46:55 -03:00
Javier Martin 665ad8af8f [media] media: i.MX27 camera: return IRQ_NONE if no IRQ status bit is set
If active_bufs() list is empty and no IRQ status bit is set
we are probably dealing with a share IRQ. Return IRQ_NONE in
this case.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:45:06 -03:00
Javier Martin 8636ead8b2 [media] media: i.MX27 camera: Use spin_lock() inside the IRQ handler
We don't need to use spin_lock_irqsave() since there are not
any other IRQs that can race with this ISR.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:44:00 -03:00
Javier Martin a654ba16fd [media] media: i.MX27 camera: Use list_first_entry() whenever possible
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: fix one list_first_entry() instance]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:43:03 -03:00
Javier Martin d84279e6d7 [media] media i.MX27 camera: handle overflows properly
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:42:31 -03:00
Javier Martin cdc9d6f191 [media] media i.MX27 camera: improve discard buffer handling
The way discard buffer was previously handled lead
to possible races that made a buffer that was not
yet ready to be overwritten by new video data. This
is easily detected at 25fps just adding "#define DEBUG"
to enable the "memset" check and seeing how the image
is corrupted.

A new "discard" queue and two discard buffers have
been added to make them flow trough the pipeline
of queues and thus provide suitable event ordering.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:41:56 -03:00
Javier Martin fb51cbdd3e [media] media i.MX27 camera: add start_stream and stop_stream callbacks
Add "start_stream" and "stop_stream" callback in order to enable
and disable the eMMa-PrP properly and save CPU usage avoiding
IRQs when the device is not streaming. This also makes the driver
return 0 as the sequence number of the first frame.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: remove the mx27_camera_emma() macro]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:40:45 -03:00
Javier Martin c6a41e3271 [media] media i.MX27 camera: migrate driver to videobuf2
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:37:52 -03:00
Sascha Hauer 2c9ba37d7a [media] V4L: mx2_camera: remove unsupported i.MX27 DMA mode, make EMMA mandatory
The i.MX27 DMA support was introduced with the initial commit of this
driver and originally created by me. However, I never got this stable
due to the racy DMA engine and used the EMMA engine instead. As the DMA
support is most probably unused and broken in its current state, remove
it. EMMA becomes the only supported mode on i.MX27.

This also helps us get rid of another user of the legacy i.MX DMA
support and remove the dependency on ARCH_MX* macros as these are
scheduled for removal.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[g.liakhovetski@gmx.de: remove unused goto]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:37:21 -03:00
Xi Wang 34817174fc [media] lgdt330x: fix signedness error in i2c_read_demod_bytes()
The error handling in lgdt3303_read_status() and lgdt330x_read_ucblocks()
doesn't work, because i2c_read_demod_bytes() returns a u8 and (err < 0)
is always false.

        err = i2c_read_demod_bytes(state, 0x58, buf, 1);
        if (err < 0)
                return err;

Change the return type of i2c_read_demod_bytes() to int.  Also change
the return value on error to -EIO to make (err < 0) work.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:01:12 -03:00
Masanari Iida bdb2c41fc1 [media] [trivial]: Fix typo in radio-sf16fmr2.c
Correct spelling "contrls" to "controls" in
drivers/media/radio/radio-sf16fmr2.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 09:00:30 -03:00
Gianluca Gennari 86d38d1e0e [media] em28xx: pre-allocate DVB isoc transfer buffers
On MIPS/ARM set-top-boxes, as well as old x86 PCs, memory allocation failures
in the em28xx driver are common, due to memory fragmentation over time, that
makes impossible to allocate large chunks of coherent memory.
A typical system with 256/512 MB of RAM fails after just 1 day of uptime (see
the old thread for detailed reports and crashlogs).

In fact, the em28xx driver allocates memory for USB isoc transfers at runtime,
as opposite to the dvb-usb drivers that allocates the USB buffers when the
device is initialized, and frees them when the device is disconnected.

Moreover, in digital mode the USB isoc transfer buffers are freed, allocated
and cleared every time the user selects a new channel, wasting time and
resources.

This patch solves both problems by allocating DVB isoc transfer buffers in
em28xx_usb_probe(), and freeing them in em28xx_usb_disconnect().
In fact, the buffers size and number depend only on the max USB packet size
that is parsed from the USB descriptors in em28xx_usb_probe(), so it can
never change for a given device.

This approach makes no sense in analog mode (as the buffer size depends on
the alternate mode selected at runtime), the patch creates two separate sets
of buffers for digital and analog modes.

For digital-only devices, USB buffers are created when the device is probed
and freed when the device is disconnected.
For analog-only devices, nothing changes: isoc buffers are created at runtime.
For hybrid devices, two sets of buffers are maintained: the digital-mode
buffers are created when the device is probed, and freed when the device is
disconnected; analog-mode buffers are created/destroyed at runtime as before.
So, in analog mode, digital and analog buffers coexists at the same time: this
can be justified by the fact that digital mode is by far more commonly used
nowadays, so it makes sense to optimize the driver for this use case scenario.

The patch has been tested in the last few days on a x86 PC and a MIPS
set-top-box, with the PCTV 290e (digital only) and the Terratec Hybrid XS
(hybrid device). With the latter, I switched several times between analog and
digital mode (Kaffeine/TvTime) with no issue at all.
I unplugged/plugged the devices several times with no problem.
Also, after over 3 days of normal usage in the MPIS set-top-box, the PCTV 290e
was still up and running.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:57:44 -03:00
Jean Delvare 06302ffbb4 [media] cx22702: Fix signal strength
The signal strength value returned is not quite correct, it decreases
when I increase the gain of my antenna, and vice versa. It also
doesn't span over the whole 0x0000-0xffff range. Compute a value which
at least increases when signal strength increases, and spans the whole
allowed range.

In practice I get 67% with my antenna fully amplified and 51% with
no amplification. This is close enough to what I get on my other
DVB-T adapter with the same antenna.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:54:42 -03:00
Malcolm Priestley 6c5637e4ed [media] it913x-fe ver 1.15 read signal strenght using reg VAR_P_INBAND
Read signal strength using VAR_P_INBAND and apply FEC preferred values.

Note this does not work on IT9137 devices even with dvb-usb-it9135-01.fw
firmware.

Config read_sl allows switch between read signal strength and signal
level.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:53:39 -03:00
Malcolm Priestley aaa589fc5e [media] it913x ver 1.27 Allow PID 8192 to turn PID filter off
Allow PID 8192 to turn PID filter off in USB high speed.

The PID number is still written to the PID index and will only
turn on again if that index is set to 0.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:52:56 -03:00
Malcolm Priestley 46f3da990b [media] it913x ver 1.26 change to remove interruptible mutex locks
Some virtual I2C commands are missed along some PID filtering
commands resulting complete stall of driver.

Since dvb-usb cannot handle the -EAGAIN error and commands
generally should not be missed mutex_lock is used instead.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:52:25 -03:00
Axel Lin c6e8d86fff [media] convert drivers/media/* to use module_i2c_driver()
This patch converts the drivers in drivers/media/* to use the
module_i2_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Heungjun Kim <riverful.kim@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Andrew Chew <achew@nvidia.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Johannes Obermaier <johannes.obermaier@gmail.com>
Cc: Steven Toth <stoth@kernellabs.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:48:01 -03:00
Jean-François Moine a2d2b25ce6 [media] gspca - zc3xx: Set the exposure at start of hv7131r
The exposure was not set when autogain was set.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:05:13 -03:00
Jean-François Moine 6028c32684 [media] gspca - zc3xx: Fix bad sensor values when changing autogain
The setexposure added in commit 590f216806 works only for the sensor hv7131r,
but it is called for all sensors when changing the autogain.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:04:46 -03:00
Jean-François Moine 0b74e2c460 [media] gspca - zc3xx: Cleanup source
- copyright change
- use the kbuild module name for messages
- remove useless comments

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:04:02 -03:00
Jean-François Moine 1b3b21206b [media] gspca - zc3xx: Remove the low level traces
The low level traces are better done by usbmon.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:03:38 -03:00
Jean-François Moine f1801904ee [media] gspca - zc3xx: Do automatic transfer control for hv7131r and pas202b
The bridge register 11 reports the current transfer status.
This value is used to know about a possible overflow and to adjust
the transfer parameters (registers 07 and 08).

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:03:18 -03:00
Jean-François Moine 30c73d464a [media] gspca - zc3xx: Adjust the JPEG decompression tables
As the bridge register 08 defines the JPEG compression quality,
it must be changed on JPEG quality change and also, the decompression
tables must be adjusted when the register varies.

[mchehab@redhat.com: replace a // comment by a /* */ one]
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:01:48 -03:00
Jean-François Moine a7705c093d [media] gspca - sonixj: Add exposure, gain and auto exposure for po2030n
The auto gain uses the knee algorithm.
Adding the setexposure control function forced to:
- rename of the previous function setexposure
- add a specific auto setting function

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:00:38 -03:00
Jean-François Moine 323bdcf235 [media] gspca - sonixj: Remove the jpeg control
The get_jcomp control is rarely used and its main information,
the JPEG quality, may be found in the images.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 08:00:13 -03:00
Jean-François Moine ac399cd313 [media] gspca - pac7302: Do autogain setting work
The autogain was always active.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08 07:59:34 -03:00