History log of /linux-master/drivers/media/usb/dvb-usb-v2/af9015.c
Revision Date Author Comments
# a0ccbc65 26-Jan-2023 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: usb: dvb-usb-v2: af9015.c: return 0 instead of 'ret'.

Since 'ret' is known to be 0, just return '0'. This fixes two smatch warnings:

af9015.c:1168 af9015_rc_query() warn: missing error code? 'ret'
af9015.c:1177 af9015_rc_query() warn: missing error code? 'ret'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


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

media: usb: dvb-usb-v2: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding a couple of break 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>


# 1771e9fb 24-Jul-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

media: 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>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# c942fddf 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 3 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 as published by
the free software foundation either version 2 of the license or at
your option any later version 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

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [kishon] [vijay] [abraham]
[i] [kishon]@[ti] [com] 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

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version [author] [graeme] [gregory]
[gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
[kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
[hk] [hemahk]@[ti] [com] 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

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

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

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b2d109f2 13-Mar-2018 Antti Palosaari <crope@iki.fi>

media: af9015: correct some coding style issues

Correct coding style issues reported mostly by checkpatch.pl.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 8b79c7ab 13-Jul-2017 Antti Palosaari <crope@iki.fi>

media: af9015: convert to regmap api

Use regmap for chip register access.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7772e380 12-Jul-2017 Antti Palosaari <crope@iki.fi>

media: af9015: enhance streaming config

Replace static stream settings by one which enables and disables
stream interface when needed (TS streaming control).

1) Configure both TS IF and USB endpoints according to current use case

2) Disable streaming USB endpoints when streaming is stopped and
enable when streaming is started. Reduces sleep power consumption
slightly.

3) Reduce USB buffersize slightly, from 130848 to 98136 bytes

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 0092293e 26-Jun-2017 Antti Palosaari <crope@iki.fi>

media: af9015: refactor copy firmware to slave demod

Small improvements.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 2ffb2fa3 26-Jun-2017 Antti Palosaari <crope@iki.fi>

media: af9015: refactor firmware download

Small revise, no functional changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# ba2d559b 26-Jun-2017 Antti Palosaari <crope@iki.fi>

media: af9015: use af9013 demod pid filters

PID filters are moved to af9013 demod driver as those are property of
demod. As pid filters are now implemented correctly by demod driver,
we could enable pid filter support for possible slave demod too on
dual tuner configuration.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 04c611e3 23-Jun-2017 Antti Palosaari <crope@iki.fi>

media: af9015: attach demod using i2c binding

af9013 demod driver has i2c binding. Use it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 49bade9f 21-Jun-2017 Antti Palosaari <crope@iki.fi>

media: af9015: fix logging

Pass correct device to dev_* logging functions, which allows us to
remove redundant KBUILD_MODNAME and __func__ parameters from log format.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6d741bfe 07-Aug-2017 Sean Young <sean@mess.org>

media: rc: rename RC_TYPE_* to RC_PROTO_* and RC_BIT_* to RC_PROTO_BIT_*

RC_TYPE is confusing and it's just the protocol. So rename it.

Suggested-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# b5e0e1a3 13-Jun-2017 Antti Palosaari <crope@iki.fi>

[media] af9015: move 2nd demod power-up wait different location

We need to wait 2nd demod power-up before download firmware. Move
that wait to more correct location.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# e94db976 13-Jun-2017 Antti Palosaari <crope@iki.fi>

[media] af9015: enable 2nd TS flow control when dual mode

It needs to be enabled in order to get stream from slave af9013 demod.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# d83886ff1 12-Jun-2017 Antti Palosaari <crope@iki.fi>

[media] af9015: fix and refactor i2c adapter algo logic

* fix write+read when write has more than one byte
* remove lock, not needed on that case
* remove useless i2c msg send loop, as we support only write, read and
write+read as one go and nothing more

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 5ded0eb7 05-Feb-2017 Antti Palosaari <crope@iki.fi>

[media] af9015: use correct 7-bit i2c addresses

Driver was using wrong "8-bit" i2c addresses for demods and tuners.
Internal demod i2c address was not set at all. These are needed
to be fixed before proper i2c client binding is used.

Signed-off-by: Antti Palosaari <crope@iki.fi>
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>


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


# 9165dabb 17-Sep-2016 Masanari Iida <standby24x7@gmail.com>

treewide: Fix printk() message errors

This patch fix spelling typos in printk and kconfig.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 2ceeca04 21-Sep-2016 Sean Young <sean@mess.org>

[media] rc: split nec protocol into its three variants

Currently we do not know what variant (bit length) of the nec protocol
is used, other than from guessing from the length of the scancode. Now
nec will be handled the same way as the sony protocol or the rc6 protocol;
one variant per bit length.

In the future we might want to expose the rc protocol type to userspace
and we don't want to be introducing this world of pain into userspace
too.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# ef703f49 26-May-2016 George Spelvin <linux@sciencehorizons.net>

Eliminate bad hash multipliers from hash_32() and hash_64()

The "simplified" prime multipliers made very bad hash functions, so get rid
of them. This completes the work of 689de1d6ca.

