]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/log
mirror_ubuntu-focal-kernel.git
6 years agomedia: meye: allow building it with COMPILE_TEST on non-x86
Mauro Carvalho Chehab [Fri, 20 Apr 2018 15:55:13 +0000 (11:55 -0400)]
media: meye: allow building it with COMPILE_TEST on non-x86

This driver depends on sony-laptop driver, but this is available
only for x86. So, add a stub function, in order to allow building
it on non-x86 too.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cxd2880: Changed version information
Yasunari Takiguchi [Thu, 26 Apr 2018 06:42:52 +0000 (02:42 -0400)]
media: cxd2880: Changed version information

This is the version update for this cxd2880 driver changing.

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+samsung@kernel.org>
6 years agomedia: cxd2880:Optimized spi drive current and BER/PER set/get condition
Yasunari Takiguchi [Thu, 26 Apr 2018 06:41:29 +0000 (02:41 -0400)]
media: cxd2880:Optimized spi drive current and BER/PER set/get condition

This is the optimization for SPI drive current and
signal lock condition check part for BER/PER measure
to ensure BER/PER are stable

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+samsung@kernel.org>
6 years agomedia: cxd2880-spi: Modified how to declare structure
Yasunari Takiguchi [Thu, 26 Apr 2018 06:39:17 +0000 (02:39 -0400)]
media: cxd2880-spi: Modified how to declare structure

This is the modification of structure declaration for spi_transfer.

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+samsung@kernel.org>
6 years agomedia: docs: update em28xx and cx23885 cardlists
Mauro Carvalho Chehab [Sat, 5 May 2018 14:35:22 +0000 (10:35 -0400)]
media: docs: update em28xx and cx23885 cardlists

As newer boards got added, update the cardlists.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: em28xx: Add new dvb-t board ":Zolid Hybrid Tv Stick"
Marcel Stork [Thu, 26 Apr 2018 19:17:02 +0000 (15:17 -0400)]
media: em28xx: Add new dvb-t board ":Zolid Hybrid Tv Stick"

Extra code to be able to use this stick, only digital, not analog
nor remote-control.

Signed-off-by: Marcel Stork <mjstork@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: em28xx: merge two identical cases inside a switch()
Marcel Stork [Wed, 25 Apr 2018 17:34:20 +0000 (13:34 -0400)]
media: em28xx: merge two identical cases inside a switch()

A cosmetic change by combining two sets of boards into one set because
having the same arguments.

Signed-off-by: Marcel Stork <mjstork@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: rcar-vin: enable field toggle after a set number of lines for Gen3
Niklas Söderlund [Tue, 24 Apr 2018 23:56:52 +0000 (19:56 -0400)]
media: rcar-vin: enable field toggle after a set number of lines for Gen3

The VIN Gen3 hardware don't have Line Post-Clip capabilities as VIN Gen2
hardware have. To protect against writing outside the capture window
enable field toggle after a set number of lines have been captured.

Capturing outside the allocated capture buffer where observed on R-Car
Gen3 Salvator-XS H3 from the CVBS input if the standard is
misconfigured. That is if a PAL source is connected to the system but
the adv748x standard is set to NTSC. In this case the format reported by
the adv748x is 720x480 and that is what is used for the media pipeline.
The PAL source generates frames in the format of 720x576 and the field
is not toggled until the VSYNC is detected and at that time data have
already been written outside the allocated capture buffer.

With this change the capture in the situation described above results in
garbage frames but that is far better then writing outside the capture
buffer.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: rcar-vin: add support for MEDIA_BUS_FMT_UYVY8_1X16
Niklas Söderlund [Tue, 24 Apr 2018 23:46:07 +0000 (19:46 -0400)]
media: rcar-vin: add support for MEDIA_BUS_FMT_UYVY8_1X16

By setting VNMC_YCAL rcar-vin can support input video in
MEDIA_BUS_FMT_UYVY8_1X16 format.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: rcar-vin: fix null pointer dereference in rvin_group_get()
Niklas Söderlund [Tue, 24 Apr 2018 23:45:06 +0000 (19:45 -0400)]
media: rcar-vin: fix null pointer dereference in rvin_group_get()

Store the group pointer before disassociating the VIN from the group.

Fixes: 3bb4c3bc85bf77a7 ("media: rcar-vin: add group allocator functions")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: rcar-vin: remove generic gen3 compatible string
Niklas Söderlund [Tue, 24 Apr 2018 23:43:21 +0000 (19:43 -0400)]
media: rcar-vin: remove generic gen3 compatible string

The compatible string "renesas,rcar-gen3-vin" was added before the
Gen3 driver code was added but it's not possible to use. Each SoC in the
Gen3 series require SoC specific knowledge in the driver to function.
Remove it before it is added to any device tree descriptions.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx88: Get rid of spurious call to cx8800_start_vbi_dma()
Devin Heitmueller [Tue, 24 Apr 2018 23:12:52 +0000 (19:12 -0400)]
media: cx88: Get rid of spurious call to cx8800_start_vbi_dma()

This was left over from the conversion to VB2, where the call was
getting invoked both in buffer_queue and start_streaming, which
was intermittently causing invalid opcodes on the VBI RISC queue.

