History log of /linux-master/drivers/media/usb/dvb-usb-v2/dvbsky.c
Revision Date Author Comments
# 387caebe 17-Jun-2021 Ján Čáni <pego149@gmail.com>

media: dvbsky: add support for MyGica T230C2_LITE and T230A

Add Geniatech MyGica T230C2_LITE and T230A as many people
are asking support for these devices on forums.

Link: https://lore.kernel.org/linux-media/YMuptIYFLdwSmw//@kali

Signed-off-by: Ján Čáni <pego149@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# e095406a 29-Sep-2020 Julia Lawall <Julia.Lawall@inria.fr>

media: dvbsky: use semicolons rather than commas to separate statements

Replace commas with semicolons. Commas introduce unnecessary
variability in the code structure and are hard to see. What is done
is essentially described by the following Coccinelle semantic patch
(http://coccinelle.lip6.fr/):

// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>

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


# bc76369b 02-Jun-2020 Jan Pieter van Woerkom <jp@jpvw.nl>

media: dvbsky: MyGica T230* receivers also do DVB-C and DVB-T

MyGica T230* receivers also do DVB-C and DVB-T: change their names.

Signed-off-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 130ec3df 22-Oct-2019 Jan Pieter van Woerkom <jp@jpvw.nl>

media: dvbsky: remove unused code

remove unused code

Signed-off-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>


# 14494583 02-Oct-2019 Thomas Voegtle <tv@lio96.de>

media: dvbsky: add support for eyeTV Geniatech T2 lite

Adds USB ID for the eyeTV Geniatech T2 lite to the dvbsky driver.
This is a Geniatech T230C based stick without IR and a different USB ID.

Signed-off-by: Thomas Voegtle <tv@lio96.de>
Tested-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# cecf0bbb 29-Sep-2019 Andrei Koshkosh <andreykosh000@mail.ru>

media: dvbsky: use a single mutex and state buffers for all R/W ops

Re-use usb_mutex from dvb_usb_device for this.

Tested-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Signed-off-by: Andrei Koshkosh <andreykosh000@mail.ru>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# a9547e52 15-Aug-2019 Jan Pieter van Woerkom <jp@jpvw.nl>

media: dvb-usb: add T230 to dvbsky

commit 5fa88151ecdb ("[media] dvb-usb-cxusb: Geniatech T230 - resync TS
FIFO after lock") does not solve the problem for all devices. This is the
same issue reported on the T230C, which was moved to the dvbsky.c driver
to work around this issue in commit 5742240577b6 ("media: dvbsky: MyGica
T230C support").

In addition, the cxusb driver causes an oops when unplugging the device
while streaming; this problem does not happen any more.

Signed-off-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Tested-by: James Hutchinson <jahutchinson99@googlemail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 66193b24 17-Jul-2019 Jan Pieter van Woerkom <jp@jpvw.nl>

media: dvbsky: add support for Mygica T230C v2

Adds support for the "Mygica T230C v2" to the dvbsky driver.

Signed-off-by: Jan Pieter van Woerkom <jp@jpvw.nl>
Tested-by: Frank Rysanek <Frantisek.Rysanek@post.cz>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@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>


# fec2e415 19-May-2019 Stefan Brüns <stefan.bruens@rwth-aachen.de>

media: dvbsky: Remove duplicate error reporting for dvbsky_usb_generic_rw

Errors are already reported by the common code in dvb_usb_v2_generic_io
(which dvbsky_usb_generic_rw is a wrapper of), so there is no reason
report the error again.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# fdfa59cd 19-Jan-2019 Stefan Brüns <stefan.bruens@rwth-aachen.de>

media: dvbsky: Avoid leaking dvb frontend

Commit 14f4eaeddabc ("media: dvbsky: fix driver unregister logic") fixed
a use-after-free by removing the reference to the frontend after deleting
the backing i2c device.

This has the unfortunate side effect the frontend device is never freed
in the dvb core leaving a dangling device, leading to errors when the
dvb core tries to register the frontend after e.g. a replug as reported
here: https://www.spinics.net/lists/linux-media/msg138181.html

media: dvbsky: issues with DVBSky T680CI

===
[ 561.119145] sp2 8-0040: CIMaX SP2 successfully attached
[ 561.119161] usb 2-3: DVB: registering adapter 0 frontend 0 (Silicon Labs
Si2168)...
[ 561.119174] sysfs: cannot create duplicate filename '/class/dvb/
dvb0.frontend0'
===

The use after free happened as dvb_usbv2_disconnect calls in this order:
- dvb_usb_device::props->exit(...)
- dvb_usbv2_adapter_frontend_exit(...)
+ if (fe) dvb_unregister_frontend(fe)
+ dvb_usb_device::props->frontend_detach(...)

Moving the release of the i2c device from exit() to frontend_detach()
avoids the dangling pointer access and allows the core to unregister
the frontend.

This was originally reported for a DVBSky T680CI, but it also affects
the MyGica T230C. As all supported devices structure the registration/
unregistration identically, apply the change for all device types.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 9afc8219 05-Oct-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

Revert "media: dvbsky: use just one mutex for serializing device R/W ops"

As pointed at:
https://bugzilla.kernel.org/show_bug.cgi?id=199323

This patch causes a bad effect on RPi. I suspect that the root
cause is at the USB out of tree RPi driver, with uses high priority
interrupts instead of normal ones. Anyway, as this patch
is mostly a cleanup, better to revert it.

This reverts commit 7d95fb746c4eece67308f1642a666ea1ebdbd2cc.

Cc: stable@vger.kernel.org # For Kernel 4.18
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# 7d95fb74 26-Apr-2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

media: dvbsky: use just one mutex for serializing device R/W ops

Right now, there are two mutexes serializing r/w ops: one "generic"
and another one specifically for stream on/off.

Clean it a little bit, getting rid of one of the mutexes.

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


# 14f4eaed 08-Mar-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: dvbsky: fix driver unregister logic

There's a user-after-free there, if the frontend is attached
via the new I2C way:

[ 112.539806] usbcore: deregistering interface driver dvb_usb_dvbsky
[ 112.568489] ==================================================================
[ 112.568600] BUG: KASAN: use-after-free in dvb_unregister_frontend+0x18/0xb0 [dvb_core]
[ 112.568610] Read of size 8 at addr ffff8803a6f61530 by task rmmod/2246

[ 112.568622] CPU: 0 PID: 2246 Comm: rmmod Not tainted 4.16.0-rc4+ #103
[ 112.568624] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
[ 112.568625] Call Trace:
[ 112.568631] dump_stack+0x5c/0x7c
[ 112.568636] print_address_description+0x6a/0x270
[ 112.568640] kasan_report+0x258/0x380
[ 112.568657] ? dvb_unregister_frontend+0x18/0xb0 [dvb_core]
[ 112.568673] dvb_unregister_frontend+0x18/0xb0 [dvb_core]
[ 112.568681] dvb_usbv2_exit+0x156/0x4a0 [dvb_usb_v2]
[ 112.568689] dvb_usbv2_disconnect+0xa0/0x140 [dvb_usb_v2]
[ 112.568694] usb_unbind_interface+0xd8/0x3f0
[ 112.568700] device_release_driver_internal+0x1ce/0x2f0
[ 112.568705] driver_detach+0x66/0xc0
[ 112.568709] bus_remove_driver+0x86/0x150
[ 112.568713] usb_deregister+0x90/0x180
[ 112.568718] SyS_delete_module+0x293/0x330
[ 112.568721] ? free_module+0x330/0x330
[ 112.568725] ? _cond_resched+0x16/0x50
[ 112.568729] ? task_work_run+0x7d/0xd0
[ 112.568732] ? mem_cgroup_handle_over_high+0x1c/0xc0
[ 112.568736] ? free_module+0x330/0x330
[ 112.568740] do_syscall_64+0xe7/0x250
[ 112.568744] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 112.568747] RIP: 0033:0x7facafa272a7
[ 112.568749] RSP: 002b:00007fffdea14cc8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 112.568753] RAX: ffffffffffffffda RBX: 00007fffdea14d28 RCX: 00007facafa272a7
[ 112.568755] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005599557337c8
[ 112.568756] RBP: 0000559955733760 R08: 000000000000000a R09: 0000000000000000
[ 112.568758] R10: 00007facafaa0280 R11: 0000000000000206 R12: 00007fffdea14ef0
[ 112.568761] R13: 00007fffdea16eac R14: 0000559955733260 R15: 0000559955733760

[ 112.568808] Allocated by task 638:
[ 112.568816] kasan_kmalloc+0xa0/0xd0
[ 112.568820] kmem_cache_alloc_trace+0x114/0x230
[ 112.568826] m88ds3103_probe+0x9a/0x643 [m88ds3103]
[ 112.568830] i2c_device_probe+0x2e9/0x3c0
[ 112.568833] driver_probe_device+0x46e/0x6a0
[ 112.568836] bus_for_each_drv+0xd6/0x130
[ 112.568838] __device_attach+0x166/0x1f0
[ 112.568841] bus_probe_device+0xea/0x110
[ 112.568844] device_add+0x6a3/0x9f0
[ 112.568847] i2c_new_device+0x28f/0x5c0
[ 112.568861] dvb_module_probe+0x91/0x110 [dvb_core]
[ 112.568867] dvbsky_s960c_attach+0x1c4/0x460 [dvb_usb_dvbsky]
[ 112.568873] dvb_usbv2_probe+0x1191/0x1950 [dvb_usb_v2]
[ 112.568877] usb_probe_interface+0x1b3/0x430
[ 112.568880] driver_probe_device+0x46e/0x6a0
[ 112.568882] __driver_attach+0xeb/0x110
[ 112.568885] bus_for_each_dev+0xe4/0x140
[ 112.568888] bus_add_driver+0x249/0x380
[ 112.568891] driver_register+0xc6/0x170
[ 112.568893] usb_register_driver+0xec/0x200
[ 112.568896] do_one_initcall+0x8f/0x1ee
[ 112.568900] do_init_module+0xde/0x320
[ 112.568902] load_module+0x3ed0/0x4850
[ 112.568905] SYSC_finit_module+0x192/0x1c0
[ 112.568908] do_syscall_64+0xe7/0x250
[ 112.568911] entry_SYSCALL_64_after_hwframe+0x3d/0xa2

[ 112.568916] Freed by task 2246:
[ 112.568923] __kasan_slab_free+0x136/0x180
[ 112.568925] kfree+0xa5/0x1e0
[ 112.568931] m88ds3103_remove+0x42/0x60 [m88ds3103]
[ 112.568934] i2c_device_remove+0x72/0xd0
[ 112.568937] device_release_driver_internal+0x1ce/0x2f0
[ 112.568940] bus_remove_device+0x197/0x270
[ 112.568942] device_del+0x239/0x550
[ 112.568945] device_unregister+0x16/0x70
[ 112.568949] dvbsky_exit+0x4c/0x70 [dvb_usb_dvbsky]
[ 112.568955] dvb_usbv2_disconnect+0x98/0x140 [dvb_usb_v2]
[ 112.568958] usb_unbind_interface+0xd8/0x3f0
[ 112.568961] device_release_driver_internal+0x1ce/0x2f0
[ 112.568964] driver_detach+0x66/0xc0
[ 112.568967] bus_remove_driver+0x86/0x150
[ 112.568970] usb_deregister+0x90/0x180
[ 112.568973] SyS_delete_module+0x293/0x330
[ 112.568976] do_syscall_64+0xe7/0x250
[ 112.568979] entry_SYSCALL_64_after_hwframe+0x3d/0xa2

[ 112.568985] The buggy address belongs to the object at ffff8803a6f61100
which belongs to the cache kmalloc-2048 of size 2048
[ 112.568998] The buggy address is located 1072 bytes inside of
2048-byte region [ffff8803a6f61100, ffff8803a6f61900)
[ 112.569008] The buggy address belongs to the page:
[ 112.569015] page:ffffea000e9bd800 count:1 mapcount:0 mapping:0000000000000000 index:0x0 compound_mapcount: 0
[ 112.569025] flags: 0x17ffe000008100(slab|head)
[ 112.569034] raw: 0017ffe000008100 0000000000000000 0000000000000000 00000001000f000f
[ 112.569044] raw: ffffea000ee2d000 0000000500000005 ffff880407002a80 0000000000000000
[ 112.569053] page dumped because: kasan: bad access detected

[ 112.569062] Memory state around the buggy address:
[ 112.569070] ffff8803a6f61400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 112.569079] ffff8803a6f61480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 112.569088] >ffff8803a6f61500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 112.569095] ^
[ 112.569103] ffff8803a6f61580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 112.569112] ffff8803a6f61600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 112.569119] ==================================================================
[ 112.569127] Disabling lock debugging due to kernel taint
[ 112.571161] dvb_usb_v2: 'DVBSky S960CI:2-2' successfully deinitialized and disconnected

