platform/kernel/linux-starfive.git
7 years agomedia: staging: atomisp: Remove dead code for MID (#1)
Andy Shevchenko [Fri, 1 Sep 2017 13:36:34 +0000 (09:36 -0400)]
media: staging: atomisp: Remove dead code for MID (#1)

Remove dead code. If someone needs it the P-Unit semaphore is handled by
I2C DesignWare driver (drivers/i2c/busses/i2c-designware-baytrail.c).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: staging: media: atomisp: Use tabs in Kconfig
Sakari Ailus [Thu, 31 Aug 2017 08:11:00 +0000 (04:11 -0400)]
media: staging: media: atomisp: Use tabs in Kconfig

Use tabs in Kconfig for indentation rather than spaces.

The patch has been created using the following command:

find drivers/staging/media/atomisp/ -name Kconfig| \
xargs perl -i -pe 's/ {8}/\t/g'

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: atomisp: fix small Kconfig issues
Hans Verkuil [Wed, 30 Aug 2017 08:39:00 +0000 (04:39 -0400)]
media: atomisp: fix small Kconfig issues

The help text should be indented by at least two spaces after the
'help' separator. This is both good practice and the media_build system
for building media drivers makes this assumption.

Fix this for the atomisp/i2c/Kconfig and fix the atomisp/pci/Kconfig
that didn't align the help separator with the preceding keywords.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Staging: atomisp: constify driver_attribute
Arvind Yadav [Thu, 31 Aug 2017 07:48:37 +0000 (03:48 -0400)]
media: Staging: atomisp: constify driver_attribute

driver_attribute are not supposed to change at runtime.
Functions driver_create_file/driver_remove_file are working with
const driver_attribute. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: atomisp2: Remove null check before kfree
Himanshu Jha [Sat, 26 Aug 2017 20:51:49 +0000 (16:51 -0400)]
media: atomisp2: Remove null check before kfree

Kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec.h: initialize *parent and *port in cec_phys_addr_validate
Hans Verkuil [Thu, 31 Aug 2017 08:12:53 +0000 (04:12 -0400)]
media: cec.h: initialize *parent and *port in cec_phys_addr_validate

Make sure these values are set to avoid 'uninitialized variable'
warnings. Hasn't happened yet, but better safe than sorry.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: fix media Kconfig help syntax issues
Hans Verkuil [Wed, 30 Aug 2017 08:47:21 +0000 (04:47 -0400)]
media: fix media Kconfig help syntax issues

The help text should be indented by at least two spaces after the
'help' separator. This is both good practice and the media_build system
for building media drivers makes this assumption.

I went through all Kconfigs under drivers/media and fixed any bad help
sections. This makes it conform to the common practice and should fix
problems with 'make menuconfig' when using media_build. This is due to
a "WARNING" message that media_build can insert in the Kconfig and that
assumes the help text is indented by at least two spaces. If not, then the
Kconfig becomes invalid and 'make menuconfig' fails.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Thomas Kaiser <linux-dvb@kaiser-linux.li>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cobalt: do not register subdev nodes
Hans Verkuil [Mon, 28 Aug 2017 08:45:58 +0000 (04:45 -0400)]
media: cobalt: do not register subdev nodes

In the distant past the adv7604 driver used private controls. In order
to access them the v4l-subdevX nodes were needed. Later the is_private
tag was removed in the adv7604 driver and the need for v4l-subdevX
device nodes disappeared.

Remove the creation of those device nodes from this driver.

Note: the cobalt card is only used inside Cisco and we never actually
used the v4l-subdevX nodes for anything. So this API change can be done
safely without breaking anything.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: v4l-ioctl: Fix typo on v4l_print_frmsizeenum
Ricardo Ribalda [Fri, 8 Sep 2017 15:47:10 +0000 (11:47 -0400)]
media: v4l-ioctl: Fix typo on v4l_print_frmsizeenum

max_width and max_height are swap with step_width and step_height.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: davinci: do a couple of checkpatch cleanups
Markus Elfring [Thu, 7 Sep 2017 20:37:16 +0000 (16:37 -0400)]
media: davinci: do a couple of checkpatch cleanups

- Delete an error message for a failed memory allocation
  in init_vpbe_layer();

- Replace the specification of data structures by pointer dereferences
  as the parameter for the operator "sizeof" to make the corresponding
  size determination a bit safer according to the Linux coding style
  convention;

- media: DaVinci-VPBE-Display: Improve a size determination in two
  functions

- Adjust 12 checks for null pointers

Those issues were pointed by checkpatch.pl and Coccinelle.

[mchehab@s-opensource.com: fold three cleanup patches into one]
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Hexium Orion: Adjust one function call together with a variable assignment
Markus Elfring [Sun, 3 Sep 2017 18:12:36 +0000 (14:12 -0400)]
media: Hexium Orion: Adjust one function call together with a variable assignment

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: meye: Adjust two function calls together with a variable assignment
Markus Elfring [Sun, 3 Sep 2017 13:41:53 +0000 (09:41 -0400)]
media: meye: Adjust two function calls together with a variable assignment

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cx23885: make const array buf static, reduces object code size
Colin Ian King [Thu, 7 Sep 2017 09:50:23 +0000 (05:50 -0400)]
media: cx23885: make const array buf static, reduces object code size

Don't populate the array buf on the stack, instead make it static.
Makes the object code smaller by over 240 bytes:

Before:
   text    data     bss     dec     hex filename
  21689   22992     416   45097    b029 cx23885-cards.o

After:
   text    data     bss     dec     hex filename
  21348   23088     416   44852    af34 cx23885-cards.o

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@s-opensource.com>
7 years agomedia: ov9640: make const arrays res_x/y static const, reduces object code size
Colin Ian King [Wed, 6 Sep 2017 13:30:16 +0000 (09:30 -0400)]
media: ov9640: make const arrays res_x/y static const, reduces object code size

Don't populate the arrays res_x and resy_y on the stack, instead make them
static const.  Makes the object code smaller by over 160 bytes:

Before:
   text    data     bss     dec     hex filename
  10509    2800      64   13373    343d ov9640.o

After:
   text    data     bss     dec     hex filename
  10184    2960      64   13208    3398 ov9640.o

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@s-opensource.com>
7 years agomedia: cobalt: remove redundant zero check on retval
Colin Ian King [Tue, 5 Sep 2017 15:19:44 +0000 (11:19 -0400)]
media: cobalt: remove redundant zero check on retval

The error handling paths all end up with retval being non-zero,
so the check for retval being zero is always false and hence
is redundant. Remove it.

Detected by CoverityScan CID#1309479 ("Logically dead code")

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@s-opensource.com>
7 years agomedia: cx25840: make array stds static const, reduces object code size
Colin Ian King [Tue, 5 Sep 2017 11:03:32 +0000 (07:03 -0400)]
media: cx25840: make array stds static const, reduces object code size

Don't populate the array syds on the stack, instead make it static const.
Makes the object code smaller by over 280 bytes:

Before:
   text    data     bss     dec     hex filename
  81451   12784     704   94939   172db cx25840-core.o

   text    data     bss     dec     hex filename
  81070   12880     704   94654   171be cx25840-core.o

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@s-opensource.com>
7 years agomedia: lgdt3306a: Use ARRAY_SIZE macro
Thomas Meyer [Sun, 3 Sep 2017 12:19:31 +0000 (08:19 -0400)]
media: lgdt3306a: Use ARRAY_SIZE macro

Use ARRAY_SIZE macro, rather than explicitly coding some variant of it
yourself.
Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e
's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)
/ARRAY_SIZE(\1)/g' and manual check/verification.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb-frontends/mxl5xx: declare LIST_HEAD(mxllist) static
Daniel Scheller [Fri, 1 Sep 2017 19:43:45 +0000 (15:43 -0400)]
media: dvb-frontends/mxl5xx: declare LIST_HEAD(mxllist) static

Fixes one sparse warning:
  mxl5xx.c:46:1: warning: symbol 'mxllist' was not declared. Should it be static?

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: rtl28xxu: make array rc_nec_tab static const
Colin Ian King [Fri, 1 Sep 2017 15:35:08 +0000 (11:35 -0400)]
media: rtl28xxu: make array rc_nec_tab static const

Don't populate the array rc_nec_tab on the stack, instead make it
static const. Makes the object code smaller by over 620 bytes:

Before:
   text    data     bss     dec     hex filename
  49511   17040      64   66615   10437 rtl28xxu.o

After:
   text    data     bss     dec     hex filename
  48825   17104      64   65993   101c9 rtl28xxu.o

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@s-opensource.com>
7 years agomedia: pci: make i2c_client const
Bhumika Goyal [Mon, 28 Aug 2017 07:42:09 +0000 (03:42 -0400)]
media: pci: make i2c_client const

Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: usb: make i2c_client const
Bhumika Goyal [Mon, 28 Aug 2017 07:21:35 +0000 (03:21 -0400)]
media: usb: make i2c_client const

Make these const as they are only used in a copy operation.
Done using Coccinelle.

@match disable optional_qualifier@
identifier s;
@@
static struct i2c_client s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
position ref.p;
identifier match.s,f,c;
expression e;
@@
(
e = s@p
|
e = s@p.f
|
c(...,s@p.f,...)
|
c(...,s@p,...)
)

@bad depends on  !good1@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct i2c_client s;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb-frontends: delete jump targets
Markus Elfring [Wed, 30 Aug 2017 06:44:29 +0000 (02:44 -0400)]
media: dvb-frontends: delete jump targets

* Return directly after a call of the function "kzalloc" failed
  at the beginning.

* Move a bit of exception handling code into an if branch.

* Delete jump targets which became unnecessary with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
7 years agomedia: drivers: Adjust checks for null pointers
Markus Elfring [Mon, 28 Aug 2017 10:50:28 +0000 (06:50 -0400)]
media: drivers: Adjust checks for null pointers

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
7 years agomedia: drivers: improve a size determination
Markus Elfring [Mon, 28 Aug 2017 09:55:16 +0000 (05:55 -0400)]
media: drivers: improve a size determination

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

[mchehab@s-opensoure.com: merge similar patches into one]

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
7 years agomedia: drivers: delete unnecessary variable initialisations
Markus Elfring [Wed, 30 Aug 2017 06:10:38 +0000 (02:10 -0400)]
media: drivers: delete unnecessary variable initialisations

The variables will be set to an appropriate value before usage.
Thus omit the explicit initialisation at the beginning.

[mchehab@s-opensource.com: fold similar patches into one]

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
7 years agomedia: drivers: delete error messages for failed memory allocation
Markus Elfring [Mon, 28 Aug 2017 09:46:57 +0000 (05:46 -0400)]
media: drivers: delete error messages for failed memory allocation

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

[mchehab@s-opensource.com: fold several similar patches into one]

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: tc358743: add CEC support
Hans Verkuil [Thu, 31 Aug 2017 08:12:55 +0000 (04:12 -0400)]
media: tc358743: add CEC support

Add CEC support for the tc358743 HDMI-CSI bridge.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: tc358743_regs.h: add CEC registers
Hans Verkuil [Thu, 31 Aug 2017 08:12:54 +0000 (04:12 -0400)]
media: tc358743_regs.h: add CEC registers

Add the missing CEC register defines.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: MAINTAINERS: add cec-gpio entry
Hans Verkuil [Wed, 28 Jun 2017 08:14:15 +0000 (04:14 -0400)]
media: MAINTAINERS: add cec-gpio entry

Add an entry for the CEC GPIO driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec-gpio: add HDMI CEC GPIO driver
Hans Verkuil [Wed, 28 Jun 2017 08:14:28 +0000 (04:14 -0400)]
media: cec-gpio: add HDMI CEC GPIO driver

Add a simple HDMI CEC GPIO driver that sits on top of the cec-pin framework.

While I have heard of SoCs that use the GPIO pin for CEC (apparently an
early RockChip SoC used that), the main use-case of this driver is to
function as a debugging tool.

By connecting the CEC line to a GPIO pin on a Raspberry Pi 3 for example
it turns it into a CEC debugger and protocol analyzer.

With 'cec-ctl --monitor-pin' the CEC traffic can be analyzed.

But of course it can also be used with any hardware project where the
HDMI CEC line is hooked up to a pull-up gpio line.

In addition this has (optional) support for tracing HPD changes if the
HPD is connected to a GPIO.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dt-bindings: document the CEC GPIO bindings
Hans Verkuil [Wed, 2 Aug 2017 07:22:33 +0000 (03:22 -0400)]
media: dt-bindings: document the CEC GPIO bindings

Document the bindings for the cec-gpio module for hardware where the
CEC line and optionally the HPD line are connected to GPIO lines.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec-ioc-dqevent.rst: document new CEC_EVENT_PIN_HPD_LOW/HIGH events
Hans Verkuil [Wed, 30 Aug 2017 16:05:55 +0000 (12:05 -0400)]
media: cec-ioc-dqevent.rst: document new CEC_EVENT_PIN_HPD_LOW/HIGH events

Document these new CEC events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec: add CEC_EVENT_PIN_HPD_LOW/HIGH events
Hans Verkuil [Tue, 15 Aug 2017 14:07:25 +0000 (10:07 -0400)]
media: cec: add CEC_EVENT_PIN_HPD_LOW/HIGH events

Add support for two new low-level events: PIN_HPD_LOW and PIN_HPD_HIGH.

This is specifically meant for use with the upcoming cec-gpio driver
and makes it possible to trace when the HPD pin changes. Some HDMI
sinks do strange things with the HPD and this makes it easy to debug
this.

Note that this also moves the initialization of a devnode mutex and
list to the allocate_adapter function: if the HPD is high, then as
soon as the HPD interrupt is created an interrupt occurs and
cec_queue_pin_hpd_event() is called which requires that the devnode
mutex and list are initialized.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec-core.rst/cec-ioc-receive.rst: clarify CEC_TX_STATUS_ERROR
Hans Verkuil [Mon, 18 Sep 2017 09:23:57 +0000 (05:23 -0400)]
media: cec-core.rst/cec-ioc-receive.rst: clarify CEC_TX_STATUS_ERROR

CEC_TX_STATUS_ERROR can be used if the HW cannot tell LOST_ARB and
LOW_DRIVE apart, or when some other error occurs. It is not a
replacement for NACK.

So the hardware must be able to tell the difference between OK, NACK and
'something else'.

Clarify the documentation (both public and kernel API) on this point.

Also fix two small typos (this messages -> this message).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec-ioc-dqevent.rst: fix typo
Hans Verkuil [Mon, 18 Sep 2017 10:26:03 +0000 (06:26 -0400)]
media: cec-ioc-dqevent.rst: fix typo

The documentation talked about INITIAL_VALUE when the actual define is
INITIAL_STATE.

Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec-pin.c: use proper ktime accessor functions
Hans Verkuil [Fri, 1 Sep 2017 08:37:54 +0000 (04:37 -0400)]
media: cec-pin.c: use proper ktime accessor functions

Use ktime_to_ns/ns_to_ktime. This makes it possible to work with older kernels
and the media_build compatibility system.

For the mainline kernel these functions are NOPs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec: Respond to unregistered initiators, when applicable
Jose Abreu [Thu, 14 Sep 2017 15:23:38 +0000 (11:23 -0400)]
media: cec: Respond to unregistered initiators, when applicable

Running CEC 1.4 compliance test we get the following error on test
11.1.6.2: "ERROR: The DUT did not broadcast a
<Report Physical Address> message to the unregistered device."

Fix this by letting GIVE_PHYSICAL_ADDR message respond to unregistered
device. Also, GIVE_DEVICE_VENDOR_ID and GIVE_FEATURES fall in the
same category so, respond also to these messages.

With this fix we pass CEC 1.4 official compliance.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: s5p-cec: add NACK detection support
Hans Verkuil [Thu, 31 Aug 2017 16:56:10 +0000 (12:56 -0400)]
media: s5p-cec: add NACK detection support

The s5p-cec driver returned CEC_TX_STATUS_ERROR for the NACK condition.

Some digging into the datasheet uncovered the S5P_CEC_TX_STAT1 register where
bit 0 indicates if the transmit was nacked or not.

Use this to return the correct CEC_TX_STATUS_NACK status to userspace.

This was the only driver that couldn't tell a NACK from another error, and
that was very unusual. And a potential problem for applications as well.

Tested with my Odroid-U3.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: <stable@vger.kernel.org> # for v4.12 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: staging/imx: Fix uninitialized variable warning
Laurent Pinchart [Wed, 30 Aug 2017 17:14:36 +0000 (13:14 -0400)]
media: staging/imx: Fix uninitialized variable warning

The ret variable can be returned uninitialized in the
imx_media_create_pad_vdev_lists() function is imxmd->num_vdevs is zero.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: qcom: camss: Make function vfe_set_selection static
Colin Ian King [Tue, 29 Aug 2017 10:21:10 +0000 (06:21 -0400)]
media: qcom: camss: Make function vfe_set_selection static

The function vfe_set_selection is local to the source and does
not need to be in global scope, so make it static.

Cleans up sparse warning:
warning: symbol 'vfe_set_selection' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: venus: init registered list on streamoff
Stanimir Varbanov [Tue, 29 Aug 2017 08:19:43 +0000 (04:19 -0400)]
media: venus: init registered list on streamoff

Add missing init_list_head for the registered buffer list.
Absence of the init could lead to a unhandled kernel paging
request as below, when streamon/streamoff are called in row.

[338046.571321] Unable to handle kernel paging request at virtual address fffffffffffffe00
[338046.574849] pgd = ffff800034820000
[338046.582381] [fffffffffffffe00] *pgd=00000000b60f5003[338046.582545]
, *pud=00000000b1f31003
, *pmd=0000000000000000[338046.592082]
[338046.597754] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[338046.601671] Modules linked in: venus_enc venus_dec venus_core
usb_f_ecm g_ether usb_f_rndis u_ether libcomposite ipt_MASQUERADE
nf_nat_masquerade_ipv4 arc4 wcn36xx mac80211 btqcomsmd btqca iptable_nat
nf_co]
[338046.662408] CPU: 0 PID: 5433 Comm: irq/160-venus Tainted: G        W
4.9.39+ #232
[338046.668024] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC
(DT)
[338046.675268] task: ffff80003541cb00 task.stack: ffff800026e20000
[338046.682097] PC is at venus_helper_release_buf_ref+0x28/0x88
[venus_core]
[338046.688282] LR is at vdec_event_notify+0xe8/0x150 [venus_dec]
[338046.695029] pc : [<ffff000000af6c48>] lr : [<ffff000000a6fc60>]
pstate: a0000145
[338046.701256] sp : ffff800026e23bc0
[338046.708494] x29: ffff800026e23bc0 x28: 0000000000000000
[338046.718853] x27: ffff000000afd4f8 x26: ffff800031faa700
[338046.729253] x25: ffff000000afd790 x24: ffff800031faa618
[338046.739664] x23: ffff800003e18138 x22: ffff800002fc9810
[338046.750109] x21: ffff800026e23c28 x20: 0000000000000001
[338046.760592] x19: ffff80002a13b800 x18: 0000000000000010
[338046.771099] x17: 0000ffffa3d01600 x16: ffff000008100428
[338046.781654] x15: 0000000000000006 x14: ffff000089045ba7
[338046.792250] x13: ffff000009045bb6 x12: 00000000004f37c8
[338046.802894] x11: 0000000000267211 x10: 0000000000000000
[338046.813574] x9 : 0000000000032000 x8 : 00000000dc400000
[338046.824274] x7 : 0000000000000000 x6 : ffff800031faa728
[338046.835005] x5 : ffff80002a13b850 x4 : 0000000000000000
[338046.845793] x3 : fffffffffffffdf8 x2 : 0000000000000000
[338046.856602] x1 : 0000000000000003 x0 : ffff80002a13b800

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb: i2c transfers over usb cannot be done from stack
Sean Young [Sat, 2 Sep 2017 11:42:42 +0000 (07:42 -0400)]
media: dvb: i2c transfers over usb cannot be done from stack

Since commit 29d2fef8be11 ("usb: catch attempts to submit urbs
with a vmalloc'd transfer buffer"), the AverMedia AverTV DVB-T
USB 2.0 (a800) fails to probe.

Cc: stable@vger.kernel.org
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: leds: as3645a: add V4L2_FLASH_LED_CLASS dependency
Arnd Bergmann [Tue, 5 Sep 2017 07:13:20 +0000 (09:13 +0200)]
media: leds: as3645a: add V4L2_FLASH_LED_CLASS dependency

We get a link error when V4L2_FLASH_LED_CLASS=m and AS3645A is built-in:

drivers/leds/leds-as3645a.o: In function `as3645a_v4l2_setup':
leds-as3645a.c:(.text+0x258): undefined reference to `v4l2_flash_init'
leds-as3645a.c:(.text+0x284): undefined reference to `v4l2_flash_indicator_init'
leds-as3645a.c:(.text+0x2a4): undefined reference to `v4l2_flash_release'
drivers/leds/leds-as3645a.o: In function `as3645a_remove':
leds-as3645a.c:(.text+0x784): undefined reference to `v4l2_flash_release'

This adds the same Kconfig dependency that the other V4L2 flash
drivers in drivers/leds use, to avoid that broken configuration.

Fixes: a56ba8fbcb55 ("media: leds: as3645a: Add LED flash class driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: get rid of removed DMX_GET_CAPS and DMX_SET_SOURCE leftovers
Mauro Carvalho Chehab [Tue, 5 Sep 2017 12:23:42 +0000 (08:23 -0400)]
media: get rid of removed DMX_GET_CAPS and DMX_SET_SOURCE leftovers

Those two ioctls were never used within the Kernel. Still, there
used to have compat32 code there (and an if #0 block at the core).

Get rid of them.

Fixes: 286fe1ca3fa1 ("media: dmx.h: get rid of DMX_GET_CAPS")
Fixes: 13adefbe9e56 ("media: dmx.h: get rid of DMX_SET_SOURCE")
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Revert "[media] v4l: async: make v4l2 coexist with devicetree nodes in a dt...
Rob Herring [Thu, 20 Jul 2017 22:06:22 +0000 (18:06 -0400)]
media: Revert "[media] v4l: async: make v4l2 coexist with devicetree nodes in a dt overlay"

This reverts commit d2180e0cf77dc7a7049671d5d57dfa0a228f83c1.

The commit was flawed in that if the device_node pointers are different,
then in fact a different device is present and the device node could be
different in ways other than full_name.

As Frank Rowand explained:

"When an overlay (1) is removed, all uses and references to the nodes and
properties in that overlay are no longer valid.  Any driver that uses any
information from the overlay _must_ stop using any data from the overlay.
Any driver that is bound to a new node in the overlay _must_ unbind.  Any
driver that became bound to a pre-existing node that was modified by the
overlay (became bound after the overlay was applied) _must_ adjust itself
to account for any changes to that node when the overlay is removed.  One
way to do this is to unbind when notified that the overlay is about to
be removed, then to re-bind after the overlay is completely removed.

If an overlay (2) is subsequently applied, a node with the same
full_name as from overlay (1) may exist.  There is no guarantee
that overlay (1) and overlay (2) are the same overlay, even if
that node has the same full_name in both cases."

Also, there's not sufficient overlay support in mainline to actually
remove and re-apply an overlay to hit this condition as overlays can
only be applied from in kernel APIs.

Fixes: d2180e0cf77d ("[media] v4l: async: make v4l2 coexist with devicetree nodes in a dt overlay")

Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Javi Merino <javi.merino@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: staging: atomisp: sh_css_calloc shall return a pointer to the allocated space
Sergei A. Trusov [Wed, 2 Aug 2017 08:00:01 +0000 (04:00 -0400)]
media: staging: atomisp: sh_css_calloc shall return a pointer to the allocated space

The calloc function returns either a null pointer or a pointer to the
allocated space. Add the second case that is missed.

Fixes: da22013f7df4 ("atomisp: remove indirection from sh_css_malloc")
Signed-off-by: Sergei A. Trusov <sergei.a.trusov@ya.ru>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: Revert "[media] lirc_dev: remove superfluous get/put_device() calls"
Sean Young [Fri, 4 Aug 2017 14:12:03 +0000 (10:12 -0400)]
media: Revert "[media] lirc_dev: remove superfluous get/put_device() calls"

This reverts commit 5be2b76a9ca4ea5fd3e221114d62eeb0d78267ca.

Only when the lirc device is freed, should we drop our reference to
rc_dev, else we the rc_dev is freed to early. If userspace has
a file descriptor open during unplug, it goes bang.

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x7bb/0x1e10
Read of size 8 at addr ffff8801d7d61ed0 by task ir-rec/2609

-snip-
 mutex_lock_nested+0x1b/0x20
 ? mutex_lock_nested+0x1b/0x20
 rc_close.part.6+0x20/0x60 [rc_core]
 rc_close+0x13/0x20 [rc_core]
 lirc_dev_fop_close+0x62/0xd0 [lirc_dev]
 __fput+0x236/0x410
 ? fput+0xb0/0xb0
 ? do_raw_spin_trylock+0x110/0x110
 ? set_rq_offline.part.70+0xa0/0xa0
 ____fput+0xe/0x10
 task_work_run+0x116/0x180
 ? task_work_cancel+0x170/0x170
 ? _raw_spin_unlock+0x27/0x40
 ? switch_task_namespaces+0x5f/0x90
 do_exit+0x68b/0xe80

Cc: stable@vger.kernel.org # For Kernel 4.13
Fixes: 5be2b76a9ca4 ("[media] lirc_dev: remove superfluous get/put_device() calls")
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: add qcom_camss.rst to v4l-drivers rst file
Mauro Carvalho Chehab [Tue, 5 Sep 2017 11:06:40 +0000 (07:06 -0400)]
media: add qcom_camss.rst to v4l-drivers rst file

Avoid this warning:
/devel/v4l/docs/Documentation/media/v4l-drivers/qcom_camss.rst:: WARNING: document isn't included in any toctree

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb headers: make checkpatch happier
Mauro Carvalho Chehab [Tue, 5 Sep 2017 11:02:44 +0000 (07:02 -0400)]
media: dvb headers: make checkpatch happier

Adjust dvb ca.h, dmx.h and frontend.h in order to make
checkpatch happier. Now, it only complains about the typedefs,
and those are there just to provide backward userspace
compatibility.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb uapi: move frontend legacy API to another part of the book
Mauro Carvalho Chehab [Tue, 5 Sep 2017 10:47:08 +0000 (06:47 -0400)]
media: dvb uapi: move frontend legacy API to another part of the book

There's a chapter for the legacy APIs. Move the frontend DVBv3
API to it, and update the chapter's introduction accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: pixfmt-srggb12p.rst: better format the table for PDF output
Mauro Carvalho Chehab [Mon, 4 Sep 2017 20:37:30 +0000 (16:37 -0400)]
media: pixfmt-srggb12p.rst: better format the table for PDF output

Adjust the table to be better displayed on PDF output.

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@s-opensource.com>
7 years agomedia: docs-rst: media: Don't use \small for V4L2_PIX_FMT_SRGGB10 documentation
Sakari Ailus [Sun, 3 Sep 2017 20:12:33 +0000 (16:12 -0400)]
media: docs-rst: media: Don't use \small for V4L2_PIX_FMT_SRGGB10 documentation

There appears to be an issue in using \small in certain cases on Sphinx
1.4 and 1.5. Other format documents don't use \small either, remove it
from here as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[mchehab@s-opensource.com: kept tabularcolumns - readjusted - and
 add a few blank lines for it to display better]
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: index.rst: don't write "Contents:" on PDF output
Mauro Carvalho Chehab [Sun, 3 Sep 2017 18:39:51 +0000 (14:39 -0400)]
media: index.rst: don't write "Contents:" on PDF output

Right now, Sphinx unconditionally creates a blank page with
just "Contents:" on it, on PDF output. While this makes sense
for html, it doesn't o PDF, as LaTeX does what's required
automatically.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: pixfmt*.rst: replace a two dots by a comma
Mauro Carvalho Chehab [Sun, 3 Sep 2017 11:04:33 +0000 (07:04 -0400)]
media: pixfmt*.rst: replace a two dots by a comma

On several tables, the color sample location table preamble is
written as:
Color Sample Location..
Instead of:
Color Sample Location:

I suspect that the repetition of such pattern was due to some
copy-and-paste (or perhaps some error during DocBook conversion).

Anyway, fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: vidioc-g-fmt.rst: adjust table format
Mauro Carvalho Chehab [Sun, 3 Sep 2017 09:46:06 +0000 (05:46 -0400)]
media: vidioc-g-fmt.rst: adjust table format

While doing a visual inspection with Sphinx 1.5, I noticed that
one of the columns was smaller than the text written there.

As this is the only thing I noticed with Sphinx 1.5, I suspect
that this was also a problem with Sphinx 1.4. Yet, I opted to
touch it in a way that wouldn't cause backward issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: vivid.rst: add a blank line to correct ReST format
Mauro Carvalho Chehab [Sun, 3 Sep 2017 09:44:19 +0000 (05:44 -0400)]
media: vivid.rst: add a blank line to correct ReST format

On all vivid parameters, there's an space after the parameter,
except for "DV Timings Signal Mode". That makes this single one
to be written in bold, and, at PDF output, at the same line as
its description.

Use the same convention as the other parameters, in order to
adjust its output.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: v4l2 uapi book: get rid of driver programming's chapter
Mauro Carvalho Chehab [Sun, 3 Sep 2017 09:13:22 +0000 (05:13 -0400)]
media: v4l2 uapi book: get rid of driver programming's chapter

It doesn't make any sense having a driver programming's chapter
at the uAPI book, as this is related to kernel API. Also,
we now have such kAPI book where V4L2 driver programming is covered.

So, get rid of this left-over.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: format.rst: use the right markup for important notes
Mauro Carvalho Chehab [Sun, 3 Sep 2017 09:10:44 +0000 (05:10 -0400)]
media: format.rst: use the right markup for important notes

There's an important note there, but it is not using the
ReST markup. So, it doesn't get any visual highlight on
the output.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: docs-rst: cardlists: change their format to flat-tables
Mauro Carvalho Chehab [Sun, 3 Sep 2017 02:08:13 +0000 (22:08 -0400)]
media: docs-rst: cardlists: change their format to flat-tables

Most tables there don't fit on 80 columns. Some are very big.

While those tables are actually generated via scripts, every
time a new board is added, the entire table could be reformatted.
>From the diffstat PoV, that's bad, as it is hard to see what
happened.

One such example is at changeset 4868f6e1fce6 ("media:
em28xx-cardlist.rst: update to reflect last changes"):

The USB ID for "Plextor ConvertX PX-AV100U" was added to card
number 9, with caused the entire table to be reformatted.

So, instead, use flat-tables. While here, fix PDF output,
by adding tablecolumns to the tables that need it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: em28xx-cardlist.rst: update to reflect last changes
Mauro Carvalho Chehab [Sun, 3 Sep 2017 02:07:20 +0000 (22:07 -0400)]
media: em28xx-cardlist.rst: update to reflect last changes

There were some new board additions. Update the cardlist
accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: v4l2-event.rst: adjust table to fit on PDF output
Mauro Carvalho Chehab [Sun, 3 Sep 2017 01:28:51 +0000 (21:28 -0400)]
media: v4l2-event.rst: adjust table to fit on PDF output

The tables there don't quite fit on PDF output.

Adjust it by adding a tabularcolumns macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: docs: don't show ToC for each part on PDF output
Mauro Carvalho Chehab [Sun, 3 Sep 2017 00:25:36 +0000 (20:25 -0400)]
media: docs: don't show ToC for each part on PDF output

The "Table of Contents" of a PDF file is generated only once,
at the beginning fo the output. It doesn't produce it on
each part.

So, don't output this text on each part of the document.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: cec uapi: Adjust table sizes for PDF output
Mauro Carvalho Chehab [Sun, 3 Sep 2017 00:02:42 +0000 (20:02 -0400)]
media: cec uapi: Adjust table sizes for PDF output

Several tables at this media book chapter have issues
when PDF is produced. Adjust them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: mc uapi: adjust some table sizes for PDF output
Mauro Carvalho Chehab [Sat, 2 Sep 2017 23:29:53 +0000 (19:29 -0400)]
media: mc uapi: adjust some table sizes for PDF output

Some cells are too small to fit the text written to it.

Increase it. No text changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: rc-sysfs-nodes.rst: better use literals
Mauro Carvalho Chehab [Sat, 2 Sep 2017 22:59:25 +0000 (18:59 -0400)]
media: rc-sysfs-nodes.rst: better use literals

A literal box provides a better visual when pdf and html output
is generated for things like the output of a sysfs devnode.
It alsod matches other conventions used within the media book.

So, use it.

While here, use literals for protocol names.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: docs: fix PDF build with Sphinx 1.4
Mauro Carvalho Chehab [Sat, 2 Sep 2017 21:46:52 +0000 (17:46 -0400)]
media: docs: fix PDF build with Sphinx 1.4

Commit 70b074df4ed1 ("media: fix pdf build with Spinx 1.6") caused
a regression at Sphinx 1.4 PDF build: although it produces a full
document in batch mode, it returns errors on interactive mode:

[63]
Runaway argument?
{\relax
! Paragraph ended before \multicolumn was complete.
<to be read again>
                   \par
l.7703 \hline\end{tabulary}

The error seems to be due to some bug at Sphinx PDF output:
when multicolumns is used, it doesn't accept an empty string.

Just removing the :cpan:`1` and replacing by two empty
columns fix the issue.

Fixes: 70b074df4ed1 ("media: fix pdf build with Spinx 1.6")

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: v4l uAPI docs: adjust some tables for PDF output
Mauro Carvalho Chehab [Sat, 2 Sep 2017 20:50:45 +0000 (16:50 -0400)]
media: v4l uAPI docs: adjust some tables for PDF output

On tests with Spinx 1.4, some tables are still writing text
outside cells. Adjust those tables.

PS.: As this was revisited several times, I suspect that this
will only be fully fixed if we add tabularcolumns to all tables
at the V4L2 part of the book.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: vidioc-g-tuner.rst: Fix table number of cols
Mauro Carvalho Chehab [Sat, 2 Sep 2017 20:48:28 +0000 (16:48 -0400)]
media: vidioc-g-tuner.rst: Fix table number of cols

The Tuner Audio Matrix table is broken: the first row has 7
columns instead of 6, causing it to be parsed wrong and displayed
very badly on PDF output.

Fix it and adjust the table to look nice at PDF output

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: vidioc-querycap: use a more realistic value for KERNEL_VERSION
Mauro Carvalho Chehab [Sat, 2 Sep 2017 20:32:15 +0000 (16:32 -0400)]
media: vidioc-querycap: use a more realistic value for KERNEL_VERSION

In the past, V4L2 versions were 0.x.y, but that changed years
ago. Since Kernel 3.1, however, the numbering schema was changed
to match the Kernel version.

However, the presented example still uses the old numerating
schema, with is a misleading information.

So, update it to the new schema.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: v4l uAPI: add descriptions for arguments to all ioctls
Mauro Carvalho Chehab [Sat, 2 Sep 2017 13:54:48 +0000 (09:54 -0400)]
media: v4l uAPI: add descriptions for arguments to all ioctls

Several ioctls are missing descriptions for the third argument
of the ioctl() command. They should have a description, as
otherwise the output won't be ok, and will sound like something
is missing.

So, add them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca.h: document ca_msg and the corresponding ioctls
Mauro Carvalho Chehab [Mon, 4 Sep 2017 12:03:40 +0000 (08:03 -0400)]
media: ca.h: document ca_msg and the corresponding ioctls

Usually, CA messages are sent/received via reading/writing at
the CA device node. However, two drivers (dst_ca and firedtv-ci)
also implement it via ioctls.

Apparently, on both cases, the net result is the same.

Anyway, let's document it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca docs: document CA_SET_DESCR ioctl and structs
Mauro Carvalho Chehab [Mon, 4 Sep 2017 00:50:17 +0000 (20:50 -0400)]
media: ca docs: document CA_SET_DESCR ioctl and structs

The av7110 driver uses CA_SET_DESCR to store the descrambler
control words at the CA descrambler slots.

Document it.

Thanks-to: Honza Petrouš <jpetrous@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: net.h: add kernel-doc and use it at Documentation/
Mauro Carvalho Chehab [Fri, 1 Sep 2017 19:45:47 +0000 (15:45 -0400)]
media: net.h: add kernel-doc and use it at Documentation/

As we did with frontend.h, ca.h and dmx.h, move the struct
definition to net.h.

That should help to keep it updated, as more stuff gets
added there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: frontend.h: Avoid the term DVB when doesn't refer to a delivery system
Mauro Carvalho Chehab [Fri, 1 Sep 2017 19:05:28 +0000 (15:05 -0400)]
media: frontend.h: Avoid the term DVB when doesn't refer to a delivery system

The DVB term can either refer to the subsystem or to a delivery
system. Avoid it in the first case at the kernel-doc markups.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: intro.rst: don't assume audio and video codecs to be MPEG2
Mauro Carvalho Chehab [Fri, 1 Sep 2017 18:44:31 +0000 (14:44 -0400)]
media: intro.rst: don't assume audio and video codecs to be MPEG2

Originally, when DVB was introduced, all codecs would be part of
MPEG2 standard. That's not true anymore, as there are a large
number of codec standards used on digital TV nowadays.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvbstb.svg: use dots for the optional parts of the hardware
Mauro Carvalho Chehab [Fri, 1 Sep 2017 18:14:48 +0000 (14:14 -0400)]
media: dvbstb.svg: use dots for the optional parts of the hardware

The hardware description mentions that some parts are optional.
Make it clearer at the drawing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dmx-get-pes-pids.rst: document the ioctl
Mauro Carvalho Chehab [Fri, 1 Sep 2017 17:44:28 +0000 (13:44 -0400)]
media: dmx-get-pes-pids.rst: document the ioctl

This ioctl is supported by the DVB core, but was never
documented.

Add a documentation for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb uAPI docs: minor editorial changes
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:21:49 +0000 (12:21 -0400)]
media: dvb uAPI docs: minor editorial changes

Do minor editorial changes to improve documentation readability:

- mark literals as such;
- add table markups to hint sizes;
- define what PES means;
- instead of hardcoding devnode numbers to zero (like adapter0/) use a
  question mark, to indicate that multiple devnodes may exist;
- add cross-references where useful.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvbapi.rst: add an entry to DVB revision history
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:32:44 +0000 (12:32 -0400)]
media: dvbapi.rst: add an entry to DVB revision history

There are several missing items at the API history. Yet,
as we're doing a significant change there, add a new entry.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb-frontend-parameters.rst: fix the name of a struct
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:31:43 +0000 (12:31 -0400)]
media: dvb-frontend-parameters.rst: fix the name of a struct

The struct that contains an union of DVB parameters is
called dvb_frontend_parameters (and not FrontendParameters).

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dmx-fread.rst: specify how DMX_CHECK_CRC works
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:30:16 +0000 (12:30 -0400)]
media: dmx-fread.rst: specify how DMX_CHECK_CRC works

In the past, the documentation used to say that, if a CRC error
was found, a "-ECRC" error would be returned. That's not true:
the DVB core will just silently ignore such errors.

So, add an explicit note about that.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb uAPI docs: Prefer use "Digital TV instead of "DVB"
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:28:16 +0000 (12:28 -0400)]
media: dvb uAPI docs: Prefer use "Digital TV instead of "DVB"

The usage of the term "DVB" at the dvb API docs is confusing,
as, right now, it can refer to either the European digital TV
standard or to the subsystem.

So, prefer calling it as "Digital TV" on most places, to avoid
ambiguity.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca-fopen.rst: Fixes the device node name for CA
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:23:17 +0000 (12:23 -0400)]
media: ca-fopen.rst: Fixes the device node name for CA