This change effectively mirrors the exact same change Hans Verkuil
made in cx88-video.c in commit 389208e1173e ("[media] cx88:
remove leftover start_video_dma() call").

Thanks to Daniel Glöckner for spotting the actual bug after I spent
several days trying to chase down the issue.

Fixes: 389208e1173e ("[media] cx88: remove leftover start_video_dma() call")
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Thanks-to: Daniel Glöckner <daniel-gl@gmx.net>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb_net: fix dvb_net_tx()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:15:51 +0000 (09:15 -0400)]
media: dvb_net: fix dvb_net_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt3306a: fix lgdt3306a_search()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:19:04 +0000 (09:19 -0400)]
media: lgdt3306a: fix lgdt3306a_search()'s return type

The method dvb_frontend_ops::search() is defined as
returning an 'enum dvbfe_search', but the implementation in this
driver returns an 'int'.

Fix this by returning 'enum dvbfe_search' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: frontends: fix ops get_algo()'s return type
Luc Van Oostenryck [Tue, 24 Apr 2018 13:19:18 +0000 (09:19 -0400)]
media: frontends: fix ops get_algo()'s return type

The method dvb_frontend_ops::get_frontend_algo() is defined as
returning an 'enum dvbfe_algo', but the implementation in this
driver returns an 'int'.

Fix this by returning 'enum dvbfe_algo' on drivers.

[mchehab+samsung@kernel.org: merge similar patches and patch
 ddbridge-mci.c the same way]
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: drivers: media: platform: make VIDEO_VIU depend on I2C
Anders Roxell [Mon, 23 Apr 2018 19:31:39 +0000 (15:31 -0400)]
media: drivers: media: platform: make VIDEO_VIU depend on I2C

Commit 7378f1149884 ("media: omap2: omapfb: allow building it with
COMPILE_TEST") broke compilation without CONFIG_I2C selected.
drivers/media/platform/fsl-viu.c: In function ‘viu_of_probe’:
drivers/media/platform/fsl-viu.c:1452:7: error: implicit declaration of function ‘i2c_get_adapter’; did you mean ‘i2c_lock_adapter’? [-Werror=implicit-function-declaration]
  ad = i2c_get_adapter(0);
       ^~~~~~~~~~~~~~~
       i2c_lock_adapter
drivers/media/platform/fsl-viu.c:1452:5: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  ad = i2c_get_adapter(0);
     ^
drivers/media/platform/fsl-viu.c:1534:2: error: implicit declaration of function ‘i2c_put_adapter’; did you mean ‘i2c_lock_adapter’? [-Werror=implicit-function-declaration]
  i2c_put_adapter(ad);
  ^~~~~~~~~~~~~~~
  i2c_lock_adapter

Added I2C dependency in order to make all configurations work again.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ngene: fix ci_tsfix modparam description typo
Daniel Scheller [Sun, 22 Apr 2018 16:06:52 +0000 (12:06 -0400)]
media: ngene: fix ci_tsfix modparam description typo

s/shifs/shifts/

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ngene: cleanup superfluous I2C adapter evaluation
Daniel Scheller [Sun, 22 Apr 2018 16:06:51 +0000 (12:06 -0400)]
media: ngene: cleanup superfluous I2C adapter evaluation

Commit ee93340e98bc ("media: ngene: deduplicate I2C adapter evaluation")
added a helper to evaluate the I2C adapter to be used for demod/tuner
attachment based on the given ngene_channel, and that helper is used in
many attach functions to initialise the i2c_adapter variable. However,
for some reason in tuner_attach_stv6110() and demod_attach_stv0900(), the
adapter evaluation wasn't removed as in all other functions. Fix (or
finalize, even) the helper use by cleaning up the superfluous I2C adapter
evaluation leftover in these two functions.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: pt1: use #ifdef CONFIG_PM_SLEEP instead of #if
Mauro Carvalho Chehab [Sat, 5 May 2018 13:23:21 +0000 (09:23 -0400)]
media: pt1: use #ifdef CONFIG_PM_SLEEP instead of #if

As pointed by ktest:

>> drivers/media//pci/pt1/pt1.c:1433:5: warning: "CONFIG_PM_SLEEP" is not defined, evaluates to 0 [-Wundef]
    #if CONFIG_PM_SLEEP
        ^~~~~~~~~~~~~~~

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: include/media: fix missing | operator when setting cfg
Colin Ian King [Wed, 18 Apr 2018 15:06:17 +0000 (11:06 -0400)]
media: include/media: fix missing | operator when setting cfg

The value from a readl is being masked with ITE_REG_CIOCAN_MASK however
this is not being used and cfg is being re-assigned.  I believe the
assignment operator should actually be instead the |= operator.

Detected by CoverityScan, CID#1467987 ("Unused value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: remove a now unused var
Mauro Carvalho Chehab [Sat, 5 May 2018 12:27:48 +0000 (08:27 -0400)]
media: cx231xx: remove a now unused var

drivers/media/usb/cx231xx/cx231xx-dvb.c: In function 'unregister_dvb':
drivers/media/usb/cx231xx/cx231xx-dvb.c:607:21: warning: unused variable 'client' [-Wunused-variable]
  struct i2c_client *client;
                     ^~~~~~

