Re: Cine CT V6.1 code change request

2017-02-19 Thread Daniel Scheller
ith the STV and also the CXD28xx-based tuners. The work on this was done in around 2013 or so by Antti Palosaari (see [2]), and it worked out so nicely when I first started tackling things I never cared to pick up the tda18212DD :-) Best regards, Daniel Scheller [1] https://github.com/herrnst/dddvb

[PATCH v2 09/12] [media] dvb-frontends/stv0367: fix symbol rate conditions in cab_SetQamSize()

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The values used for comparing symbol rates and the resulting conditional reg writes seem wrong (rates multiplied by ten), so fix those values. While this doesn't seem to influence operation, it should be fixed anyway. Signed-off-by: Daniel Sc

[PATCH v2 08/12] [media] dvb-frontends/stv0367: selectable QAM FEC Lock status register

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> In some configurations (due to different PIN config, wiring or so), the QAM FECLock might be signalled using a different register than F367CAB_QAMFEC_LOCK (e.g. F367CAB_DESCR_SYNCSTATE on Digital Devices hw), so make that register selectable. Sign

[PATCH v2 02/12] [media] dvb-frontends/stv0367: print CPAMP status only if stv_debug is enabled

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The CPAMP log lines generated in stv0367_ter_check_cpamp() are printed everytime tuning succeeds or fails, quite cluttering the normal kernel log. Use dprintk() instead of printk(KERN_ERR...) so that if the information is needed, it'll be printe

[PATCH v2 12/12] [media] ddbridge: support STV0367-based cards and modules

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This adds detection and activation for STV0367-based tuner hardware (namely CineCTv6 bridge cards and older DuoFlex CT addon modules). Utilises the extended stv0367 demod driver. TDA18212 i2c_client/regmap-api code was originally implemented by

[PATCH v2 00/12] stv0367/ddbridge: support CTv6/FlexCT hardware

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> These patches enhance the functionality of dvb-frontends/stv0367 to work with Digital Devices hardware driven by the ST STV0367 demodulator chip and adds probe & attach bits to ddbridge to make use of them, effectively enabling full support fo

[PATCH v2 04/12] [media] dvb-frontends/stv0367: move out tables, support multiple tab variants

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Move the *ter and *cab st_register tables into a separate header file and additionally organize them via a multidimensional array, allowing to add more tables with differing init values, and also prepare for a base init table which should contain g

[PATCH v2 06/12] [media] dvb-frontends/stv0367: make full reinit on set_frontend() optional

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Every time dvb_frontend_ops.set_frontend() is called, an almost full reinit of the demodulator will be performed. While this might cause a slight delay when switching channels due to all involved tables being rewritten, it can even be dan

