Commit graph

691657 commits

Author SHA1 Message Date
Jasmin Jessich
b9af29e15a media: dvb_ca_en50221: use usleep_range
Fixed all:
  WARNING: msleep < 20ms can sleep for up to 20ms
by using usleep_range.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:28:18 -04:00
Jasmin Jessich
5d023252cb media: dvb_ca_en50221: New function dvb_ca_en50221_poll_cam_gone
The CAM poll code for the budget-av is exactly the same on several
places. Extracting the code to a new function improves maintainability.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:27:50 -04:00
Jasmin Jessich
a004b70e70 media: dvb_ca_en50221: Refactored dvb_ca_en50221_thread
Refactored "dvb_ca_en50221_thread" by moving the state machine into the
new function "dvb_ca_en50221_thread_state_machine". This reduces the
thread function size and reduces the structural complexity and of course
gives us more space to meet the line length goal in the new function.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:26:52 -04:00
Daniel Scheller
d105d08344 media: dvb-frontends/stv0367: improve QAM fe_status
While cab_state->state gives a quite accurate indication of the demod
signal status, it might be incorrect if cab_algo() wasn't able to
determine the exact status, with cab_algo() being the only place where
this status was updated from, and it is only called upon tuning to new
parameters passed to set_frontend(). Thus, the status will be wrong
until the demod is retuned. With the cab_signal_type parsing in
read_status(), this results in unusual fe_states like FE_HAS_SIGNAL |
FE_HAS_CARRIER | FE_HAS_LOCK, which, while userspace applications check
for FE_HAS_LOCK and work fine, leads to missing CNR or UCB stats.

Fix this by re-reading CAB_FSM_STATUS and updating cab_state->state() in
read_status(). While at it, refactor the fsm/qamfeclock and the
fsm->signaltype parsing into separate functions to make things cleaner
and deduplicate code. Also, assume full QAM FEC lock equals full
FE_STATUS.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:16:48 -04:00
Sakari Ailus
552636be7a media: devnode: Rename mdev argument as devnode
Historically, mdev argument name was being used on both struct
media_device and struct media_devnode. Recently most occurrences of mdev
referring to struct media_devnode were replaced by devnode, which makes
more sense. Fix the last remaining occurrence.

Fixes: 163f1e93e9 ("[media] media-devnode: fix namespace mess")

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:11:40 -04:00
Sakari Ailus
10e81bcdde media: Remove useless curly braces and parentheses
Simplify the code to satisfy Linux coding style.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:10:30 -04:00
Colin Ian King
6e4e4447d4 media: dib0090: make const array dib0090_tuning_table_cband_7090e_aci static
Don't populate array dib0090_tuning_table_cband_7090e_aci on the stack but
instead make it static. Makes the object code smaller by over 180 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  40052	   7320	    192	  47564	   b9cc dib0090.o

After:
   text	   data	    bss	    dec	    hex	filename
  39780	   7408	    192	  47380	   b914	dib0090.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:08:12 -04:00
Colin Ian King
679cfbb158 media: drxj: make several const arrays static
Don't populate const arrays on the stack but instead make them static.
Makes the object code smaller by over 1800 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  94100	   9160	      0	 103260	  1935c	drxj.o

After:
   text	   data	    bss	    dec	    hex	filename
  91044	  10400	      0	 101444	  18c44	drxj.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:07:50 -04:00
Colin Ian King
7f0337086e media: drxd: make const arrays slowIncrDecLUT and fastIncrDecLUT static
Don't populate arrays slowIncrDecLUT and fastIncrDecLUT on the stack but
instead make them static. Makes the object code smaller by over 100 bytes:

   text	   data	    bss	    dec	    hex	filename
  27776	    832	     64	  28672	   7000	drxd_hard.o

   text	   data	    bss	    dec	    hex	filename
  27530	    976	     64	  28570	   6f9a	drxd_hard.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:07:28 -04:00
Daniel Scheller
bd2355b8ef media: dvb-frontends/cxd2841er: do sleep on delivery system change
Discovered using w_scan when scanning DVB-T/T2: When w_scan goes from -T
to -T2, it does so without stopping the frontend using .sleep. Due to
this, the demod operation mode isn't re-setup, but as it still is in
STATE_ACTIVE_TC, PLP and T2 Profile are set up, but only retune_active()
is called, leaving the demod in T mode, thus not operable on any T2
frequency.