Fixes: a12481354656 ("media: cx231xx: Switch to using new dvb i2c helpers")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Add I2C_MUX dependency
Brad Love [Thu, 3 May 2018 21:20:15 +0000 (17:20 -0400)]
media: cx231xx: Add I2C_MUX dependency

cx231xx requires i2c mux adapter capability.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Remove RC_CORE dependency
Brad Love [Thu, 3 May 2018 21:20:14 +0000 (17:20 -0400)]
media: cx231xx: Remove RC_CORE dependency

VIDEO_CX231XX_RC requires RC_CORE, but VIDEO_CX231XX
does not require RC to compile or function.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Remove unnecessary parameter clear
Brad Love [Thu, 3 May 2018 21:20:13 +0000 (17:20 -0400)]
media: cx231xx: Remove unnecessary parameter clear

The default is now 0, no need to override

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Update 955Q from dvb attach to i2c device
Brad Love [Thu, 3 May 2018 21:20:12 +0000 (17:20 -0400)]
media: cx231xx: Update 955Q from dvb attach to i2c device

Trim out some unused config params. Use the i2c mux
adapter returned by frontend with the tuner.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Switch to using new dvb i2c helpers
Brad Love [Thu, 3 May 2018 21:20:11 +0000 (17:20 -0400)]
media: cx231xx: Switch to using new dvb i2c helpers

Mostly very straight forward replace of blocks with equivalent code.

Cleanup added at end of dvb_init in case of failure.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Ignore an i2c mux adapter
Brad Love [Thu, 3 May 2018 21:20:10 +0000 (17:20 -0400)]
media: cx231xx: Ignore an i2c mux adapter

Hauppauge 935C cannot communicate with the si2157
when using the mux adapter returned by the si2168,
so disable it to fix the device.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Style fix for struct zero init
Brad Love [Thu, 3 May 2018 21:20:09 +0000 (17:20 -0400)]
media: cx231xx: Style fix for struct zero init

Replace zero fill memset inits with
equivalent {} in declaration

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Use board profile values for addresses
Brad Love [Thu, 3 May 2018 21:20:08 +0000 (17:20 -0400)]
media: cx231xx: Use board profile values for addresses

Replace all usage of hard coded values with
the proper field from the board profile.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: Fix several incorrect demod addresses
Brad Love [Thu, 3 May 2018 21:20:07 +0000 (17:20 -0400)]
media: cx231xx: Fix several incorrect demod addresses

Now the board values match the hard coded
constants used in the dvb initialization.

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-usb: Replace GFP_ATOMIC with GFP_KERNEL
Jia-Ju Bai [Wed, 11 Apr 2018 03:23:49 +0000 (23:23 -0400)]
media: dvb-usb: Replace GFP_ATOMIC with GFP_KERNEL

Despite never getting called from atomic context,
usb URB memory allocations use GFP_ATOMIC, which does not sleep
for allocation.

GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL,
which can sleep and improve the possibility of sucessful allocation.

This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.

[mchehab+samsung@kernel.org: merged 3 similar patches into one]
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: pt1: fix strncmp() size warning
Mauro Carvalho Chehab [Sat, 5 May 2018 11:32:27 +0000 (07:32 -0400)]
media: pt1: fix strncmp() size warning

As warned by smatch:
drivers/media/pci/pt1/pt1.c:213 config_demod() error: strncmp() '"tc90522sat"' too small (11 vs 20)

Use the same strncmp() syntax as pt1_init_frontends() does.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb: earth-pt1: replace schedule_timeout with usleep_range
Akihiro Tsukada [Sun, 8 Apr 2018 17:39:53 +0000 (13:39 -0400)]
media: dvb: earth-pt1: replace schedule_timeout with usleep_range

As described in Document/timers/timers-howto.txt,
hrtimer-based delay should be used for small sleeps.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb: earth-pt1: add support for suspend/resume
Akihiro Tsukada [Sun, 8 Apr 2018 17:39:52 +0000 (13:39 -0400)]
media: dvb: earth-pt1: add support for suspend/resume

Without this patch, re-loading of the module was required after resume.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb: earth-pt1: decompose pt1 driver into sub drivers
Akihiro Tsukada [Sun, 8 Apr 2018 17:39:51 +0000 (13:39 -0400)]
media: dvb: earth-pt1: decompose pt1 driver into sub drivers

earth-pt1 was a monolithic module and included demod/tuner drivers.
This patch removes those FE parts and  attach demod/tuner i2c drivers.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: tuners: add new i2c driver for Sharp qm1d1b0004 ISDB-S tuner
Akihiro Tsukada [Sun, 8 Apr 2018 17:39:50 +0000 (13:39 -0400)]
media: tuners: add new i2c driver for Sharp qm1d1b0004 ISDB-S tuner

The tuner is used in Earthsoft PT1/PT2 DVB boards,
and  the driver was extraced from (the former) va1j5jf8007s.c of PT1.
it might contain PT1 specific configs.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/dvb-pll: add tda6651 ISDB-T pll_desc
Akihiro Tsukada [Sun, 8 Apr 2018 17:39:49 +0000 (13:39 -0400)]
media: dvb-frontends/dvb-pll: add tda6651 ISDB-T pll_desc

