GitHub/moto-9609/android_kernel_motorola_exynos9610.git
8 years ago[media] media: platform: pxa_camera: make printk consistent
Robert Jarzmik [Tue, 6 Sep 2016 09:04:17 +0000 (06:04 -0300)]
[media] media: platform: pxa_camera: make printk consistent

Make all print consistent by always using :
 - dev_xxx(pcdev_to_dev(pcdev), ....)

This prepares the soc_camera adherence removal by making these call rely
on only pcdev, and not the soc_camera icd structure.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: platform: pxa_camera: introduce sensor_call
Robert Jarzmik [Tue, 6 Sep 2016 09:04:16 +0000 (06:04 -0300)]
[media] media: platform: pxa_camera: introduce sensor_call

Introduce sensor_call(), which will be used for all sensor invocations.
This is a preparation move to v4l2 device conversion, ie. soc_camera
adherence removal.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: platform: pxa_camera: trivial move of functions
Robert Jarzmik [Tue, 6 Sep 2016 09:04:15 +0000 (06:04 -0300)]
[media] media: platform: pxa_camera: trivial move of functions

Move the functions in the file to be regrouped into meaningful blocks :
 1. pxa camera core handling functions, manipulating the herdware
 2. videobuf2 functions, dealing with video buffers
 3. video ioctl (vidioc) related functions
 4. driver probing, removal, suspend and resume

This patch doesn't modify a single line of code.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: platform: pxa_camera: convert to vb2
Robert Jarzmik [Tue, 6 Sep 2016 09:04:14 +0000 (06:04 -0300)]
[media] media: platform: pxa_camera: convert to vb2

Convert pxa_camera from videobuf to videobuf2.

As the soc_camera was already compatible with videobuf2, the port is
quite straightforward.

The special case of this code in which the vb2 to prepare is "too
big" in terms of size for the new capture format, the pxa_camera will
fail.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: mt9m111: move mt9m111 out of soc_camera
Robert Jarzmik [Tue, 6 Sep 2016 09:04:13 +0000 (06:04 -0300)]
[media] media: mt9m111: move mt9m111 out of soc_camera

As the mt9m111 is now working as a standalone v4l2 subdevice sensor,
move it out of soc_camera directory and sever its dependency on
soc_camera.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: mt9m111: use only the SRGB colorspace
Robert Jarzmik [Tue, 6 Sep 2016 09:04:12 +0000 (06:04 -0300)]
[media] media: mt9m111: use only the SRGB colorspace

mt9m111 being a camera sensor, its colorspace should always be SRGB, for
both RGB based formats or YCbCr based ones.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: mt9m111: make a standalone v4l2 subdevice
Robert Jarzmik [Tue, 6 Sep 2016 09:04:11 +0000 (06:04 -0300)]
[media] media: mt9m111: make a standalone v4l2 subdevice

Remove the soc_camera adherence. Mostly the change removes the power
manipulation provided by soc_camera, and instead :
 - powers on the sensor when the s_power control is activated
 - powers on the sensor in initial probe
 - enables and disables the MCLK provided to it in power on/off

This patch also drops support for inverters on synchronisation and clock
lines. It is assumed, if any board ever needs such inverters, support
for them can be added in the future

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] st-hva: update MAINTAINERS
Jean-Christophe Trotin [Mon, 5 Sep 2016 15:31:29 +0000 (12:31 -0300)]
[media] st-hva: update MAINTAINERS

Add entry for the HVA driver to the MAINTAINERS file.

Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] st-hva: add H.264 video encoding support
Jean-Christophe Trotin [Mon, 5 Sep 2016 14:06:30 +0000 (11:06 -0300)]
[media] st-hva: add H.264 video encoding support

This patch adds the H.264 video encoding capability in the V4L2 HVA
video encoder driver for STMicroelectronics SoC (hva-h264.c).

The main supported features are:
- profile: baseline, main, high, stereo high
- level: up to 4.2
- bitrate mode: CBR, VBR
- entropy mode: CABAC, CAVLC
- video aspect: 1x1 only

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] st-hva: multi-format video encoder V4L2 driver
Jean-Christophe Trotin [Mon, 5 Sep 2016 14:06:29 +0000 (11:06 -0300)]
[media] st-hva: multi-format video encoder V4L2 driver

This patch adds V4L2 HVA (Hardware Video Accelerator) video encoder
driver for STMicroelectronics SoC. It uses the V4L2 mem2mem framework.

This patch only contains the core parts of the driver:
- the V4L2 interface with the userland (hva-v4l2.c)
- the hardware services (hva-hw.c)
- the memory management utilities (hva-mem.c)

This patch doesn't include the support of specific codec (e.g. H.264)
video encoding: this support is part of subsequent patches.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-subdev.h: fix a typo at a kernel-doc markup
Mauro Carvalho Chehab [Fri, 9 Sep 2016 11:40:15 +0000 (08:40 -0300)]
[media] v4l2-subdev.h: fix a typo at a kernel-doc markup

One struct at the comment was not written well.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-subdev: fix some references to v4l2_dev
Mauro Carvalho Chehab [Thu, 8 Sep 2016 21:31:17 +0000 (18:31 -0300)]
[media] v4l2-subdev: fix some references to v4l2_dev

There is a warning there, because it was pointing to a different
name. Fix it.

While here, use struct &foo, instead of &struct foo.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-flash-led-class.h: document v4l2_flash_ops
Mauro Carvalho Chehab [Thu, 8 Sep 2016 21:23:35 +0000 (18:23 -0300)]
[media] v4l2-flash-led-class.h: document v4l2_flash_ops