Fix it by letting the dvb-usb-v2 core to know that the frontend
was already removed.

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


# 2c7e3ca8 08-Mar-2018 Mauro Carvalho Chehab <mchehab@kernel.org>

media: dvbsky: use the new dvb_module_probe() API

Instead of repeating countless times a complex logic, use
the new dvb_module_probe()/dvb_module_release(), simplifying
the module.

That reduced about 15% at the module's size:

text data bss dec hex filename
7083 1108 12 8203 200b old/drivers/media/usb/dvb-usb-v2/dvbsky.o
5817 1108 12 6937 1b19 new/drivers/media/usb/dvb-usb-v2/dvbsky.o

Tested with a DVBSky S960C DVB-S2 tuner (0572:960c)

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


# 57422405 16-Feb-2017 Stefan Brüns <stefan.bruens@rwth-aachen.de>

media: dvbsky: MyGica T230C support

Mygica T230 DVB-T/T2/C USB stick support. It uses the same FX2/Si2168
bridge/demodulator combo as the other devices supported by the driver,
but uses the Si2141 tuner.
Several DVB-T (MPEG2) and DVB-T2 (H.265) channels were tested, as well as
the included remote control.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 021c01d3 01-Nov-2017 Mauro Carvalho Chehab <mchehab@kernel.org>