The device node name for CA is wrong since ever. I suspect
that the name there was before DVBv3 (with was the first API
introduced at the Kernel).

Anyway, use the right name there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb uAPI docs: adjust return value ioctl descriptions
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:15:43 +0000 (12:15 -0400)]
media: dvb uAPI docs: adjust return value ioctl descriptions

There are several issues on the return value for ioctls:

- Text is confusing;
- Some error codes don't exist;
- The non-generic error codes should come before the text
  that points to the generic error codes;
- Tables don't contain column size hints;
- Some references are not marked as such.

Correct them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: gen-errors.rst: document ENXIO error code
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:20:12 +0000 (12:20 -0400)]
media: gen-errors.rst: document ENXIO error code

This error can be produced at least at the DVB subsystem.

As it is generic enough, document it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: gen-errors.rst: remove row number comments
Mauro Carvalho Chehab [Fri, 1 Sep 2017 16:19:17 +0000 (12:19 -0400)]
media: gen-errors.rst: remove row number comments

Those are introduced by the conversion scripts and don't
really help. Get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb uapi docs: better organize header files
Mauro Carvalho Chehab [Fri, 1 Sep 2017 14:02:23 +0000 (10:02 -0400)]
media: dvb uapi docs: better organize header files

Instead of having one chapter per file, place all of them at
the same chapter. That better organize the chapters at the uAPI
documentation.