This patch adds a PLL "description" of Philips TDA6651 for ISDB-T.
It was extracted from (the former) va1j5jf8007t.c of EarthSoft PT1,
thus the desc might include PT1 specific configs.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-usb-v2/gl861: ensure USB message buffers DMA'able
Akihiro Tsukada [Sun, 8 Apr 2018 17:21:38 +0000 (13:21 -0400)]
media: dvb-usb-v2/gl861: ensure USB message buffers DMA'able

i2c message buf might be on stack.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-usb-v2/gl861: use usleep_range() for short delay
Akihiro Tsukada [Sun, 8 Apr 2018 17:21:37 +0000 (13:21 -0400)]
media: dvb-usb-v2/gl861: use usleep_range() for short delay

As the kernel doc "timers-howto.txt" reads,
short delay with msleep() can take much longer.
In a case of raspbery-pi platform where CONFIG_HZ_100 was set,
it actually affected the init of Friio devices
since it issues lots of i2c transactions with short delay.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/dvb-pll: add tua6034 ISDB-T tuner used in Friio
Akihiro Tsukada [Sun, 8 Apr 2018 17:21:35 +0000 (13:21 -0400)]
media: dvb-frontends/dvb-pll: add tua6034 ISDB-T tuner used in Friio

This driver already contains tua6034-based device settings,
but they are not for ISDB-T and have different parameters.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/dvb-pll: add i2c driver support
Akihiro Tsukada [Sun, 8 Apr 2018 17:21:34 +0000 (13:21 -0400)]
media: dvb-frontends/dvb-pll: add i2c driver support

registers the module as an i2c driver,
but keeps dvb_pll_attach() untouched for compatibility.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: v4l2-dev: use pr_foo() for printing messages
Mauro Carvalho Chehab [Thu, 5 Apr 2018 10:34:39 +0000 (06:34 -0400)]
media: v4l2-dev: use pr_foo() for printing messages

Instead of using printk() directly, use the pr_foo()
macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: platform: video-mux: propagate format from sink to source
Chris Lesiak [Tue, 3 Apr 2018 19:50:22 +0000 (15:50 -0400)]
media: platform: video-mux: propagate format from sink to source

Propagate the v4l2_mbus_framefmt to the source pad when either a sink
pad is activated or when the format of the active sink pad changes.

Signed-off-by: Chris Lesiak <chris.lesiak@licor.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: i2c: tvp5150: Fix open brace placement codding style
Nasser Afshin [Mon, 2 Apr 2018 22:23:19 +0000 (18:23 -0400)]
media: i2c: tvp5150: Fix open brace placement codding style