Fix this warning:
./include/media/v4l2-flash-led-class.h:103: WARNING: c:type reference target not found: v4l2_flash_ops

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-v4l2: document two helper functions
Mauro Carvalho Chehab [Thu, 8 Sep 2016 21:12:18 +0000 (18:12 -0300)]
[media] videobuf2-v4l2: document two helper functions

Document vb2_ops_wait_prepare() and vb2_ops_wait_finish(),
in order to fix those two warnings:
Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference target not found: vb2_ops_wait_prepare
Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference target not found: vb2_ops_wait_finish

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-v4l2.h: improve documentation
Mauro Carvalho Chehab [Thu, 8 Sep 2016 21:01:44 +0000 (18:01 -0300)]
[media] videobuf2-v4l2.h: improve documentation

There are a few issues at the documentation: fields not documented,
bad cross refrences, etc.

Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-v4l2.h: get kernel-doc tags from C file
Mauro Carvalho Chehab [Thu, 8 Sep 2016 17:22:00 +0000 (14:22 -0300)]
[media] videobuf2-v4l2.h: get kernel-doc tags from C file

There are several functions documented at the C file. Move
them to the header, as this is the one used to build the
media books.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] conf_nitpick.py: ignore C domain data used on vb2
Mauro Carvalho Chehab [Thu, 8 Sep 2016 17:12:29 +0000 (14:12 -0300)]
[media] conf_nitpick.py: ignore C domain data used on vb2

Ignore external C domain structs and functions used by VB2
header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-core.h: improve documentation
Mauro Carvalho Chehab [Thu, 8 Sep 2016 17:08:34 +0000 (14:08 -0300)]
[media] videobuf2-core.h: improve documentation

There are several small issues with the documentation. Fix them,
in order to avoid producing warnings.

While here, also make checkpatch.pl happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-core.h: document enum vb2_memory
Mauro Carvalho Chehab [Thu, 8 Sep 2016 17:08:00 +0000 (14:08 -0300)]
[media] videobuf2-core.h: document enum vb2_memory

This enum was not documented. Document it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] videobuf2-core.h: move function descriptions from c file
Mauro Carvalho Chehab [Thu, 8 Sep 2016 16:34:37 +0000 (13:34 -0300)]
[media] videobuf2-core.h: move function descriptions from c file

There are several functions that were documented at the .c
file. As we only include the headers, we need to move them to
there, in order to have documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] conf_nitpick.py: ignore an opaque struct from v4l2-mem2mem.h
Mauro Carvalho Chehab [Thu, 8 Sep 2016 21:01:36 +0000 (18:01 -0300)]
[media] conf_nitpick.py: ignore an opaque struct from v4l2-mem2mem.h

The v4l2_m2m_dev is opaque: its meaning is only known by
v4l2-mem2mem.c. Ignore it on nitpick mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-mem2mem.h: make kernel-doc parse v4l2-mem2mem.h again
Mauro Carvalho Chehab [Thu, 8 Sep 2016 20:20:44 +0000 (17:20 -0300)]
[media] v4l2-mem2mem.h: make kernel-doc parse v4l2-mem2mem.h again

The kernel-doc C parser doesn't like opaque structures. So,
document it on another way.

This should get rid of this warning:
./include/media/v4l2-mem2mem.h:62: error: Cannot parse struct or union!

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-mem2mem.h: document the public structures
Mauro Carvalho Chehab [Thu, 8 Sep 2016 13:16:36 +0000 (10:16 -0300)]
[media] v4l2-mem2mem.h: document the public structures

Most structures here are not documented. Add a documentation
for them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-mem2mem.h: document function arguments
Mauro Carvalho Chehab [Thu, 8 Sep 2016 13:39:58 +0000 (10:39 -0300)]
[media] v4l2-mem2mem.h: document function arguments

There are lots of troubles with the function arguments on this
file. Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-mem2mem.h: move descriptions from .c file
Mauro Carvalho Chehab [Thu, 8 Sep 2016 13:16:27 +0000 (10:16 -0300)]
[media] v4l2-mem2mem.h: move descriptions from .c file

Several routines are somewhat documented at v4l2-mem2mem.c
file. Move what's there to the header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mc-core.rst: fix a warning about an internal routine
Mauro Carvalho Chehab [Thu, 8 Sep 2016 12:57:24 +0000 (09:57 -0300)]
[media] mc-core.rst: fix a warning about an internal routine

Fix this warning:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference target not found: media_devnode_release

The media_device_release() is a function internal to media-devnode.c,
and not exported elsewhere. So, we can't cross-reference it here.
Make it explicit at the documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc-map.h: fix a Sphinx warning
Mauro Carvalho Chehab [Thu, 8 Sep 2016 11:18:04 +0000 (08:18 -0300)]
[media] rc-map.h: fix a Sphinx warning

./include/media/rc-map.h:121: WARNING: Inline emphasis start-string without end-string.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix two wrong :name: tags
Mauro Carvalho Chehab [Thu, 8 Sep 2016 11:14:10 +0000 (08:14 -0300)]
[media] docs-rst: fix two wrong :name: tags

There's a typo there, causing 4 warnings:

  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: name
  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: lirc
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: name
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: v4l2

 Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media-ioc-g-topology.rst: fix a c domain reference
Mauro Carvalho Chehab [Thu, 8 Sep 2016 10:55:13 +0000 (07:55 -0300)]
[media] media-ioc-g-topology.rst: fix a c domain reference