To avoid the inefficiency which was the motivation for the "simplified"
multipliers, hash_64() on 32-bit systems is changed to use a different
algorithm. It makes two calls to hash_32() instead.

drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
for some horrible reason, so it inherits a copy of the old definition.

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.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/*


# 74426324 20-Aug-2014 Hans Verkuil <hans.verkuil@cisco.com>

[media] af9015: fix sparse warning

drivers/media/usb/dvb-usb-v2/af9015.c:422:38: warning: cast to restricted __le32

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


# 120703f9 03-Apr-2014 David Härdeman <david@hardeman.nu>

[media] rc-core: document the protocol type

Right now the protocol information is not preserved, rc-core gets handed a
scancode but has no idea which protocol it corresponds to.

This patch (which required reading through the source/keymap for all drivers,
not fun) makes the protocol information explicit which is important
documentation and makes it easier to e.g. support multiple protocols with one
decoder (think rc5 and rc-streamzap). The information isn't used yet so there
should be no functional changes.

[m.chehab@samsung.com: rebased, added cxusb and removed bad whitespacing]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 65e2f1cb 02-Nov-2013 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] af9015: Don't use dynamic static allocation

Dynamic static allocation is evil, as Kernel stack is too low, and
compilation complains about it on some archs:
drivers/media/usb/dvb-usb-v2/af9015.c:433:1: warning: 'af9015_eeprom_hash' uses dynamic stack allocation [enabled by default]
In this specific case, it is a gcc bug, as the size is a const, but
it is easy to just change it from const to a #define, getting rid of
the gcc warning.

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


# e8c7aab5 07-Jan-2013 Antti Palosaari <crope@iki.fi>

[media] af9015: reject device TerraTec Cinergy T Stick Dual RC (rev. 2)

That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# aff8c2d4 26-Feb-2013 Antti Palosaari <crope@iki.fi>

[media] af9015: do not use buffers from stack for usb_bulk_msg()

WARNING: at lib/dma-debug.c:947 check_for_stack+0xa7/0xf0()
ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack

Reported-by: poma <pomidorabelisima@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 37b44a0f 04-Jan-2013 Antti Palosaari <crope@iki.fi>

[media] dvb_usb_v2: use IS_ENABLED() macro

replace:
#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
with:
#if IS_ENABLED(CONFIG_RC_CORE)

Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# b6215596 09-Dec-2012 Antti Palosaari <crope@iki.fi>

[media] af9015: make remote controller optional

Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# c003ab1b 11-Oct-2012 David Härdeman <david@hardeman.nu>

[media] rc-core: add separate defines for protocol bitmaps and numbers

The RC_TYPE_* defines are currently used both where a single protocol is
expected and where a bitmap of protocols is expected.

Functions like rc_keydown() and functions which add/remove entries to the
keytable want a single protocol. Future userspace APIs would also
benefit from numeric protocols (rather than bitmap ones). Keytables are
smaller if they can use a small(ish) integer rather than a bitmap.

Other functions or struct members (e.g. allowed_protos,
enabled_protocols, etc) accept multiple protocols and need a bitmap.

Using different types reduces the risk of programmer error. Using a
protocol enum whereever possible also makes for a more future-proof
user-space API as we don't need to worry about a sufficient number of
bits being available (e.g. in structs used for ioctl() calls).

The use of both a number and a corresponding bit is dalso one in e.g.
the input subsystem as well (see all the references to set/clear bit when
changing keytables for example).

This patch separate the different usages in preparation for
upcoming patches.

Where a single protocol is expected, enum rc_type is used; where one or more
protocol(s) are expected, something like u64 is used.

The patch has been rewritten so that the format of the sysfs "protocols"
file is no longer altered (at the loss of some detail). The file itself
should probably be deprecated in the future though.

Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# c2c1b415 28-Sep-2012 Peter Senna Tschudin <peter.senna@gmail.com>

[media] drivers/media: Remove unnecessary semicolon

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p
@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

[mchehab@redhat.com: some hunks got bitroted; applied only the
ones that succeeds]
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
[crope@iki.fi: For my drivers a8293, af9013, af9015, af9035]
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# e1e9e510 12-Sep-2012 Antti Palosaari <crope@iki.fi>

[media] af9015: correct few error codes

Plain '-1' is not very good error code. Use more suitable error
code definitions.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 2e35c66f 12-Sep-2012 Antti Palosaari <crope@iki.fi>

[media] af9015: improve af9015_eeprom_hash()

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# f224749b 12-Sep-2012 Antti Palosaari <crope@iki.fi>

[media] af9015: use Kernel dev_foo() logging

... and some minor logging changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# bab9b4fe 12-Sep-2012 Antti Palosaari <crope@iki.fi>

[media] af9015: declare MODULE_FIRMWARE

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 04966aa8 14-Aug-2012 Antti Palosaari <crope@iki.fi>

[media] dvb_usb_v2: af9015, af9035, anysee use .reset_resume

All these seems to survive .reset_resume.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>


# 786baecf 14-Jun-2012 Mauro Carvalho Chehab <mchehab@kernel.org>

[media] dvb-usb: move it to drivers/media/usb/dvb-usb

As media/dvb will be removed, move it to a proper place.

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