media: dvbsky: shut up a bogus warning

Smatch gives two bogus warnings on this driver:
drivers/media/usb/dvb-usb-v2/dvbsky.c:336 dvbsky_s960_attach() error: uninitialized symbol 'i2c_adapter'.
drivers/media/usb/dvb-usb-v2/dvbsky.c:459 dvbsky_s960c_attach() error: uninitialized symbol 'i2c_adapter'.

Shut them up.

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>


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


# 82b65714 09-Sep-2016 Olli Salonen <olli.salonen@iki.fi>

[media] dvb-usb-dvbsky: Add support for TechnoTrend S2-4650 CI

TechnoTrend TT-connect S2-4650 CI seems to be a variation of
the DVBSky S960CI device.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# d309c8bb 06-Jan-2016 Torbjörn Jansson <torbjorn.jansson@mbox200.swipnet.se>

[media] dvb-usb-dvbsky: add new product id for TT CT2-4650 CI

Add a new product id to dvb-usb-dvbsky for new version of TechnoTrend CT2-4650 CI

Signed-off-by: Torbjörn Jansson <torbjorn.jansson@mbox200.swipnet.se>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# c5d89a49 28-Nov-2015 Benjamin Larsson <benjamin@southpole.se>

[media] Add support for Terratec Cinergy S2 Rev.4

