1
0
Fork 0
Commit Graph

1310 Commits (1723c3155f117ee6e00f28fadf6e9eda4fc85806)

Author SHA1 Message Date
Mauro Carvalho Chehab 670d7adb09 media: dvb: point to the location of the old README.dvb-usb file
This file got renamed, but the references still point to the
old place.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-06-15 18:10:01 -03:00
Mauro Carvalho Chehab fe63a1a621 media: dvb: fix location of get_dvb_firmware script
This script was moved out of Documentation/dvb, but the
links weren't updated.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-06-15 18:10:01 -03:00
Kees Cook 6396bb2215 treewide: kzalloc() -> kcalloc()
The kzalloc() function has a 2-factor argument form, kcalloc(). This
patch replaces cases of:

        kzalloc(a * b, gfp)

with:
        kcalloc(a * b, gfp)

as well as handling cases of:

        kzalloc(a * b * c, gfp)

with:

        kzalloc(array3_size(a, b, c), gfp)

as it's slightly less ugly than:

        kzalloc_array(array_size(a, b), c, gfp)

This does, however, attempt to ignore constant size factors like:

        kzalloc(4 * 1024, gfp)

though any constants defined via macros get caught up in the conversion.

Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.

The Coccinelle script used for this was:

// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@

(
  kzalloc(
-	(sizeof(TYPE)) * E
+	sizeof(TYPE) * E
  , ...)
|
  kzalloc(
-	(sizeof(THING)) * E
+	sizeof(THING) * E
  , ...)
)

// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@

(
  kzalloc(
-	sizeof(u8) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(__u8) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(char) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(unsigned char) * (COUNT)
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(u8) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(__u8) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(char) * COUNT
+	COUNT
  , ...)
|
  kzalloc(
-	sizeof(unsigned char) * COUNT
+	COUNT
  , ...)
)

// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@

(
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (COUNT_ID)
+	COUNT_ID, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * COUNT_ID
+	COUNT_ID, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (COUNT_CONST)
+	COUNT_CONST, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * COUNT_CONST
+	COUNT_CONST, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (COUNT_ID)
+	COUNT_ID, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * COUNT_ID
+	COUNT_ID, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (COUNT_CONST)
+	COUNT_CONST, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * COUNT_CONST
+	COUNT_CONST, sizeof(THING)
  , ...)
)

// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@

- kzalloc
+ kcalloc
  (
-	SIZE * COUNT
+	COUNT, SIZE
  , ...)

// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@

(
  kzalloc(
-	sizeof(TYPE) * (COUNT) * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * (COUNT) * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * COUNT * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(TYPE) * COUNT * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(TYPE))
  , ...)
|
  kzalloc(
-	sizeof(THING) * (COUNT) * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * (COUNT) * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * COUNT * (STRIDE)
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
|
  kzalloc(
-	sizeof(THING) * COUNT * STRIDE
+	array3_size(COUNT, STRIDE, sizeof(THING))
  , ...)
)

// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@