As a side effect, now all uAPI headers are at the same page,
at the html output, with makes easier to use it as a reference
index for the spec.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dst_ca: remove CA_SET_DESCR boilerplate
Mauro Carvalho Chehab [Fri, 1 Sep 2017 13:18:02 +0000 (09:18 -0400)]
media: dst_ca: remove CA_SET_DESCR boilerplate

This ioctl is not implemented at dst_ca driver. There's just
a boilerplate code there. Remove it, as it is unlikely that
anyone would implement it those days.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb rst: identify the documentation gap at the API
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:53:11 +0000 (08:53 -0400)]
media: dvb rst: identify the documentation gap at the API

Now that DVB spec is almost in sync, document what's missing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dvb CA docs: place undocumented data together with ioctls
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:45:28 +0000 (08:45 -0400)]
media: dvb CA docs: place undocumented data together with ioctls

Right now, the same undocumented structs are on two places:
at ca_data_types.rst and together with their ioctls.

Move them to just one place and use the standard way to
represent them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca-get-descr-info.rst: document this ioctl
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:39:43 +0000 (08:39 -0400)]
media: ca-get-descr-info.rst: document this ioctl

Instead of a generic boilerplate, fill it with relevant
information about this ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca-get-slot-info.rst: document this ioctl
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:32:56 +0000 (08:32 -0400)]
media: ca-get-slot-info.rst: document this ioctl

