summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
Commit message (Collapse)AuthorAgeFilesLines
* media: sp887x: fix a warningMauro Carvalho Chehab2018-03-231-3/+3
| | | | | | | | | | drivers/media/dvb-frontends/sp887x.c:179 sp887x_initial_setup() error: memcpy() '&buf[2]' too small (30 vs 16384) This is actually a false alarm, but reverting the check order makes not only for humans to review the code, but also cleans the warning. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: add pid filter supportAntti Palosaari2018-03-212-0/+57
| | | | | | | af9013 demod has pid filter. Add support for it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: remove all legacy media attach releated stuffAntti Palosaari2018-03-212-115/+7
| | | | | | | | No one is binding that driver through media attach so remove it and all related dead code. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: add i2c mux adapter for tuner busAntti Palosaari2018-03-214-19/+111
| | | | | | | Add muxed i2c adapter for demod tuner i2c bus gate control. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: convert inittabs suitable for regmap_update_bitsAntti Palosaari2018-03-212-768/+782
| | | | | | | | Convert inttabs to format (reg, mask, val) which are suitable parameters to pass directly for regmap_update_bits. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: wrap dvbv3 statistics via dvbv5Antti Palosaari2018-03-212-352/+22
| | | | | | | | | Driver has calculated dvbv5 statistics, so use those as a base for legacy dvbv3 statistics. Wrap and convert needed values to dvbv3, remove old dvbv3 statistic implementations. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: dvbv5 ber and perAntti Palosaari2018-03-211-1/+72
| | | | | | | Implement dvbv5 ber and per. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: dvbv5 cnrAntti Palosaari2018-03-212-5/+84
| | | | | | | Implement dvbv5 cnr. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: dvbv5 signal strengthAntti Palosaari2018-03-211-2/+81
| | | | | | | | | Implement dvbv5 signal strength estimate. We know tuner dependent -80dBm and -50dBm agc values, construct line equation and use it to map agc value to signal strength estimate. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: af9013: change lock detection slightlyAntti Palosaari2018-03-211-28/+27
| | | | | | | | | Whilst rewritten largely, the basic logic remains same with one exception: do not return immediately on success case. We are going to add statistics that function and cannot return too early. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dvb-frontends/Kconfig: move the SP2 driver to the CI sectionDaniel Scheller2018-03-081-7/+7
| | | | | | | | | | | The CIMaX SP2 driver is a EN50221 CI controller I2C driver similar to the cxd2099 driver. Move it's Kconfig block into the newly introduced CI subsection. Cc: Olli Salonen <olli.salonen@iki.fi> Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dvb-frontends/cxd2099: Kconfig additionsDaniel Scheller2018-03-081-1/+3
| | | | | | | | | | | The cxd2099 driver makes use of the Regmap I2C kernel API, thus add "select REGMAP_I2C" to it's Kconfig block. Also, make it default "m" if !MEDIA_SUBDRV_AUTOSELECT, just like every other dvb-frontend driver. And, while at it, remove the hyphens around the help tag. Cc: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: si2168: fix a comment about firmware versionMauro Carvalho Chehab2018-03-081-1/+1
| | | | | | | | | | There's a comment there at s82168 that it is wrong. With firmware 4.0.11, sleep/resume works well without need of download it every time. But firmware 4.0.19 needs to be downloaded again after sleep. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: remove unused varsMauro Carvalho Chehab2018-03-071-7/+0
| | | | | | | | | | | | | | | | | drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_set_ber_per_period_t’: drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:677:34: warning: variable ‘c’ set but not used [-Wunused-but-set-variable] struct dtv_frontend_properties *c; ^ drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_set_ber_per_period_t2’: drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:790:34: warning: variable ‘c’ set but not used [-Wunused-but-set-variable] struct dtv_frontend_properties *c; ^ drivers/media/dvb-frontends/cxd2880/cxd2880_top.c: In function ‘cxd2880_get_frontend’: drivers/media/dvb-frontends/cxd2880/cxd2880_top.c:1799:23: warning: variable ‘priv’ set but not used [-Wunused-but-set-variable] struct cxd2880_priv *priv = NULL; ^~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: don't return unitialized valuesMauro Carvalho Chehab2018-03-072-3/+3
| | | | | | | | drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c:59 cxd2880_io_spi_read_reg() error: uninitialized symbol 'ret'. drivers/media/dvb-frontends/cxd2880/cxd2880_devio_spi.c:111 cxd2880_io_spi_write_reg() error: uninitialized symbol 'ret'. drivers/media/dvb-frontends/cxd2880/cxd2880_tnrdmd.c:2985 cxd2880_tnrdmd_set_cfg() error: uninitialized symbol 'ret'. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Makefile: remove an includeMauro Carvalho Chehab2018-03-071-1/+0
| | | | | | | | It is not needed anymore to include the dvb-core directory, as all the public headers that used to be there was moved to include/media. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add all Makefile, Kconfig files and Update MAINTAINERS file ↵Yasunari Takiguchi2018-03-074-0/+30
| | | | | | | | | | | | | | | | for the driver This is the Makefile, Kconfig files of driver and MAINTAINERS file update about the driver for the Sony CXD2880 DVB-T2/T tuner + demodulator. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Fix location of DVB headersMauro Carvalho Chehab2018-03-076-7/+7
| | | | | | | Fix a trivial conflict, where the location of DVB headers got moved. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add DVB-T2 monitor functionsYasunari Takiguchi2018-03-072-0/+2013
| | | | | | | | | | | | | Provide monitor functions (DVB-T2) for the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add DVB-T2 control functions for the driverYasunari Takiguchi2018-03-073-0/+1667
| | | | | | | | | | | | | Provide definitions, interfaces and functions needed for DVB-T2 of the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add DVB-T monitor functionsYasunari Takiguchi2018-03-072-0/+852
| | | | | | | | | | | | | Provide monitor functions (DVB-T) for the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add DVB-T control functions the driverYasunari Takiguchi2018-03-073-0/+1038
| | | | | | | | | | | | | Provide definitions, interfaces and functions needed for DVB-T of the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add top level of the driverYasunari Takiguchi2018-03-071-0/+1954
| | | | | | | | | | | | | This provides the main dvb frontend operation functions for the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add integration layer for the driverYasunari Takiguchi2018-03-072-0/+99
| | | | | | | | | | | | | These functions monitor the driver and watch for task completion. This is part of the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add tuner part of the driverYasunari Takiguchi2018-03-076-0/+4104
| | | | | | | | | | | | | | | This part of the driver has the main routines to handle the tuner and demodulator functionality. The tnrdmd_mon.* files have monitor functions for the driver. This is part of the Sony CXD2880 DVB-T2/T tuner + demodulator driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add spi device IO routinesYasunari Takiguchi2018-03-075-0/+325
| | | | | | | | | | | | | Add functions for initializing, reading and writing to the SPI device for the Sony CXD2880 DVB-T2/T tuner + demodulator. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2880: Add common files for the driverYasunari Takiguchi2018-03-075-0/+189
| | | | | | | | | | | | | | These are common files for the driver for the Sony CXD2880 DVB-T2/T tuner + demodulator. These contains helper functions for the driver. Signed-off-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Masayuki Yamamoto <Masayuki.Yamamoto@sony.com> Signed-off-by: Hideki Nozawa <Hideki.Nozawa@sony.com> Signed-off-by: Kota Yonezawa <Kota.Yonezawa@sony.com> Signed-off-by: Toshihiko Matsumoto <Toshihiko.Matsumoto@sony.com> Signed-off-by: Satoshi Watanabe <Satoshi.C.Watanabe@sony.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: remove symbol count mismatch fixBrad Love2018-03-071-8/+2
| | | | | | | | | | | | | | | | | | This symbol mismatch is handled by NULL'ing out the release callback if the driver is loaded as an i2c device. This patch reverts: - commit 94448e21cf08 ("media: lgdt3306a: Fix a double kfree on i2c device remove") - commit 835d66173a38 ("media: lgdt3306a: Fix module count mismatch on usb unplug") The symbol count mismatch is handled by: - commit 5b3a8e906973 ("media: lgdt3306a: Set fe ops.release to NULL if probed") Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dvb-frontends/cxd2099: remove remainders from old attach wayDaniel Scheller2018-03-061-10/+0
| | | | | | | | | | | As all drivers using the cxd2099 are converted to handle attach/detach the generic I2C client way, the static inline cxd2099_attach isn't required anymore. Thus cleanup cxd2099.h from the remainders, the adr struct member also isn't used anymore. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: si2168: change ts bus control logicBrad Love2018-03-061-27/+33
| | | | | | | | | | | | | | | | | | Move the ts bus control function moved higher, enabling it after configuring frontend and removeing ts_bus_ctrl callback. While here, also add an error checking and re-add a comment that were removed by commit 445877742ce3 ("media: si2168: Add ts bus coontrol, turn off bus on sleep"). [mchehab@s-opensource.com: I ended by applying the first version, instead of the right one. So, this patch contains the diff and the v2 changelog instead] Fixes: 445877742ce3 ("media: si2168: Add ts bus coontrol, turn off bus on sleep") Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dvb-frontends/stv0910: rework and fix DiSEqC sendDaniel Scheller2018-03-061-9/+10
| | | | | | | | | | | | | | | | | | | | | | Rework both DiSEqC send functions (send_master_cmd() and send_burst()) to utilise the new SET_REG() and SET_FIELD() macros. Esp. due to SET_FIELD(), this makes sure that not all bits (with unrelated purposes) are always rewritten, but only those needed for sending DiSEqC commands. In send_burst(), this makes sure that DISEQC_MODE isn't changed from 3 to 2 inbetween when sending SEC_MINI_A. Also, change both functions to write DISEQC_MODE first before setting DIS_PRECHARGE. This makes diseqc control work more reliable for "fullblown" DiSEqC strings in VDR's diseqc.conf in combination with certain multiswitches. Fixes: 448461af0e19 ("media: dvb-frontends/stv0910: implement diseqc_send_burst") Reported-by: Helmut Auer <post@helmutauer.de> Cc: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Tested-by: Helmut Auer <post@helmutauer.de> Tested-by: Richard Scobie <rascobie@slingshot.co.nz> Tested-by: Dietmar Spingler <d_spingler@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: cxd2099: move driver out of staging into dvb-frontendsDaniel Scheller2018-03-064-0/+759
| | | | | | | | | | | | | | | | | | | | | | | | | According to the TODO file, this driver only landed in staging because of the way device nodes and data transfers are handled. Besides that this way (use of secX devices) has become sort of standard to date (ie. VDR supports this literally since ages via the ddci plugin, TVHeadend received this functionality lately, and minisatip being currently worked on regarding this), most importantly this I2C client only driver isn't even responsible for setting up device nodes, not for handling data transfer and so on, but only serves as interface for the dvb_ca_en50221 subsystem, just like every other DVB card out in the wild, with hard-wired or such flexible CA interfaces. And, it would even work with cards having the cxd2099 controller hard-wired. Also, this driver received quite some love and even is a proper I2C client driver by now. So, as this driver acts as a EN50221 frontend device, move it to dvb-frontends. There is no need to keep it buried in staging. This commit also updates all affected Kconfig and Makefile's, and adds MEDIA_AUTOSELECT depends to ddbridge and ngene. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Jasmin Jessich <jasmin@anw.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: v4l: dvb-frontends: stb0899: fix comparison to bitshift when dealing ↵Wolfram Sang2018-03-061-4/+4
| | | | | | | | | | with a mask Due to a typo, the mask was destroyed by a comparison instead of a bit shift. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: drx-j remove bsp_i2c.hCorentin Labbe2018-03-061-139/+0
| | | | | | | | bsp_i2c.h is unused since commit ffe7c4f92183 ("[media] drx-j: Get rid of drx39xyj/bsp_tuner.h") Remove it from tree. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: si2168: Add spectrum inversion propertyBrad Love2018-03-063-0/+7
| | | | | | | | | | | | Some tuners produce inverted spectrum, but the si2168 is not currently set up to accept it. This adds an optional parameter to set the frontend up to receive inverted spectrum. Parameter is optional and only boards who enable inversion will utilize this. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: si2168: Announce frontend creation failureBrad Love2018-03-061-1/+1
| | | | | | | | The driver outputs on success, but is silent on failure. Give one message that probe failed. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: Announce successful creationBrad Love2018-03-061-1/+3
| | | | | | | | | The driver is near silent, this adds a simple announcement at the end of probe after the chip has been detected and upgrades a debug message to error if probe has failed. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: si2168: Add ts bus coontrol, turn off bus on sleepBrad Love2018-03-062-8/+31
| | | | | | | | | | | Includes a function to set TS MODE property os si2168. The function either disables the TS output bus, or sets mode to config option. When going to sleep the TS bus is turned off, this makes the driver compatible with multiple frontend usage. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dibx000_common: use strlcpy() instead of strncpy()Xiongfeng Wang2018-03-061-1/+1
| | | | | | | | | | | | | | | gcc-8 reports drivers/media/dvb-frontends/dibx000_common.c: In function 'i2c_adapter_init': ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified bound 48 equals destination size [-Wstringop-truncation] We need to use strlcpy() to make sure the dest string is nul-terminated. Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: s5h14*.h: fix typos for CONTINUOUSMauro Carvalho Chehab2018-03-065-20/+20
| | | | | | | | | | | | | | There is a typo at the several s5h14*.h headers: continuous were spelled incorrectly. Fix it with this script: for i in $(git grep -l S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK); do sed s,S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,S5H1409_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK,g -i $i done for i in $(git grep -l -i continous drivers/media); do sed s,CONTINOUS,CONTINUOUS,g -i $i; done Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: Fix a double kfree on i2c device removeBrad Love2018-03-061-1/+7
| | | | | | | | | Both lgdt33606a_release and lgdt3306a_remove kfree state, but _release is called first, then _remove operates on states members before kfree'ing it. This can lead to random oops/GPF/etc on USB disconnect. Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: Fix module count mismatch on usb unplugBrad Love2018-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | When used as an i2c device there is a module usage count mismatch on removal, preventing the driver from being used thereafter. dvb_attach increments the usage count so it is properly balanced on removal. On disconnect of Hauppauge SoloHD/DualHD before: lsmod | grep lgdt3306a lgdt3306a 28672 -1 i2c_mux 16384 1 lgdt3306a On disconnect of Hauppauge SoloHD/DualHD after: lsmod | grep lgdt3306a lgdt3306a 28672 0 i2c_mux 16384 1 lgdt3306a Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: Add QAM AUTO supportBrad Love2018-03-061-9/+33
| | | | | | | | | | | | | | | As configured currently, modulation in the driver is set to auto detect, no matter what the user sets modulation to. This leads to both QAM64 and QAM256 having the same effect. QAM AUTO is explicitly added here for compatibility with scanning software who can use AUTO instead of doing essentially the same scan twice. Also included is a module option to enforce a specific QAM modulation if desired. The true modulation is read before calculating the snr. Changes are backwards compatible with current behaviour. Signed-off-by: Brad Love <brad@nextdimension.cc> Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: QAM streaming improvementBrad Love2018-03-061-0/+22
| | | | | | | | | | | | Add some register updates required for stable viewing on Cablevision in NY. Does not adversely affect other providers. Changes since v1: - Change upper case hex to lower case. Signed-off-by: Brad Love <brad@nextdimension.cc> Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: lgdt3306a: Set fe ops.release to NULL if probedBrad Love2018-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If release is part of frontend ops then it is called in the course of dvb_frontend_detach. The process also decrements the module usage count. The problem is if the lgdt3306a driver is reached via i2c_new_device, then when it is eventually destroyed remove is called, which further decrements the module usage count to negative. After this occurs the driver is in a bad state and no longer works. Also fixed by NULLing out the release callback is a double kfree of state, which introduces arbitrary oopses/GPF. This problem is only currently reachable via the em28xx driver. On disconnect of Hauppauge SoloHD before: lsmod | grep lgdt3306a lgdt3306a 28672 -1 i2c_mux 16384 1 lgdt3306a On disconnect of Hauppauge SoloHD after: lsmod | grep lgdt3306a lgdt3306a 28672 0 i2c_mux 16384 1 lgdt3306a Signed-off-by: Brad Love <brad@nextdimension.cc> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: ABS macro parameter parenthesizationDan Gopstein2018-03-068-16/+10
| | | | | | | | | | | | | | | | | Replace usages of the locally defined ABS() macro with calls to the canonical abs() from kernel.h and remove the old definitions of ABS() This change was originally motivated by two local definitions of the ABS (absolute value) macro that fail to parenthesize their parameter properly. This can lead to a bad expansion for low-precedence expression arguments. For example: ABS(1-2) currently expands to ((1-2) < 0 ? (-1-2) : (1-2)) which evaluates to -3. But the correct expansion would be ((1-2) < 0 ? -(1-2) : (1-2)) which evaluates to 1. Signed-off-by: Dan Gopstein <dgopstein@nyu.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: dvb-frontend/mxl5xx: add support for physical layer scramblingDaniel Scheller2018-03-051-1/+33
| | | | | | | | | | | | | | The MaxLinear MxL5xx has support for physical layer scrambling, which was recently added to the DVB core via the new scrambling_sequence_index property. Add required bits to the mxl5xx driver. Picked up from dddvb master, commit 5c032058b9ba ("add support for PLS") by Ralph Metzler <rjkm@metzlerbros.de>, adapted to the different naming of the pls property (pls vs. scrambling_sequence_index). Cc: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* Merge commit 'v4.16-rc4~0' into patchworkMauro Carvalho Chehab2018-03-051-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'v4.16-rc4~0': (900 commits) Linux 4.16-rc4 memremap: fix softlockup reports at teardown libnvdimm: re-enable deep flush for pmem devices via fsync() MAINTAINERS: take over Kconfig maintainership vfio: disable filesystem-dax page pinning kconfig: fix line number in recursive inclusion error message Coccinelle: memdup: Fix typo in warning messages i2c: octeon: Prevent error message on bus error parisc: Reduce irq overhead when run in qemu parisc: Use cr16 interval timers unconditionally on qemu parisc: Check if secondary CPUs want own PDC calls parisc: Hide virtual kernel memory layout parisc: Fix ordering of cache and TLB flushes kconfig: Update ncurses package names for menuconfig kbuild/kallsyms: trivial typo fix kbuild: test --build-id linker flag by ld-option instead of cc-ldoption kbuild: drop superfluous GCC_PLUGINS_CFLAGS assignment kconfig: Don't leak choice names during parsing sh: fix build error for empty CONFIG_BUILTIN_DTB_SOURCE kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list ...
| * media: m88ds3103: don't call a non-initalized functionMauro Carvalho Chehab2018-02-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If m88d3103 chip ID is not recognized, the device is not initialized. However, it returns from probe without any error, causing this OOPS: [ 7.689289] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 7.689297] pgd = 7b0bd7a7 [ 7.689302] [00000000] *pgd=00000000 [ 7.689318] Internal error: Oops: 80000005 [#1] SMP ARM [ 7.689322] Modules linked in: dvb_usb_dvbsky(+) m88ds3103 dvb_usb_v2 dvb_core videobuf2_vmalloc videobuf2_memops videobuf2_core crc32_arm_ce videodev media [ 7.689358] CPU: 3 PID: 197 Comm: systemd-udevd Not tainted 4.15.0-mcc+ #23 [ 7.689361] Hardware name: BCM2835 [ 7.689367] PC is at 0x0 [ 7.689382] LR is at m88ds3103_attach+0x194/0x1d0 [m88ds3103] [ 7.689386] pc : [<00000000>] lr : [<bf0ae1ec>] psr: 60000013 [ 7.689391] sp : ed8e5c20 ip : ed8c1e00 fp : ed8945c0 [ 7.689395] r10: ed894000 r9 : ed894378 r8 : eda736c0 [ 7.689400] r7 : ed894070 r6 : ed8e5c44 r5 : bf0bb040 r4 : eda77600 [ 7.689405] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : eda77600 [ 7.689412] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 7.689417] Control: 10c5383d Table: 2d8e806a DAC: 00000051 [ 7.689423] Process systemd-udevd (pid: 197, stack limit = 0xe9dbfb63) [ 7.689428] Stack: (0xed8e5c20 to 0xed8e6000) [ 7.689439] 5c20: ed853a80 eda73640 ed894000 ed8942c0 ed853a80 bf0b9e98 ed894070 bf0b9f10 [ 7.689449] 5c40: 00000000 00000000 bf08c17c c08dfc50 00000000 00000000 00000000 00000000 [ 7.689459] 5c60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 7.689468] 5c80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 7.689479] 5ca0: 00000000 00000000 ed8945c0 ed8942c0 ed894000 ed894830 bf0b9e98 00000000 [ 7.689490] 5cc0: ed894378 bf0a3cb4 bf0bc3b0 0000533b ed920540 00000000 00000034 bf0a6434 [ 7.689500] 5ce0: ee952070 ed826600 bf0a7038 bf0a2dd8 00000001 bf0a6768 bf0a2f90 ed8943c0 [ 7.689511] 5d00: 00000000 c08eca68 ed826620 ed826620 00000000 ee952070 bf0bc034 ee952000 [ 7.689521] 5d20: ed826600 bf0bb080 ffffffed c0aa9e9c c0aa9dac ed826620 c16edf6c c168c2c8 [ 7.689531] 5d40: c16edf70 00000000 bf0bc034 0000000d 00000000 c08e268c bf0bb080 ed826600 [ 7.689541] 5d60: bf0bc034 ed826654 ed826620 bf0bc034 c164c8bc 00000000 00000001 00000000 [ 7.689553] 5d80: 00000028 c08e2948 00000000 bf0bc034 c08e2848 c08e0778 ee9f0a58 ed88bab4 [ 7.689563] 5da0: bf0bc034 ed90ba80 c168c1f0 c08e1934 bf0bb3bc c17045ac bf0bc034 c164c8bc [ 7.689574] 5dc0: bf0bc034 bf0bb3bc ed91f564 c08e34ec bf0bc000 c164c8bc bf0bc034 c0aa8dc4 [ 7.689584] 5de0: ffffe000 00000000 bf0bf000 ed91f600 ed91f564 c03021e4 00000001 00000000 [ 7.689595] 5e00: c166e040 8040003f ed853a80 bf0bc448 00000000 c1678174 ed853a80 f0f22000 [ 7.689605] 5e20: f0f21fff 8040003f 014000c0 ed91e700 ed91e700 c16d8e68 00000001 ed91e6c0 [ 7.689615] 5e40: bf0bc400 00000001 bf0bc400 ed91f564 00000001 00000000 00000028 c03c9a24 [ 7.689625] 5e60: 00000001 c03c8c94 ed8e5f50 ed8e5f50 00000001 bf0bc400 ed91f540 c03c8cb0 [ 7.689637] 5e80: bf0bc40c 00007fff bf0bc400 c03c60b0 00000000 bf0bc448 00000028 c0e09684 [ 7.689647] 5ea0: 00000002 bf0bc530 c1234bf8 bf0bc5dc bf0bc514 c10ebbe8 ffffe000 bf000000 [ 7.689657] 5ec0: 00011538 00000000 ed8e5f48 00000000 00000000 00000000 00000000 00000000 [ 7.689666] 5ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 7.689676] 5f00: 00000000 00000000 7fffffff 00000000 00000013 b6e55a18 0000017b c0309104 [ 7.689686] 5f20: ed8e4000 00000000 00510af0 c03c9430 7fffffff 00000000 00000003 00000000 [ 7.689697] 5f40: 00000000 f0f0f000 00011538 00000000 f0f107b0 f0f0f000 00011538 f0f1fdb8 [ 7.689707] 5f60: f0f1fbe8 f0f1b974 00004000 000041e0 bf0bc3d0 00000001 00000000 000024c4 [ 7.689717] 5f80: 0000002d 0000002e 00000019 00000000 00000010 00000000 16894000 00000000 [ 7.689727] 5fa0: 00000000 c0308f20 16894000 00000000 00000013 b6e55a18 00000000 b6e5652c [ 7.689737] 5fc0: 16894000 00000000 00000000 0000017b 00020000 00508110 00000000 00510af0 [ 7.689748] 5fe0: bef68948 bef68938 b6e4d3d0 b6d32590 60000010 00000013 00000000 00000000 [ 7.689790] [<bf0ae1ec>] (m88ds3103_attach [m88ds3103]) from [<bf0b9f10>] (dvbsky_s960c_attach+0x78/0x280 [dvb_usb_dvbsky]) [ 7.689821] [<bf0b9f10>] (dvbsky_s960c_attach [dvb_usb_dvbsky]) from [<bf0a3cb4>] (dvb_usbv2_probe+0xa3c/0x1024 [dvb_usb_v2]) [ 7.689849] [<bf0a3cb4>] (dvb_usbv2_probe [dvb_usb_v2]) from [<c0aa9e9c>] (usb_probe_interface+0xf0/0x2a8) [ 7.689869] [<c0aa9e9c>] (usb_probe_interface) from [<c08e268c>] (driver_probe_device+0x2f8/0x4b4) [ 7.689881] [<c08e268c>] (driver_probe_device) from [<c08e2948>] (__driver_attach+0x100/0x11c) [ 7.689895] [<c08e2948>] (__driver_attach) from [<c08e0778>] (bus_for_each_dev+0x4c/0x9c) [ 7.689909] [<c08e0778>] (bus_for_each_dev) from [<c08e1934>] (bus_add_driver+0x1c0/0x264) [ 7.689919] [<c08e1934>] (bus_add_driver) from [<c08e34ec>] (driver_register+0x78/0xf4) [ 7.689931] [<c08e34ec>] (driver_register) from [<c0aa8dc4>] (usb_register_driver+0x70/0x134) [ 7.689946] [<c0aa8dc4>] (usb_register_driver) from [<c03021e4>] (do_one_initcall+0x44/0x168) [ 7.689963] [<c03021e4>] (do_one_initcall) from [<c03c9a24>] (do_init_module+0x64/0x1f4) [ 7.689979] [<c03c9a24>] (do_init_module) from [<c03c8cb0>] (load_module+0x20a0/0x25c8) [ 7.689993] [<c03c8cb0>] (load_module) from [<c03c9430>] (SyS_finit_module+0xb4/0xec) [ 7.690007] [<c03c9430>] (SyS_finit_module) from [<c0308f20>] (ret_fast_syscall+0x0/0x54) [ 7.690018] Code: bad PC value This may happen on normal circumstances, if, for some reason, the demod hangs and start returning an invalid chip ID: [ 10.394395] m88ds3103 3-0068: Unknown device. Chip_id=00 So, change the logic to cause probe to fail with -ENODEV, preventing the OOPS. Detected while testing DVB MMAP patches on Raspberry Pi 3 with DVBSky S960CI. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* | media: dvb-frontends: ves1820: use 64-bit arithmetic instead of 32-bitGustavo A. R. Silva2018-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add suffix ULL to constant 10 in order to give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type u64 (64 bits, unsigned). The expression fpxin = state->config->xin * 10 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 200604 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>