Commit graph

703 commits

Author SHA1 Message Date
Mauro Carvalho Chehab e32b31ae45 [media] mb86a20s: remove unused debug modprobe parameter
The debug parameter is not used anymore, as this module was
converted already to use dev_dbg().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-26 10:08:29 -02:00
Jurgen Kramer 551c33e729 [media] Si2168: increase timeout to fix firmware loading
Increase si2168 cmd execute timeout to prevent firmware load failures. Tests
shows it takes up to 52ms to load the 'dvb-demod-si2168-a30-01.fw' firmware.
Increase timeout to a safe value of 70ms.

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-26 08:23:45 -02:00
Benjamin Larsson d2fb785227 [media] mn88472: calculate the IF register values
Add xtal as a configuration parameter so it can be used
in the IF register value calculation.

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 14:46:02 -02:00
Hans Verkuil 50fd5e8c1e [media] hd29l2: fix sparse error and warnings
drivers/media/dvb-frontends/hd29l2.c:29:18: warning: Variable length array is used.
drivers/media/dvb-frontends/hd29l2.c:34:32: error: cannot size expression
drivers/media/dvb-frontends/hd29l2.c:125:5: warning: symbol 'hd29l2_rd_reg_mask' was not declared. Should it be static?

Variable length arrays are frowned upon, so replace with a fixed length and check
that there won't be a buffer overrun.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23 10:42:51 -02:00
Hans Verkuil 215cedec37 [media] media: remove emacs editor variables
1) This is not allowed by the kernel coding style
2) Just configure your editor correctly
3) It's really ugly

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-22 17:52:20 -02:00
Mauro Carvalho Chehab ffe300107d [media] stv090x: add an extra protetion against buffer overflow
As pointed by smatch:
	drivers/media/dvb-frontends/stv090x.c:2787 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
	drivers/media/dvb-frontends/stv090x.c:2789 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
	drivers/media/dvb-frontends/stv090x.c:2791 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
	drivers/media/dvb-frontends/stv090x.c:2793 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
	drivers/media/dvb-frontends/stv090x.c:2795 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13

The situation of a buffer overflow won't happen, in practice,
with the current values of car_loop table. Yet, the entire logic
that checks for those registration values is too complex. So,
better to add an explicit check, just in case someone changes
the car_loop tables causing a buffer overflow by mistake.

This also helps to remove several smatch warnings, with is good.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 15:28:46 -02:00
Mauro Carvalho Chehab b769ef69d0 [media] stv090x: Remove an unreachable code
if STV090x_RANGEOK is not returned, then STV090x_OUTOFRANGE
is returned. However, that part of the code is never reached,
as pointed by smatch:

	drivers/media/dvb-frontends/stv090x.c:2673 stv090x_get_sig_params() info: ignoring unreachable code.

So, remove the two uneeded elses, with makes the code a little bit
cleaner.

No functional changes, and one less smatch warning.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 15:28:41 -02:00
Mauro Carvalho Chehab 09e59098bb [media] stv090x: Some whitespace cleanups
While writing changeset fdf1bc9fa2, I noticed some checkpatch
complains about the CodingStyle for function parameters. So,
clean them.

While here, also removes uneeded "extern" from function prototype.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 14:19:49 -02:00
Olli Salonen 1b97dc98b5 [media] si2168: add support for firmware files in new format
This patch adds support for new type of firmware versions of Si2168 chip.

Old type: n x 8 bytes (all data, first byte seems to be 04 or 05)
New type: n x 17 bytes (1 byte indicates len and max 16 bytes data)