Instead of a generic boilerplate, fill it with relevant
information about this ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca-get-cap.rst: document this ioctl
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:07:46 +0000 (08:07 -0400)]
media: ca-get-cap.rst: document this ioctl

Instead of a generic boilerplate, fill it with relevant
information about this ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca-reset.rst: add some description to this ioctl
Mauro Carvalho Chehab [Fri, 1 Sep 2017 11:59:59 +0000 (07:59 -0400)]
media: ca-reset.rst: add some description to this ioctl

While we don't have any documentation for it, based on what's
there at Kaffeine and VDR, it seems that this command should
be issued before start using CA. So, document it as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dst_ca: return a proper error code from CA errors
Mauro Carvalho Chehab [Fri, 1 Sep 2017 12:21:04 +0000 (08:21 -0400)]
media: dst_ca: return a proper error code from CA errors

Right now, on several places, the driver is returning a
"-1" error to userspace, instead of a proper error code.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca.h: document most CA data types
Mauro Carvalho Chehab [Fri, 1 Sep 2017 11:48:02 +0000 (07:48 -0400)]
media: ca.h: document most CA data types

For most of the stuff there, documenting is easy, as the
header file contains information.

Yet, I was unable to document two data structs:
ca_msg and ca_descr

As those two structs are used by a few drivers, keep them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: ca.h: get rid of CA_SET_PID
Mauro Carvalho Chehab [Fri, 1 Sep 2017 11:41:49 +0000 (07:41 -0400)]
media: ca.h: get rid of CA_SET_PID