Also Add Terratec Cinergy S2 usb id's

Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 2788052a 19-Sep-2015 Erik Andresen <erik@vontaene.de>

[media] Add Terratec H7 Revision 4 to DVBSky driver

Adds Terratec H7 Rev. 4 with USB id 0ccd:10a5 to DVBSky driver.

Signed-off-by: Erik Andresen <erik@vontaene.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0f91c9d6 25-May-2015 David Howells <dhowells@redhat.com>

[media] TS2020: Calculate tuner gain correctly

The TS2020 and TS2022 tuners take an input from the demodulator indicating the
AGC setting on that component that is then used to influence the tuner's own
gain. This should be taken into account when calculating the gain and signal
strength.

Further, the existing TS2020 driver miscalculates the signal strength as the
result of its calculations can exceed the storage capacity of the 16-bit word
used to return it to userspace.

To this end:

(1) Add a callback function (->get_agc_pwm()) in the ts2020_config struct that
the tuner can call to get the AGC PWM value from the demodulator.

(2) Modify the TS2020 driver to calculate the gain according to Montage's
specification with the adjustment that we produce a negative value and
scale it to 0.001dB units (which is what the DVBv5 API will require):

(a) Callback to the demodulator to retrieve the AGC PWM value and then
turn that into Vagc for incorporation in the calculations. If the
callback is unset, assume a Vagc of 0.

(b) Calculate the tuner gain from a combination of Vagc and the tuner's RF
gain and baseband gain settings.

(3) Turn this into a percentage signal strength as per Montage's
specification for return to userspace with the DVBv3 API.