Fix this by putting the demod to sleep if priv->system isn't equal to
p->delsys. To properly accomplish this, sleep_tc() is split into
sleep_tc() and shutdown_tc(), where sleep_tc() will only perform the
sleep operation, while shutdown_tc() additionally performs the full
demod shutdown (to keep the behaviour when the .sleep FE_OP is called).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:06:45 -04:00
Colin Ian King
d4a06464c2 media: staging: fbtft: make const array gamma_par_mask static
Don't populate array gamma_par_mask on the stack but instead make it
static.  Makes the object code smaller by 148 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   2993	   1104	      0	   4097	   1001	drivers/staging/fbtft/fb_st7789v.o

After:
   text	   data	    bss	    dec	    hex	filename
   2757	   1192	      0	   3949	    f6d	drivers/staging/fbtft/fb_st7789v.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:06:08 -04:00
Colin Ian King
3802c1bc2c media: dvb-frontends/cxd2841er: make several arrays static
Don't populate arrays on the stack but make them static.  Makes
the object code smaller:

Before:
   text	   data	    bss	    dec	    hex	filename
  89299	  21704	     64	 111067	  1b1db	cxd2841er.o

After:
   text	   data	    bss	    dec	    hex	filename
  85823	  23432	     64	 109319	  1ab07	cxd2841er.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:03:07 -04:00
Akihiro Tsukada
d0a0548ade media: media/dvb: earth-pt3: fix hang-up in a rare case
When a user starts and stops filtering at a demux device too quickly
in a very short interval, the user process hangs in uninterruptible sleep,
due to an inconsistency of kthread status in the driver.
The kthread can be stopped before it starts running its thread function,
but the invocation status was partly managed in the kthread function,
which resulted in a double kthread_stop() of one kthread.

Signed-off-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 15:01:30 -04:00
Gustavo A. R. Silva
62055056da media: ngene: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:59:58 -04:00
Gustavo A. R. Silva
e46ab9dc4a media: mantis: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:59:15 -04:00
Gustavo A. R. Silva
3c13978ead media: dm1105: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:58:58 -04:00
Gustavo A. R. Silva
618e8aac3d media: ddbridge: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:58:43 -04:00
Gustavo A. R. Silva
6ac8b81ec9 media: cx24123: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:58:27 -04:00
Gustavo A. R. Silva
c51df136e5 media: zd1301_demod: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:58:10 -04:00
Gustavo A. R. Silva
28e83542cd media: dib8000: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:57:52 -04:00
Gustavo A. R. Silva
053aa4a833 media: s5h1420: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:57:35 -04:00
Gustavo A. R. Silva
a76f094a47 media: dib7000p: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:57:19 -04:00
Gustavo A. R. Silva
8e10fd851c media: marvell-ccic: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:55:41 -04:00
Gustavo A. R. Silva
ea925e4db1 media: saa7146: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:55:14 -04:00
Gustavo A. R. Silva
19779f4052 media: dib9000: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:53:16 -04:00
Gustavo A. R. Silva
830a45a2f4 media: usbvision: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:53:00 -04:00
Gustavo A. R. Silva
8d08a4c1aa media: dvb-ttusb-budget: constify i2c_algorithm structure
Check for i2c_algorithm structures that are only stored in
the algo field of an i2c_adapter structure. This field is
declared const, so i2c_algorithm structures that have this
property can be declared as const also.

This issue was identified using Coccinelle and the following
semantic patch:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };

@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.algo = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct i2c_algorithm i = { ... };

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:52:43 -04:00
Daniel Scheller
3658ea39f9 media: dvb-frontends/stv0367: DDB frontend status inquiry fixup
Return 0 instead of -EINVAL in get_frontend if no demod mode is active.
This fixes ie. dvb-fe-tool getting confused and assuming a DVBv3 FE on idle
frontends when the FE has been put to sleep using sleep().