This patch resolves the following checkpatch.pl error:
    ERROR: that open brace { should be on the previous line

Signed-off-by: Nasser Afshin <Afshin.Nasser@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: i2c: tvp5150: Use the correct comment style
Nasser Afshin [Mon, 2 Apr 2018 22:23:18 +0000 (18:23 -0400)]
media: i2c: tvp5150: Use the correct comment style

This patch resolves checkpatch.pl warnings:
    WARNING: Block comments use * on subsequent lines
    WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Nasser Afshin <Afshin.Nasser@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: i2c: tvp5150: Add a space after commas
Nasser Afshin [Mon, 2 Apr 2018 22:23:17 +0000 (18:23 -0400)]
media: i2c: tvp5150: Add a space after commas

This patch resolves checkpatch.pl errors:
    ERROR: space required after that ',' (ctx:VxV)

Signed-off-by: Nasser Afshin <Afshin.Nasser@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: i2c: tvp5150: Use parentheses for sizeof
Nasser Afshin [Mon, 2 Apr 2018 22:23:20 +0000 (18:23 -0400)]
media: i2c: tvp5150: Use parentheses for sizeof

This patch resolves a checkpatch.pl warning:
    WARNING: sizeof *cap should be sizeof(*cap)

Signed-off-by: Nasser Afshin <Afshin.Nasser@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: bttv: Fixed oops error when capturing at yuv410p
Samuel Williams [Sun, 1 Apr 2018 15:00:27 +0000 (11:00 -0400)]
media: bttv: Fixed oops error when capturing at yuv410p

When capturing at yuv410p, sg_next was called too many times when chroma is
false, eventually returning NULL. This patch does fix this for my hardware.

Signed-off-by: Samuel Williams <sam8641@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: tuners/qm1d1c0042: use SPDX License Identifier
Akihiro Tsukada [Tue, 27 Mar 2018 17:08:22 +0000 (13:08 -0400)]
media: tuners/qm1d1c0042: use SPDX License Identifier

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: tuners/mxl301rf: use SPDX License Identifier
Akihiro Tsukada [Tue, 27 Mar 2018 17:08:21 +0000 (13:08 -0400)]
media: tuners/mxl301rf: use SPDX License Identifier

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb/pci/pt3: use SPDX License Identifier
Akihiro Tsukada [Tue, 27 Mar 2018 17:08:20 +0000 (13:08 -0400)]
media: dvb/pci/pt3: use SPDX License Identifier

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/tc90522: use SPDX License Identifier
Akihiro Tsukada [Tue, 27 Mar 2018 17:08:19 +0000 (13:08 -0400)]
media: dvb-frontends/tc90522: use SPDX License Identifier

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-core/dvb_frontend: set better default for ISDB-T
Akihiro Tsukada [Tue, 27 Mar 2018 16:56:58 +0000 (12:56 -0400)]
media: dvb-core/dvb_frontend: set better default for ISDB-T

DTV_ISDBT_LAYER_ENABLED parameter should be set to "All" by default,
instead of "None", as described in the API document.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/tc90522: fix bit shift mistakes
Akihiro Tsukada [Tue, 27 Mar 2018 15:51:21 +0000 (11:51 -0400)]
media: dvb-frontends/tc90522: fix bit shift mistakes

GIT_AUTHOR_NAME=Akihiro TSUKADA
GIT_AUTHOR_EMAIL=tskd08@gmail.com

they were obviously wrong.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ov13858: Remove owner assignment from i2c_driver
Fabio Estevam [Sat, 24 Mar 2018 14:01:34 +0000 (10:01 -0400)]
media: ov13858: Remove owner assignment from i2c_driver

Structure i2c_driver does not need to set the owner field, as this will
be populated by the driver core.

Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.

Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ov5695: Remove owner assignment from i2c_driver
Fabio Estevam [Sat, 24 Mar 2018 14:01:33 +0000 (10:01 -0400)]
media: ov5695: Remove owner assignment from i2c_driver

Structure i2c_driver does not need to set the owner field, as this will
be populated by the driver core.

Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.

Cc: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: em28xx-cards: output regular messages as info
Chris Mayo [Fri, 23 Mar 2018 19:47:13 +0000 (15:47 -0400)]
media: em28xx-cards: output regular messages as info

Messages expected during device probe were being marked as errors.

Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: pt3: no need to check if null for dvb_module_release()
Mauro Carvalho Chehab [Fri, 4 May 2018 18:23:43 +0000 (14:23 -0400)]
media: pt3: no need to check if null for dvb_module_release()

Such check is already there at the routine. So, no need to
repeat it outside.

Cc: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: media/dvb: earth-pt3: use the new i2c binding helper
Akihiro Tsukada [Mon, 19 Mar 2018 16:00:23 +0000 (12:00 -0400)]
media: media/dvb: earth-pt3: use the new i2c binding helper

This patch slightly simplifies the binding code by introducing commit
8f569c0b4e6b ("media: dvb-core: add helper functions for I2C binding").

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb: add alternative USB PID for Hauppauge WinTV-soloHD
Rainer Keller [Sun, 18 Mar 2018 12:40:16 +0000 (08:40 -0400)]
media: dvb: add alternative USB PID for Hauppauge WinTV-soloHD

Newer DVB receivers of this type have a different USB PID.

Signed-off-by: Rainer Keller <mail@rainerkeller.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge, cxd2099: include guard, fix unneeded NULL init, strings
Daniel Scheller [Sat, 17 Mar 2018 14:55:32 +0000 (10:55 -0400)]
media: ddbridge, cxd2099: include guard, fix unneeded NULL init, strings

Three really tiny minors in this single commit which all on their own
would just clutter up the commit history unnecessarily:

* ddbridge-regs.h is lacking an include guard. Add it.
* Fix an unnecessary NULL initialisation in ddbridge-ci. The declaration
  of the ci struct ptr is immediately followed by kzalloc().
* Clarify that the CXD2099AR is a Sony device in the cxd2099 driver at a
  few places including Kconfig.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Acked-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cxd2880-spi: avoid out-of-bounds access warning
Arnd Bergmann [Tue, 13 Mar 2018 12:09:11 +0000 (08:09 -0400)]
media: cxd2880-spi: avoid out-of-bounds access warning

The -Warray-bounds warning in gcc-8 triggers for a newly added file:

drivers/media/spi/cxd2880-spi.c: In function 'cxd2880_write_reg':
drivers/media/spi/cxd2880-spi.c:111:3: error: 'memcpy' forming offset [133, 258] is out of the bounds [0, 132] of object 'send_data' with type 'u8[132]' {aka 'unsigned char[132]'} [-Werror=array-bounds]

The problem appears to be that we have two range checks in this function,
first comparing against BURST_WRITE_MAX (128) and then comparing against
a literal '255'. The logic checking the buffer size looks at the second
one and decides that this might be the actual maximum data length.

This is understandable behavior from the compiler, but the code is actually
safe. Since the first check is already shorter, we can remove the loop
and only leave that. To be on the safe side in case BURST_WRITE_MAX might
be increased, I'm leaving the check against U8_MAX.

Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface")
Cc: Martin Sebor <msebor@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: don't use an uninitialized state
Mauro Carvalho Chehab [Fri, 4 May 2018 15:16:49 +0000 (11:16 -0400)]
media: lgdt330x: don't use an uninitialized state

If state is not initialized or is freed, we can't use it:
drivers/media/dvb-frontends/lgdt330x.c:920 lgdt330x_probe() error: potential null dereference 'state'.  (kzalloc returns null)
drivers/media/dvb-frontends/lgdt330x.c:920 lgdt330x_probe() error: we previously assumed 'state' could be null (see line 878)
drivers/media/dvb-frontends/lgdt330x.c:920 lgdt330x_probe() error: dereferencing freed memory 'state'

Fixes: 23ba635d45f5 ("media: lgdt330x: convert it to the new I2C binding way")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: add block error counts via DVBv5
Mauro Carvalho Chehab [Fri, 9 Mar 2018 16:15:41 +0000 (11:15 -0500)]
media: lgdt330x: add block error counts via DVBv5

Show the UCB error counts via DVBv5.

Please notice that there's no scale indication at the driver.
As we don't have the datasheet, let's assume that it is receiving
data at a rate of 10.000 packets per second. Ideally, this should
be read or estimated.

In order to avoid flooding I2C bus with data, the maximum
polling rate for those stats was set to 1 second.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: get rid of read_ber stub
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:35 +0000 (10:53 -0500)]
media: lgdt330x: get rid of read_ber stub