New version of TechnoTrend CT2-4400 drivers
(http://www.tt-downloads.de/bda-treiber_4.3.0.0.zip) contains newer
firmware for Si2168-B40 that is in the new format. It can be extracted
with the following command:

dd if=ttTVStick4400_64.sys ibs=1 skip=323872 count=6919 of=dvb-demod-si2168-b40-01.fw

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 14:00:01 -02:00
Olli Salonen a594cf21aa [media] si2168: debug printout for firmware version
A debug printout for firmware version.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 13:59:04 -02:00
Geert Uytterhoeven 510cb39c4f [media] cx24117: Grammar s/if ... if/if ... is/
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 13:57:24 -02:00
Mauro Carvalho Chehab a2ea556117 [media] stv090x: remove export symbol for stv090x_set_gpio()
Drivers that use dvb_attach can have just one exported symbol,
or they will cause compilation breakages depending on the
selected frontends.

As Jim reported:
drivers/built-in.o: In function `technisat_usb2_set_voltage':
technisat-usb2.c:(.text+0x3b4919): undefined reference to `stv090x_set_gpio'
make: *** [vmlinux] Error 1

That happens because, on his configuration, the configuration
is:

	CONFIG_DVB_USB=y
	CONFIG_DVB_STV090x=m

Luis proposed ar way to fix, but that would just force the
STV090x to be selected, even if one wants to use a device
with a different frontend.

Instead, let's do the right thing: move set_gpio to the
configuration structure and fill it during dvb_attach().

This way, the driver can still call it, and dvb_attach()
will load stv090x module only if the device really needs it.

Reported by: Jim Davis <jim.epost@gmail.com>

Cc: Luis Rodriguez <mcgrof@suse.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 13:52:45 -02:00
Antti Palosaari 2281c8244b [media] rtl2832_sdr: control ADC
Recent rtl28xxu patch I made moved demod ADC enable from power control
to frontend control (due to slave demod support). Because of that we
need call USB interface frontend control too in order to enable ADC.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04 12:42:46 -02:00
Markus Elfring 034e1ec0ce [media] si2168: One function call less in si2168_init() after error detection
GIT_AUTHOR_DATE=1416472767
The release_firmware() function was called in some cases by the
si2168_init() function during error handling even if the passed variable
contained still a null pointer. This implementation detail could be improved
by the introduction of another jump label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25 12:12:01 -02:00
Markus Elfring 5ed0cf8800 [media] m88ds3103: One function call less in m88ds3103_init() after error detection
GIT_AUTHOR_DATE=1416472158
The release_firmware() function was called in some cases by the
m88ds3103_init() function during error handling even if the passed variable
contained still a null pointer. This implementation detail could be improved
by the introduction of another jump label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25 12:07:33 -02:00
Markus Elfring 9bc2dd7ec0 [media] DVB-frontends: Deletion of unnecessary checks before the function call "release_firmware"
GIT_AUTHOR_DATE=1416472432
The release_firmware() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25 09:52:44 -02:00
CrazyCat 52791979e9 [media] si2168: TS clock inversion control
TS clock polarity control implemented.

[Antti: Resolved simple conflict]

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25 09:14:41 -02:00
Antti Palosaari fe37b38bbb [media] rtl2832: implement option to bypass slave demod TS
Implement partial PIP mode to carry TS from slave demodulator,
through that master demodulator. RTL2832 demod has TS input
interface to connected another demodulator TS output.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-21 16:03:39 -02:00
Antti Palosaari 4f80d85881 [media] mn88473: move to staging
It is not ready enough to be released on mainline.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:26:05 -02:00
Antti Palosaari 97de6e89d8 [media] mn88473: convert to RegMap API
Convert driver to I2C RegMap API. That offers unified register
access routines, register value caching and more.

We need 3 register maps, one for each register page, as chips has
3 I2C address.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:25:45 -02:00
Antti Palosaari 01b4be1452 [media] mn88473: convert driver to I2C binding
Driver was using DVB proprietary binding model. As it is I2C
device, we could change it to normal kernel I2C driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:25:18 -02:00
Antti Palosaari df810e8a97 [media] mn88473: improve IF frequency and BW handling
Separate IF and BW based registers.
Add support for DVB-T and DVB-T2 6MHz channel bandwidth.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:25:03 -02:00
Antti Palosaari 6ebbe22d42 [media] mn88473: implement DVB-T mode
Implement DVB-T mode.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:24:22 -02:00
Antti Palosaari c00a6b9f9f [media] mn88473: add support for DVB-T2
Add support for DVB-T2.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:24:04 -02:00
Antti Palosaari dadb5bb473 [media] mn88473: Panasonic MN88473 DVB-T/T2/C demod driver
Only DVB-C is implemented.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:23:35 -02:00
Antti Palosaari c867b265b1 [media] mn88472: move to staging
It is not ready enough to be released on mainline.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:22:34 -02:00
Antti Palosaari 5048907076 [media] mn88472: implement DVB-T and DVB-T2
Implement initial support for DVB-T and DVB-T2 modes. Now driver has
basic support for all the modes, DVB-C/T/T2.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:22:11 -02:00
Antti Palosaari c1011fb818 [media] mn88472: Convert driver to I2C RegMap API
Convert driver to I2C RegMap API.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:21:45 -02:00
Antti Palosaari 528af1952e [media] mn88472: convert driver to I2C client
It uses I2C bus so better to implement it as a standard I2C driver
model. It was using proprietary DVB binding.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:21:04 -02:00
Antti Palosaari 0186e434a7 [media] mn88472: rename state to dev
Rename state to dev.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:20:29 -02:00
Antti Palosaari 5ef1ad351c [media] mn88472: rename mn88472_c.c => mn88472.c
Original plan was to implement driver as one file per used demod
standard (mn88472_c.c, mn88472_t.c and mn88472_t2.c). However, that
plan was a mistake as driver code differences are so small between
different standards. Due to that rename this file and implement all
the needed functionality to that file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:19:42 -02:00
Antti Palosaari 8e0d8572be [media] mn88472: add small delay to wait DVB-C lock
400ms delay seems to be enough in order to gain DVB-C lock.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:19:12 -02:00
Antti Palosaari 64796a5288 [media] mn88472: correct attach symbol name
Wrong symbol name causes demod attach failure.

Reported-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:18:46 -02:00
Antti Palosaari ca25cb54ac [media] mn88472: Panasonic MN88472 demod driver (DVB-C only)
Only DVB-C mode is supported, DVB-T and DVB-T2 are not supported.
Very much feature reduced version, no signal statistics nor normal
chip configuration options.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-14 17:18:19 -02:00
nibble.max b685141940 [media] m88ds3103: change ts clock config for serial mode
1> When m88ds3103 works in serial ts mode, its serial ts clock is equal to ts master clock and the clock divider is bypassed.
2> The serial ts clock is configed by the bridge driver just like parallel ts clock.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11 09:21:11 -02:00
Mauro Carvalho Chehab 47a09af68b Merge tag 'v3.18-rc4' into patchwork
Needed due to some important regression fixes at RC core.

* commit 'v3.18-rc4': (587 commits)
  Linux 3.18-rc4
  ARM: dts: zynq: Enable PL clocks for Parallella
  tiny: rename ENABLE_DEV_COREDUMP to ALLOW_DEV_COREDUMP
  tiny: reverse logic for DISABLE_DEV_COREDUMP
  i2c: core: Dispose OF IRQ mapping at client removal time
  i2c: at91: don't account as iowait
  i2c: remove FSF address
  USB: Update default usb-storage delay_use value in kernel-parameters.txt
  sysfs: driver core: Fix glue dir race condition by gdp_mutex
  MIPS: Fix build with binutils 2.24.51+
  xfs: track bulkstat progress by agino
  xfs: bulkstat error handling is broken
  xfs: bulkstat main loop logic is a mess
  xfs: bulkstat chunk-formatter has issues
  xfs: bulkstat chunk formatting cursor is broken
  xfs: bulkstat btree walk doesn't terminate
  mm: Fix comment before truncate_setsize()
  USB: cdc-acm: add quirk for control-line state requests
  tty: Fix pty master poll() after slave closes v2
  MIPS: R3000: Fix debug output for Virtual page number
  ...

Conflicts:
	drivers/media/rc/rc-main.c
2014-11-11 08:37:35 -02:00
Mauro Carvalho Chehab a235473742 [media] cx24110: Simplify error handling at cx24110_set_fec()
move the return to happen before the logic. This way, we can
avoid one extra identation.

This also fixes an identation issue on this function.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 10:00:45 -02:00
Mauro Carvalho Chehab 6deaca2bc3 [media] cx23110: Fix return code for cx24110_set_fec()
When a parameter is invalid, the right return code is
-EINVAL.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:58:07 -02:00
Mauro Carvalho Chehab 5eb2829212 [media] cx24110: Fix whitespaces at cx24110_set_fec()
It is hard to read what's there, because it doesn't follow the
CodingStyle.

Add missing whitespaces to split function arguments.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:57:33 -02:00
Mauro Carvalho Chehab b8e64df002 [media] cx24110: Fix a spatch warning
This is actually a false positive:
	drivers/media/dvb-frontends/cx24110.c:210 cx24110_set_fec() error: buffer overflow 'rate' 7 <= 8

But fixing it is easy: just ensure that the table size will be
limited to FEC_AUTO.

While here, fix spacing on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:56:12 -02:00
Mauro Carvalho Chehab 667c952e71 [media] cx22700: Fix potential buffer overflow
As new FEC types were added, we need a check to avoid overflows:
	drivers/media/dvb-frontends/cx22700.c:172 cx22700_set_tps() error: buffer overflow 'fec_tab' 6 <= 6
	drivers/media/dvb-frontends/cx22700.c:173 cx22700_set_tps() error: buffer overflow 'fec_tab' 6 <= 6

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:42:22 -02:00
Mauro Carvalho Chehab b9f62ffe05 [media] stb0899: don't go past DiSEqC msg buffer
As reported by spatch:
	drivers/media/dvb-frontends/stb0899_drv.c:720 stb0899_send_diseqc_msg() error: buffer overflow 'cmd->msg' 6 <= 7

The buffer size is 6 and not 8. Anyway, the best is to use sizeof(),
to avoid such mistakes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:34:12 -02:00
Mauro Carvalho Chehab 1011d24a21 [media] stv090x: Fix delivery system setting
As sparse complains:
	drivers/media/dvb-frontends/stv090x.c:3471:30: warning: mixing different enum types
	drivers/media/dvb-frontends/stv090x.c:3471:30:     int enum fe_delivery_system  versus
	drivers/media/dvb-frontends/stv090x.c:3471:30:     int enum stv090x_delsys

There's actually an error when setting the delivery system on
stv090x_search(): it is using the DVBv5 macros as if they were
the stv090x ones.

Instead, we should convert between the two namespaces, returning
an error if an unsupported delivery system is requested.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 09:23:05 -02:00
Mauro Carvalho Chehab 060f79d575 [media] af0933: Don't go past arrays
X-Patchwork-Delegate: m.chehab@samsung.com
Fixes the following sparse warnings:
	drivers/media/dvb-frontends/af9033.c:295 af9033_init() error: buffer overflow 'clock_adc_lut' 11 <= 11
	drivers/media/dvb-frontends/af9033.c:300 af9033_init() error: buffer overflow 'clock_adc_lut' 11 <= 11
	drivers/media/dvb-frontends/af9033.c:584 af9033_set_frontend() error: buffer overflow 'coeff_lut' 3 <= 3
	drivers/media/dvb-frontends/af9033.c:595 af9033_set_frontend() error: buffer overflow 'clock_adc_lut' 11 <= 11

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-05 08:09:27 -02:00
Antti Palosaari fdc533a97b [media] af9033: continue polling unless critical IO error
That case is not IO error, so better to jump out now, but still
continue polling.

Cc: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:21:12 -02:00
Antti Palosaari c3a80cd024 [media] af9033: return 0.1 dB DVBv3 SNR for AF9030 family
Previous patch changed both AF9030 and IT9130 SNR reporting from
dB to relative. Restore AF9030 to old behavior as it has been always
returning 0.1 dB value. Leave IT9130 relative as old IT9130 was
returning relative values.

Cc: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:20:51 -02:00
Bimow Chen 6d03f6a875 [media] af9033: fix DVBv3 snr value not correct issue
Snr returns value not correct. Fix it.

Signed-off-by: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:20:35 -02:00
Antti Palosaari 1620d22184 [media] af9033: improve read_signal_strength error handling slightly
Check return status after each register access routine and avoid
masking return status values.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:20:06 -02:00
Antti Palosaari 0b0d96281f [media] af9033: fix AF9033 DVBv3 signal strength measurement
Previous patch changes used signal strength firmware register from
0x800048 to 0x80004a in case of AF9033/AF9035 chip. In practice
reported values were running upside-down, when RR strength increases
reported value decreases and vice versa. That is because of 0x80004a
returns values that are dBm scale, but negative RF strength dBm
returned as positive number.

0x800048 returns 0-100, like percentage
0x80004a returns 0-255 dBm, without a negative sign

So restore old measurement now.

Cc: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:19:27 -02:00
Bimow Chen 3adec27242 [media] af9033: fix DVBv3 signal strength value not correct issue
Register 0x800048 is not dB measure but relative scale. Fix it and conform to NorDig specifications.

Signed-off-by: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:19:12 -02:00
Antti Palosaari 45c3cbb184 [media] si2168: do not print device is warm every-time when opened
It repeated "found a 'Silicon Labs Si2168' in warm state" everytime
when device was opened. Message is aimed to point out firmware is
downloaded, up and running. So print it only in case firmware download
is performed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-04 18:18:13 -02:00
Fengguang Wu 167921cb0f [media] sp2: sp2_init() can be static
drivers/media/dvb-frontends/sp2.c:269:5: sparse: symbol 'sp2_init' was not declared. Should it be static?
drivers/media/dvb-frontends/sp2.c:351:5: sparse: symbol 'sp2_exit' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 19:08:06 -02:00
nibble.max f4df95bcbb [media] m88ds3103: add support for the demod of M88RS6000
M88RS6000 is the integrated chip, which includes tuner and demod. Its
internal demod is similar with M88DS3103 except some registers
definition.

The main different part of this internal demod from others is its
clock/pll generation IP block sitting inside the tuner die. So clock/pll
functions should be configed through its tuner i2c bus, NOT its demod
i2c bus.

The demod of M88RS6000 need the firmware: dvb-demod-m88rs6000.fw
firmware download link:
	http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 18:24:15 -02:00
Akihiro Tsukada 01bd399a10 [media] dvb:tc90522: fix always-false expression
Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 16:40:10 -02:00
Akihiro Tsukada 906aaf5a19 [media] dvb:tc90522: fix stats report
* report the fixed per-transponder symbolrate instead of per-TS ones
* add output TS-ID report

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 16:40:09 -02:00
Dan Carpenter 66ae9fc237 [media] stv090x: remove indent levels in stv090x_get_coldlock()
This code is needlessly complicated and checkpatch.pl complains that we
go over the 80 characters per line limit.

If we flip the "if (!lock) {" test to "if (lock) return;" then we can
remove an indent level from the rest of the function.

We can add two returns in the "if (state->srate >= 10000000) {"
condition and move the else statement back an additional indent level.

There is another "if (!lock) {" check which can be removed since we have
already checked "lock" and know it is zero at this point.  This second
check on "lock" is also a problem because it sets off a static checker
warning.  I have reviewed this code for some time to see if something
else was intended, but have concluded that it was simply an oversight
and should be removed.  Removing this duplicative check gains us an
third indent level.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 14:53:14 -02:00
Richard Vollkommer dcc33cc57d [media] au8522: improve lock performance with ZeeVee modulators
Improves lock performance with signals from the ZeeVee family
of modulators.

Signed-off-by: Richard Vollkommer <linux@hauppauge.com>
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 12:25:28 -02:00
ほち 30934dd3e8 [media] dvb-frontends/Kconfig: better describe Toshiba TC90522
Toshiba TC90522 is wrongly categorized, fix it

Signed-off-by: ほち, AreMa Inc <knightrider@are.ma>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03 08:58:25 -02:00
Ulrich Eckhardt 8c5bcded11 [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization
The Tevii S480 outputs 18V on startup for the LNB supply voltage and does not
automatically power down. This blocks other receivers connected
to a satellite channel router (EN50494), since the receivers can not send the
required DiSEqC sequences when the Tevii card is connected to a the same SCR.

This patch switches off the LNB supply voltage on initialization of the frontend.

[mchehab@osg.samsung.com: add a comment about why we're explicitly
 turning off voltage at device init]
Cc: stable@vger.kernel.org
Signed-off-by: Ulrich Eckhardt <uli@uli-eckhardt.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 16:53:44 -02:00
Olli Salonen b1cb7ad2d2 [media] sp2: improve debug logging
Improve debugging output.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 11:47:21 -02:00
Olli Salonen 9a25d410bb [media] sp2: fix incorrect struct
Incorrect struct used in the SP2 driver.

Reported-by: Max Nibble <nibble.max@gmail.com>
Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 11:46:34 -02:00
Mauro Carvalho Chehab 52ee29fe94 [media] drxk: Fix debug printks
This patch partially reverts 0fb220f2a5. What happened is
that the conversion of debug messages to use pr_debug() was a
bad idea, because one needing to debug would need to both
enable debug level via a modprobe parameter, and then to
enable the dynamic printk's.

So, for now, let's use printk() directly at dprintk().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 09:06:27 -02:00
Mauro Carvalho Chehab 986f168644 [media] dib7000p: get rid of an unused argument
dib7000p is for DVB, and not ISDB. So, there's no layer.

That removes this compilation warning:
	drivers/media/dvb-frontends/dib7000p.c:1972: warning: 'i' is used uninitialized in this function

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30 08:12:58 -02:00
Linus Torvalds 4d9708ea5e media updates for v3.18-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUNr9iAAoJEAhfPr2O5OEVSygP/iVpHK7JZCFSvy1ly67gUcIw
 zeO2q0Exm3WwApchaCNX0b9qB9A6jeaRiJtuqOgR7L8ksYorku7k12g0IrveK8e4
 UhwscWw1HkYvTR3JG4Z2a8LoYiUatQCgcknICgjJ12fo2fCg2SnzbGp9jKiLqJew
 dx1zOgn5Hslqy+PWQULtkLo/XxdlAX8YNUhXU5q5gxCfhciaJ7Kq+tvM9NodobHG
 u94b10fmOclLug37b+Vpg01pxjqe+X+HbrHzbOsL7dvxW84igqzpyb9+WNH8FGZZ
 +oSu66faokH8rVxzkPyODT8TSwHuqafVF1IFafsFFJpYYfRWiY0SttMACVMuuB3z
 m6kVM9pTApmh736xvzB4JP4i/+aIu2qQftYTybQkTpn1AIy2kw8b09pOWbhEgdjl
 5CfI7I2iSkSviZXMrIe51znIhdxohF7gEN8PyaPto3N1LHVnHAd7/J43nolSSnke
 DE0lQGk+NaGFv/MiESiKC8lSiEGzqpMkrxpOIeDZAsKxQ3ihxKai3kqAYYiPt2+n
 2HVhLsmfMqdd23DGSf7LjhhLqjXKhEC/+LDsLl105keRYLN/TYZuQxieJEDikRF/
 NLJcuuXUQkcsdgrAChAonu1K3roAsgZ8E6BP+814CWZ5LM4xW0kQqqKN6S88eKx2
 HcIz2xwveR6sZBNZE7Kl
 =DUbD
 -----END PGP SIGNATURE-----

Merge tag 'media/v3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - new IR driver: hix5hd2-ir

 - the virtual test driver (vivi) was replaced by vivid, with has an
   almost complete set of features to emulate most v4l2 devices and
   properly test all sorts of userspace apps

 - the as102 driver had several bugs fixed and was properly split into a
   frontend and a core driver.  With that, it got promoted from staging
   into mainstream

 - one new CI driver got added for CIMaX SP2/SP2HF (sp2 driver)

 - one new frontend driver for Toshiba ISDB-T/ISDB-S demod (tc90522)

 - one new PCI driver for ISDB-T/ISDB-S (pt3 driver)

 - saa7134 driver got support for go7007-based devices

 - added a new PCI driver for Techwell 68xx chipsets (tw68)

 - a new platform driver was added (coda)

 - new tuner drivers: mxl301rf and qm1d1c0042

 - a new DVB USB driver was added for DVBSky S860 & similar devices

 - added a new SDR driver (hackrf)

 - usbtv got audio support

 - several platform drivers are now compiled with COMPILE_TEST

 - a series of compiler fixup patches, making sparse/spatch happier with
   the media stuff and removing several warnings, especially on those
   platform drivers that didn't use to compile on x86

 - Support for several new modern devices got added

 - lots of other fixes, improvements and cleanups

* tag 'media/v3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (544 commits)
  [media] ir-hix5hd2: fix build on c6x arch
  [media] pt3: fix DTV FE I2C driver load error paths
  Revert "[media] media: em28xx - remove reset_resume interface"
  [media] exynos4-is: fix some warnings when compiling on arm64
  [media] usb drivers: use %zu instead of %zd
  [media] pci drivers: use %zu instead of %zd
  [media] dvb-frontends: use %zu instead of %zd
  [media] s5p-mfc: Fix several printk warnings
  [media] s5p_mfc_opr: Fix warnings
  [media] ti-vpe: Fix typecast
  [media] s3c-camif: fix dma_addr_t printks
  [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits
  [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64
  [media] em28xx: Fix identation
  [media] drxd: remove a dead code
  [media] saa7146: remove return after BUG()
  [media] cx88: remove return after BUG()
  [media] cx88: fix cards table CodingStyle
  [media] radio-sf16fmr2: declare some structs as static
  [media] radio-sf16fmi: declare pnp_attached as static
  ...
2014-10-10 22:04:49 -04:00
Linus Torvalds ea584595fc This is the bulk of GPIO changes for the v3.18 development
cycle:
 
 - Increase the default ARCH_NR_GPIO from 256 to 512. This
   was done to avoid having a custom <asm/gpio.h> header for
   the x86 architecture - GPIO is custom and complicated
   enough as it is already! We want to move to a radix to
   store the descriptors going forward, and finally get rid
   of this fixed array size altogether.
 
 - Endgame patching of the gpio_remove() semantics initiated
   by Abdoulaye Berthe. It is not accepted by the system that
   the removal of a GPIO chip fails during e.g. reboot or
   shutdown, and therefore the return value has now painfully
   been refactored away. For special cases like GPIO expanders
   on a hot-pluggable bus like USB, we may later add some
   gpiochip_try_remove() call, but for the cases we have now,
   return values are moot.
 
 - Some incremental refactoring of the gpiolib core and ACPI
   GPIO library for more descriptor usage.
 
 - Refactor the chained IRQ handler set-up method to handle
   also threaded, nested interrupts and set up the parent IRQ
   correctly. Switch STMPE and TC3589x drivers to use this
   registration method.
 
 - Add a .irq_not_threaded flag to the struct gpio_chip, so
   that also GPIO expanders that block but are still not
   using threaded IRQ handlers.
 
 - New drivers for the ARM64 X-Gene SoC GPIO controller.
 
 - The syscon GPIO driver has been improved to handle the
   "DSP GPIO" found on the TI Keystone 2 SoC:s.
 
 - ADNP driver switched to use gpiolib irqchip helpers.
 
 - Refactor the DWAPB driver to support being instantiated
   from and MFD cell (platform device).
 
 - Incremental feature improvement in the Zynq, MCP23S08,
   DWAPB, OMAP, Xilinx and Crystalcove drivers.
 
 - Various minor fixes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUNOr0AAoJEEEQszewGV1z9toP/2ISXRnsi3+jlqVmEGm/y6EA
 PPwJOiYnOhZR2/fTCHIF0PNbIi9pw7xKnzxttYCu4uCz7geHX+FfTwUZ2/KWMfqi
 ZJ9kEoOVVKzKjmL/m2a2tO4IRSBHqJ8dF3yvaNjS3AL7EDfG6F5STErQurdLEynK
 SeJZ2OwM/vRFCac6F7oDlqAUTu3xYGbVD8+zI0H0V/ReocosFlEwcbl2S8ctDWUd
 h98M+gY+A8rxkvVMnmQ/k7rUTme/glDQ3z5xVx+uHbS2/a5M1jSM/71cXE6YnSrR
 it0CK7CHomq2RzHsKf7oH7GD4kFkukMwFKeMoqz75JWz3352VZPTF53chCIqRSgO
 hrgGwZ7WF6pUUUhsn1ZdZsnBPA2Fou2uwslyLSAiE+OYEH2/NSVIOUcorjQcWqU/
 0Kix5yb8X1ZzRMhR+TVrTD5V0jguqp2buXq+0P2XlU6MoO2vy7iNf2eXvPg8sF8C
 anjTCKgmkzy7eyT2uzfDaNZAyfSBKb1TiKiR9zA0SRChJkCi1ErJEXDGeHiptvSA
 +D2k68Ils2LqsvdrnEd2XvVFMllh0iq7b+16o7D+Els0WRbnHpfYCaqfOuF5F4U0
 SmeyI0ruawNDc5e9EBKXstt0/R9AMOetyTcTu29U2ZVo90zGaT1ofT8+R1jJ0kGa
 bPARJZrgecgv1E9Qnnnd
 =8InA
 -----END PGP SIGNATURE-----

Merge tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO changes from Linus Walleij:
 "This is the bulk of GPIO changes for the v3.18 development cycle:

   - Increase the default ARCH_NR_GPIO from 256 to 512.  This was done
     to avoid having a custom <asm/gpio.h> header for the x86
     architecture - GPIO is custom and complicated enough as it is
     already! We want to move to a radix to store the descriptors going
     forward, and finally get rid of this fixed array size altogether.

   - Endgame patching of the gpio_remove() semantics initiated by
     Abdoulaye Berthe.  It is not accepted by the system that the
     removal of a GPIO chip fails during eg reboot or shutdown, and
     therefore the return value has now painfully been refactored away.
     For special cases like GPIO expanders on a hot-pluggable bus like
     USB, we may later add some gpiochip_try_remove() call, but for the
     cases we have now, return values are moot.

   - Some incremental refactoring of the gpiolib core and ACPI GPIO
     library for more descriptor usage.

   - Refactor the chained IRQ handler set-up method to handle also
     threaded, nested interrupts and set up the parent IRQ correctly.
     Switch STMPE and TC3589x drivers to use this registration method.

   - Add a .irq_not_threaded flag to the struct gpio_chip, so that also
     GPIO expanders that block but are still not using threaded IRQ
     handlers.

   - New drivers for the ARM64 X-Gene SoC GPIO controller.

   - The syscon GPIO driver has been improved to handle the "DSP GPIO"
     found on the TI Keystone 2 SoC:s.

   - ADNP driver switched to use gpiolib irqchip helpers.

   - Refactor the DWAPB driver to support being instantiated from and
     MFD cell (platform device).

   - Incremental feature improvement in the Zynq, MCP23S08, DWAPB, OMAP,
     Xilinx and Crystalcove drivers.

   - Various minor fixes"

* tag 'gpio-v3.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (52 commits)
  gpio: pch: Build context save/restore only for PM
  pinctrl: abx500: get rid of unused variable
  gpio: ks8695: fix 'else should follow close brace '}''
  gpio: stmpe: add verbose debug code
  gpio: stmpe: fix up interrupt enable logic
  gpio: staticize xway_stp_init()
  gpio: handle also nested irqchips in the chained handler set-up
  gpio: set parent irq on chained handlers
  gpiolib: irqchip: use irq_find_mapping while removing irqchip
  gpio: crystalcove: support virtual GPIO
  pinctrl: bcm281xx: make Kconfig dependency more strict
  gpio: kona: enable only on BCM_MOBILE or for compile testing
  gpio, bcm-kona, LLVMLinux: Remove use of __initconst
  gpio: Fix ngpio in gpio-xilinx driver
  gpio: dwapb: fix pointer to integer cast
  gpio: xgene: Remove unneeded #ifdef CONFIG_OF guard
  gpio: xgene: Remove unneeded forward declation for struct xgene_gpio
  gpio: xgene: Fix missing spin_lock_init()
  gpio: ks8695: fix switch case indentation
  gpiolib: add irq_not_threaded flag to gpio_chip
  ...
2014-10-09 14:58:15 -04:00
Mauro Carvalho Chehab a66d05d504 Merge branch 'patchwork' into v4l_for_linus
* patchwork: (544 commits)
  [media] ir-hix5hd2: fix build on c6x arch
  [media] pt3: fix DTV FE I2C driver load error paths
  Revert "[media] media: em28xx - remove reset_resume interface"
  [media] exynos4-is: fix some warnings when compiling on arm64
  [media] usb drivers: use %zu instead of %zd
  [media] pci drivers: use %zu instead of %zd
  [media] dvb-frontends: use %zu instead of %zd
  [media] s5p-mfc: Fix several printk warnings
  [media] s5p_mfc_opr: Fix warnings
  [media] ti-vpe: Fix typecast
  [media] s3c-camif: fix dma_addr_t printks
  [media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits
  [media] s5p_mfc_opr_v5: Fix lots of warnings on x86_64
  [media] em28xx: Fix identation
  [media] drxd: remove a dead code
  [media] saa7146: remove return after BUG()
  [media] cx88: remove return after BUG()
  [media] cx88: fix cards table CodingStyle
  [media] radio-sf16fmr2: declare some structs as static
  [media] radio-sf16fmi: declare pnp_attached as static
  ...

Conflicts:
	Documentation/DocBook/media/v4l/compat.xml
2014-10-09 14:00:54 -03:00
Mauro Carvalho Chehab 35f30f36a7 [media] dvb-frontends: use %zu instead of %zd
size_t is unsigned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:50:59 -03:00
Mauro Carvalho Chehab b39ba19cf3 [media] drxd: remove a dead code
drivers/media/dvb-frontends/drxd_hard.c:2839 drxd_init() info: ignoring unreachable code.

Firmware request/release is not at drxd_init. So, we can remove
that dead code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:58 -03:00
Olli Salonen 327eeb3a1a [media] si2168: add FE_CAN_MULTISTREAM into caps
PLP selection was implemented for Si2168 last month (patchwork 25387). However, FE_CAN_MULTISTREAM was not added to dvb_frontend_ops of si2168. This patch adds FE_CAN_MULTISTREAM, which indicates that multiple PLP are supported.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:44 -03:00
Mauro Carvalho Chehab 2ea12442e3 [media] tc90522: fix compilation on 32 bits
drivers/built-in.o: In function `tc90522t_get_frontend':
>> tc90522.c:(.text+0x260b64c): undefined reference to `__divdi3'
>> tc90522.c:(.text+0x260b685): undefined reference to `__divdi3'
>> tc90522.c:(.text+0x260b6bb): undefined reference to `__divdi3'
>> tc90522.c:(.text+0x260b713): undefined reference to `__divdi3'
   drivers/built-in.o:tc90522.c:(.text+0x260bb64): more undefined references to `__divdi3' follow

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26 06:47:42 -03:00
Mauro Carvalho Chehab 70dc536337 [media] tc90522: declare tc90522_functionality as static
drivers/media/dvb-frontends/tc90522.c:706:5: warning: symbol 'tc90522_functionality' was not declared. Should it be static?
drivers/media/dvb-frontends/tc90522.c:706:5: warning: no previous prototype for 'tc90522_functionality' [-Wmissing-prototypes]
 u32 tc90522_functionality(struct i2c_adapter *adap)
     ^

Cc: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 17:04:01 -03:00
Akihiro Tsukada f5d82a75e6 [media] tc90522: add driver for Toshiba TC90522 quad demodulator
This patch adds driver for tc90522 demodulator chips.
The chip contains 4 demod modules that run in parallel and are independently
controllable via separate I2C addresses.
Two of the modules are for ISDB-T and the rest for ISDB-S.
It is used in earthsoft pt3 cards.

Note that this driver does not init the chip,
because the initilization sequence / register setting is not disclosed.
Thus, the driver assumes that the chips are initilized externally
by its parent board driver before fe->ops->init() are called.
Earthsoft PT3 PCIe card, for example, contains the init sequence
in its private memory and provides a command to trigger the sequence.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 17:04:00 -03:00
Dan Carpenter cf3b576d52 [media] dvb: si21xx: buffer overflow in si21_writeregs()
"len" is user controlled and can be up to 255.  Anything more than 59
will cause a buffer overflow so we need to add a test for that.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:38 -03:00
Matthias Schwarzott 119bd82e0e [media] si2165: enable Si2161 support
Additionally print chip name with revision symbolically.
This is a preparation for supporting new Hauppauge WinTV-HVR-900-H based
on cx231xx.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:33 -03:00
Matthias Schwarzott 55bea40070 [media] si2165: Load driver for all hardware revisions
Current firmware is only for revision D.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23 16:13:33 -03:00
Mauro Carvalho Chehab 886da6ac33 [media] stv0367: Remove an unused parameter
cab_state->modulation is initialized with a wrong value:

drivers/media/dvb-frontends/stv0367.c:3000:42: warning: mixing different enum types
drivers/media/dvb-frontends/stv0367.c:3000:42:     int enum fe_modulation  versus
drivers/media/dvb-frontends/stv0367.c:3000:42:     int enum stv0367cab_mod

as it was declared as "enum stv0367cab_mod". While it could be fixed,
there's no value on it, as this is never used.

So, just remove the modulation from cab_state structure.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 17:36:53 -03:00
Maks Naumov eafeda9666 [media] media: stv0367: fix frontend modulation initialization with FE_CAB_MOD_QAM256
It was using the wrong constant for QAM256 on get_frontend.

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 17:31:52 -03:00
Hans Wennborg 612f676bbe [media] dvb: return the error from i2c_transfer if negative
Just returns whatever error that was returned by the i2c core,
in the case of errors, only returning -EREMOTEIO if the transfer size
is not what it was expected.

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 17:05:13 -03:00
Hans Wennborg a375218460 [media] dvb: remove 0x prefix from decimal value in printf
The returned code is 0, 1 or an error. It doesn't make sense to
print it in hexadecimal.

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 17:04:09 -03:00
Andrey Utkin 6694ba62c7 [media] drivers/media/dvb-frontends/stv0900_sw.c: Fix break placement
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81621

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-22 16:56:17 -03:00
Hans Verkuil fdc6b38892 [media] cx24123: fix kernel oops due to missing parent pointer
When I try to set the TV standard to e.g. PAL on my Hauppauge WinTV-HVR3000 I get
the following oops:

 9464.262345] CX24123: detected CX24123
[ 9464.262526] BUG: unable to handle kernel NULL pointer dereference at 0000000000000230
[ 9464.262555] IP: [<ffffffff816676b5>] acpi_i2c_install_space_handler+0x15/0xc0
[ 9464.262576] PGD 0
[ 9464.262584] Oops: 0000 [#1] PREEMPT SMP
[ 9464.262597] Modules linked in: cx24123 cx22702 cx88_dvb(+) videobuf_dvb cx88_vp3054_i2c cx88_blackbird cx8802 ir_lirc_codec ir_xmp_decoder ir_sanyo_decoder ir_jvc_decoder ir_mce_kbd_decoder ir_sharp_decoder lirc_dev ir_sony_decoder ir_rc6_decoder ir_nec_decoder ir_rc5_decoder rc_hauppauge wm8775 tuner_simple tuner_types tda9887 cx8800 cx88xx btcx_risc videobuf_dma_sg videobuf_core mt2131 s5h1409 tda8290 tuner cx25840 cx23885 altera_ci tda18271 altera_stapl videobuf2_dvb tveeprom cx2341x videobuf2_dma_sg dvb_core rc_core videobuf2_memops videobuf2_core v4l2_common videodev media nouveau x86_pkg_temp_thermal cfbfillrect cfbimgblt cfbcopyarea ttm drm_kms_helper processor button isci
[ 9464.262786] CPU: 2 PID: 2417 Comm: modprobe Not tainted 3.17.0-rc1-telek #322
[ 9464.262796] Hardware name: ASUSTeK COMPUTER INC. Z9PE-D8 WS/Z9PE-D8 WS, BIOS 5404 02/10/2014
[ 9464.262807] task: ffff881097959ad0 ti: ffff88109967c000 task.ti: ffff88109967c000
[ 9464.262817] RIP: 0010:[<ffffffff816676b5>]  [<ffffffff816676b5>] acpi_i2c_install_space_handler+0x15/0xc0
[ 9464.262834] RSP: 0018:ffff88109967fbd8  EFLAGS: 00010246
[ 9464.262843] RAX: 0000000000000000 RBX: ffff880892a89540 RCX: 0000000000000000
[ 9464.262853] RDX: 0000000080000001 RSI: ffff880892e75870 RDI: ffff880892a89540
[ 9464.262862] RBP: ffff88109967fbf8 R08: ffff881099b2ccc0 R09: ffff880891efa088
[ 9464.262872] R10: 0000000000000000 R11: 0000000000000022 R12: 0000000000000000
[ 9464.262883] R13: ffff880892a895b0 R14: 00000000ffffffed R15: ffff88089b48f800
[ 9464.262893] FS:  00007fe42b6d7700(0000) GS:ffff88089fc40000(0000) knlGS:0000000000000000
[ 9464.262904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 9464.262912] CR2: 0000000000000230 CR3: 0000001094078000 CR4: 00000000000407e0
[ 9464.262922] Stack:
[ 9464.262927]  ffff880892a89540 0000000000000000 ffff880892a895b0 ffff88109a155a80
[ 9464.262944]  ffff88109967fc20 ffffffff81666a36 0000000000000020 ffff880892a89540
[ 9464.262960]  ffffffffa01c8d40 ffff88109967fc40 ffffffff81666c67 ffff880892a89000
[ 9464.262977] Call Trace:
[ 9464.262987]  [<ffffffff81666a36>] i2c_register_adapter+0x166/0x340
[ 9464.262998]  [<ffffffff81666c67>] i2c_add_adapter+0x57/0x60
[ 9464.263011]  [<ffffffffa01e2c58>] cx24123_attach+0x108/0x1ba [cx24123]
[ 9464.263025]  [<ffffffffa01c5a76>] dvb_register+0x404/0x245b [cx88_dvb]
[ 9464.263039]  [<ffffffffa0059183>] ? videobuf_queue_core_init+0xe3/0x140 [videobuf_core]
[ 9464.263052]  [<ffffffffa01c54b1>] cx8802_dvb_probe+0x1e1/0x261 [cx88_dvb]
[ 9464.263066]  [<ffffffffa01a3b00>] cx8802_register_driver+0x190/0x20d [cx8802]
[ 9464.263077]  [<ffffffffa01cc000>] ? 0xffffffffa01cc000
[ 9464.263089]  [<ffffffffa01cc025>] dvb_init+0x25/0x27 [cx88_dvb]
[ 9464.263101]  [<ffffffff810002c4>] do_one_initcall+0x84/0x1c0
[ 9464.263113]  [<ffffffff811893fa>] ? __vunmap+0x9a/0x100
[ 9464.263125]  [<ffffffff81122a66>] load_module+0x1216/0x1790
[ 9464.263134]  [<ffffffff8111ff70>] ? __symbol_put+0x70/0x70
[ 9464.263145]  [<ffffffff811aa8cc>] ? vfs_read+0x11c/0x170
[ 9464.263156]  [<ffffffff811201d9>] ? copy_module_from_fd.isra.53+0x119/0x170
[ 9464.263168]  [<ffffffff81123116>] SyS_finit_module+0x76/0x80
[ 9464.263181]  [<ffffffff818d19e9>] system_call_fastpath+0x16/0x1b
[ 9464.263190] Code: 81 31 c0 e8 2e f6 e8 ff 48 83 c4 08 5b 5d eb de 66 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 53 41 be ed ff ff ff 48 8b 47 70 <48> 8b 80 30 02 00 00 48 85 c0 74 58 4c 8b 68 08 4d 85 ed 74 4f
[ 9464.263347] RIP  [<ffffffff816676b5>] acpi_i2c_install_space_handler+0x15/0xc0
[ 9464.263361]  RSP <ffff88109967fbd8>
[ 9464.263367] CR2: 0000000000000230
[ 9464.266919] ---[ end trace 57fd490bdb72e733 ]---

I traced this to a NULL i2c_adapter parent pointer when cx24123 creates its own
i2c adapter. The acpi_i2c_install_space_handler function appeared in 3.17, so
that's probably why this hasn't been seen before.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 20:55:37 -03:00
Antti Palosaari 2db4d179e1 [media] af9033: init DVBv5 statistics
We need to init supported stats here in order signal app which
stats are supported.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:50:35 -03:00
Antti Palosaari ef2fb46b6d [media] af9033: remove all DVBv3 stat calculation logic
Statistics are now calculated for DVBv5 and those DVBv5 values are
returned for legacy DVBv3 calls also. So we could remove all old
statistics calculation logic.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:47:28 -03:00
Antti Palosaari e53c47445b [media] af9033: wrap DVBv3 BER to DVBv5 BER
DVBv5 BER is calculated anyway, so just return it for legacy
read_ber() API too.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:47:03 -03:00
Antti Palosaari 1d0ceae4a1 [media] af9033: wrap DVBv3 UCB to DVBv5 UCB stats
Remove 'duplicate' DVBv3 read UCB implementation and return value,
calculated already for DVBv5 statistics.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:46:43 -03:00
Antti Palosaari 6bb096c926 [media] af9033: implement DVBv5 post-Viterbi BER
Implement following DTV API commands:
DTV_STAT_POST_ERROR_BIT_COUNT
DTV_STAT_POST_TOTAL_BIT_COUNT

These will provide post-Viterbi bit error rate reporting.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:46:22 -03:00
Antti Palosaari 204f431928 [media] af9033: implement DVBv5 stat block counters
Implement following API commands:
DTV_STAT_ERROR_BLOCK_COUNT
DTV_STAT_TOTAL_BLOCK_COUNT

These returns total and uncorrected error packets from outer FEC.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:46:01 -03:00
Antti Palosaari 6b45778609 [media] af9033: wrap DVBv3 read SNR to DVBv5 CNR
Remove 'duplicate' DVBv3 read SNR implementation and return value,
calculated already by DVBv5 CNR, from the cache.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:45:27 -03:00
Antti Palosaari 3e41313aea [media] af9033: implement DVBv5 statistics for CNR
Return CNR via DVBv5 statistics API.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:44:59 -03:00
Antti Palosaari 83f1161911 [media] af9033: implement DVBv5 statistics for signal strength
Let the demod firmware estimate RF signal strength and return it
to the app as a dBm. To handle that, use thread which reads signal
strengths from firmware in 2 sec intervals when device is active.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:44:43 -03:00
Antti Palosaari a781edd16c [media] af9033: remove I2C addr from config
I2C driver address is passed as a i2c_new_device() parameter when
device is created. Thus no need to keep it in config struct.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:39:47 -03:00
Antti Palosaari 6a087f1f6b [media] af9033: clean up logging
It uses I2C client so logging system prints module name
automatically. Function name is also added automatically, if it is
requested from dynamic debug by setting proper format.
Because of that, we could simplify logging in our driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:38:25 -03:00
Antti Palosaari f5b00a7670 [media] af9033: convert to I2C client
Convert driver to kernel I2C model.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 19:37:33 -03:00
Antti Palosaari 09611caad1 [media] af9033: rename 'state' to 'dev'
foo_dev seems to be most correct term for the structure holding data
of each device instance. It is most used term in Kernel codebase and also
examples from book Linux Device Drivers, Third Edition, uses it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 18:31:30 -03:00
Antti Palosaari ef5211fd59 [media] af9033: fix firmware version logging
AF9030 and IT9130 series has different memory location for firmware
version. Choose correct location according to chip type.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 18:30:21 -03:00
Antti Palosaari 24e419a0f3 [media] af9033: make checkpatch.pl happy
Correct issues reported by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 17:43:23 -03:00
Antti Palosaari ca681fe0bc [media] af9033: provide dyn0_clk clock source
AF903x/IT913x demod provides clock source(s). It seems that this
clock source is used for integrated RF tuner of IT913x. It is
enabled by default, but firmware disables it automatically when
suspend is requested (suspend_flag (0x004c) + trigger_ofsm
(0x0000)). Automatic disable behavior seems to be similar for both
AF903x and IT913x I tested, though there is no likely any real
clock user in a case of AF903x.

Cc: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 17:03:45 -03:00
Olli Salonen 8e417224df [media] si2168: avoid firmware loading if it has been loaded previously
Add a variable to keep track if firmware is loaded or not and skip parts of the
initialization if fw is already loaded. Resume from sleep with a different
command compared to initial power up and run command 85 after resume command.
This behaviour is observed when using manufacturer provided binary-only si2168
driver for TechnoTrend CT2-4400.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 16:42:39 -03:00
Antti Palosaari d4d2050006 [media] rtl2832_sdr: logging changes
Remove function name from debug logs. Logging system could add it
automatically.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 16:42:37 -03:00
Antti Palosaari b538a8e85b [media] rtl2832_sdr: enhance sample rate debug calculation precision
Sample rate calculation gives a little bit too large results because
in real life there was around one milliseconds (~one usb packet) too
much data for given time. Calculate time more accurate in order to
provide better results.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 16:42:37 -03:00
Antti Palosaari abfc8d66d7 [media] rtl2832_sdr: remove unneeded spinlock irq flags initialization
There is no need to init flags before calling spin_lock_irqsave().
spin_lock_irqsave is macro which stores value to 'flags'

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21 16:42:36 -03:00
Mauro Carvalho Chehab 3cf0c6bd68 Merge remote-tracking branch 'linus/master' into patchwork
There are some patches that depends on media-v3.16-rc6.
So, merge back from upstream before applying them.

* linus/master: (1123 commits)
  drm/nouveau: ltc/gf100-: fix cbc issues on certain boards
  drm/bochs: add missing drm_connector_register call
  drm/cirrus: add missing drm_connector_register call
  staging: vt6655: buffer overflow in ioctl
  USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters
  USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter
  USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter
  USB: EHCI: unlink QHs even after the controller has stopped
  [SCSI] fix for bidi use after free
  [SCSI] fix regression that accidentally disabled block-based tcq
  [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu
  drm/radeon: Fix typo 'addr' -> 'entry' in rs400_gart_set_page
  drm/nouveau/runpm: fix module unload
  drm/radeon/px: fix module unload
  vgaswitcheroo: add vga_switcheroo_fini_domain_pm_ops
  drm/radeon: don't reset dma on r6xx-evergreen init
  drm/radeon: don't reset sdma on CIK init
  drm/radeon: don't reset dma on NI/SI init
  drm/radeon/dpm: fix resume on mullins
  drm/radeon: Disable HDP flush before every CS again for < r600
  ...
2014-09-21 16:40:04 -03:00
abdoulaye berthe 88d5e520aa driver:gpio remove all usage of gpio_remove retval in driver
this remove all reference to gpio_remove retval in all driver
except pinctrl and gpio. the same thing is done for gpio and
pinctrl in two different patches.

Signed-off-by: Abdoulaye Berthe <berthe.ab@gmail.com>
Acked-by: Michael Büsch <m@bues.ch>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-09-18 11:03:10 -07:00
Antti Palosaari 9dc0f3fe3f [media] af9033: feed clock to RF tuner
IT9135 RF tuner clock is coming from demodulator. We need enable it
early in demod init, before any tuner I/O. Currently it is enabled
by tuner driver itself, but it is too late and performance will be
reduced as some registers are not updated correctly. Clock is
disabled automatically when demod is put onto sleep.

Cc: <stable@vger.kernel.org> # v3.15+
Cc: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-04 12:23:56 -03:00
Bimow Chen 0df6580c5f [media] af9033: update IT9135 tuner inittabs
Update IT9135 BX tuner config 60 and 61 inittabs.

[crope@iki.fi: removed two reg writes from driver init itself]
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Bimow Chen <Bimow.Chen@ite.com.tw>
Signed-off-by: Antti Palosaari <crope@iki.fi>

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-04 12:22:55 -03:00
Mauro Carvalho Chehab 89fffac802 [media] drxk_hard: fix bad alignments
drivers/media/dvb-frontends/drxk_hard.c:2224:3-22: code aligned with following code on line 2227

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 19:19:18 -03:00
Mauro Carvalho Chehab cea1300214 [media] drxd_hard: fix bad alignments
As reported by cocinelle:

drivers/media/dvb-frontends/drxd_hard.c:2632:3-51: code aligned with following code on line 2633

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 19:18:08 -03:00
Mauro Carvalho Chehab a16ae7d5bc [media] sp8870: fix bad alignments
As reported by cocinelle:

drivers/media/dvb-frontends/sp8870.c:395:2-14: code aligned with following code on line 397

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 19:18:08 -03:00
Mauro Carvalho Chehab 7c9950768f [media] stv0367: just return 0 instead of using a var
Instead of allocating a var to store 0 and just return it,
change the code to return 0 directly.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:28 -03:00
Mauro Carvalho Chehab 5a7f7b79d8 [media] drxk_hard: simplify test logic
instead of testing if it is false or true, just use
if (!foo) or if (foo). That makes the code easier to
read and shorter.

Also, properly initialize booleans with true or false.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:23 -03:00
Mauro Carvalho Chehab 79a5ee7882 [media] tda10071: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:17 -03:00
Mauro Carvalho Chehab 2fe15e2013 [media] af9013: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Also, instead of testing foo == false, just use the
simplified notation if(!foo).

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:16 -03:00
Mauro Carvalho Chehab afbd6eb4ba [media] m88ds3103: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:16 -03:00
Mauro Carvalho Chehab 285c0b005f [media] cxd2820r: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:15 -03:00
Mauro Carvalho Chehab 6a5e7fde3a [media] af9013: use true/false for boolean vars
Instead of using 0 or 1 for boolean, use the true/false
defines.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:14 -03:00
Mauro Carvalho Chehab 49bc89623d [media] stv0900_core: don't allocate a temporary var
The error return code STV0900_NO_ERROR happens only once, at
the end of the functions. So, just return it directly.

This driver should actually be fixed to return standard
Linux error codes, instead of its own macros, but this
should be done on a separate patchset.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 17:59:13 -03:00
Hans Verkuil e73c7bfea0 [media] si2165: fix sparse warning
drivers/media/dvb-frontends/si2165.c:329:16: warning: odd constant _Bool cast (ffffffffffffffea becomes 1)

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 10:00:36 -03:00
Hans Verkuil 817d2fd4cb [media] stv0367: fix sparse warnings
drivers/media/dvb-frontends/stv0367.c:557:5: warning: symbol 'stv0367cab_RF_LookUp1' was not declared. Should it be static?
drivers/media/dvb-frontends/stv0367.c:569:5: warning: symbol 'stv0367cab_RF_LookUp2' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 10:00:13 -03:00
Hans Verkuil fba16a1eee [media] bcm3510: fix sparse warnings
drivers/media/dvb-frontends/bcm3510.c:646:24: warning: cast to restricted __le16
drivers/media/dvb-frontends/bcm3510.c:647:24: warning: cast to restricted __le16

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 09:39:45 -03:00
Hans Verkuil ce08131c42 [media] mb86a16/mb86a20s: fix sparse warnings
drivers/media/dvb-frontends/mb86a16.c:31:14: warning: symbol 'verbose' was not declared. Should it be static?
drivers/media/dvb-frontends/mb86a20s.c:36:4: warning: symbol 'mb86a20s_subchannel' was not declared. Should it be static?
drivers/media/dvb-frontends/mb86a20s.c:1333:24: warning: symbol 'cnr_qpsk_table' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 09:37:47 -03:00
Hans Verkuil 4182438e65 [media] drxj: fix sparse warnings
drivers/media/dvb-frontends/drx39xyj/drxj.c:11768:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11768:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11768:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11768:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11770:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11770:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11770:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11770:25: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11794:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11796:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11796:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11796:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11796:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11798:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11798:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11798:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11798:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11800:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11800:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11800:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11800:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11605:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11605:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11605:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11605:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11632:29: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11632:29: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11632:29: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11632:29: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11650:34: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11652:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11652:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11652:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11652:34: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11654:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11654:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11654:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11654:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11656:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11656:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11656:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11656:33: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11670:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11670:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11670:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11670:35: warning: cast to restricted __be16
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11678:47: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11680:46: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32
drivers/media/dvb-frontends/drx39xyj/drxj.c:11682:51: warning: cast to restricted __be32

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 09:36:22 -03:00
Hans Verkuil 18ef20da8f [media] dib7000p: fix sparse warning
drivers/media/dvb-frontends/dib7000p.c:2562:5: warning: symbol 'dib7090_set_diversity_in' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-03 09:33:42 -03:00
Antti Palosaari 41b9aa0040 [media] m88ds3103: fix coding style issues
Fix coding style issues pointed out by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:54:13 -03:00
Antti Palosaari d28677ffbc [media] m88ds3103: change .set_voltage() implementation
Add some error checking and implement functionality a little bit
differently.

Cc: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:53:30 -03:00
CrazyCat e395e573b3 [media] si2168: DVB-T2 PLP selection implemented
DVB-T2 PLP selection implemented for Si2168 demod.
Tested with PCTV 292e.

Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:45:36 -03:00
Olli Salonen 868736ad34 [media] sp2: Add I2C driver for CIMaX SP2 common interface module
Driver for the CIMaX SP2 common interface chip. It is very much based on
the existing cimax2 driver for cx23885, but should be more reusable. The
product has been sold with name Atmel T90FJR as well and the data sheets
for that chip seem to be publicly available.

It seems that the USB device that I have and the cx23885 based devices will
need to interact differently with the chip for the CAM operations. Thus
there is one callback function that is passed on to the sp2 driver
(see function sp2_ci_op_cam for that one).

IRQ functionality is not included currently (not needed by USB devices
and I don't have a PCIe device for development).

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:06:49 -03:00
Olli Salonen 389ce3984b [media] si2168: add ts_mode setting and move to si2168_init
Luis Alves submitted a TS mode patch to si2168 earlier, but the
patch was rejected due to a small issue. Here is a working version.
Also, setting of TS mode is moved from si2168_set_frontend to
si2168_init.

This patch adds the TS mode as a config option for the si2168 demod:
- ts_mode added to config struct.
- Possible (interesting) values are
   * Parallel mode = 0x06
   * Serial mode = 0x03

Currently the modules using this demod only use parallel mode.
Patches for these modules later in this patch series.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:03:19 -03:00
nibble.max 79d0933032 [media] m88ds3103: implement set voltage and TS clock
Implement set voltage operation.
Separate TS clock as a own configuration parameter.
Add TS clock polarity parameter.

[crope@iki.fi: merge em28xx driver m88ds3103 config change patch
to that one, in order to keep build unbroken]

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 15:02:10 -03:00
Olli Salonen 37b4e43d8b [media] si2168: clean logging
Same thing for si2168 as Antti did earlier for tda18212:

There is no need to print module name nor function name as those
are done by kernel logging system when dev_xxx logging is used and
driver is proper I2C driver.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-09-02 14:57:27 -03:00
Mauro Carvalho Chehab 5b6aa19919 [media] as102-fe: Add a release function
This is needed to free state and for dvb_detach() to be
called.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:31 -05:00
Mauro Carvalho Chehab 4628f993bf [media] as102: add missing viterbi lock
In order to get FE_HAS_SYNC, the viterbi should already be
locked too. So, add the missing FE_HAS_VITERBI lock.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:31 -05:00
Mauro Carvalho Chehab dcae778148 [media] as102-fe: make it an independent driver
Move as102-fe to dvb-frontends directory and make it an
independent driver.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21 15:25:30 -05:00
Mauro Carvalho Chehab 7f196789b3 si2135: Declare the structs even if frontend is not enabled
As reported by Kbuildtest:

   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:57:9: warning: 'struct si2165_config' declared inside parameter list [enabled by default]
     struct i2c_adapter *i2c)
            ^
   drivers/media/dvb-frontends/si2165.h:57:9: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:157:21: error: variable 'hauppauge_930C_HD_1113xx_si2165_config' has initializer but incomplete type
    static const struct si2165_config hauppauge_930C_HD_1113xx_si2165_config = {
                        ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: error: unknown field 'i2c_addr' specified in initializer
     .i2c_addr = 0x64,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: warning: excess elements in struct initializer [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: error: unknown field 'chip_mode' specified in initializer
     .chip_mode = SI2165_MODE_PLL_XTAL,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:15: error: 'SI2165_MODE_PLL_XTAL' undeclared here (not in a function)
     .chip_mode = SI2165_MODE_PLL_XTAL,
                  ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: warning: excess elements in struct initializer [enabled by default]
     .chip_mode = SI2165_MODE_PLL_XTAL,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: error: unknown field 'ref_freq_Hz' specified in initializer
     .ref_freq_Hz = 16000000,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: warning: excess elements in struct initializer [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:163:21: error: variable 'pctv_quatro_stick_1114xx_si2165_config' has initializer but incomplete type
    static const struct si2165_config pctv_quatro_stick_1114xx_si2165_config = {
                        ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: error: unknown field 'i2c_addr' specified in initializer
     .i2c_addr = 0x64,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: warning: excess elements in struct initializer [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: error: unknown field 'chip_mode' specified in initializer
     .chip_mode = SI2165_MODE_PLL_EXT,
     ^
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:165:15: error: 'SI2165_MODE_PLL_EXT' undeclared here (not in a function)
     .chip_mode = SI2165_MODE_PLL_EXT,
                  ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: warning: excess elements in struct initializer [enabled by default]
     .chip_mode = SI2165_MODE_PLL_EXT,
     ^
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: error: unknown field 'ref_freq_Hz' specified in initializer
     .ref_freq_Hz = 24000000,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: warning: excess elements in struct initializer [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c: In function 'dvb_init':
   drivers/media/usb/cx231xx/cx231xx-dvb.c:731:3: warning: passing argument 1 of 'si2165_attach' from incompatible pointer type [enabled by default]
      dev->dvb->frontend = dvb_attach(si2165_attach,
      ^
   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:55:36: note: expected 'const struct si2165_config *' but argument is of type 'const struct si2165_config *'
    static inline struct dvb_frontend *si2165_attach(
                                       ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:764:3: warning: passing argument 1 of 'si2165_attach' from incompatible pointer type [enabled by default]
      dev->dvb->frontend = dvb_attach(si2165_attach,
      ^
   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:55:36: note: expected 'const struct si2165_config *' but argument is of type 'const struct si2165_config *'
    static inline struct dvb_frontend *si2165_attach(
                                       ^

That happens because the frontend was disabled by .config, but the
si2165_attach void stub require those structs, and also the
drivers that call it.

While here, remove the duplicated info about the possible I2C
addresses.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-28 10:37:08 -03:00
Matthias Schwarzott 3e54a1697a [media] si2165: Add demod driver for DVB-T only
DVB-T was tested  with 8MHz BW channels in germany
This driver is the simplest possible, it uses automatic mode for all
parameters (TPS).

Added spectrum inversion support.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Tested-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-27 17:01:41 -03:00
Mauro Carvalho Chehab 60ecb71a72 [media] remove some new warnings on drxj
changeset b601fe5688 did some cleanup, but didn't remove some
now unused vars:
	drivers/media/dvb-frontends/drx39xyj/drxj.c: In function 'drx39xxj_set_frontend':
	drivers/media/dvb-frontends/drx39xyj/drxj.c:12072:21: warning: unused variable 'uio_data' [-Wunused-variable]
	drivers/media/dvb-frontends/drx39xyj/drxj.c: In function 'drx39xxj_set_lna':
	drivers/media/dvb-frontends/drx39xyj/drxj.c:12230:21: warning: unused variable 'uio_data' [-Wunused-variable]
	drivers/media/dvb-frontends/drx39xyj/drxj.c:12229:20: warning: unused variable 'uio_cfg' [-Wunused-variable]
	drivers/media/dvb-frontends/drx39xyj/drxj.c:12224:6: warning: unused variable 'result' [-Wunused-variable]

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 11:57:09 -03:00
Shuah Khan b601fe5688 [media] media: drx39xyj - use drxj_set_lna_state() and remove duplicate LNA code
drx39xxj_set_lna() and drx39xxj_set_frontend() set LNA. Instead of
duplicating LNA configure code, change to use drxj_set_lna_state()
which sets LNA to the caller requested state (on or off).

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 11:22:51 -03:00
Shuah Khan 3074187111 [media] media: drx39xyj - fix to return actual error codes instead of -EIO
Several functions ignore the return values in error legs and always
return -EIO. This makes it hard to debug and take proper action in
calling routines.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 11:22:30 -03:00
Shuah Khan 998819d271 [media] media: drx39xyj - add resume support
drx39xyj driver lacks resume support. Add support by changing
its fe ops init interface to detect the resume status by checking
fe exit flag and do the necessary initialization. With this change,
driver resume correctly in both dvb adapter is not in use and in use
by an application cases.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 11:22:05 -03:00
Shuah Khan 5b22b1a4f7 [media] media: drx39xyj driver change to check fe exit flag from release
Change drx39xyj_release() to check fe exit flag to detect the
device disconnect state and avoid accessing the device after
it has been removed.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-26 11:19:21 -03:00
Antti Palosaari 69cc4bfab9 [media] Kconfig: rtl2832_sdr must depend on USB
Fixes error:
[next:master 7435/8702] ERROR: "usb_alloc_urb
[drivers/media/dvb-frontends/rtl2832_sdr.ko] undefined!

rtl2832_sdr driver implements own USB streaming for SDR data.
Logically that functionality belongs to USB interface driver, but
currently it is implemented here.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-25 19:32:04 -03:00
Himangi Saraogi 157a5fe90a [media] dib7000m: Remove unnecessary null test
This patch removes the null test on ch. ch is initialized at the
beginning of the function to &demod->dtv_property_cache. Since demod
is dereferenced prior to the null test, demod must be a valid pointer,
and &demod->dtv_property_cache cannot be null.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:42:23 -03:00
Mauro Carvalho Chehab 277bfd2f4d [media] mb86a20s: Fix the code that estimates the measurement interval
Instead of looking at the guard interval field, it was using
the interval length, with is wrong. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:34:03 -03:00
Mauro Carvalho Chehab 4247368bf7 [media] mb86a20s: Fix Interleaving
Interleaving code was wrong at mb86a20s: instead, it was looking
at the Guard Interval. Fix it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:33:41 -03:00
Mauro Carvalho Chehab 276dfc4b99 [media] mb86a20s: fix ISDB-T mode handling
The driver was reporting an incorrect mode, when mode 2
is selected.

While testing it, noticed that neither mode 1 or guard
interval 1/32 is supported by this device. Document it,
and ensure that it will report _AUTO when it doesn't lock,
in order to not report a wrong detection to userspace.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:33:25 -03:00
Antti Palosaari 4423a2ba80 [media] m88ds3103: implement BER
Implement read_ber for BER estimate.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:30:58 -03:00
Antti Palosaari 3ae266f80c [media] m88ds3103: fix SNR reporting on 32-bit arch
There was 32-bit calculation overflow. Use div_u64.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:28:26 -03:00
Fabian Frederick 045655a94d [media] dvb-frontends: remove unnecessary break after goto
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:26:57 -03:00
Emil Goode 8f73b481b9 [media] Cleanup line > 80 character violations
This cleans up some line over 80 character violations.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:24:24 -03:00
Emil Goode 20721185c9 [media] Remove checks of struct member addresses
This removes checks of struct member addresses since they likely result
in the condition always being true. Also in the stb6100_get_bandwidth
and tda8261_get_bandwidth functions the pointers frontend_ops and
tuner_ops are assigned the same addresses twice.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:23:53 -03:00
Heinrich Schuchardt 18d75a09e9 [media] media: dib9000: avoid out of bound access
This updated patch also fixes out of bound access to b[].

In dib9000_risc_apb_access_write() an out of bound access to mb[].

The current test to avoid out of bound access to mb[] is insufficient.
For len = 19 non-existent mb[10] will be accessed.

For odd values of len b[] is accessed out of bounds.

For large values of len an of bound access to mb[] may occur in
dib9000_mbx_send_attr.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22 21:15:41 -03:00