Граф коммитов

142 Коммитов

Автор SHA1 Сообщение Дата
Gianluca Gennari a908eb9936 [media] rtl28xxu: fix buffer overflow when probing Rafael Micro r820t tuner
As suggested by Antti, this patch replaces:
https://patchwork.kernel.org/patch/2649861/
The buffer overflow is fixed by reading only the r820t ID register.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-17 15:25:34 -03:00
Mauro Carvalho Chehab cfc3d6c444 Merge branch 'topic/r820t' into patchwork
* topic/r820t: (31 commits)
  [media] r820t: Don't divide the IF by two
  [media] r820t: disable auto gain/VGA setting
  [media] rtl2832: Fix IF calculus
  [media] r820t: put it into automatic gain mode
  [media] r820t: Fix hp_cor filter mask
  [media] r820t: fix PLL calculus
  [media] r820t: Don't put it in standby if not initialized yet
  [media] r820t: avoid rewrite all regs when not needed
  [media] r820t: Allow disabling IMR callibration
  [media] r820t: add a commented code for GPIO
  [media] r820t: add IMR calibrate code
  [media] r820t: proper initialize the PLL register
  [media] r820t: use usleep_range()
  [media] r820t: fix prefix of the r820t_read() function
  [media] r820t: split the function that read cached regs
  [media] r820t: better report signal strength
  [media] r820t: add support for diplexer
  [media] r820t: Show the read data in the bit-reversed order
  [media] r820t: use the second table for 7MHz
  [media] r820t: Invert bits for read ops
  ...
2013-04-25 10:26:21 -03:00
Geert Uytterhoeven 542b329f8e [media] anysee: Grammar s/report the/report to/
[mchehab@redhat.com: Fix a merge conflict]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-25 09:56:55 -03:00
Geert Uytterhoeven ecb52ab821 [media] anysee: Initialize ret = 0 in anysee_frontend_attach()
drivers/media/usb/dvb-usb-v2/anysee.c: In function ‘anysee_frontend_attach’:
drivers/media/usb/dvb-usb-v2/anysee.c:641: warning: ‘ret’ may be used uninitialized in this function
And gcc is right (see the ANYSEE_HW_507T case), so initialize ret to zero
to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-25 09:55:16 -03:00
Mauro Carvalho Chehab 9e30edd890 [media] rtl28xxu: use r820t to obtain the signal strength
Now that we can get the strength from r820t, use it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:23:01 -03:00
Mauro Carvalho Chehab 6889ab2a25 [media] rtl28xxu: add support for Rafael Micro r820t
This tuner is used on some rtl2882 dongles. Add it to the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Tested-by: Antti Palosaari <crope@iki.fi>
2013-04-16 21:19:10 -03:00
Mauro Carvalho Chehab 99ca5557ff [media] it913x: rename its tuner driver to tuner_it913x
There are three drivers with *it913x name on it, and they all
belong to the same device:
	a tuner, at it913x.c;
	a frontend: it913x-fe.c;
	a bridge: it913x.c, renamed to dvb_usb_it913x by the
building system.

This is confusing. Even more confusing are the two .c files with
the same name under different directories, with different contents
and different functions. So, prepend the tuner one.

This also breaks the out-of-tree compilation system.