This routine does nothing. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: provide DVBv5 Carrier S/N measurements
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:34 +0000 (10:53 -0500)]
media: lgdt330x: provide DVBv5 Carrier S/N measurements

Change the logic at the driver to provide CNR stats via
DVBv5 API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: move *read_status functions
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:33 +0000 (10:53 -0500)]
media: lgdt330x: move *read_status functions

In preparation to implement DVBv5 stats on this driver, move
the *read_status functions to happen after SNR and signal
strength routines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: constify several register init arrays
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:32 +0000 (10:53 -0500)]
media: lgdt330x: constify several register init arrays

There are several register init arrays there that can be
constified.

The change reduced a little bit the amount of initialized
data:

   text    data     bss     dec     hex filename
   6372     360       4    6736    1a50 old/drivers/media/dvb-frontends/lgdt330x.o
   6500     264       4    6768    1a70 new/drivers/media/dvb-frontends/lgdt330x.o

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: do some cleanups at status logic
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:31 +0000 (10:53 -0500)]
media: lgdt330x: do some cleanups at status logic

Simplify a few ifs there.

While here, add debug messages for the 8-vsb and qam log status
flags.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: convert it to the new I2C binding way
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:30 +0000 (10:53 -0500)]
media: lgdt330x: convert it to the new I2C binding way

Convert the driver to allow its usage with the new I2C
binding way.

Please notice that this patch doesn't convert the
callers to bind to it using the new way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: print info when device gets probed
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:29 +0000 (10:53 -0500)]
media: lgdt330x: print info when device gets probed

It is useful to know if the driver load succeded. So,
add a printk info there.

While here, improve the .init debug printed message.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: use pr_foo() macros
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:28 +0000 (10:53 -0500)]
media: lgdt330x: use pr_foo() macros

Cleanup the usecases of dprintk() by using pr_fmt() and replace
printk by pr_foo().

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: fix coding style issues
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:27 +0000 (10:53 -0500)]
media: lgdt330x: fix coding style issues

As we're about to convert this driver to use the new i2c
binding way, let's first solve most coding style issues,
in order to avoid mixing coding style changes with code
changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: lgdt330x: use kernel-doc instead of inlined comments
Mauro Carvalho Chehab [Fri, 9 Mar 2018 15:53:26 +0000 (10:53 -0500)]
media: lgdt330x: use kernel-doc instead of inlined comments

Change the lgdt330x_config documentation to use kernel-doc
style.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: em28xx: fix a regression with HVR-950
Mauro Carvalho Chehab [Fri, 9 Mar 2018 12:21:45 +0000 (07:21 -0500)]
media: em28xx: fix a regression with HVR-950

Commit be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner
functionality") removed the logic with sets the alternate for the DVB
device. Without setting the right alternate, the device won't be
able to submit URBs, and userspace fails with -EMSGSIZE:

ERROR     DMX_SET_PES_FILTER failed (PID = 0x2000): 90 Message too long

Tested with Hauppauge HVR-950 model A1C0.

Fixes: be7fd3c3a8c5 ("media: em28xx: Hauppauge DualHD second tuner functionality")
Cc: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: v4l2-core: get rid of videobuf-dvb
Mauro Carvalho Chehab [Fri, 9 Mar 2018 08:30:48 +0000 (03:30 -0500)]
media: v4l2-core: get rid of videobuf-dvb

Videobuf has been replaced by videobuf2. Now, no drivers use
the videobuf-dvb helper module anymore. So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: cx231xx: get rid of videobuf-dvb dependency
Mauro Carvalho Chehab [Fri, 9 Mar 2018 08:30:47 +0000 (03:30 -0500)]
media: cx231xx: get rid of videobuf-dvb dependency

This driver doesn't use videobuf-dvb. So, stop adding an
unused struct and unused header on it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-usb-v2: stop using coherent memory for URBs
Mauro Carvalho Chehab [Thu, 8 Mar 2018 19:09:03 +0000 (14:09 -0500)]
media: dvb-usb-v2: stop using coherent memory for URBs

