au8522_attach is dependent on CONFIG_DVB_AU8522_DTV, not CONFIG_DVB_AU8522.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now that au0828 has been converted to the control framework these
compatilibity ops are no longer needed.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This ioctl is defined as IOW, so pass the argument as const.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Last parameter of function GetLockStatus() isn't used so drop it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Changeset 8f3741e accidentally broke the CNR estimation. It should
be calculated as "a + b - c". However, previously, the subtraction
by c only occurred if SNR would be positive, due to a bad binding
to DVBv3 API.
This also fixes the following warning:
drivers/media/dvb-frontends/drxk_hard.c:2556:6: warning: variable 'c' set but not used [-Wunused-but-set-variable]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Use register address auto increment to reduce I/O when large
register / values tables are written.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
That register is property of demodulator so move it correct place.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Those are demodulator init tables according to used tuner tuner
config. af9033 demod driver does those inits currently and due
to that these duplicate inits could be removed.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from the Windows driver version 12.07.06.1
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dumped out from Windows driver version 12.07.06.1, 07/06/2012.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add support for tuners integrated to the IT9135 and IT9137.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The Kconfig entry for "TS2020 based tuners" defaults to modular if
DVB_FE_CUSTOMISE is set. But that Kconfig symbol was replaced with
MEDIA_SUBDRV_AUTOSELECT as of v3.7. So use the new symbol. And negate
the logic, so we are in line with all the similar entries in this file.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The DVBv3 signal strength indicator is bogus: it doesn't range
from 0 to 65535 as it would be expected. Also, 0 means the max
signal strength.
Now that a better way to estimate it was added, use the new
way.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The AZ6007 driver released by Terratec has a better way to
estimate the signal strength, at CtrlSigStrength(). Port it
to the driver.
It should be noticed that there are two parameters there that
are tuner-specific.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The original az6007 driver has the code to calculate such
stats. Add it to the driver, reporting them via DVBv5
stats API.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
goto err and goto err_gateoff before mutex_lock(&state->internal->demod_lock)
lead to unlock of unheld mutex in stv090x_sleep().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Now that some devices initialize register 0x2a with different
values, add the calculus formula, instead of hardcoding it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Up to now, the driver was simply assuming TV mode, 13 segs.
Implement the logic to control the ISDB operational mode.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signal strength is always available. There's no reason to reset
it, as it has its own logic to reset it already.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Always init the frontend when set_frontend is called. The rationale
is: it was noticed that, on some devices, it fails to lock with a
different channel. It seems that some other registers need to be
restored to its initial state, when the channel changes.
As it is better to reset everything, even wasting a few more
miliseconds than to loose channel lock, let's change the logic
to always reset.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Use the AGC settings present on a newer device.
The initial settings were taken from one of the first devices with
mb86a20s, and there are several reports that this is not working
properly on some places.
So, instead of keeping using it, get the parameters taken from a
newer device. Tests are welcomed.
Tested also with cx231xx PixelView SBTVD Hybrid with no regressions
noticed so far.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
State 9 means TS started to be output, and it should be
associated with FE_HAS_SYNC.
The mb86a20scan get CNR statistics at state 7, when frame sync
is obtained.
As CNR may help to adjust the antenna, provide it earlier.
A latter patch could eventually start outputing MER measures
earlier, but that would require a bigger change, and probably
won't be better than the current way, as the time between
changing from state 8 to 9 is generally lower than the time
to get the stats collected.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of hardcoding a fixed IF frequency of 3.3 MHz, use
the IF frequency provided by the tuner driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
There are a few debug tests that are shown with dev_err() or
dev_info(). Replace them by dev_dbg().
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The address of a variable is impossible to be null, so we remove the check.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This patch introduces the use of IS_ENABLED() macro. For example,
replacing:
#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
with:
#if IS_ENABLED(CONFIG_I2C)
All changes made by this patch respect the same replacement pattern.
Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Sometimes there is a problem when trying to access the non-existing registers
of the second demodulator path on the STV0903.
This change removes the calls in case the driver is used on a STV0903.
Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The logic that resets the device is wrong. It should be resetting
just the layer that got read. Also, stop is needed before updating
the counters.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
The logic that resets the device is wrong. It should be resetting
just the layer that got read. Also, stop is needed before updating
the counters.
While there, rename it, as we'll soon introduce a postBER logic
there.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add both per-layer and global block error count and block count,
for PER and UCB measurements.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add Signal/Noise ratio measurement. On this device, a global measure
is taken by the demod. It also provides per-layer CNR measurements,
based on Modulation Error measures (MER).
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Do a better job on setting the bit error counters, in order to
have all layer measures to happen in a little less than one
second.
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Add the methods to read bit error/bit count measurements from
mb86a20s. On ISDB-T devices, those reads are done per layer.
However, as userspace applications may not be aware of that,
add a global measure that will sum the bit errors and bit
counts for each layer, storing them into a global value.
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Instead of providing separate callbacks to read the several FE
stats properties, the better seems to use just one method that will:
- Read lock status;
- Read signal strength;
- if locked, get TMCC data;
- if locked, get DVB statistics.
As the DVB frontend thread will call this read_status callback
on every 3 seconds, and userspace can even call it earlier,
all stats data and layers layout will be updated together if
available, with is a good thing.
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
As reported by Feng's kbuild test:
From: kbuild test robot <fengguang.wu@intel.com>
Subject: drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: potential null dereference 'state'. (kzalloc returns null)
Date: Wed, 23 Jan 2013 19:30:43 +0800
commit: f66d81b54d [media] mb86a20s: convert it to use dev_info/dev_err/dev_dbg
drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: potential null dereference 'state'. (kzalloc returns null)
drivers/media/dvb-frontends/mb86a20s.c:706 mb86a20s_attach() error: we previously assumed 'state' could be null (see line 705)
As, at mb86a20s_attach(), we have an i2c pointer, use it for all printk
messages there, instead of state->i2c.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>