Reported-by: Frederic Fays <frederic.fays@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16 20:06:05 -03:00
Hans Verkuil 79a63c60a6 [media] media: move dvb-usb-v2/cypress_firmware.c to media/common
Loading the cypress firmware is not dvb specific and should be common
functionality. Move the source to media/common and make it a standalone
module.
As a result we can remove the dependency on dvb-usb in go7007, which has
nothing to do with dvb.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 11:35:06 -03:00
Wei Yongjun 0170a39b69 [media] af9035: fix missing unlock on error in af9035_ctrl_msg()
Add the missing unlock before return from function af9035_ctrl_msg()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26 08:37:45 -03:00
Jose Alberto Reguero 78c7bc4bd2 [media] [PATH] enable dual tuner to Avermedia Twinstar in af9035 driver
This patch enable dual tuner for Avermedia Twinstar.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:06:20 -03:00
Antti Palosaari b09e71a8de [media] it913x: fix pid filter
I just made commit: "dvb_usb_v2: rework USB streaming logic" that
breaks that driver PID filter.
it913x driver checks use of PID filter directly from DVB USB v2 core
internal variable "adap->pid_filtering" and stores it to own state.
Calling order of .pid_filter_ctrl() and .pid_filter() was changed
and due to that state was updated too late. Update state earlier.
TODO: checking PID filter usage from DVB USB v2 is not very good idea
as PID filter callbacks are called only when PID filter is enabled.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:02:41 -03:00
Antti Palosaari 96d7ca5ec9 [media] dvb_usb_v2: rework USB streaming logic
Control flow order changed a little bit. HW PID filter is now
disabled also when streaming is stopped - earlier it was just
set only when streaming was started.
Control flow is now:
* set streaming status bit
* submit USB streaming packets
* enable HW PID filter
* ask device to start streaming
* N x add PID to device HW PID filter
... streaming video ...
* N x remove PID from device HW PID filter
* ask device to stop streaming
* disable HW PID filter
* kill USB streaming packets
* clear streaming status bit

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:02:04 -03:00
Antti Palosaari 61356eea67 [media] cypress_firmware: make checkpatch.pl happy
New checkpatch version likes to see strings not to split multiple
lines even those are exceeding 80 line length.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:00:23 -03:00
Antti Palosaari 6d7cfec413 [media] dvb_usb_v2: make checkpatch.pl happy
New checkpatch version likes to see strings not to split multiple
lines even those are exceeding 80 line length.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:59:56 -03:00
Antti Palosaari bdecbe43e3 [media] dvb_usb_v2: replace Kernel userspace lock with wait queue
There was sync mutex which was held over userspace. That is very
wrong and could cause deadlock if different userspace process is
used to "unlock". Wait queue seems to be correct solution for
that kind of synchronizing issue so use it instead.
lock debug gives following bug report:
================================================
[ BUG: lock held when returning to user space! ]
3.9.0-rc1+ #38 Tainted: G           O
------------------------------------------------
tzap/4614 is leaving the kernel with locks still held!
1 lock held by tzap/4614:

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:58:49 -03:00
Mauro Carvalho Chehab 028c70ff42 [media] dvb-usb/dvb-usb-v2: use IS_ENABLED
Instead of checking everywhere there for 3 symbols, use instead
IS_ENABLED macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:33:30 -03:00
Wei Yongjun 13828c61e9 [media] dvb_usb_v2: make local function dvb_usb_v2_generic_io() static
dvb_usb_v2_generic_io() was not declared. It should be static.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 13:50:12 -03:00
Antti Palosaari 75cd5886ed [media] af9035: style changes for remote controller polling
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:06:31 -03:00
Antti Palosaari 1bfd5294dd [media] af9035: check I/O errors on IR polling
Use more careful error checks.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:06:13 -03:00
Antti Palosaari 70375ecc45 [media] af9035: change dual mode boolean to bit field
For some reason there seems to be value	0x03 in eeprom for dual mode
(and 0x00 for single mode). Boolean is not always 1 bit wide - it
could be 8 bit wide too. Storing number 0x03 to boolean causes driver
to thing there is 4 tuners in some cases :o
Add also some comments regarding to eeprom.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:58 -03:00
Antti Palosaari 1c72fe2679 [media] af9035: enable remote controller for IT9135 too
There is no difference towards AF9035 remote controller, so enable it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:28 -03:00
Antti Palosaari ab56ad6ada [media] af9035: set demod TS mode config in read_config()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:14 -03:00
Antti Palosaari 431a6d4ab9 [media] af9035: use already detected eeprom base addr
eeprom memory mapped base address is detected at the very first.
Use it everywhere.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:00 -03:00
Antti Palosaari 8229da5064 [media] af9035: select firmware loader according to firmware
AF9035 and IT9135 supports two different firmware format. Select
correct loader according to first byte of firmware file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:00:38 -03:00
Antti Palosaari 44af747f4e [media] it913x: get rid of it913x config struct
We don't need it. Tuner ID and device address are enough.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:58:46 -03:00
Antti Palosaari df8f1be14f [media] af9035: IT9135 dual tuner related changes
Now it supports IT9135 based dual tuner devices.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:56:42 -03:00
Antti Palosaari bc3c9e10fc [media] af9035: basic support for IT9135 v2 chips
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:55:13 -03:00
Antti Palosaari 9ea3681db4 [media] af9035: merge af9035 and it9135 eeprom read routines
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:51:31 -03:00
Antti Palosaari bada342e08 [media] af9035: USB1.1 support (== PID filters)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:50:53 -03:00
Antti Palosaari a7816b7667 [media] af9035: constify clock tables
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:41 -03:00
Antti Palosaari b799b8102b [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC (rev. 2)
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:20 -03:00
Antti Palosaari e8c7aab50d [media] af9015: reject device TerraTec Cinergy T Stick Dual RC (rev. 2)
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:02 -03:00
Antti Palosaari 0d94d6a04b [media] af9035: fix af9033 demod sampling frequency
ADC needs to be also multiplied to 2 as it9135.
Fixes bug I introduced few commits ago.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:48:16 -03:00
Antti Palosaari 74c1883a56 [media] af9035: add auto configuration heuristic for it9135
Detect automatically multiple chip versions and select configuration
according to that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:47:55 -03:00
Antti Palosaari ac77fb0f0c [media] af9035: add support for 1st gen it9135
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:47:19 -03:00
Syam Sidhardhan 72873e51c5 [media] lmedm04: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:19:29 -03:00
Antti Palosaari 4458a54c5e [media] anysee: coding style changes
I did what I liked to do. Also corrected two long log writings
as checkpatch.pl was complaining about those.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:54:57 -03:00
Antti Palosaari 6c604e8e86 [media] anysee: do not use buffers from stack for usb_bulk_msg()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:54:26 -03:00
Antti Palosaari 3484d37a66 [media] af9035: do not use buffers from stack for usb_bulk_msg()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:53:33 -03:00
Antti Palosaari aff8c2d475 [media] af9015: do not use buffers from stack for usb_bulk_msg()
WARNING: at lib/dma-debug.c:947 check_for_stack+0xa7/0xf0()
ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack

Reported-by: poma <pomidorabelisima@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:51:17 -03:00
Antti Palosaari acb0549acc [media] dvb_usb_v2: locked versions of USB bulk IO functions
Implement:
dvb_usbv2_generic_rw_locked()
dvb_usbv2_generic_write_locked()
Caller must hold device lock when locked versions are called.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:43:15 -03:00
Syam Sidhardhan 06f950f43f [media] lmedm04: Fix possible NULL pointer dereference
Check for (adap == NULL) has to done before accessing adap.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:34:15 -03:00
Fabrizio Gazzato d9b7595bed [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2)
This patch adds USB ID for alternative "Terratec Cinergy T Stick".
Tested by a friend: works similarly to 0ccd:0093 version (af9035+tua9001)

Signed-off-by: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:24:03 -03:00
Fabrizio Gazzato e6a60d768b [media] rtl28xxu: Add USB ID for MaxMedia HU394-T
Add USB ID for MaxMedia HU394-T USB DVB-T Multi (FM, DAB, DAB+)
dongle (RTL2832U+FC0012)

In Italy, is branded as "DIKOM USB-DVBT HD"
lsusb:	ID 1b80:d394 Afatech

Signed-off-by: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 17:02:54 -03:00
Linus Torvalds 21fbd5809a Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:

 - Some cleanups at V4L2 documentation

 - new drivers: ts2020 frontend, ov9650 sensor, s5c73m3 sensor,
   sh-mobile veu mem2mem driver, radio-ma901, davinci_vpfe staging
   driver

 - Lots of missing MAINTAINERS entries added

 - several em28xx driver improvements, including its conversion to
   videobuf2

 - several fixups on drivers to make them to better comply with the API

 - DVB core: add support for DVBv5 stats, allowing the implementation of
   statistics for new standards like ISDB

 - mb86a20s: add statistics to the driver

 - lots of new board additions, cleanups, and driver improvements.

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (596 commits)
  [media] media: Add 0x3009 USB PID to ttusb2 driver (fixed diff)
  [media] rtl28xxu: Add USB IDs for Compro VideoMate U620F
  [media] em28xx: add usb id for terratec h5 rev. 3
  [media] media: rc: gpio-ir-recv: add support for device tree parsing
  [media] mceusb: move check earlier to make smatch happy
  [media] radio-si470x doc: add info about v4l2-ctl and sox+alsa
  [media] staging: media: Remove unnecessary OOM messages
  [media] sh_vou: Use vou_dev instead of vou_file wherever possible
  [media] sh_vou: Use video_drvdata()
  [media] drivers/media/platform/soc_camera/pxa_camera.c: use devm_ functions
  [media] mt9t112: mt9t111 format set up differs from mt9t112
  [media] sh-mobile-ceu-camera: fix SHARPNESS control default
  Revert "[media] fc0011: Return early, if the frequency is already tuned"
  [media] cx18/ivtv: fix regression: remove __init from a non-init function
  [media] em28xx: fix analog streaming with USB bulk transfers
  [media] stv0900: remove unnecessary null pointer check
  [media] fc0011: Return early, if the frequency is already tuned
  [media] fc0011: Add some sanity checks and cleanups
  [media] fc0011: Fix xin value clamping
  Revert "[media] [PATH,1/2] mxl5007 move reset to attach"
  ...
2013-02-24 17:35:10 -08:00
Alistair Buxton b9e2afff1e [media] rtl28xxu: Add USB IDs for Compro VideoMate U620F
Signed-off-by: Alistair Buxton <a.j.buxton@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-13 17:58:54 -02:00
Eddi De Pieri 09f9408dc3 [media] Support Digivox Mini HD (rtl2832)
Add support for Digivox Mini HD (rtl2832)
The tuner works, but with worst performance then realtek linux driver,
due to incomplete implementation of fc2580.c

Signed-off-by: Eddi De Pieri <eddi@depieri.net>
Tested-by: Lorenzo Dongarrà <lorenzo_64@katamail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06 08:16:08 -02:00
Kees Cook e141a48185 drivers/media: remove depends on CONFIG_EXPERIMENTAL
The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
while now and is almost always enabled by default. As agreed during the
Linux kernel summit, remove it from any "depends on" lines in Kconfigs.

CC: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21 14:52:44 -08:00
Antti Palosaari 9db15638e1 [media] rtl28xxu: correct some device names
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-06 10:26:31 -02:00
Alexander Inyukhin 78a5e70919 [media] rtl28xxu: add Gigabyte U7300 DVB-T Dongle
Device with ID 1b80:d393 is the Gigabyte U7300 DVB-T dongle.
It contains decoder Realtek RTL2832U and tuner Fitipower FC0012.

[crope@iki.fi: fix trivial merge conflict]
Signed-off-by: Alexander Inyukhin <shurick@sectorb.msk.ru>
Signed-off-by: Antti Palosaari <crope@iki.fi>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-06 10:26:15 -02:00