Also, in read_status(), don't immediately return when no demod is active,
so the remaining code has a chance to clear the signal statistics.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 14:06:56 -04:00
Daniel Scheller
979507a751 media: MAINTAINERS: add entries for stv0910 and stv6111
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:07:26 -04:00
Daniel Scheller
7914505949 media: ddbridge: stv0910 single demod mode module option
Adds a stv0910_single modparm which, when set, configures the stv0910 to
run in single demodulator mode, currently intended for high bit rate
testing.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:07:10 -04:00
Daniel Scheller
df3082df7d media: ddbridge: support for CineS2 V7(A) and DuoFlex S2 V4 hardware
This adds all required glue code to support - in conjunction with the new
stv0910 and stv6111 demod/tuner drivers and additionally the lnbh25 LNB
controller driver - all current DVB-S/S2 hardware (bridges and flex
modules) from Digital Devices like the DD CineS2 V7 and V7A, current
S2 V4 DuoFlex modules, and probably all upcoming devices based on this
STV0910/STV6111/LNBH25 hardware stack.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:06:32 -04:00
Daniel Scheller
76103bac71 media: ddbridge: return stv09xx id in port_has_stv0900_aa()
The returned value is required for further evaluation of the exact
demodulator chip (stv090x or stv0910).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:05:05 -04:00
Daniel Scheller
44173fda45 media: dvb-frontends: add ST STV6111 DVB-S/S2 tuner frontend driver
This adds a frontend driver for the ST STV6111 DVB-S/S2 tuners. Like the
stv0910 demod frontend driver, this driver originates from the Digital
Devices' dddvb vendor driver package as of version 0.9.29, and was cleaned
up aswell. No functionality had to be removed though. Any camel case has
been converted to kernel_case, fixup patch has been proposed upstream.

Permission to reuse and mainline the driver code was formally granted by
Ralph Metzler <rjkm@metzlerbros.de>.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:04:25 -04:00
Daniel Scheller
2f4675c003 media: dvb-frontends/stv0910: Add missing set_frontend fe-op
This was missing from the frontend_ops.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 13:00:09 -04:00
Daniel Scheller
19bb3b718f media: dvb-frontends/stv0910: Add demod-only signal strength reporting
Original code at least has some signed/unsigned issues, resulting in
values like 32dBm. Implement signal strength readout to work without
asking the attached tuner, and use a lookup table instead of log calc.
Values reported appear plausible, gathered from feedback from several
testers.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 12:59:50 -04:00
Daniel Scheller
ea71c62bde media: dvb-frontends/stv0910: add multistream (ISI) and PLS capabilities
Implements stream_id filter and scrambling code setup in start() and also
sets FE_CAN_MULTISTREAM in frontend_ops. This enables the driver to
properly receive and handle multistream transponders, functionality has
been reported working fine by testers with access to such streams, in
conjunction with VDR on the userspace side.

The code snippet originates from the original vendor's dddvb driver
package and has been made working properly with the current in-kernel
DVB core API.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 12:59:03 -04:00
Daniel Scheller
13c8148962 media: dvb-frontends/stv0910: Fix possible buffer overflow
Fixes smatch error:

  drivers/media/dvb-frontends/stv0910.c:715 dvbs2_nbch() error: buffer overflow 'nbch[fectype]' 2 <= 28

Also, fixes the nbch array table by adding the DUMMY_PLF element at the top
to match the enums (table element order was off by one before).

Patch sent upstream aswell.

Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 12:57:59 -04:00
Daniel Scheller
cd21b33494 media: dvb-frontends: add ST STV0910 DVB-S/S2 demodulator frontend driver
This adds a multi frontend driver for the ST STV0910 DVB-S/S2 demodulator
frontends. The driver code originates from the Digital Devices' dddvb
vendor driver package as of version 0.9.29, and has been cleaned up from
core API usage which isn't supported yet in the kernel, and additionally
all obvious style issues have been resolved. All camel case and allcaps
have been converted to kernel_case and lowercase. Patches have been sent
to the vendor package maintainers to fix this aswell. Signal statistics
acquisition has been refactored to comply with standards.

Permission to reuse and mainline the driver code was formally granted by
Ralph Metzler <rjkm@metzlerbros.de>.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 12:57:11 -04:00
Philipp Zabel
435945e085 media: platform: video-mux: convert to multiplexer framework
Now that the multiplexer framework is merged, drop the temporary
mmio-mux implementation from the video-mux driver and convert it to use
the multiplexer API.

[mchehab@s-opensource.com: fix a merge conflict at Kconfig]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:59:25 -04:00
Arnd Bergmann
d82cf24859 media: usbvision-i2c: fix format overflow warning
gcc-7 notices that we copy a fixed length string into another
string of the same size, with additional characters:

drivers/media/usb/usbvision/usbvision-i2c.c: In function 'usbvision_i2c_register':
drivers/media/usb/usbvision/usbvision-i2c.c:190:36: error: '%d' directive writing between 1 and 11 bytes into a region of size between 0 and 47 [-Werror=format-overflow=]
  sprintf(usbvision->i2c_adap.name, "%s-%d-%s", i2c_adap_template.name,
                                    ^~~~~~~~~~
drivers/media/usb/usbvision/usbvision-i2c.c:190:2: note: 'sprintf' output between 4 and 76 bytes into a destination of size 48

Using snprintf() makes the code more robust in general, but will still
trigger a possible warning about truncation in the string.
We know this won't happen as the template name is always "usbvision", so
we can easily avoid the warning as well by using this as the format string
directly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:58:28 -04:00
Todor Tomov
f1923010b0 media: v4l2-mediabus: Add helper functions
Add helper functions for mbus to/from mplane pixel format conversion.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:54:35 -04:00
Ulrich Hecht
281ddc3cdc media: adv7180: add missing adv7180cp, adv7180st i2c device IDs
Fixes a crash on Renesas R8A7793 Gose board that uses these "compatible"
entries.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:54:04 -04:00
Anton Sviridenko
3361d54eec media: solo6x10: fix detection of TW2864B chips
This patch enables support for non-Bluecherry labeled solo6110
based PCI cards which have 3 x TW2864B chips and one TW2865.
These cards are displayed by lspci -nn as

"Softlogic Co., Ltd. SOLO6110 H.264 Video encoder/decoder [9413:6110]"

Bluecherry cards have 4 x TW2864A. According to datasheet register 0xFF
of TW2864B chips contains value 0x6A or 0x6B depending on revision
which being shifted 3 bits right gives value 0x0d.
Existing version of solo6x10 fails on these cards with

[276582.344942] solo6x10 0000:07:00.0: Probing Softlogic 6110
[276582.402151] solo6x10 0000:07:00.0: Could not initialize any techwell chips
[276582.402781] solo6x10: probe of 0000:07:00.0 failed with error -22

Signed-off-by: Anton Sviridenko <anton@corp.bluecherry.net>
Acked-by: Andrey Utkin <andrey_utkin@fastmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:53:34 -04:00
Ramesh Shanmugasundaram
d05431a1ef media: dt-bindings: media: Add r8a7796 DRIF bindings
Add r8a7796 DRIF bindings.

Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-20 06:53:11 -04:00
Mauro Carvalho Chehab
cc0ff41b0f media: adv748x: get rid of unused var
drivers/media/i2c/adv748x/adv748x-csi2.c: In function 'adv748x_csi2_init_controls':
drivers/media/i2c/adv748x/adv748x-csi2.c:251:20: warning: variable 'ctrl' set but not used [-Wunused-but-set-variable]
  struct v4l2_ctrl *ctrl;
                    ^~~~

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:51:01 -04:00
Kieran Bingham
8d935787d3 media: MAINTAINERS: Add ADV748x driver
The ADV7481 is an integrated video decoder and combined HDMI/MHL
receiver.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:35:48 -04:00
Kieran Bingham
3e89586a64 media: i2c: adv748x: add adv748x driver
Provide support for the ADV7481 and ADV7482.

The driver is modelled with 4 subdevices to allow simultaneous streaming
from the AFE (Analog front end) and HDMI inputs though two CSI TX
entities.

The HDMI entity is linked to the TXA CSI bus, whilst the AFE is linked
to the TXB CSI bus.

The driver is based on a prototype by Koji Matsuoka in the Renesas BSP,
and an earlier rework by Niklas Söderlund.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:35:31 -04:00
Kieran Bingham
e69595170b media: adv748x: Add adv7481, adv7482 bindings
Create device tree bindings documentation for the ADV748x.
The ADV748x supports both the ADV7481 and ADV7482 chips which
provide analogue decoding and HDMI receiving capabilities

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:31:02 -04:00
Shy More
6d78cf7a60 media: staging: atomisp: fixed trivial coding style issue
Below was the trival error flagged by checkpatch.pl:
ERROR: space prohibited after that open parenthesis '('

Signed-off-by: Shy More <smklearn@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:29:05 -04:00
Shy More
54d71c26e3 media: staging: atomisp: fixed trivial coding style warning
Below was the trivial wanrning flagged by checkpatch.pl
WARNING: Block comments use * on subsequent lines

Signed-off-by: Shy More <smklearn@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19 16:28:49 -04:00