History log of /linux-master/drivers/media/dvb-frontends/drxk_hard.c
Revision Date Author Comments
# 86495af1 08-Sep-2023 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: dvb: symbol fixup for dvb_attach()

In commit 9011e49d54dc ("modules: only allow symbol_get of
EXPORT_SYMBOL_GPL modules") the use of symbol_get is properly restricted
to GPL-only marked symbols. This interacts oddly with the DVB logic
which only uses dvb_attach() to load the dvb driver which then uses
symbol_get().

Fix this up by properly marking all of the dvb_attach attach symbols as
EXPORT_SYMBOL_GPL().

Fixes: 9011e49d54dc ("modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules")
Cc: stable <stable@kernel.org>
Reported-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: linux-media@vger.kernel.org
Cc: linux-modules@vger.kernel.org
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Link: https://lore.kernel.org/r/20230908092035.3815268-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78e9ab0f 19-Jul-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: drxk: Use %*ph for printing hexdump of a small buffer

The kernel already has a helper to print a hexdump of a small
buffer via pointer extension. Use that instead of open coded
variant.

In long term it helps to kill pr_cont() or at least narrow down
its use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# f97fa3dc 03-Jul-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

lib/math: Move dvb_math.c into lib/math/int_log.c

Some existing and new users may benefit from the intlog2() and
intlog10() APIs, make them wide available.

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/20230619172019.21457-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20230703135211.87416-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# e78da4da 29-Jan-2023 Jonathan Neuschäfer <j.neuschaefer@gmx.net>

media: dvb-frontends: Fix a typo ("Unknow sleep mode")

Spell "unknown" correctly.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 20694e96 29-Aug-2022 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: dvb-frontends/drxk: initialize err to 0

Fix a compiler warning:

drivers/media/dvb-frontends/drxk_hard.c: In function 'drxk_read_ucblocks':
drivers/media/dvb-frontends/drxk_hard.c:6673:21: warning: 'err' may be used uninitialized [-Wmaybe-uninitialized]
6673 | *ucblocks = (u32) err;
| ^~~~~~~~~
drivers/media/dvb-frontends/drxk_hard.c:6663:13: note: 'err' was declared here
6663 | u16 err;
| ^~~

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 73854b86 04-Aug-2022 Jason Wang <wangborong@cdjrlc.com>

media: drxk: Fix comment typo

The double `for' is duplicated in the comment, remove one.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 1cef3942 21-Nov-2021 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: drxk: drop operation_mode from set_dvbt()

This var is set, but never used. So, drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# af7ab662 20-Nov-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

media: dvb-frontends: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break and a return statements
instead of just letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# c386e079 08-Oct-2020 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning

drxk_hard.c: In function 'hi_command.constprop':
drxk_hard.c:1016:5: warning: 'wait_cmd' may be used uninitialized in this function [-Wmaybe-uninitialized]
1015 | } while ((status < 0) && (retry_count < DRXK_MAX_RETRIES)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1016 | && (wait_cmd != 0));
| ^~~~~~~~~~~~~~~~~~

The underlying cause is that the while condition is wrong. It should be:

(status < 0 || wait_cmd) && (retry_count < DRXK_MAX_RETRIES)

'wait_cmd' is only valid if '!(status < 0)'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 29af79e1 16-Jun-2020 Sean Young <sean@mess.org>

media: drx-k: remove unused MulDiv32 function

This function has never been used. Found with clang:

drivers/media/dvb-frontends/drxk_hard.c:159:19: warning: unused function 'MulDiv32' [-Wunused-function]
static inline u32 MulDiv32(u32 a, u32 b, u32 c)

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 43c4dc3f 07-May-2020 Colin Ian King <colin.king@canonical.com>

media: dvb-frontends: remove redundant initialization of variable status

The variable status is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 89ee7f4f 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 461

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 only
as published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details to obtain the license point your browser to http
www gnu org copyleft gpl html

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 12 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Enrico Weigelt <info@metux.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081202.028166291@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 868c9a17 18-Feb-2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: dvb-frontends: fix several typos

Use codespell to fix lots of typos over frontends.

Manually verified to avoid false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# daad52c8 07-Dec-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: drxk_hard: check if parameter is not NULL

There is a smatch warning:
drivers/media/dvb-frontends/drxk_hard.c: drivers/media/dvb-frontends/drxk_hard.c:1478 scu_command() error: we previously assumed 'parameter' could be null (see line 1467)

Telling that parameter might be NULL. Well, it can't, due to the
way the driver works, but it doesn't hurt to add a check, in order
to shut up smatch.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 40e43111 07-Aug-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: cleanup fall-through comments

As Ian pointed out, adding a '-' to the fallthrough seems to meet
the regex requirements at level 3 of the warning, at least when
the comment fits into a single line.

So, replace by a single line the comments that were broken into
multiple lines just to make gcc -Wimplicit-fallthrough=3 happy.

Suggested-by: Ian Arkver <ian.arkver.dev@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# f1b1eabf 05-Jul-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: dvb: represent min/max/step/tolerance freqs in Hz

Right now, satellite frontend drivers specify frequencies in kHz,
while terrestrial/cable ones specify in Hz. That's confusing
for developers.

However, the main problem is that universal frontends capable
of handling both satellite and non-satelite delivery systems
are appearing. We end by needing to hack the drivers in
order to support such hybrid frontends.

So, convert everything to specify frontend frequencies in Hz.

Tested-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# c060a9fe 19-Jun-2018 Peter Rosin <peda@axentia.se>

media: drxk_hard: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)

Locking the root adapter for __i2c_transfer will deadlock if the
device sits behind a mux-locked I2C mux. Switch to the finer-grained
i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not
sit behind a mux-locked mux, the two locking variants are equivalent.

Signed-off-by: Peter Rosin <peda@axentia.se>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# fada1935 28-Dec-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: move dvb kAPI headers to include/media

Except for DVB, all media kAPI headers are at include/media.

Move the headers to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7369bbf2 17-Dec-2017 Nick Desaulniers <ndesaulniers@google.com>

media: dvb-frontends: remove extraneous parens

Fixes 2 warnings from Clang about extra parentheses in a conditional,
that might have been meant as assignment.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 34eb9751 27-Nov-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: drxj and drxk: don't produce kernel-doc warnings

Those drivers use a different notation for comments. While
it is not worth converting to kernel-doc, removing it is also
not an option.

So, just replace /** by /* and be happy :-)

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 06eeefe8 18-May-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] media drivers: annotate fall-through

Avoid warnings like those:

drivers/media/pci/ddbridge/ddbridge-core.c: In function 'dvb_input_detach':
drivers/media/pci/ddbridge/ddbridge-core.c:787:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (input->fe) {
^
drivers/media/pci/ddbridge/ddbridge-core.c:792:2: note: here
case 4:
^~~~
...

On several cases, it is just that gcc 7.1 is not capable of
understanding the comment, but on other places, we need an
annotation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# b73bb2ab 14-Mar-2017 Daniel Scheller <d.scheller@gmx.net>

[media] dvb-frontends/drxk: don't log errors on unsupported operation mode

When fe_ops.read_status is called and no channel is tuned (yet), the
subsequent calls to get_lock_status() causes the kernel log to be filled
with

drxk: Error -22 on get_lock_status

which either means a NULL pointer was passed for the p_lock_status var,
or neither QAM nor OFDM/DVBT operation mode are active. Instead of
filling the kernel log in the latter case, print out a message to the debug
level and return 0 (this isn't used in the calling drxk_get_stats() anyway).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 95fab47b 14-Mar-2017 Arushi Singhal <arushisinghal19971997@gmail.com>

staging: dvb-frontends: removed code in comments.

Commenting out Code is a Bad Idea.
Comments are their to explain the code and how the code achieves its
goal and as codes in the comments does not explain what the code is
doing so there is no use of commenting them.
So in this patch codes in the comments are removed.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2c149601 27-Feb-2017 Masahiro Yamada <yamada.masahiro@socionext.com>

scripts/spelling.txt: add "configuartion" pattern and fix typo instances

Fix typos and add the following to the scripts/spelling.txt:

configuartion||configuration

While we are here, fix the "ouput" as well in the touched hunk in
drivers/media/dvb-frontends/drx39xyj/drx_driver.h.

Link: http://lkml.kernel.org/r/1481573103-11329-23-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# bcb63314 28-Oct-2016 Sakari Ailus <sakari.ailus@linux.intel.com>

[media] media: Drop FSF's postal address from the source code files

Drop the FSF's postal address from the source code files that typically
contain mostly the license text. Of the 628 removed instances, 578 are
outdated.

The patch has been created with the following command without manual edits:

git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
drivers/media/ include/media|while read i; do i=$i perl -e '
open(F,"< $ENV{i}");
$a=join("", <F>);
$a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
close(F);
open(F, "> $ENV{i}");
print F $a;
close(F);'; done

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>


# bd336e63 09-Aug-2016 Max Kellermann <max.kellermann@gmail.com>

[media] dvb: make DVB frontend *_ops instances "const"

These are immutable. Making them "const" allows the compiler to move
them to the "rodata" section.

Note that cxd2841er_t_c_ops cannot be made "const", because
cxd2841er_attach() modifies it. Ouch!

[mchehab@s-opensource.com: fix merge conflicts]
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# d259a5ee 09-Aug-2016 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[media] drxd_hard: Add missing error code assignment before test

It is likely that checking the result of the 2nd 'read16' is expected here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 0df289a2 07-Jun-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] dvb: Get rid of typedev usage for enums

The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.

So, let's do it.

This patch was generated by this shell script:

for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done

While here, make CodingStyle fixes on the affected lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*


# 2f60f13c 05-Jun-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: better handle errors

As reported by smatch:
drivers/media/dvb-frontends/drxk_hard.c:3277 dvbt_sc_command() warn: missing break? reassigning 'status'

This is basically because the error handling logic there was crappy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 5a13e40b 08-May-2015 Mauro Carvalho Chehab <mchehab@kernel.org>

media: replace bellow -> below

Bellow is yelling. Ok, sometimes the code is yells a lot, but
but this is not the case there ;)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 9bc2dd7e 19-Nov-2014 Markus Elfring <elfring@users.sourceforge.net>

[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>


# 52ee29fe 28-Sep-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: Fix debug printks

This patch partially reverts 0fb220f2a5cb. 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>


# 89fffac8 03-Sep-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 5a7f7b79 03-Sep-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[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>


# 4b819724 13-Jan-2014 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: remove the option to load firmware asynchronously

The option to load firmware asynchronously were added due to
a requirement with a few versions of udev. It turns that this was
a bad idea and caused regressions on drxk-based devices.

So, we end by only letting the firmware to be loaded syncronously
everywhere.

So, let's remove the bad code.

This patch partially reverts the changeset 8e30783b0b3.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# f58c91ce 20-Oct-2013 Jonathan McCrohan <jmccrohan@gmail.com>

[media] media_tree: Fix spelling errors

Fix various spelling errors in strings and comments throughout the media
tree. The majority of these were found using Lucas De Marchi's codespell
tool.

[m.chehab@samsung.com: discard hunks with conflicts]

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 39c1cb2b 20-Oct-2013 Jonathan McCrohan <jmccrohan@gmail.com>

[media] media_tree: Fix spelling errors

Fix various spelling errors in strings and comments throughout the media
tree. The majority of these were found using Lucas De Marchi's codespell
tool.

[m.chehab@samsung.com: discard hunks with conflicts]

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# b1cf2019 04-Oct-2013 Hans Verkuil <hans.verkuil@cisco.com>

[media] drxk_hard: fix sparse warnings

drivers/media/dvb-frontends/drxk_hard.c:1086:62: warning: Using plain integer as NULL pointer
drivers/media/dvb-frontends/drxk_hard.c:2784:63: warning: Using plain integer as NULL pointer

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# ab5060cd 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: Remove most 80-cols checkpatch warnings

X-Patchwork-Delegate: mchehab@redhat.com
There are a few cases where breaking the code into separate
lines make it worse to read. However, on several places,
breaking it to make checkpatch.pl happier is OK and improves
code readability.
So, break longer lines where that won't cause harm.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 949dd08d 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: remove needless parenthesis

X-Patchwork-Delegate: mchehab@redhat.com
There are several places where: state->var = (some_var)
The parenthesis there are doing nothing but making it
harder to read and breaking the 80 columns soft limits.
Just get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# b72852ba 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: use usleep_range()

X-Patchwork-Delegate: mchehab@redhat.com
Fixes the following checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(10);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(1);

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 0fb220f2 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: don't split strings across lines

X-Patchwork-Delegate: mchehab@redhat.com
WARNING: quoted string split across lines
#5416: FILE: media/dvb-frontends/drxk_hard.c:5416:
+ dprintk(1, "Could not set demodulator parameters. Make "
+ "sure qam_demod_parameter_count (%d) is correct for "
WARNING: quoted string split across lines
#5423: FILE: media/dvb-frontends/drxk_hard.c:5423:
+ dprintk(1, "Auto-probing the correct QAM demodulator command "
+ "parameters was successful - using %d parameters.\n",

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 3a4398f5 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: use pr_info/pr_warn/pr_err/... macros

X-Patchwork-Delegate: mchehab@redhat.com
replace all occurrences of printk(KERN_* by
pr_info/pr_warn/pr_err/pr_debug/pr_cont macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# cd7a67a4 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: Don't use CamelCase

X-Patchwork-Delegate: mchehab@redhat.com
Thare are lots of CamelCase warnings produced by checkpatch.pl.
This weren't fixed at the time the driver got submitted due
to the lack of manpower do to such cleanup.
Now that I have one script that automates this task, cleans
it. That makes the driver almost checkpatch-compliant,
except for 80 column warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# b5e9eb6f 28-Apr-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: don't re-implement log10

X-Patchwork-Delegate: mchehab@redhat.com
Log10 routine is already defined at dvb_math.h and provides a good
enough approximation for 100 x log10(). So, instead of reinventing
the wheel, use the already existing function.
While here, don't use CamelCase on the function name.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# a3ad56d0 19-Mar-2013 Jean Delvare <khali@linux-fr.org>

[media] drxk_hard: Drop unused parameter

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>


# 48f72a1a 22-Mar-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: fix CNR calculus

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>


# 340e7696 20-Mar-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: Fix bogus signal strength indicator

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>


# 59a7a23c 20-Mar-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: use a better calculus for RF strength

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>


# 8f3741e0 20-Mar-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: Add pre/post BER and PER/UCB stats

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>


# 2b0e1f3a 20-Mar-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: remove dummy BER read code

The BER code does nothing but filling it with zero. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 9c768207 29-Nov-2012 Masanari Iida <standby24x7@gmail.com>

treewide: Fix typos in various drivers

Fix typos in printk within various drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 94af1b63 29-Oct-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: fix the return code from an error handler

While it is very unlikely, if the number of parameters for
QAMDemodulatorCommand is not 2 or 4, status become undefined:

/home/hans/work/build/v4l-dvb-git/drivers/media/dvb-frontends/drxk_hard.c: In function ‘QAMDemodulatorCommand’:
/home/hans/work/build/v4l-dvb-git/drivers/media/dvb-frontends/drxk_hard.c:5452:5: warning: ‘status’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 5a70972e 27-Oct-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk: get rid of some unused vars

drivers/media/dvb-frontends/drxk_hard.c:68:13: warning: 'IsA1WithPatchCode' defined but not used [-Wunused-function]
drivers/media/dvb-frontends/drxk_hard.c:73:13: warning: 'IsA1WithRomCode' defined but not used [-Wunused-function]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# ff38c216 25-Oct-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] drxk_hard: fix a few warnings

drivers/media/dvb-frontends/drxk_hard.c:68:6: warning: no previous prototype for 'IsA1WithPatchCode' [-Wmissing-prototypes]
drivers/media/dvb-frontends/drxk_hard.c:73:6: warning: no previous prototype for 'IsA1WithRomCode' [-Wmissing-prototypes]
drivers/media/dvb-frontends/drxk_hard.c:192:12: warning: no previous prototype for 'Frac28a' [-Wmissing-prototypes]
drivers/media/dvb-frontends/drxk_hard.c:590:5: warning: no previous prototype for 'PowerUpDevice' [-Wmissing-prototypes]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 8418366d 04-Oct-2012 Martin Blumenstingl <martin.blumenstingl@googlemail.com>

[media] drxk: Use the #define instead of hardcoded values

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 8e30783b 02-Oct-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

drxk: allow loading firmware synchrousnously

Due to udev-182, the firmware load was changed to be async, as
otherwise udev would give up of loading a firmware.

Add an option to return to the previous behaviour, async firmware
loads cause failures with the tda18271 driver.

Antti tested it with the following hardware:
Hauppauge WinTV HVR 930C
MaxMedia UB425-TC
PCTV QuatroStick nano (520e)

Tested-by: Antti Palosaari <crope@iki.fi>
Cc: stable@kernel.org # for Kernel 3.6 - please note that driver location has changed
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 9a0bf528 13-Aug-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] move the dvb/frontends to drivers/media/dvb-frontends

Raise the DVB frontends one level up, as the intention is to remove
the drivers/media/dvb directory.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>