One reference there is still using :ref:. Fix it, to solve this
warning:
  Documentation/media/uapi/mediactl/media-ioc-g-topology.rst:236: WARNING: undefined label: media-v2-intf-devnode (if the link has no caption the label must precede a section header)

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0
Mauro Carvalho Chehab [Thu, 8 Sep 2016 10:50:59 +0000 (07:50 -0300)]
[media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0

The struct v4l2_mpeg_vbi_ITV0 is identical to struct v4l2_mpeg_vbi_itv0,
except by its size, and it is documented at the same place at the
book.

Fix cross reference for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix cross-references for videodev2.h
Mauro Carvalho Chehab [Thu, 8 Sep 2016 09:41:26 +0000 (06:41 -0300)]
[media] docs-rst: fix cross-references for videodev2.h

There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:

# funcs is a file with the broken functions/references
for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); do
i=${i//-/_}
echo $i
j=${i//_/-}
for k in $(git grep -l "_$j:" Documentation/); do
sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/media/*.exceptions); do
sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/); do
sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a $k
sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a && mv a $k
done
for k in $(git grep -l "<$j>" include/media); do
sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a $k
done
done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] hist-v4l2.rst: don't do refs to old structures
Mauro Carvalho Chehab [Thu, 8 Sep 2016 09:30:27 +0000 (06:30 -0300)]
[media] hist-v4l2.rst: don't do refs to old structures

Several structs were renamed or removed during V4L2 development.
Don't try to cross-reference the legacy ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] libv4l-introduction.rst: improve crossr-references
Mauro Carvalho Chehab [Thu, 8 Sep 2016 09:21:01 +0000 (06:21 -0300)]
[media] libv4l-introduction.rst: improve crossr-references

Use C cross-references to mention the V4L2 API calls on all
places it occurs inside this file.

While here, also mark constants as such.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] libv4l-introdution.rst: fix function definitions
Mauro Carvalho Chehab [Thu, 8 Sep 2016 09:07:47 +0000 (06:07 -0300)]
[media] libv4l-introdution.rst: fix function definitions

c:type is not the right tag for function definitions.
Replace them by .. c:function::

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] fix clock_gettime cross-references
Mauro Carvalho Chehab [Thu, 8 Sep 2016 08:51:10 +0000 (05:51 -0300)]
[media] fix clock_gettime cross-references

Fix those warnings:

Documentation/media/uapi/cec/cec-ioc-dqevent.rst:124: WARNING: c:func reference target not found: clock_gettime(2)

By replacing it with the right function name, using this shell script:

for i in `find Documentation/media -type f`; do sed 's,clock_gettime(2),clock_gettime,' <$i >a && mv a $i; done

Please notice that this will make the nitpick mode to shut up
complaining about that, becasue clock_gettime is on its exclude list,
but the cross reference will be undefined until someone documents
this function at the core documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix some broken struct references
Mauro Carvalho Chehab [Thu, 8 Sep 2016 08:48:50 +0000 (05:48 -0300)]
[media] docs-rst: fix some broken struct references

The :c:type: references point to the structure name, and not to
struct foo.

Fixed via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if (s/\:c\:type\:\`struct\s*(\S+)\`/struct :c:type:`$1`/) { s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  } print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: simplify c:type: cross references
Mauro Carvalho Chehab [Thu, 8 Sep 2016 08:43:01 +0000 (05:43 -0300)]
[media] docs-rst: simplify c:type: cross references

Instead of using c:type:`struct foo <foo>`, use:
struct c:type:`foo`

This patch was generated via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if (m/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/) { $s=$1; $r=$2; if ($s eq $r) { s/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/struct :c:type:`$2`/; s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  }} print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix cec bad cross-references
Mauro Carvalho Chehab [Wed, 31 Aug 2016 22:15:05 +0000 (19:15 -0300)]
[media] docs-rst: fix cec bad cross-references

Fix some CEC cross references that are broken.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix dmx bad cross-references
Mauro Carvalho Chehab [Wed, 31 Aug 2016 21:57:07 +0000 (18:57 -0300)]
[media] docs-rst: fix dmx bad cross-references

Some structs are pointed via the typedef. As we replaced
those references, fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] fix broken references on dvb/video*rst
Mauro Carvalho Chehab [Wed, 31 Aug 2016 19:34:07 +0000 (16:34 -0300)]
[media] fix broken references on dvb/video*rst

Trivially fix those broken references, by copying the structs
fron the header, just like other API documentation at the
DVB side.

This doesn't have the level of quality used at the V4L2 side
of the API, but, as this documents a deprecated API, used
only by av7110 driver, it doesn't make much sense to invest
time making it better.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: fix the remaining broken links for DVB CA API
Mauro Carvalho Chehab [Wed, 31 Aug 2016 18:59:14 +0000 (15:59 -0300)]
[media] docs-rst: fix the remaining broken links for DVB CA API

Several links are broken, as they were using the typedef
name, instead of using the corresponding structs. Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ca-set-pid.rst: document struct ca_pid
Mauro Carvalho Chehab [Wed, 31 Aug 2016 18:59:11 +0000 (15:59 -0300)]
[media] ca-set-pid.rst: document struct ca_pid

Add a table describing the fields on this struct, based
on ca.h header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ca-get-slot-info.rst: document struct ca_slot_info
Mauro Carvalho Chehab [Wed, 31 Aug 2016 17:15:56 +0000 (14:15 -0300)]
[media] ca-get-slot-info.rst: document struct ca_slot_info

Add documentation for struct ca_slot_info and for the two
sets of define used by it, according with what's there at the
ca.h header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ca-get-msg.rst: add a boilerplate for struct ca_msg
Mauro Carvalho Chehab [Wed, 31 Aug 2016 17:14:26 +0000 (14:14 -0300)]
[media] ca-get-msg.rst: add a boilerplate for struct ca_msg

There are no descriptions at ca.h header for this struct.
Yet, as we want to get rid of the warnings, let's add a
boilerplate, with just the struct types and fields.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ca-get-descr-info.rst: add doc for for struct ca_descr_info
Mauro Carvalho Chehab [Wed, 31 Aug 2016 17:07:38 +0000 (14:07 -0300)]
[media] ca-get-descr-info.rst: add doc for for struct ca_descr_info

The documentation follows what's there at the ca.h header.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] ca-get-cap.rst: add a table for struct ca_caps
Mauro Carvalho Chehab [Wed, 31 Aug 2016 16:07:43 +0000 (13:07 -0300)]
[media] ca-get-cap.rst: add a table for struct ca_caps

Add a flat-table describing struct ca_caps, as found at
the source file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst exceptions: use C domain references for DVB headers
Mauro Carvalho Chehab [Tue, 30 Aug 2016 13:21:03 +0000 (10:21 -0300)]
[media] docs-rst exceptions: use C domain references for DVB headers

Now that we moved away from the :ref: type of references,
we need to update the exceptions lists.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-subdev.h: fix a doc nitpick warning
Mauro Carvalho Chehab [Wed, 31 Aug 2016 00:08:17 +0000 (21:08 -0300)]
[media] v4l2-subdev.h: fix a doc nitpick warning

One markup tag is wrong here.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-subdev.rst: get rid of legacy functions
Mauro Carvalho Chehab [Wed, 31 Aug 2016 00:01:57 +0000 (21:01 -0300)]
[media] v4l2-subdev.rst: get rid of legacy functions

There are two warnings that are due to functions that has long
gone:

Documentation/media/kapi/v4l2-subdev.rst:417: WARNING: c:func reference target not found: v4l2_i2c_new_subdev_cfg
Documentation/media/kapi/v4l2-subdev.rst:436: WARNING: c:func reference target not found: v4l2_i2c_new_probed_subdev

Update the documentation to remove those.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-dv-timings.h: let kernel-doc parte the typedef argument
Mauro Carvalho Chehab [Tue, 30 Aug 2016 23:11:11 +0000 (20:11 -0300)]
[media] v4l2-dv-timings.h: let kernel-doc parte the typedef argument

Now that scripts/kernel-doc was fixed to parse the typedef
argument used here, let it produce documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-device.h: fix some doc tags
Mauro Carvalho Chehab [Tue, 30 Aug 2016 22:16:25 +0000 (19:16 -0300)]
[media] v4l2-device.h: fix some doc tags

Fix some minor issues at the documentation tags on this file,
adding cross-references where needed, and fixing some broken
ones.

While here, fix a few spaces before tabs to make Checkpatch happier.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-dev.rst: fix a broken c domain reference
Mauro Carvalho Chehab [Tue, 30 Aug 2016 21:55:17 +0000 (18:55 -0300)]
[media] v4l2-dev.rst: fix a broken c domain reference

The "struct" were inside the reference, causing it to break.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-ioctl.h: document the remaining functions
Mauro Carvalho Chehab [Tue, 30 Aug 2016 15:18:09 +0000 (12:18 -0300)]
[media] v4l2-ioctl.h: document the remaining functions

There are several undocumented functions here; document them.

While here, make checkpatch.pl happy.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec-ioc-dqevent.rst: fix some undefined references
Mauro Carvalho Chehab [Mon, 29 Aug 2016 22:45:57 +0000 (19:45 -0300)]
[media] cec-ioc-dqevent.rst: fix some undefined references

Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-ctrls.h: Fix some c:type references
Mauro Carvalho Chehab [Mon, 29 Aug 2016 22:29:58 +0000 (19:29 -0300)]
[media] v4l2-ctrls.h: Fix some c:type references

Now that the uAPI is using c:type, let's use it here too.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: use C domain for enum references on uapi
Mauro Carvalho Chehab [Mon, 29 Aug 2016 21:40:21 +0000 (18:40 -0300)]
[media] docs-rst: use C domain for enum references on uapi

Change the parse-headers.pl and the corresponding files to use
the C domain for enum references.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()
Mauro Carvalho Chehab [Mon, 29 Aug 2016 21:43:02 +0000 (18:43 -0300)]
[media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()

The prepare_ext_ctrls() function is actually internal to the
v4l2-ctrls.c implementation, so it doesn't have a declaration
for the kAPI header to reference it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] diff-v4l.rst: Fix V4L version 1 references
Mauro Carvalho Chehab [Mon, 29 Aug 2016 21:22:52 +0000 (18:22 -0300)]
[media] diff-v4l.rst: Fix V4L version 1 references

The V4L version 1 structures had long gone from the Linux Kernel.
It doesn't make sense to use cross-references for them, as they
won't be found.

So, get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: convert uAPI structs to C domain
Mauro Carvalho Chehab [Mon, 29 Aug 2016 20:37:59 +0000 (17:37 -0300)]
[media] docs-rst: convert uAPI structs to C domain

instead of declaring the uAPI structs using usual refs, e. g.:
.. _foo-struct:

Use the C domain way:
.. c:type:: foo_struct

This way, the kAPI documentation can use cross-references to
point to the uAPI symbols.

That solves about ~100 undefined warnings like:
WARNING: c:type reference target not found: foo_struct

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] v4l2-ctrls: document some extra data structures
Mauro Carvalho Chehab [Mon, 29 Aug 2016 20:26:15 +0000 (17:26 -0300)]
[media] v4l2-ctrls: document some extra data structures

The typedefs and a macro are not defined. While here, improve a
few bits on the documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] rc-map.h: document structs/enums on it
Mauro Carvalho Chehab [Mon, 29 Aug 2016 20:00:22 +0000 (17:00 -0300)]
[media] rc-map.h: document structs/enums on it

There are some structs/enums that aren't documented via
kernel-doc markup. Add documentation for them.

Fix those warnings:
./include/media/rc-map.h:103: WARNING: c:type reference target not found: rc_map_list
./include/media/rc-map.h:110: WARNING: c:type reference target not found: rc_map_list
./include/media/rc-map.h:117: WARNING: c:type reference target not found: rc_map

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] conf_nitpick.py: ignore external functions used on mediactl
Mauro Carvalho Chehab [Mon, 29 Aug 2016 19:09:16 +0000 (16:09 -0300)]
[media] conf_nitpick.py: ignore external functions used on mediactl

There are some functions/macros used by the mediactl documentation
that are alien to the media subsystem. Ignore them.

After this patch, the media core will only complain about this
static function:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference target not found: media_devnode_release

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: improve the kAPI documentation for the mediactl
Mauro Carvalho Chehab [Mon, 29 Aug 2016 19:09:11 +0000 (16:09 -0300)]
[media] docs-rst: improve the kAPI documentation for the mediactl

There are several issues on the documentation:
  - the media.h header were not properly referenced;
  - verbatim expressions were not properly marked as such;
  - struct member references were wrong;
  - some notes were not using the right markup;
  - a comment that were moved to the kernel-doc markup were
    duplicated as a comment inside the struct media_entity;
  - some args were not pointing to the struct they're using;
  - macros weren't documented.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] demux.h: fix a documentation warning
Mauro Carvalho Chehab [Mon, 29 Aug 2016 19:04:01 +0000 (16:04 -0300)]
[media] demux.h: fix a documentation warning

The kernel-doc parser didn't handle well the private:
tag. Rewrite it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] mc-core.rst: Fix cross-references to the source
Mauro Carvalho Chehab [Mon, 29 Aug 2016 19:03:00 +0000 (16:03 -0300)]
[media] mc-core.rst: Fix cross-references to the source

The cross-reference to "struct media_pad" was pointing to
a place that doesn't exist. Fix it, and adjust the second
reference on the same paragraph to use the same text.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] demux.h: Fix a few documentation issues
Mauro Carvalho Chehab [Mon, 29 Aug 2016 13:05:49 +0000 (10:05 -0300)]
[media] demux.h: Fix a few documentation issues

demux.h was lacking documentation for the DMX_FE_ENTRY macro:
./drivers/media/dvb-core/demux.h:511: WARNING: c:func reference target not found: DMX_FE_ENTRY

While here, get rid of unused parameters and fix a few minor issues
at the header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dvb_ringbuffer.h: document the define macros
Mauro Carvalho Chehab [Mon, 29 Aug 2016 13:01:06 +0000 (10:01 -0300)]
[media] dvb_ringbuffer.h: document the define macros

There are a few define macros not documented, because the ReST
output was causing more warnings.

Now that this got fixed, document them. While here, fix the
remaining coding style issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc
Mauro Carvalho Chehab [Mon, 29 Aug 2016 11:39:32 +0000 (08:39 -0300)]
[media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc

Instead of keeping those notes at the file on a non-structured
way, move them to dtv-core.rst, using the proper ReST tags.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] dvb_ringbuffer.h: Document all functions
Mauro Carvalho Chehab [Mon, 29 Aug 2016 11:38:01 +0000 (08:38 -0300)]
[media] dvb_ringbuffer.h: Document all functions

There are several functions there there weren't properly
documented. Add documentation for them.

While here, make checkpatch.pl happier.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] conf_nitpick.py: add external vars to ignore list
Mauro Carvalho Chehab [Mon, 29 Aug 2016 11:39:47 +0000 (08:39 -0300)]
[media] conf_nitpick.py: add external vars to ignore list

There a some other types and functions that aren't declared
inside the media document but are elsewhere. Add them to the
ignore list.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: parse-headers.pl: use the C domain for cross-references
Mauro Carvalho Chehab [Wed, 31 Aug 2016 09:44:21 +0000 (06:44 -0300)]
[media] docs-rst: parse-headers.pl: use the C domain for cross-references

Instead of keep using the normal reference, move to the C
domain ones. Using C domains everywhere will allow
cross-references between kAPI and uAPI docs.

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] docs-rst: parse-headers.pl: make debug a command line option
Mauro Carvalho Chehab [Wed, 31 Aug 2016 09:41:40 +0000 (06:41 -0300)]
[media] docs-rst: parse-headers.pl: make debug a command line option

Add a parser for the --debug option, in order to allow
seeing what the parser is doing.

Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] Documentation: DT: add bindings for ST HVA
Jean-Christophe Trotin [Mon, 5 Sep 2016 14:06:28 +0000 (11:06 -0300)]
[media] Documentation: DT: add bindings for ST HVA

This patch adds DT binding documentation for STMicroelectronics hva
driver.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cobalt: update EDID
Hans Verkuil [Mon, 5 Sep 2016 14:30:39 +0000 (11:30 -0300)]
[media] cobalt: update EDID

Update the cobalt EDID, fixing various incorrect values (wrong name,
product code, various video capabilities).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vivid: update EDID
Hans Verkuil [Mon, 5 Sep 2016 14:30:08 +0000 (11:30 -0300)]
[media] vivid: update EDID

Update the vivid EDID, fixing various incorrect values (wrong name,
product code, various video capabilities).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] tw5864-core: remove excessive irqsave
Andrey Utkin [Wed, 24 Aug 2016 23:17:18 +0000 (20:17 -0300)]
[media] tw5864-core: remove excessive irqsave

As warned by smatch:
drivers/media/pci/tw5864/tw5864-core.c:160 tw5864_h264_isr() error: double lock 'irqsave:flags'
drivers/media/pci/tw5864/tw5864-core.c:174 tw5864_h264_isr() error: double unlock 'irqsave:flags'

Two different spinlocks are obtained, so having two calls is correct,
but second irqsave is superfluous, and using same "flags" variable is
just wrong.

Reported-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] Revert "[media] tw5864: remove double irq lock code"
Hans Verkuil [Mon, 5 Sep 2016 13:09:17 +0000 (10:09 -0300)]
[media] Revert "[media] tw5864: remove double irq lock code"

This reverts commit 617e901a12ad ("[media] tw5864: remove double irq lock code").

That commit was rejected by Andrey Utkin <andrey_utkin@fastmail.com>,
but it had already been merged. Revert and apply Andrey's corrected
patch next.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pulse8-cec: some small fixes
Johan Fjeldtvedt [Tue, 30 Aug 2016 12:31:28 +0000 (09:31 -0300)]
[media] pulse8-cec: some small fixes

Fix some small things:
    - clean up setup function
    - use MSGEND instead of 0xfe
    - don't assign "return value" from cec_phys_addr to err,
      it has return type void.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] atmel-isc: remove the warning
Songjun Wu [Wed, 24 Aug 2016 08:49:28 +0000 (05:49 -0300)]
[media] atmel-isc: remove the warning

Replace the 'IS_ERR_VALUE(irq)' with 'ret < 0' in
function 'atmel_isc_probe'.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media: tw686x: Support frame sizes and frame intervals enumeration
Ezequiel Garcia [Mon, 22 Aug 2016 16:12:24 +0000 (13:12 -0300)]
[media] media: tw686x: Support frame sizes and frame intervals enumeration

This commit adds support for VIDIOC_ENUM_FRAMESIZES
and VIDIOC_ENUM_FRAMEINTERVALS enumeration ioctls.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pulse8-cec: sync configuration with adapter
Johan Fjeldtvedt [Mon, 22 Aug 2016 09:04:54 +0000 (06:04 -0300)]
[media] pulse8-cec: sync configuration with adapter

When the configuration is changed, they are also written to the adapter.
This allows the adapter to continue operating in autonomous mode with
the same settings when it is disconnected from the driver (typically by
going into suspend). For adapters with firmware version 2 or greater, the
settings are also persisted in EEPROM.

A new module parameter is added to optionally also use the configuration
already present in the adapter when it is connected. This option is
enabled by default.

When a new configuration is written, the autonomous mode is
automatically enabled. When the device is unconfigured, autonomous mode
is disabled.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pulse8-cec: add notes about behavior in autonomous mode
Johan Fjeldtvedt [Mon, 22 Aug 2016 09:04:53 +0000 (06:04 -0300)]
[media] pulse8-cec: add notes about behavior in autonomous mode

The pulse8 dongle has some quirky behaviors when in autonomous mode.
Document these.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] pulse8-cec: serialize communication with adapter
Johan Fjeldtvedt [Mon, 22 Aug 2016 09:04:52 +0000 (06:04 -0300)]
[media] pulse8-cec: serialize communication with adapter

Make sending messages to the adapter serialized within the driver.

send_and_wait is split into send_and_wait_once, which only sends once
and checks for the result, and the higher level send_and_wait, which
performs locking and retries.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cec: allow configuration both from within driver and from user space
Johan Fjeldtvedt [Mon, 22 Aug 2016 09:04:51 +0000 (06:04 -0300)]
[media] cec: allow configuration both from within driver and from user space

It makes sense for adapters such as the Pulse-Eight to be configurable
both from within the driver and from user space, so remove the
requirement that drivers only can call cec_s_log_addrs or
cec_s_phys_addr if they don't expose those capabilities to user space.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] radio-si470x-i2c: Delete owner assignment
Markus Elfring [Mon, 15 Aug 2016 05:01:56 +0000 (02:01 -0300)]
[media] radio-si470x-i2c: Delete owner assignment

The field "owner" is set by core. Thus delete an extra initialisation.

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

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] vcodec: mediatek: Add g/s_selection support for V4L2 Encoder
Tiffany Lin [Mon, 15 Aug 2016 02:15:33 +0000 (23:15 -0300)]
[media] vcodec: mediatek: Add g/s_selection support for V4L2 Encoder

This patch add g/s_selection for MT8173 V4L2 Encoder.
Only output queue support g/s_selection to configure crop.
The top/left of active rectangle should always be (0,0)

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] media/i2c: Delete owner assignment
Markus Elfring [Sun, 14 Aug 2016 20:20:26 +0000 (17:20 -0300)]
[media] media/i2c: Delete owner assignment

The field "owner" is set by core. Thus delete an extra initialisation.

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

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Remove set_xclk() callback from hwconfig
Sakari Ailus [Wed, 31 Aug 2016 12:38:54 +0000 (09:38 -0300)]
[media] smiapp: Remove set_xclk() callback from hwconfig

The clock framework is generally so well supported that there's no reason
to keep this one around.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Switch to gpiod API for GPIO control
Sakari Ailus [Sat, 13 Aug 2016 15:46:50 +0000 (12:46 -0300)]
[media] smiapp: Switch to gpiod API for GPIO control

Switch from the old gpio API to the new descriptor based gpiod API.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Constify the regs argument to smiapp_write_8s()
Sakari Ailus [Sat, 13 Aug 2016 15:49:17 +0000 (12:49 -0300)]
[media] smiapp: Constify the regs argument to smiapp_write_8s()

The data may now be const as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Return -EPROBE_DEFER if the clock cannot be obtained
Sakari Ailus [Mon, 29 Aug 2016 20:28:25 +0000 (17:28 -0300)]
[media] smiapp: Return -EPROBE_DEFER if the clock cannot be obtained

The clock may be provided by a driver which is yet to probe. Print the
actual error code as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Rename smiapp_platform_data as smiapp_hwconfig
Sakari Ailus [Thu, 11 Aug 2016 10:43:50 +0000 (07:43 -0300)]
[media] smiapp: Rename smiapp_platform_data as smiapp_hwconfig

This is really configuration to the driver originating from DT or
elsewhere. Do not call it platform data.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] smiapp: Unify enforced and need-based 8-bit read
Sakari Ailus [Sat, 13 Dec 2014 20:53:37 +0000 (18:53 -0200)]
[media] smiapp: Unify enforced and need-based 8-bit read

Unify enforced 8-bit read access with that based on actual need.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx-cards: unregister IR earlier
Mauro Carvalho Chehab [Mon, 5 Sep 2016 09:55:59 +0000 (06:55 -0300)]
[media] cx231xx-cards: unregister IR earlier

Without this patch, a bug is issued when the module is removed:

[ 1417.425863] cx231xx 1-3.1.4:1.1: Cx231xx dvb Extension removed
[ 1417.571923] BUG: unable to handle kernel paging request at ffffffffc081a024
[ 1417.571962] IP: [<ffffffff813da854>] string+0x24/0x80
[ 1417.571987] PGD 1c09067 PUD 1c0b067 PMD 88e653067 PTE 0
[ 1417.572013] Oops: 0000 [#1] SMP
[ 1417.572026] Modules linked in: mb86a20s dvb_core cx231xx_alsa ir_kbd_i2c(-) tda18271 tea5767 tuner cx25840 cx231xx i2c_mux videobuf_vmalloc tveeprom cx2341x videobuf_core rc_core v4l2_common videodev media bnep usblp fuse xt_CHECKSUM iptable_mangle tun ebtable_filter ebtables ip6table_filter ip6_tables xt_physdev br_netfilter bridge nf_log_ipv4 nf_log_common xt_LOG xt_conntrack ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack cpufreq_stats vfat fat snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel snd_hda_intel snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm irqbypass crct10dif_pclmul iTCO_wdt crc32_pclmul nfsd hci_uart iTCO_vendor_support
[ 1417.572317]  snd_timer ghash_clmulni_intel btbcm intel_cstate btqca snd intel_uncore btintel intel_rapl_perf mei_me bluetooth mei shpchp soundcore pcspkr i2c_i801 auth_rpcgss wmi acpi_als kfifo_buf nfs_acl industrialio rfkill lockd pinctrl_sunrisepoint pinctrl_intel tpm_tis tpm intel_lpss_acpi intel_lpss acpi_pad grace sunrpc binfmt_misc hid_logitech_hidpp hid_logitech_dj 8021q garp stp llc mrp i915 i2c_algo_bit drm_kms_helper drm e1000e sdhci_pci sdhci mmc_core crc32c_intel ptp pps_core video i2c_hid fjes analog gameport joydev [last unloaded: rc_pixelview_002t]
[ 1417.572487] CPU: 4 PID: 24493 Comm: rmmod Tainted: G        W       4.7.0+ #2
[ 1417.572504] Hardware name:                  /NUC6i7KYB, BIOS KYSKLi70.86A.0041.2016.0817.1130 08/17/2016
[ 1417.572526] task: ffff880894b81e80 ti: ffff880896bdc000 task.ti: ffff880896bdc000
[ 1417.572544] RIP: 0010:[<ffffffff813da854>]  [<ffffffff813da854>] string+0x24/0x80
[ 1417.572564] RSP: 0018:ffff880896bdfbe8  EFLAGS: 00010286
[ 1417.572577] RAX: ffffffffc081a025 RBX: ffff8808935aa15c RCX: ffff0a00ffffff04
[ 1417.572594] RDX: ffffffffc081a024 RSI: ffffffffffffffff RDI: ffff8808935aa15c
[ 1417.572610] RBP: ffff880896bdfbe8 R08: fffffffffffffffe R09: ffff8808935aa91c
[ 1417.572628] R10: ffffffffc07b85d6 R11: 0000000000000000 R12: ffff8808935aa91c
[ 1417.572644] R13: 00000000000007c5 R14: ffffffffc07b85dd R15: ffffffffc07b85dd
[ 1417.572662] FS:  00007f5a5392d700(0000) GS:ffff8808bed00000(0000) knlGS:0000000000000000
[ 1417.572681] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1417.572705] CR2: ffffffffc081a024 CR3: 0000000897188000 CR4: 00000000003406e0
[ 1417.572735] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1417.572761] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 1417.572778] Stack:
[ 1417.572785]  ffff880896bdfc48 ffffffff813dcf77 0000000000000005 ffff8808935aa157
[ 1417.572806]  ffff880896bdfc58 ffff0a00ffffff04 000000009d27375e ffff8808935aa000
[ 1417.572829]  0000000000000800 ffff880896182800 0000000000000000 ffff88089e898ae0
[ 1417.572850] Call Trace:
[ 1417.572860]  [<ffffffff813dcf77>] vsnprintf+0x2d7/0x500
[ 1417.572873]  [<ffffffff813d3e12>] add_uevent_var+0x82/0x120
[ 1417.572890]  [<ffffffffc07b534d>] rc_dev_uevent+0x2d/0x60 [rc_core]
[ 1417.572907]  [<ffffffff81515969>] dev_uevent+0xd9/0x2d0
[ 1417.572921]  [<ffffffff813d4309>] kobject_uevent_env+0x2d9/0x4f0
[ 1417.572938]  [<ffffffff813d452b>] kobject_uevent+0xb/0x10
[ 1417.572954]  [<ffffffff81513a3f>] device_del+0x18f/0x260
[ 1417.572974]  [<ffffffff813d2db7>] ? kobject_put+0x27/0x50
[ 1417.572998]  [<ffffffffc07b5e25>] rc_unregister_device+0x75/0xb0 [rc_core]
[ 1417.573028]  [<ffffffffc07e6023>] ir_remove+0x23/0x30 [ir_kbd_i2c]
[ 1417.573055]  [<ffffffff8162bf88>] i2c_device_remove+0x58/0xb0
[ 1417.573078]  [<ffffffff81518191>] __device_release_driver+0xa1/0x160
[ 1417.573102]  [<ffffffff81518de6>] driver_detach+0xa6/0xb0
[ 1417.573122]  [<ffffffff81517b25>] bus_remove_driver+0x55/0xd0
[ 1417.573146]  [<ffffffff815195bc>] driver_unregister+0x2c/0x50
[ 1417.573168]  [<ffffffff8162cf62>] i2c_del_driver+0x22/0x50
[ 1417.573194]  [<ffffffffc07e6ba4>] ir_kbd_driver_exit+0x10/0x46c [ir_kbd_i2c]
[ 1417.573227]  [<ffffffff81126348>] SyS_delete_module+0x1b8/0x220
[ 1417.573254]  [<ffffffff817debf2>] entry_SYSCALL_64_fastpath+0x1a/0xa4
[ 1417.573279] Code: eb e9 76 ff ff ff 90 55 49 89 f1 48 89 ce 48 c1 fe 30 48 81 fa ff 0f 00 00 48 89 e5 4c 8d 46 ff 76 40 48 85 f6 74 4e 48 8d 42 01 <0f> b6 12 84 d2 74 43 49 01 c0 31 f6 eb 0c 48 83 c0 01 0f b6 50
[ 1417.573437] RIP  [<ffffffff813da854>] string+0x24/0x80
[ 1417.573455]  RSP <ffff880896bdfbe8>
[ 1417.573465] CR2: ffffffffc081a024
[ 1417.580053] ---[ end trace 4ca9e2eced326a62 ]---

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx: can't proceed if I2C bus register fails
Mauro Carvalho Chehab [Mon, 5 Sep 2016 08:56:37 +0000 (05:56 -0300)]
[media] cx231xx: can't proceed if I2C bus register fails

The driver should not ignore errors while registering the I2C
bus, as this device can't even minimally work without the buses,
as it uses those buses internally to talk with the several IP
blocks inside the chip.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx-i2c: handle errors with cx231xx_get_i2c_adap()
Mauro Carvalho Chehab [Mon, 5 Sep 2016 08:41:53 +0000 (05:41 -0300)]
[media] cx231xx-i2c: handle errors with cx231xx_get_i2c_adap()

The cx231xx_get_i2c_adap() function should return the I2C
adapter that will be used to talk with a device. It should never
be NULL, as otherwise the driver will try to dereference a
null pointer.

We might instead fix the callers, but if this condition
ever happens, it is really a driver bug, because i2c_port
should always be a value from enum CX231XX_I2C_MASTER_PORT.

Found when checking the code due to this bug:

[   39.769021] BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
[   39.769105] IP: [<ffffffff81638393>] i2c_master_send+0x13/0x70

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx-core: fix GPIO comments
Mauro Carvalho Chehab [Sat, 3 Sep 2016 17:36:16 +0000 (14:36 -0300)]
[media] cx231xx-core: fix GPIO comments

The number of the cx231xx REQ for GPIO register set/get are wrong.
They should follow what's there at cx231xx-pcb-cfg.h.

Noticed while checking the cx231xx parser at the v4l-utils.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx: prints error code if can't switch TV mode
Mauro Carvalho Chehab [Sun, 4 Sep 2016 13:08:17 +0000 (10:08 -0300)]
[media] cx231xx: prints error code if can't switch TV mode

If something bad happens when switching between digital
and analog mode, prints an error and outputs the returned code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx: fix GPIOs for Pixelview SBTVD hybrid
Mauro Carvalho Chehab [Sun, 4 Sep 2016 13:06:39 +0000 (10:06 -0300)]
[media] cx231xx: fix GPIOs for Pixelview SBTVD hybrid

This device uses GPIOs: 28 to switch between analog and
digital modes: on digital mode, it should be set to 1.

The code that sets it on analog mode is OK, but it misses
the logic that sets it on digital mode.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
8 years ago[media] cx231xx: don't return error on success
Mauro Carvalho Chehab [Sun, 4 Sep 2016 12:56:33 +0000 (09:56 -0300)]
[media] cx231xx: don't return error on success

The cx231xx_set_agc_analog_digital_mux_select() callers
expect it to return 0 or an error. Returning a positive value
makes the first attempt to switch between analog/digital to fail.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>