[PATCH v2 10/12] [media] dvb-frontends/stv0367: add defaults for use w/DD-branded devices

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Digital Devices uses defaults tables in their stv0367dd demod driver variant which differ in a few registers, at least enough that no stable operation can be provided with the tables already present in the driver (init succeeds and DVB reception

[PATCH v2 05/12] [media] dvb-frontends/stv0367: make PLLSETUP a function, add 58MHz IC speed

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This moves the PLL SETUP code from stv0367ter_init() into a dedicated function, and also make it possible to configure 58Mhz IC speed at 27MHz Xtal (used on STV0367-based DDB cards/modules in QAM mode). Signed-off-by: Daniel Scheller <d.schel..

[PATCH v2 11/12] [media] dvb-frontends/stv0367: add Digital Devices compatibility

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This - in conjunction with the previous changes - makes it possible to use the STV0367 DVB-C/T demodulator driver with Digital Devices hardware having this demodulator soldered on them (namely CineCTv6 bridges and some earlier DuoFlex CT addon m

[PATCH v2 03/12] [media] dvb-frontends/stv0367: refactor defaults table handling

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Change defaults table writing so tables can be of dynamic length without having to keep track of their lengths by adding and evaluating an end marker (reg 0x), also move table writing to a dedicated function to remove code duplication. Additi

[PATCH v2 01/12] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Some hardware and bridges (namely ddbridge) require that tuner access is limited to one concurrent access and wrap i2c gate control with a mutex_lock when attaching frontends. According to vendor information, this is required as concurrent

[PATCH v2 07/12] [media] dvb-frontends/stv0367: support reading if_khz from tuner config

2017-03-24 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Currently, if_khz is set and provided using the configuration var in struct stv0367_config. However, in some constellations, the value might be different for differing channel bandwidths or even -T and -C operation. When e.g. used in conju

Re: [PATCH v2 01/12] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional

2017-03-26 Thread Daniel Scheller
Am Sun, 26 Mar 2017 10:03:33 +0200 schrieb Matthias Schwarzott <z...@gentoo.org>: > Am 24.03.2017 um 19:23 schrieb Daniel Scheller: > > From: Daniel Scheller <d.schel...@gmx.net> > > > > Some hardware and bridges (namely ddbridge) require that tuner > > acc

Re: [PATCH v2 12/12] [media] ddbridge: support STV0367-based cards and modules

2017-03-26 Thread Daniel Scheller
e system] > > url: > https://github.com/0day-ci/linux/commits/Daniel-Scheller/stv0367-ddbridge-support-CTv6-FlexCT-hardware/20170326-235957 > base: git://linuxtv.org/media_tree.git master config: > x86_64-rhel-7.2 (attached as .config) compiler: gcc-6 (Debian > 6.2.0-3) 6.2.0

[PATCH v3 12/13] [media] ddbridge: add i2c_read_regs()

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Adds new i2c_read_regs() function and make i2c_read_reg() wrap into this with len=1. Required for the tuner_tda18212_ping() and XO2 handling functions (part of the Sony CXD28xx support patch series). Signed-off-by: Daniel Scheller <d.schel..

[PATCH v3 10/13] [media] dvb-frontends/stv0367: add defaults for use w/DD-branded devices

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Digital Devices uses defaults tables in their stv0367dd demod driver variant which differ in a few registers, at least enough that no stable operation can be provided with the tables already present in the driver (init succeeds and DVB reception

[PATCH v3 13/13] [media] ddbridge: support STV0367-based cards and modules

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This adds detection and activation for STV0367-based tuner hardware (namely CineCTv6 bridge cards and older DuoFlex CT addon modules). Utilises the extended stv0367 demod driver. TDA18212 i2c_client/regmap-api code was originally implemented by

[PATCH v3 04/13] [media] dvb-frontends/stv0367: move out tables, support multiple tab variants

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Move the *ter and *cab st_register tables into a separate header file and additionally organize them via a multidimensional array, allowing to add more tables with differing init values, and also prepare for a base init table which should contain g

[PATCH v3 06/13] [media] dvb-frontends/stv0367: make full reinit on set_frontend() optional

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Every time dvb_frontend_ops.set_frontend() is called, an almost full reinit of the demodulator will be performed. While this might cause a slight delay when switching channels due to all involved tables being rewritten, it can even be dan

[PATCH v3 11/13] [media] dvb-frontends/stv0367: add Digital Devices compatibility

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This - in conjunction with the previous changes - makes it possible to use the STV0367 DVB-C/T demodulator driver with Digital Devices hardware having this demodulator soldered on them (namely CineCTv6 bridges and some earlier DuoFlex CT addon m

[PATCH v3 01/13] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Some hardware and bridges (namely ddbridge) require that tuner access is limited to one concurrent access and wrap i2c gate control with a mutex_lock when attaching frontends. According to vendor information, this is required as concurrent

[PATCH v3 03/13] [media] dvb-frontends/stv0367: refactor defaults table handling

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Change defaults table writing so tables can be of dynamic length without having to keep track of their lengths by adding and evaluating an end marker (reg 0x), also move table writing to a dedicated function to remove code duplication. Additi

[PATCH v3 00/13] stv0367/ddbridge: support CTv6/FlexCT hardware

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Third iteration of the DD CineCTv6/FlexCT support patches with mostly all things cleaned up that popped up so far. Obsoletes V1 and V2 series. These patches enhance the functionality of dvb-frontends/stv0367 to work with Digital Devices hardware

[PATCH v3 07/13] [media] dvb-frontends/stv0367: support reading if_khz from tuner config

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Currently, if_khz is set and provided using the configuration var in struct stv0367_config. However, in some constellations, the value might be different for differing channel bandwidths or even -T and -C operation. When e.g. used in conju

[PATCH v3 05/13] [media] dvb-frontends/stv0367: make PLLSETUP a function, add 58MHz IC speed

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This moves the PLL SETUP code from stv0367ter_init() into a dedicated function, and also make it possible to configure 58Mhz IC speed at 27MHz Xtal (used on STV0367-based DDB cards/modules in QAM mode). Signed-off-by: Daniel Scheller <d.schel..

[PATCH v3 09/13] [media] dvb-frontends/stv0367: fix symbol rate conditions in cab_SetQamSize()

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The values used for comparing symbol rates and the resulting conditional reg writes seem wrong (rates multiplied by ten), so fix those values. While this doesn't seem to influence operation, it should be fixed anyway. Signed-off-by: Daniel Sc

[PATCH v3 02/13] [media] dvb-frontends/stv0367: print CPAMP status only if stv_debug is enabled

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The CPAMP log lines generated in stv0367_ter_check_cpamp() are printed everytime tuning succeeds or fails, quite cluttering the normal kernel log. Use dprintk() instead of printk(KERN_ERR...) so that if the information is needed, it'll be printe

[PATCH v3 08/13] [media] dvb-frontends/stv0367: selectable QAM FEC Lock status register

2017-03-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> In some configurations (due to different PIN config, wiring or so), the QAM FECLock might be signalled using a different register than F367CAB_QAMFEC_LOCK (e.g. F367CAB_DESCR_SYNCSTATE on Digital Devices hw), so make that register selectable. Sign

Re: [PATCH v2 12/12] [media] ddbridge: support STV0367-based cards and modules

2017-03-25 Thread Daniel Scheller
Am Fri, 24 Mar 2017 19:24:08 +0100 schrieb Daniel Scheller <d.scheller@gmail.com>: > When boards with STV0367 are cold-started, there might be issues with > the I2C gate, causing the TDA18212 detection/probe to fail. For these > demods, a workaround is implemented to do the tu

[PATCH] [media] dvb-frontends/cxd2841er: define symbol_rate_min/max in T/C fe-ops

2017-03-19 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Fixes "w_scan -f c" complaining with This dvb driver is *buggy*: the symbol rate limits are undefined - please report to linuxtv.org) Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/dvb-frontends/cxd284

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

2017-03-14 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> 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_

Re: [PATCH 12/13] [media] tuners/tda18212: add flag for retrying tuner init on failure

2017-03-14 Thread Daniel Scheller
Am Mon, 13 Mar 2017 16:16:29 +0200 schrieb Antti Palosaari <cr...@iki.fi>: > On 03/07/2017 08:57 PM, Daniel Scheller wrote: > > From: Daniel Scheller <d.schel...@gmx.net> > > > > Taken from tda18212dd, first read after cold reset sometimes fails > > on some

Re: [PATCH 11/13] [media] dvb-frontends/stv0367: add Digital Devices compatibility

2017-03-20 Thread Daniel Scheller
Am Tue, 7 Mar 2017 19:57:25 +0100 schrieb Daniel Scheller <d.scheller@gmail.com>: > - add a third *_attach function which will make use of a third > frontend_ops struct which announces both -C and -T support (the same > as with DD's own driver stv0367dd). This is necessary

Re: [PATCH v3 00/13] stv0367/ddbridge: support CTv6/FlexCT hardware

2017-04-12 Thread Daniel Scheller
Am Wed, 29 Mar 2017 18:43:00 +0200 schrieb Daniel Scheller <d.scheller@gmail.com>: > From: Daniel Scheller <d.schel...@gmx.net> > > Third iteration of the DD CineCTv6/FlexCT support patches with mostly > all things cleaned up that popped up so far. Obso

[PATCH 02/19] [media] dvb-frontends/cxd2841er: do I2C reads in one go

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Doing the I2C read operation with two calls to i2c_transfer() causes the exclusive I2C bus lock of the underlying adapter to be released. While this isn't an issue if only one demodulator is attached to the bus, having two or even more causes tr

[PATCH 00/19] cxd2841er/ddbridge: support Sony CXD28xx hardware

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Important note: This series depends on the stv0367/ddbridge series posted earlier (patches 12 [1] and 13 [2], depending on the I2C functions and the TDA18212 attach function). This series improves the cxd2841er demodulator driver and adds som

[PATCH 01/19] [media] dvb-frontends/cxd2841er: remove kernel log spam in non-debug levels

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This moves the I2C debug dump into the preceding dev_dbg() call by utilising the %*ph format macro and removes the call to print_hex_debug_bytes(). Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/dvb-frontends/cxd

[PATCH 10/19] [media] dvb-frontends/cxd2841er: make ASCOT use optional

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The Sony CXD28xx demods may have other tuner types attached to them (e.g. NXP TDA18212), so don't mandatorily configure and enable the ASCOT functionality, but make this conditional by a config flag. Signed-off-by: Daniel Scheller <d.schel..

[PATCH 04/19] [media] dvb-frontends/cxd2841er: support CXD2837/38/43ER demods/Chip IDs

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Those demods are programmed in the same way as the CXD2841ER/54ER and can be handled by this driver. Support added in a way matching the existing code, supported delivery systems are set according to what each demod supports. Updates the type

[PATCH 09/19] [media] dvb-frontends/cxd2841er: TS_SERIAL config flag

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Some constellations work/need a serial TS transport mode. This adds a flag that will toggle set up of such mode. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/dvb-frontends/cxd2841er.c | 18 -- drive

[PATCH 03/19] [media] dvb-frontends/cxd2841er: immediately unfreeze regs when done

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Do unfreeze_regs() directly when accessing the demod registers is done, and don't have multiple unfreeze's on different conditions, which even can get prone to errors. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/d

[PATCH 12/19] [media] dvb-frontends/cxd2841er: make lock wait in set_fe_tc() optional

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Don't wait for FE_HAS_LOCK in set_frontend_tc() and thus don't hammer the lock status register with inquiries when CXD2841ER_NO_WAIT_LOCK is set in the configuration, which also unneccessarily blocks applications until a TS LOCK has been acquired.

[PATCH 16/19] [media] ddbridge: board control setup, ts quirk flags

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This is a backport of the board control setup from the vendor provided dddvb driver package, which does additional device initialisation based on the board_control device info values. Also backports the TS quirk flags which is used to control

[PATCH 17/19] [media] ddbridge: add I2C functions, add XO2 module support

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Some Flex modules (mostly with anyof C/C2/T/T2 demods based on the Sony CXD28xxER series) are equipped with an interface named XO2 (which appears to be the Lattice MachXO2). Add functionality to detect such links and initialise them, so any tuner

[PATCH 19/19] [media] ddbridge: hardware IDs for new C2T2 cards and other devices

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Adds hardware IDs for all Sony CXD-based Cine-cards and MaxA8 devices, also adds some other yet missing IDs like the Octopus V3, Octopus OEM and Octopus Mini, as well as cards with unknown/deleted sub-ids. Signed-off-by: Daniel Scheller &l

[PATCH 11/19] [media] dvb-frontends/cxd2841er: optionally tune earlier in set_frontend()

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> When AUTO_IFHZ is set and the tuner is supposed to provide proper IF speed values, it should be possible to have the tuner setup take place before the demod is configured, else the demod might be configured with either wrong (old), or even no

[PATCH 06/19] [media] dvb-frontends/cxd2841er: add variable for configuration flags

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Throughout the patch series some configuration flags will be added to the demod driver. This patch prepares this by adding the flags var to struct cxd2841er_config, which will serve as a bitmask to toggle various options and behaviour in the

[PATCH 14/19] [media] dvb-frontends/cxd2841er: more configurable TSBITS

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Bits 3 and 4 of the TSCONFIG register are important for certain hardware constellations, in that they need to be zeroed. Add a configuration flag to toggle this. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/d

[PATCH 05/19] [media] dvb-frontends/cxd2841er: replace IFFREQ calc macros into functions

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The way the MAKE_IFFREQ_CONFIG macros are written make it impossible to pass regular integers for iffreq calculation, since this will cause "SSE register return with SSE disabled" compile errors. This changes the calculation into C func

[PATCH 07/19] [media] dvb-frontends/cxd2841er: make call to i2c_gate_ctrl optional

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Some cards/bridges wrap i2c_gate_ctrl handling with a mutex_lock(). This is e.g. done in ddbridge to protect against concurrent tuner access with regards to the dual tuner HW, where concurrent tuner reconfiguration can result in tuning fails

[PATCH 13/19] [media] dvb-frontends/cxd2841er: configurable IFAGCNEG

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Adds a flag to enable or disable the IFAGCNEG bit in cxd2841er_init_tc(). Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- drivers/media/dvb-frontends/cxd2841er.c | 5 +++-- drivers/media/dvb-frontends/cxd2841er.h | 1 + 2 file

[PATCH 18/19] [media] ddbridge: support for Sony CXD28xx C/C2/T/T2 tuner modules

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Properly detect and attach Ports and Flex modules with the Sony CXD28xxER series demods. This makes newer Cine cards and most DuoFlex C/C2/T/T2 (or any combination of these systems) work, PCI IDs need to be added though. Note: This ut

[PATCH 08/19] [media] dvb-frontends/cxd2841er: support IF speed calc from tuner values

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Add a AUTO_IFHZ flag and a function that will read IF speed values from any attached tuner if the tuner supports this and if AUTO_IFHZ is enabled, and else the passed default value (which probably matches Sony ASCOT tuners) will be passe

[PATCH 15/19] [media] dvb-frontends/cxd2841er: improved snr reporting

2017-04-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> On DVB-T/T2 at least, SNR might be reported as >2500dB, which not only is just wrong but also ridiculous, so fix this by improving the conversion of the register value. The INTLOG10X100 function/macro and the way the values are converted were b

[PATCH 10/13] [media] dvb-frontends/stv0367: add defaults for use w/DD-branded devices

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Digital Devices uses defaults tables in their stv0367dd demod driver variant which differ in a few registers, at least enough that no stable operation can be provided with the tables already present in the driver (init succeeds and DVB reception

[PATCH 12/13] [media] tuners/tda18212: add flag for retrying tuner init on failure

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Taken from tda18212dd, first read after cold reset sometimes fails on some cards, trying twice shall do the trick. This is the case with the STV0367 demods soldered on the CineCTv6 bridge boards and older DuoFlex CT modules. All other users (c

[PATCH 11/13] [media] dvb-frontends/stv0367: add Digital Devices compatibility

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This - in conjunction with the previous changes - makes it possible to use the STV0367 DVB-C/T demodulator driver with Digital Devices hardware having this demodulator soldered on them (namely CineCTv6 bridges and some earlier DuoFlex CT addon m

[PATCH 01/13] [media] dvb-frontends/stv0367: add flag to make i2c_gatectrl optional

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> There can be use cases (bridges, namely ddbridge) which will care about gate control in a way that involves mutex_locks and remapped i2c_gatectrl FE ops. If the demod driver (additionally) performs it's own gate control and there's somethin

[PATCH 02/13] [media] dvb-frontends/stv0367: print CPAMP status only if stv_debug is enabled

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The CPAMP log lines generated in stv0367_ter_check_cpamp() are printed everytime tuning succeeds or fails, quite cluttering the normal kernel log. Use dprintk() instead of printk(KERN_ERR...) so that if the information is needed, it'll be printe

[PATCH 07/13] [media] dvb-frontends/stv0367: support reading if_khz from tuner config

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Currently, if_khz is set and provided using the configuration var in struct stv0367_config. However, in some constellations, the value might be different for differing channel bandwidths or even -T and -C operation. When e.g. used in conju

[PATCH 08/13] [media] dvb-frontends/stv0367: selectable QAM FEC Lock status register

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> In some configurations (due to different PIN config, wiring or so), the QAM FECLock might be signalled using a different register than F367CAB_QAMFEC_LOCK (e.g. F367CAB_DESCR_SYNCSTATE on Digital Devices hw), so make that register selectable. Sign

[PATCH 13/13] [media] ddbridge: support STV0367-based cards and modules

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This adds detection and activation for STV0367-based tuner hardware (namely CineCTv6 bridge cards and older DuoFlex CT addon modules). Utilises the extended stv0367 demod driver, and needs the init_retry when attaching the TDA18212 tuner. TD

[PATCH 06/13] [media] dvb-frontends/stv0367: make full reinit on set_frontend() optional

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Every time dvb_frontend_ops.set_frontend() is called, an almost full reinit of the demodulator will be performed. While this might cause a slight delay when switching channels due to all involved tables being rewritten, it can even be dan

[PATCH 05/13] [media] dvb-frontends/stv0367: make PLLSETUP a function, add 58MHz IC speed

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This moves the PLL SETUP code from stv0367ter_init() into a dedicated function, and also make it possible to configure 58Mhz IC speed at 27MHz Xtal (used on STV0367-based DDB cards/modules in QAM mode). Signed-off-by: Daniel Scheller <d.schel..

[PATCH 04/13] [media] dvb-frontends/stv0367: move out tables, support multiple tab variants

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Move the *ter and *cab st_register tables into a separate header file and additionally organize them via a multidimensional array, allowing to add more tables with differing init values, and also prepare for a base init table which should contain g

[PATCH 00/13] stv0367/ddbridge: support CTv6/FlexCT hardware

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> These patches enhance the functionality of dvb-frontends/stv0367 to work with Digital Devices hardware driven by the ST STV0367 demodulator chip and adds probe & attach bits to ddbridge to make use of them, effectively enabling full support fo

[PATCH 09/13] [media] dvb-frontends/stv0367: fix symbol rate conditions in cab_SetQamSize()

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The values used for comparing symbol rates and the resulting conditional reg writes seem wrong (rates multiplied by ten), so fix those values. While this doesn't seem to influence operation, it should be fixed anyway. Signed-off-by: Daniel Sc

[PATCH 03/13] [media] dvb-frontends/stv0367: refactor defaults table handling

2017-03-07 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Change defaults table writing so tables can be of dynamic length without having to keep track of their lengths by adding and evaluating an end marker (reg 0x), also move table writing to a dedicated function to remove code duplication. Additi

[PATCH v2 13/14] [media] ddbridge: Kconfig option to control the MSI modparam default

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> It is known that MSI interrupts - while working quite well so far - can still cause issues on some hardware platforms (causing I2C timeouts due to unhandled interrupts). The msi variable/option is set to 1 by default. So, add a Kconfig option pr

[PATCH v2 06/14] [media] ddbridge: split off hardware definitions and mappings

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Further cleanup of ddbridge-core and ddbridge-main, and moves all such hw definitions into one single place, making things easier to maintain. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> Tested-by: Richard Scobie <r.sco...@clear

[PATCH v2 10/14] [media] ddbridge: remove unreachable code

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> >From smatch: drivers/media/pci/ddbridge/ddbridge-core.c:3490 snr_store() info: ignoring unreachable code. In fact, the function immediately returns zero, so remove it and update ddb_attrs_snr[] to not reference it anymore. Cc: Ralph M

[PATCH v2 08/14] [media] ddbridge: only register frontends in fe2 if fe is not NULL

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Smatch reported: drivers/media/pci/ddbridge/ddbridge-core.c:1602 dvb_input_attach() error: we previously assumed 'dvb->fe' could be null (see line 1595) dvb->fe2 will ever only be populated when dvb->fe is set. So only handle regi

[PATCH v2 09/14] [media] ddbridge: fix possible buffer overflow in ddb_ports_init()

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Report from smatch: drivers/media/pci/ddbridge/ddbridge-core.c:2659 ddb_ports_init() error: buffer overflow 'dev->port' 32 <= u32max Fix by making sure "p" is greater than zero before checking for "dev->port[].typ

[PATCH v2 12/14] [media] ddbridge: fix dereference before check

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Both ts_release() and ts_open() can use "output" before check (smatch): drivers/media/pci/ddbridge/ddbridge-core.c:816 ts_release() warn: variable dereferenced before check 'output' (see line 809) drivers/media/pci/ddbridge/ddb

[PATCH v2 05/14] [media] ddbridge: split off IRQ handling

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This not only helps keep the ddbridge-core tidy, but also gets rid of defined-but-unused-function warnings which might be triggered depending of CONFIG_PCI_MSI, without having to clutter the code with #ifdef'ery. Signed-off-by: Daniel Scheller &l

[PATCH v2 02/14] [media] ddbridge: split code into multiple files

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> As of 0.9.9b, the ddbridge code has been split from one single file (ddbridge-core.c) into multiple files, with the purpose of taking care of different topics, and to be able to reuse code in different kernel modules (ddbridge.ko and octo

[PATCH v2 00/14] ddbridge: bump to ddbridge-0.9.29

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Still prefered for and made for Linux 4.14. Changes from v1 to v2: * I2C access functions (ie. i2c_read() et al) refactored from ddbridge-i2c.c into ddbridge-i2c.h and declared static, and needed include added to all .c files making use o

[PATCH v2 01/14] [media] ddbridge: move/reorder functions

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> The functions in ddbridge-core.c have been moved to different positions in newer versions of the dddvb vendor driver package (most notably in version 0.9.9b). Perform the same code move to keep the diff of the upcoming code bump simpler. Sign

[PATCH v2 04/14] [media] ddbridge: split I/O related functions off from ddbridge.h

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> While it seems valid that headers can carry simple oneline static inline annotated functions, move them into their own header file to have the overall code more readable. Also, keep them as header (and don't put in a separate object) and static

[PATCH v2 14/14] [media] MAINTAINERS: add entry for ddbridge

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9826a918d37a..f25f26b5d9f6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -842

[PATCH v2 07/14] [media] ddbridge: check pointers before dereferencing

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Fixes two warnings reported by smatch: drivers/media/pci/ddbridge/ddbridge-core.c:240 ddb_redirect() warn: variable dereferenced before check 'idev' (see line 238) drivers/media/pci/ddbridge/ddbridge-core.c:240 ddb_redirect() warn: va

[PATCH v2 11/14] [media] ddbridge: fix impossible condition warning

2017-07-29 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Smatch and gcc complained: drivers/media/pci/ddbridge/ddbridge-core.c:3491 bpsnr_show() warn: impossible condition '(snr[0] == 255) => ((-128)-127 == 255)' drivers/media/pci/ddbridge/ddbridge-core.c: In function ‘bpsnr_show’: drivers/

[PATCH v4 09/11] [media] ddbridge: fix dereference before check

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Both ts_release() and ts_open() can use "output" before check (smatch): drivers/media/pci/ddbridge/ddbridge-core.c:816 ts_release() warn: variable dereferenced before check 'output' (see line 809) drivers/media/pci/ddbridge/ddb

[PATCH v4 10/11] [media] ddbridge: Kconfig option to control the MSI modparam default

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> It is known that MSI interrupts - while working quite well so far - can still cause issues on some hardware platforms (causing I2C timeouts due to unhandled interrupts). The msi variable/option is set to 1 by default. So, add a Kconfig option pr

[PATCH v4 11/11] [media] MAINTAINERS: add entry for ddbridge

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 931abca006b7..0453a1365c3a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -842

[PATCH v4 04/11] [media] ddbridge: check pointers before dereferencing

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Fixes two warnings reported by smatch: drivers/media/pci/ddbridge/ddbridge-core.c:240 ddb_redirect() warn: variable dereferenced before check 'idev' (see line 238) drivers/media/pci/ddbridge/ddbridge-core.c:240 ddb_redirect() warn: va

[PATCH v4 05/11] [media] ddbridge: only register frontends in fe2 if fe is not NULL

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Smatch reported: drivers/media/pci/ddbridge/ddbridge-core.c:1602 dvb_input_attach() error: we previously assumed 'dvb->fe' could be null (see line 1595) dvb->fe2 will ever only be populated when dvb->fe is set. So only handle regi

[PATCH v4 03/11] [media] ddbridge: split off hardware definitions and mappings

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Further cleanup of ddbridge-core and ddbridge-main, and moves all such hw definitions into one single place, making things easier to maintain. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> Tested-by: Richard Scobie <r.sco...@clear

[PATCH v4 02/11] [media] ddbridge: split I/O related functions off from ddbridge.h

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> While it seems valid that headers can carry simple oneline static inline annotated functions, move them into their own header file to have the overall code more readable. Also, keep them as header (and don't put in a separate object) and static

[PATCH v4 00/11] ddbridge: bump to ddbridge-0.9.29

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Still, target: 4.14. Changes from v3 to v4: * IRQ handler splitoff removed * Prefixed irq_handler{,0,1} with ddb_ to avoid potential conflicts in the global namespace wrt things like allyesconfig due to very generic function naming * R

[PATCH v4 07/11] [media] ddbridge: remove unreachable code

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> >From smatch: drivers/media/pci/ddbridge/ddbridge-core.c:3490 snr_store() info: ignoring unreachable code. In fact, the function immediately returns zero, so remove it and update ddb_attrs_snr[] to not reference it anymore. Cc: Ralph M

[PATCH v4 06/11] [media] ddbridge: fix possible buffer overflow in ddb_ports_init()

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Report from smatch: drivers/media/pci/ddbridge/ddbridge-core.c:2659 ddb_ports_init() error: buffer overflow 'dev->port' 32 <= u32max Fix by making sure "p" is greater than zero before checking for "dev->port[].typ

[PATCH v4 08/11] [media] ddbridge: fix impossible condition warning

2017-08-12 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Smatch and gcc complained: drivers/media/pci/ddbridge/ddbridge-core.c:3491 bpsnr_show() warn: impossible condition '(snr[0] == 255) => ((-128)-127 == 255)' drivers/media/pci/ddbridge/ddbridge-core.c: In function ‘bpsnr_show’: drivers/

[PATCH] [media] dvb-frontends/stv0367: remove QAM_AUTO from ddb_fe_ops

2017-08-14 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Since the cab_* codepath doesn't recognize QAM_AUTO, don't announce that it is supported when it really isn't. Fixes ie. w_scan from unconditionally using QAM_AUTO on DVB-C scans. Signed-off-by: Daniel Scheller <d.schel...@gmx.net> --- d

[PATCH] [media] dvb-frontends/stv0367: DDB frontend status inquiry fixup

2017-07-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Return 0 instead of -EINVAL in get_frontend if no demod mode is active. This fixes ie. dvb-fe-tool getting confused and assuming a DVBv3 FE on idle frontends when the FE has been put to sleep using sleep(). Also, in read_status(), don't immed

[PATCH 3/4] [media] ddbridge: fix buffer overflow in max_set_input_unlocked()

2017-07-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Picked up code parts introduced one smatch error: drivers/media/pci/ddbridge/ddbridge-maxs8.c:163 max_set_input_unlocked() error: buffer overflow 'dev->link[port->lnr].lnb.voltage' 4 <= 255 Fix this by clamping the .lnb.voltage arra

[PATCH 1/4] [media] dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver

2017-07-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> This adds the frontend driver for the MaxLinear MxL5xx family of tuner- demodulators, as used on Digital Devices MaxS4/8 four/eight-tuner cards. The driver was picked from the dddvb vendor driver package and - judging solely from the diff

[PATCH 12/14] [media] ddbridge: fix dereference before check

2017-07-09 Thread Daniel Scheller
From: Daniel Scheller <d.schel...@gmx.net> Both ts_release() and ts_open() can use "output" before check (smatch): drivers/media/pci/ddbridge/ddbridge-core.c:816 ts_release() warn: variable dereferenced before check 'output' (see line 809) drivers/media/pci/ddbridge/ddb

  1   2   3   4   5   6   >