This ioctl seems to be some attempt to support a feature
at the bt8xx dst_ca driver. Yet, as said there, it
"needs more work". Right now, the code there is just
a boilerplate.

At the end of the day, no driver uses this ioctl, nor it is
documented anywhere (except for "needs more work").

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: net.rst: Fix the level of a section of the net chapter
Mauro Carvalho Chehab [Thu, 31 Aug 2017 23:34:02 +0000 (19:34 -0400)]
media: net.rst: Fix the level of a section of the net chapter

Due to a mistake, the DVB net chapter was actually broken
into two different chapters. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dmx.h: add kernel-doc markups and use it at Documentation/
Mauro Carvalho Chehab [Thu, 31 Aug 2017 16:28:52 +0000 (12:28 -0400)]
media: dmx.h: add kernel-doc markups and use it at Documentation/

The demux documentation is pretty poor nowadays: most of the
structs and enums aren't documented at all.

Add proper kernel-doc markups for them and use it.

Now, the demux API data structures are fully documented :-)

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years agomedia: dmx.h: get rid of GET_DMX_EVENT
Mauro Carvalho Chehab [Thu, 31 Aug 2017 23:09:06 +0000 (19:09 -0400)]
media: dmx.h: get rid of GET_DMX_EVENT

This seems to be a pure fictional API :-)

It only exists at the DVB book, with no code implemeting it.

So, just get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>