(
  kzalloc(
-	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
  , ...)
|
  kzalloc(
-	sizeof(THING1) * sizeof(THING2) * COUNT
+	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(THING1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * COUNT
+	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
  , ...)
|
  kzalloc(
-	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
  , ...)
)

// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@

(
  kzalloc(
-	(COUNT) * STRIDE * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * (STRIDE) * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * STRIDE * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * (STRIDE) * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * (STRIDE) * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * STRIDE * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	(COUNT) * (STRIDE) * (SIZE)
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
|
  kzalloc(
-	COUNT * STRIDE * SIZE
+	array3_size(COUNT, STRIDE, SIZE)
  , ...)
)

// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@

(
  kzalloc(C1 * C2 * C3, ...)
|
  kzalloc(
-	(E1) * E2 * E3
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	(E1) * (E2) * E3
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	(E1) * (E2) * (E3)
+	array3_size(E1, E2, E3)
  , ...)
|
  kzalloc(
-	E1 * E2 * E3
+	array3_size(E1, E2, E3)
  , ...)
)

// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@

(
  kzalloc(sizeof(THING) * C2, ...)
|
  kzalloc(sizeof(TYPE) * C2, ...)
|
  kzalloc(C1 * C2 * C3, ...)
|
  kzalloc(C1 * C2, ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * (E2)
+	E2, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(TYPE) * E2
+	E2, sizeof(TYPE)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * (E2)
+	E2, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	sizeof(THING) * E2
+	E2, sizeof(THING)
  , ...)
|
- kzalloc
+ kcalloc
  (
-	(E1) * E2
+	E1, E2
  , ...)
|
- kzalloc
+ kcalloc
  (
-	(E1) * (E2)
+	E1, E2
  , ...)
|
- kzalloc
+ kcalloc
  (
-	E1 * E2
+	E1, E2
  , ...)
)

Signed-off-by: Kees Cook <keescook@chromium.org>
2018-06-12 16:19:22 -07:00
Daniel Scheller 7069018ec3 media: dvb-frontends/stv0910: make TS speed configurable
Add a tsspeed config option to struct stv0910_cfg which can be used by
users of the driver to set the (parallel) TS speed (higher speeds enable
support for higher bitrate transponders). If tsspeed isn't set in the
config, it'll default to a sane value.

This commit also updates the two consumers of the stv0910 driver (ngene
and ddbridge) to have a default tsspeed in their stv0910_cfg templates.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <rascobie@slingshot.co.nz>
Tested-by: Helmut Auer <post@helmutauer.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-28 17:46:04 -04:00
Gustavo A. R. Silva b3b2d5b624 media: au8522: remove duplicate code
This code has been there for nine years now, and it has been
working "good enough" since then [1].

Remove duplicate code by getting rid of the if-else statement.

[1] https://marc.info/?l=linux-kernel&m=152693550225081&w=2

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-28 16:26:38 -04:00
Hans Verkuil 2a5f2705c9 media: lgdt330x.h: fix compiler warning
Add missing 'inline' to fix this compiler warning:

In file included from drivers/media/common/b2c2/flexcop-fe-tuner.c:21:0:
drivers/media/dvb-frontends/lgdt330x.h:61:22: warning: 'lgdt330x_attach' defined but not used [-Wunused-function]
 struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
                      ^~~~~~~~~~~~~~~

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Suggested-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-11 11:40:09 -04:00
Colin Ian King 715b703daa media: dvb_frontends: fix spelling mistake: "unexpcted" -> "unexpected"
Trivial fix to spelling mistake in dprintk message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-11 11:38:39 -04:00
Mauro Carvalho Chehab 901b9dd5e3 media: update/fix my e-mail on some places
There are two places pointing to an unexisting "m.chehab@kernel.org"
email. I never had such email, so, I'm unsure how it ends there.
Anyway, it is plain wrong.

While here, use my canonical e-mail on a bunch of places that
are pointing to another e-mail. The idea is that, from now on,
all places will be pointing to the same SMTP server.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-10 07:27:15 -04:00
Yasunari Takiguchi 51d4fd2b87 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>
2018-05-05 10:38:18 -04:00
Yasunari Takiguchi f2e7af0bae 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>
2018-05-05 10:37:53 -04:00
Luc Van Oostenryck f172fe9fd8 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>
2018-05-05 10:21:17 -04:00
Luc Van Oostenryck 8d718e5376 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>
2018-05-05 10:11:35 -04:00
Akihiro Tsukada 648db06dd9 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>
2018-05-05 07:19:32 -04:00
Akihiro Tsukada 17459727ba 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>
2018-05-05 06:42:23 -04:00
Akihiro Tsukada eaa51fee29 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>
2018-05-05 06:41:12 -04:00
Akihiro Tsukada 072cf1aafc 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>
2018-05-04 14:44:30 -04:00
Akihiro Tsukada 1c96f3deb6 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>
2018-05-04 14:43:41 -04:00
Daniel Scheller 2dc3e05046 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>
2018-05-04 14:20:24 -04:00
Mauro Carvalho Chehab 89eaaf2d19 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: 23ba635d45 ("media: lgdt330x: convert it to the new I2C binding way")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-05-04 11:17:58 -04:00
Mauro Carvalho Chehab 5f939c36b5 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>
2018-05-04 11:13:20 -04:00
Mauro Carvalho Chehab ea2d7611fa 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>
2018-05-04 11:11:46 -04:00
Mauro Carvalho Chehab 19bdd0d661 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>
2018-05-04 11:11:25 -04:00
Mauro Carvalho Chehab 53d41728f2 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>
2018-05-04 11:10:57 -04:00
Mauro Carvalho Chehab 1334a7dc5f 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>
2018-05-04 11:10:28 -04:00
Mauro Carvalho Chehab db9c1007bc 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>
2018-05-04 11:09:54 -04:00
Mauro Carvalho Chehab 23ba635d45 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>
2018-05-04 11:09:26 -04:00
Mauro Carvalho Chehab ff093612b0 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>
2018-05-04 11:06:48 -04:00
Mauro Carvalho Chehab 6752c79719 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>
2018-05-04 11:06:12 -04:00
Mauro Carvalho Chehab 467845a1a8 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>
2018-05-04 11:05:38 -04:00
Mauro Carvalho Chehab 7129d31484 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>
2018-05-04 11:03:38 -04:00
Daniel Scheller cea6d2392f 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>
2018-05-04 10:25:21 -04:00
Daniel Scheller e2c53c8d0b 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>
2018-05-04 10:24:51 -04:00
Mauro Carvalho Chehab 89d6e45c8a media: sp887x: fix a warning
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>
2018-03-23 06:54:32 -04:00
Antti Palosaari 83d6b7c327 media: af9013: add pid filter support
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>
2018-03-21 14:11:54 -04:00
Antti Palosaari 12c6b22fbf media: af9013: remove all legacy media attach releated stuff
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>
2018-03-21 14:11:19 -04:00
Antti Palosaari 22e59e7204 media: af9013: add i2c mux adapter for tuner bus
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>
2018-03-21 14:09:50 -04:00
Antti Palosaari 3b536127f5 media: af9013: convert inittabs suitable for regmap_update_bits
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>
2018-03-21 14:08:59 -04:00
Antti Palosaari b911fc89e1 media: af9013: wrap dvbv3 statistics via dvbv5
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>
2018-03-21 14:06:47 -04:00
Antti Palosaari 233f3ef71c media: af9013: dvbv5 ber and per
Implement dvbv5 ber and per.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21 14:05:48 -04:00
Antti Palosaari f3bb7e22b1 media: af9013: dvbv5 cnr
Implement dvbv5 cnr.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-21 14:05:13 -04:00
Antti Palosaari 943a720f5c media: af9013: dvbv5 signal strength
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>
2018-03-21 14:04:43 -04:00
Antti Palosaari 7903fbe3a6 media: af9013: change lock detection slightly
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>
2018-03-21 14:03:57 -04:00
Daniel Scheller a31b86b176 media: dvb-frontends/Kconfig: move the SP2 driver to the CI section
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>
2018-03-08 06:06:50 -05:00
Daniel Scheller d158490ae5 media: dvb-frontends/cxd2099: Kconfig additions
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>
2018-03-08 06:06:50 -05:00
Mauro Carvalho Chehab fce61d1dfd media: si2168: fix a comment about firmware version
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>
2018-03-08 06:06:49 -05:00
Mauro Carvalho Chehab 8239bac18a media: cxd2880: remove unused vars
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>
2018-03-07 05:12:59 -05:00
Mauro Carvalho Chehab 9ca4897be5 media: cxd2880: don't return unitialized values
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>
2018-03-07 05:09:30 -05:00
Mauro Carvalho Chehab e61591875b media: cxd2880: Makefile: remove an include
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>
2018-03-07 05:03:03 -05:00
Yasunari Takiguchi 9dbaad428d media: cxd2880: Add all Makefile, Kconfig files and Update MAINTAINERS file 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>
2018-03-07 05:02:57 -05:00
Mauro Carvalho Chehab 7cbc3013f6 media: cxd2880: Fix location of DVB headers
Fix a trivial conflict, where the location of DVB headers
got moved.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2018-03-07 05:02:37 -05:00