(4) Provide a function in the M88DS3103 demodulator driver that can be used to
get the AGC PWM value on behalf of the tuner.

(5) The ts2020_config.get_agc_pwm function should be set by the code that
stitches together the drivers for each card.

For the DVBSky cards that use the M88DS3103 with the TS2020 or the TS2022,
set the get_agc_pwm function to point to m88ds3103_get_agc_pwm.

I have tested this with a DVBSky S952 card which has an M88DS3103 and a TS2022.

Thanks to Montage for providing access to information about the workings of
these parts.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.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/*


# ee3c3e46 05-May-2015 Olli Salonen <olli.salonen@iki.fi>

[media] si2157: support selection of IF interface

The chips supported by the si2157 driver have two IF outputs (either
pins 12+13 or pins 9+11). Instead of hardcoding the output to be used
add an option to choose which output shall be used.

As this patch changes the default behaviour, the IF interface is
specified in each driver currently using si2157 driver. This is to
keep bisectability.

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>


# c060f932 05-May-2015 Olli Salonen <olli.salonen@iki.fi>

[media] dvbsky: use si2168 config option ts_clock_gapped

Change the dvbsky driver to support gapped clock instead of the current
hack.

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>


# f31a6386 23-Mar-2015 Antti Palosaari <crope@iki.fi>

[media] dvbsky: switch ts2022 to ts2020 driver

Change ts2022 driver to ts2020 driver. ts2020 driver supports
both tuner chip models.

Cc: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 134e7e1c 26-Nov-2014 Nibble Max <nibble.max@gmail.com>

[media] dvb-usb-dvbsky: add TechnoTrend CT2-4400 and CT2-4650 devices support

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Tested-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 0a5a4f32 26-Nov-2014 Nibble Max <nibble.max@gmail.com>

[media] dvb-usb-dvbsky: add T330 dvb-t2/t/c usb stick support

DVBSky T330 dvb-t2/t/c usb stick:
1>dvb frontend: SI2157A30(tuner), SI2168B40(demod)
2>usb controller: CY7C68013A

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# b43a590d 13-Nov-2014 Nibble Max <nibble.max@gmail.com>

[media] dvb-usb-dvbsky: add T680CI dvb-t2/t/c usb ci box support

DVBSky T680CI dvb-t2/t/c usb ci box:
1>dvb frontend: SI2158A20(tuner), SI2168A30(demod)
2>usb controller: CY7C86013A
3>ci controller: CIMAX SP2 or its clone.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# dd0a6fe2 08-Nov-2014 nibble.max <nibble.max@gmail.com>

[media] dvb-usb-dvbsky: fix i2c adapter for sp2 device

It is wrong that sp2 device uses the i2c adapter from m88ds3103 return.
sp2 device sits on the same i2c bus with m88ds3103, not behind m88ds3103.

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>


# 24d333f3 20-Oct-2014 nibble.max <nibble.max@gmail.com>

[media] dvb-usb-dvbsky: add s960ci dvb-s/s2 usb ci box support

DVBSky s960ci dvb-s/s2 usb ci box:
1>dvb frontend: M88TS2022(tuner),M88DS3103(demod)
2>usb controller: CY7C86013A
3>ci controller: CIMAX SP2 or its clone.

Signed-off-by: Nibble Max <nibble.max@gmail.com>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 69e7b650 12-Oct-2014 Olli Salonen <olli.salonen@iki.fi>

[media] dvbsky: add option to disable IR receiver

Add an option to disable remote controller for DVBSky devices by specifying
the disable_rc option at modprobe.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 40bba097 12-Oct-2014 Olli Salonen <olli.salonen@iki.fi>

[media] dvbsky: clean logging

dev_err includes the function name in the log printout, so there is no need to include it manually. While here, fix a small grammatical error in the i2c error message.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 49141aa2 12-Oct-2014 Olli Salonen <olli.salonen@iki.fi>

[media] dvbsky: don't print MAC address from read_mac_address

The dvb-usb-v2 already prints out the MAC address, no need to print
it out also here.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# af64fb3f 10-Aug-2014 nibble.max <nibble.max@gmail.com>

[media] dvbsky: new driver to support DVBSky S860/S960 devices

Support for DVBSky dvb-s2 usb: add dvb-usb-v2 driver for DVBSky dvb-s2
box, no ci support yet.

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>