There's no need to use coherent buffers there. So, let the
DVB core do the allocation. That should give some performance
gain outside x86.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvbsky: fix driver unregister logic
Mauro Carvalho Chehab [Thu, 8 Mar 2018 18:47:39 +0000 (13:47 -0500)]
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 [ffff8803a6f61100ffff8803a6f61900)
[  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>
6 years agomedia: dvbsky: use the new dvb_module_probe() API
Mauro Carvalho Chehab [Thu, 8 Mar 2018 18:47:38 +0000 (13:47 -0500)]
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>
6 years agomedia: ddbridge: set driver version to 0.9.33-integrated
Daniel Scheller [Mon, 9 Apr 2018 16:47:52 +0000 (12:47 -0400)]
media: ddbridge: set driver version to 0.9.33-integrated

Set DDBRIDGE_VERSION in ddbridge.h to 0.9.33-integrated to reflect the
updated driver.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: recognize and attach the MaxSX8 cards
Daniel Scheller [Mon, 9 Apr 2018 16:47:51 +0000 (12:47 -0400)]
media: ddbridge: recognize and attach the MaxSX8 cards

Add needed logic into dvb_input_attach(), ddb_port_probe() and
ddb_ports_init() to initialize and support these new cards.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: add hardware defs and PCI IDs for MCI cards
Daniel Scheller [Mon, 9 Apr 2018 16:47:50 +0000 (12:47 -0400)]
media: ddbridge: add hardware defs and PCI IDs for MCI cards

Add PCI IDs and ddb_info for the new MCI-based MaxSX8 cards. Also add
needed defines so the cards can be hooked up into ddbridge's probe and
attach handling.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge/max: implement MCI/MaxSX8 attach function
Daniel Scheller [Mon, 9 Apr 2018 16:47:49 +0000 (12:47 -0400)]
media: ddbridge/max: implement MCI/MaxSX8 attach function

Implement frontend attachment as ddb_fe_attach_mci() into the
ddbridge-max module. The MaxSX8 MCI cards are part of the Max card series
and make use of the LNB controller driven by the already existing lnb
functionality, so here's where this code belongs to.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: initial support for MCI-based MaxSX8 cards
Daniel Scheller [Mon, 9 Apr 2018 16:47:48 +0000 (12:47 -0400)]
media: ddbridge: initial support for MCI-based MaxSX8 cards

This adds initial support for the new MCI-based (micro-code interface)
DD cards, with the first one being the MaxSX8 eight-tuner DVB-S/S2/S2X
PCIe card. The MCI is basically a generalized interface implemented in
the card's FPGA firmware and usable for all kind of cards, without the
need to implement any demod/tuner drivers as this interface "hides" any
I2C interface to the actual ICs, in other words any required driver is
implemented in the card firmware.

At this stage, the MCI interface is quite rudimentary with things like
signal statistics reporting missing, but is already working to serve
DVB streams to DVB applications. Missing functionality will be enabled
over time.

This implements only the ddbridge-mci sub-object and hooks it up to the
Makefile so the object gets build. The upcoming commits hook this module
into all other ddbridge parts where required, including device IDs etc.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: support dummy tuners with 125MByte/s dummy data stream
Daniel Scheller [Mon, 9 Apr 2018 16:47:47 +0000 (12:47 -0400)]
media: ddbridge: support dummy tuners with 125MByte/s dummy data stream

The Octopus V3 and Octopus Mini devices support set up of a dummy tuner
mode on port 0 that will deliver a continuous data stream of 125MBytes
per second while raising IRQs and filling the DMA buffers, which comes
handy for some stress, PCIe link and IRQ handling testing. The dummy
frontend is registered using dvb_dummy_fe's QAM dummy frontend. Set
ddbridge.dummy_tuner to 1 to enable this on the supported cards.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: make DMA buffer count and size modparam-configurable
Daniel Scheller [Mon, 9 Apr 2018 16:47:46 +0000 (12:47 -0400)]
media: ddbridge: make DMA buffer count and size modparam-configurable

Make the number of DMA buffers and their size configurable using module
parameters. Being able to set these to a higher number might help on
busy systems when handling overall high data rates without having to
edit the driver sources and recompile things.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: set devid entry for link 0
Daniel Scheller [Mon, 9 Apr 2018 16:47:45 +0000 (12:47 -0400)]
media: ddbridge: set devid entry for link 0

Currently, /sys/class/ddbridgeX/devid always reports 0 due to devid not
being set at all. Set the devid field alongside while storing all other
hardware ID data.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: fix output buffer check
Daniel Scheller [Mon, 9 Apr 2018 16:47:44 +0000 (12:47 -0400)]
media: ddbridge: fix output buffer check

A 188 byte gap has to be left between the writer and the consumer. This
requires 2*188 bytes available to be able to write to the output buffers.
So, change ddb_output_free() to report free bytes according to this rule.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: use spin_lock_irqsave() in output_work()
Daniel Scheller [Mon, 9 Apr 2018 16:47:43 +0000 (12:47 -0400)]
media: ddbridge: use spin_lock_irqsave() in output_work()

Make sure to save IRQ states before taking the dma lock, as already done
in it's input_work() counterpart.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: improve separated MSI IRQ handling
Daniel Scheller [Mon, 9 Apr 2018 16:47:42 +0000 (12:47 -0400)]
media: ddbridge: improve separated MSI IRQ handling

Improve IRQ handling in the separated MSG/I2C and IO/TSDATA handlers by
applying a mask for recognized bits immediately upon reading the IRQ mask
from the hardware, so only the bits/IRQs that actually were set will be
acked.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: add macros to handle IRQs in nibble and byte blocks
Daniel Scheller [Mon, 9 Apr 2018 16:47:41 +0000 (12:47 -0400)]
media: ddbridge: add macros to handle IRQs in nibble and byte blocks

Currently, each IRQ requires one IRQ_HANDLE() line to call each IRQ
handler that was set up. Add a IRQ_HANDLE_NIBBLE() and IRQ_HANDLE_BYTE()
macro to call all handlers in blocks of four (_NIBBLE) or eight (_BYTE)
handlers at a time, to make this construct more compact.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: add helper for IRQ handler setup
Daniel Scheller [Mon, 9 Apr 2018 16:47:40 +0000 (12:47 -0400)]
media: ddbridge: add helper for IRQ handler setup

Introduce the ddb_irq_set() helper function (along with a matching
prototype in ddbridge.h) to improve the set up of the IRQ handlers
and handler_data, and rework storing this data into the ddb_link
using a new ddb_irq struct. This also does the necessary rework
of affected variables. And while at it, always do queue_work in
input_handler() as there's not much of a difference to directly
calling input_work if there's no ptr at input->redi, or queueing
this call.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: request/free_irq using pci_irq_vector, enable MSI-X
Daniel Scheller [Mon, 9 Apr 2018 16:47:39 +0000 (12:47 -0400)]
media: ddbridge: request/free_irq using pci_irq_vector, enable MSI-X

Instead of trying to manage IRQ numbers on itself, utilise the
pci_irq_vector() function to do this, which will take care of correct IRQ
numbering for MSI and non-MSI IRQs. While at it, request and enable MSI-X
interrupts for hardware (boards and cards) that support this.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: move MSI IRQ cleanup to a helper function
Daniel Scheller [Mon, 9 Apr 2018 16:47:38 +0000 (12:47 -0400)]
media: ddbridge: move MSI IRQ cleanup to a helper function

Introduce the ddb_msi_exit() helper to be used for cleaning up previously
allocated MSI IRQ vectors. Deduplicates code and makes things look
cleaner as for all cleanup work the CONFIG_PCI_MSI ifdeffery is only
needed in the helper now. Also, replace the call to the deprecated
pci_disable_msi() function with pci_free_irq_vectors().

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: move ddb_wq and the wq+class initialisation to -core
Daniel Scheller [Mon, 9 Apr 2018 16:47:37 +0000 (12:47 -0400)]
media: ddbridge: move ddb_wq and the wq+class initialisation to -core

Move the ddbridge module initialisation and cleanup code to ddbridge-core
and set up the ddb_wq workqueue there, and create and destroy the ddb
device class there aswell. Due to this, the prototypes for ddb_wq,
ddb_class_create() and ddb_class_destroy() aren't required in ddbridge.h
anymore, so remove them. Also, declare ddb_wq and the ddb_class_*()
functions static.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: ddbridge: move modparams to ddbridge-core.c
Daniel Scheller [Mon, 9 Apr 2018 16:47:36 +0000 (12:47 -0400)]
media: ddbridge: move modparams to ddbridge-core.c

Besides the 'msi' module option, all options are used from within
ddbridge-core only, so move them over from ddbridge-main, and declare the
associated variables static. Since the prototypes in ddbridge.h aren't
necessary anymore now, remove them. As a side effect, this has the benefit
of aligning things more with the dddvb upstream.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/stv0910: fix CNR reporting in read_snr()
Daniel Scheller [Mon, 9 Apr 2018 16:47:35 +0000 (12:47 -0400)]
media: dvb-frontends/stv0910: fix CNR reporting in read_snr()

The CNR value determined in read_snr() is reported via the wrong variable.
It uses FE_SCALE_DECIBEL, which implies the value to be reported in svalue
instead of uvalue. Fix this accordingly.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: dvb-frontends/stv0910: add init values for TSINSDELM/L
Daniel Scheller [Mon, 9 Apr 2018 16:47:34 +0000 (12:47 -0400)]
media: dvb-frontends/stv0910: add init values for TSINSDELM/L

The TSINSDEL registers were lacking initialisation in the stv0910 demod
driver. Initialise them (both demods) in the probe() function.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
6 years agomedia: video-i2c: get rid of two gcc warnings
Mauro Carvalho Chehab [Fri, 4 May 2018 14:18:05 +0000 (10:18 -0400)]
media: video-i2c: get rid of two gcc warnings

After adding this driver, gcc complains with:

drivers/media/i2c/video-i2c.c:55:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
 const static struct v4l2_fmtdesc amg88xx_format = {
 ^~~~~
drivers/media/i2c/video-i2c.c:59:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
 const static struct v4l2_frmsize_discrete amg88xx_size = {
 ^~~~~

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