platform/kernel/linux-starfive.git
6 years agomedia: vivid: fix incorrect capabilities for radio
Hans Verkuil [Thu, 1 Feb 2018 07:36:33 +0000 (02:36 -0500)]
media: vivid: fix incorrect capabilities for radio

The vivid driver has two custom controls that change the behavior of RDS.
Depending on the control setting the V4L2_CAP_READWRITE capability is toggled.
However, after an earlier commit the capability was no longer set correctly.
This is now fixed.

Fixes: 9765a32cd8 ("vivid: set device_caps in video_device")

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx25821: prevent out-of-bounds read on array card
Colin Ian King [Wed, 31 Jan 2018 17:33:09 +0000 (12:33 -0500)]
media: cx25821: prevent out-of-bounds read on array card

Currently an out of range dev->nr is detected by just reporting the
issue and later on an out-of-bounds read on array card occurs because
of this. Fix this by checking the upper range of dev->nr with the size
of array card (removes the hard coded size), move this check earlier
and also exit with the error -ENOSYS to avoid the later out-of-bounds
array read.

Detected by CoverityScan, CID#711191 ("Out-of-bounds-read")

Fixes: commit 02b20b0b4cde ("V4L/DVB (12730): Add conexant cx25821 driver")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: %ld -> %zd]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-dev.h: fix symbol collision in media_entity_to_video_device()
Niklas Söderlund [Thu, 25 Jan 2018 13:08:52 +0000 (08:08 -0500)]
media: v4l2-dev.h: fix symbol collision in media_entity_to_video_device()

A recent change to the media_entity_to_video_device() macro breaks some
use-cases for the macro due to a symbol collision. Before the change
this worked:

    vdev = media_entity_to_video_device(link->sink->entity);

While after the change it results in a compiler error "error: 'struct
video_device' has no member named 'link'; did you mean 'lock'?". While
the following still works after the change.

    struct media_entity *entity = link->sink->entity;
    vdev = media_entity_to_video_device(entity);

Fix the collision by renaming the macro argument to '__entity'.

Fixes: 69b925c5fc36d8f1 ("media: v4l2-dev.h: add kernel-doc to two macros")

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: s2255drv: Remove unneeded if else blocks
Christopher Díaz Riveros [Wed, 24 Jan 2018 21:40:43 +0000 (16:40 -0500)]
media: s2255drv: Remove unneeded if else blocks

Given the following definitions from s2255drv.c

 #define LINE_SZ_4CIFS_NTSC      640
 #define LINE_SZ_2CIFS_NTSC      640
 #define LINE_SZ_1CIFS_NTSC      320

and

 #define LINE_SZ_4CIFS_PAL       704
 #define LINE_SZ_2CIFS_PAL       704
 #define LINE_SZ_1CIFS_PAL       352

f->fmt.pix.width possible values can be reduced to
LINE_SZ_4CIFS_NTSC or LINE_SZ_1CIFS_NTSC.

This patch removes unneeded if else blocks in vidioc_try_fmt_vid_cap
function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR
Gustavo A. R. Silva [Wed, 24 Jan 2018 00:43:40 +0000 (19:43 -0500)]
media: staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in vdic_get_ipu_resources.
The proper pointer to be passed as argument is ch.

This issue was detected with the help of Coccinelle.

Fixes: 0b2e9e7947e7 ("media: staging/imx: remove confusing IS_ERR_OR_NULL usage")

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: venus: hfi: use true for boolean values
Gustavo A. R. Silva [Tue, 23 Jan 2018 17:54:53 +0000 (12:54 -0500)]
media: venus: hfi: use true for boolean values

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: buffer.rst: fix link text of VIDIOC_QBUF
Gustavo Padovan [Mon, 22 Jan 2018 12:32:18 +0000 (07:32 -0500)]
media: buffer.rst: fix link text of VIDIOC_QBUF

The link was showing both VIDIOC_QBUF, VIDIOC_DQBUF while it should show
only VIDIOC_QBUF in this case.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()
Wei Yongjun [Wed, 17 Jan 2018 11:24:52 +0000 (06:24 -0500)]
media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()

Fix to return error code -ENODEV from the dma_request_slave_channel()
error handling case instead of 0, as done elsewhere in this function.
rc can be overwrite to 0 by dmaengine_slave_config() in the for loop.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: usbtv: Add USB ID 1f71:3306 to the UTV007 driver
Ian Douglas Scott [Mon, 15 Jan 2018 00:27:55 +0000 (19:27 -0500)]
media: usbtv: Add USB ID 1f71:3306 to the UTV007 driver

Add support for a new USB ID in this driver.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
[hans.verkuil@cisco.com: add commit message]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-core: v4l2-mc: Add SPDX license identifier
Shuah Khan [Thu, 11 Jan 2018 22:26:22 +0000 (17:26 -0500)]
media: v4l2-core: v4l2-mc: Add SPDX license identifier

Replace GPL license statement with SPDX GPL-2.0 license identifier.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mtk-vcodec: Always signal source change event on format change
Tomasz Figa [Tue, 9 Jan 2018 08:42:47 +0000 (03:42 -0500)]
media: mtk-vcodec: Always signal source change event on format change

Currently the driver signals the source change event only in case of
a midstream resolution change, however the initial format detection
is also defined as a source change by the V4L2 codec API specification.
Fix this by signaling the event after the initial header is parsed as
well.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: usbtv: prevent double free in error case
Oliver Neukum [Mon, 8 Jan 2018 14:21:07 +0000 (09:21 -0500)]
media: usbtv: prevent double free in error case

Quoting the original report:

It looks like there is a double-free vulnerability in Linux usbtv driver
on an error path of usbtv_probe function. When audio registration fails,
usbtv_video_free function ends up freeing usbtv data structure, which
gets freed the second time under usbtv_video_fail label.

usbtv_audio_fail:

        usbtv_video_free(usbtv); =>

           v4l2_device_put(&usbtv->v4l2_dev);

              => v4l2_device_put

                  => kref_put

                      => v4l2_device_release

  => usbtv_release (CALLBACK)

                             => kfree(usbtv) (1st time)

usbtv_video_fail:

        usb_set_intfdata(intf, NULL);

        usb_put_dev(usbtv->udev);

        kfree(usbtv); (2nd time)

So, as we have refcounting, use it

Reported-by: Yavuz, Tuba <tuba@ece.ufl.edu>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media-device: use strlcpy() instead of strncpy()
Xiongfeng Wang [Mon, 8 Jan 2018 12:40:59 +0000 (07:40 -0500)]
media: media-device: use strlcpy() instead of strncpy()

gcc-8 reports

drivers/media/media-device.c: In function 'media_device_get_topology':
./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
bound 64 equals destination size [-Wstringop-truncation]

We need to use strlcpy() to make sure the dest string is nul-terminated.

Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: coda: bump maximum number of internal framebuffers to 19
Philipp Zabel [Thu, 4 Jan 2018 15:58:55 +0000 (10:58 -0500)]
media: coda: bump maximum number of internal framebuffers to 19

While the h.264 standard only allows up to 16 reference frames, the CODA
firmware needs two more buffers: one to hold the currently decoded frame
and one for the display frame. Adding the framebuffer needed by the
driver for VDOA operation brings the total to a maximum of 19 internal
framebuffers.
Lift the current maximum of 17 internal framebuffers to allow playback
of high profile streams that require more than 14 reference frames.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: au0828: fix VIDEO_V4L2 dependency
Arnd Bergmann [Thu, 4 Jan 2018 13:43:50 +0000 (08:43 -0500)]
media: au0828: fix VIDEO_V4L2 dependency

After the move of videobuf2 into the common directory, selecting the
au0828 driver with CONFIG_V4L2 disabled started causing a link failure,
as we now attempt to build videobuf2 but it still requires v4l2:

ERROR: "v4l2_event_pending" [drivers/media/common/videobuf/videobuf2-v4l2.ko] undefined!
ERROR: "v4l2_fh_release" [drivers/media/common/videobuf/videobuf2-v4l2.ko] undefined!
ERROR: "video_devdata" [drivers/media/common/videobuf/videobuf2-v4l2.ko] undefined!
ERROR: "__tracepoint_vb2_buf_done" [drivers/media/common/videobuf/videobuf2-core.ko] undefined!
ERROR: "__tracepoint_vb2_dqbuf" [drivers/media/common/videobuf/videobuf2-core.ko] undefined!
ERROR: "v4l_vb2q_enable_media_source" [drivers/media/common/videobuf/videobuf2-core.ko] undefined!

We want to be able to build the core au0828 support without V4L2,
so this makes the 'select' conditional on V4L2, and refines the
dependencies in VIDEO_AU0828_V4L2 so it can only be enabled in
the exact conditions that have VIDEOBUF2_VMALLOC reachable.

Fixes: 03fbdb2fc2b8 ("media: move videobuf2 to drivers/media/common")
Fixes: 05439b1a3693 ("[media] media: au0828 - convert to use videobuf2")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: atmel-isc: Make local symbol fmt_configs_list static
Wei Yongjun [Sat, 23 Dec 2017 01:57:04 +0000 (20:57 -0500)]
media: atmel-isc: Make local symbol fmt_configs_list static

Fixes the following sparse warning:

drivers/media/platform/atmel/atmel-isc.c:338:19: warning:
 symbol 'fmt_configs_list' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: imx: allow to build with COMPILE_TEST
Philipp Zabel [Tue, 19 Dec 2017 11:42:32 +0000 (06:42 -0500)]
media: imx: allow to build with COMPILE_TEST

Allow building this driver for other platforms under COMPILE_TEST.

Suggested-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: coda: Add i.MX51 (CodaHx4) support
Philipp Zabel [Mon, 18 Dec 2017 10:16:29 +0000 (05:16 -0500)]
media: coda: Add i.MX51 (CodaHx4) support

Add support for the CodaHx4 VPU used on i.MX51.

Decoding h.264, MPEG-4, and MPEG-2 video works, as well as encoding
h.264. MPEG-4 encoding is not enabled, it currently produces visual
artifacts.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix (bogus) sparse warning about uninited me_bits]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: coda: Add compatible for CodaHx4 on i.MX51
Philipp Zabel [Mon, 18 Dec 2017 10:16:28 +0000 (05:16 -0500)]
media: dt-bindings: coda: Add compatible for CodaHx4 on i.MX51

Add a compatible for the CodaHx4 VPU used on i.MX51.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: platform: stm32: Adopt SPDX identifier
Benjamin Gaignard [Tue, 5 Dec 2017 14:51:07 +0000 (09:51 -0500)]
media: platform: stm32: Adopt SPDX identifier

Add SPDX identifiers to files under stm32 directory

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agoov13858: fix endiannes warnings
Mauro Carvalho Chehab [Fri, 23 Feb 2018 08:15:42 +0000 (03:15 -0500)]
ov13858: fix endiannes warnings

3 warning regressions:
  + drivers/media/i2c/ov13858.c: warning: cast to restricted __be32:  => 1093:16
  + drivers/media/i2c/ov13858.c: warning: incorrect type in assignment (different base types):  => 1111:13
  + drivers/media/i2c/ov13858.c: warning: incorrect type in initializer (different base types):  => 1071:27

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: fix framerate update
Hugues Fruchet [Thu, 8 Feb 2018 12:22:14 +0000 (07:22 -0500)]
media: ov5640: fix framerate update

After a framerate update through s_frame_interval(), the new
framerate was not taken into account when streaming,
but was taken into account on next session.
This was due to sensor->current_mode not updated accordingly to new
framerate setting in ov5640_s_frame_interval().

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: fix virtual_channel parameter permissions
Hugues Fruchet [Tue, 6 Feb 2018 13:24:09 +0000 (08:24 -0500)]
media: ov5640: fix virtual_channel parameter permissions

Fix module_param(virtual_channel) permissions.
This problem was detected by checkpatch:
$ scripts/checkpatch.pl -f drivers/media/i2c/ov5640.c
ERROR: Use 4 digit octal (0777) not decimal permissions
+module_param(virtual_channel, int, 0);

Also add an error trace in case of virtual_channel not in
the valid range of values.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: various typo & style fixes
Hugues Fruchet [Thu, 1 Feb 2018 08:44:06 +0000 (03:44 -0500)]
media: ov5640: various typo & style fixes

Various typo & style fixes either detected by code
review or checkpatch.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: add error trace in case of i2c read failure
Hugues Fruchet [Wed, 31 Jan 2018 12:46:17 +0000 (07:46 -0500)]
media: ov5640: add error trace in case of i2c read failure

Add an error trace in ov5640_read_reg() in case of i2c_transfer()
failure.
Uniformize error traces using dev_err instead v4l2_err.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: add JPEG support
Hugues Fruchet [Wed, 31 Jan 2018 09:08:10 +0000 (04:08 -0500)]
media: ov5640: add JPEG support

Add YUV422 encoded JPEG support.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2: i2c: ov7670: Implement OF mbus configuration
Jacopo Mondi [Wed, 24 Jan 2018 09:30:50 +0000 (04:30 -0500)]
media: v4l2: i2c: ov7670: Implement OF mbus configuration

ov7670 driver supports two optional properties supplied through platform
data, but currently does not support any standard video interface
property.

Add support through OF parsing for 2 generic properties (vsync and hsync
polarities) and for one custom property already supported through
platform data to suppress pixel clock output during horizontal
blanking.

While at there, check return value of register writes in set_fmt
function and rationalize spacings.

Signal polarities and pixel clock blanking verified through scope and
image capture.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: Add OF properties to ov7670
Jacopo Mondi [Wed, 24 Jan 2018 09:30:49 +0000 (04:30 -0500)]
media: dt-bindings: Add OF properties to ov7670

Describe newly introduced OF properties for ov7670 image sensor.
The driver supports two standard properties to configure synchronism
signals polarities and one custom property already supported as
platform data options to suppress pixel clock during horizontal
blankings.

Re-phrase child nodes description while at there.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval
Gustavo A. R. Silva [Tue, 30 Jan 2018 00:32:01 +0000 (19:32 -0500)]
media: i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval

Cast fi->interval.numerator to u64 in order to avoid a potential integer
overflow. This variable is being used in a context that expects an
expression of type u64.

Addresses-Coverity-ID: 1324146 ("Unintentional integer overflow")
[Sakari Ailus: use do_div() to make this work on 32-bit systems]

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov9650: support device tree probing
Akinobu Mita [Sun, 21 Jan 2018 15:14:14 +0000 (10:14 -0500)]
media: ov9650: support device tree probing

The ov9650 driver currently only supports legacy platform data probe.
This change adds device tree probing.

There has been an attempt to add device tree support for ov9650 driver
by Hugues Fruchet as a part of the patchset that adds support of OV9655
camera (http://www.spinics.net/lists/linux-media/msg117903.html), but
it wasn't merged into mainline because creating a separate driver for
OV9655 is preferred.

This is very similar to Hugues's patch, but not supporting new device.

Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Hugues Fruchet <hugues.fruchet@st.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Rob Herring <robh@kernel.org>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov9650: add device tree binding
Akinobu Mita [Sun, 21 Jan 2018 15:14:16 +0000 (10:14 -0500)]
media: ov9650: add device tree binding

Now the ov9650 driver supports device tree probing.  So this adds a
device tree binding documentation.

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Hugues Fruchet <hugues.fruchet@st.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: MAINTAINERS: add entry for ov9650 driver
Akinobu Mita [Sun, 21 Jan 2018 15:14:15 +0000 (10:14 -0500)]
media: MAINTAINERS: add entry for ov9650 driver

This adds an entry to the MAINTAINERS file for ov9650 driver.  The
following persons are added in this entry.

* Sakari as a person who looks after media sensor driver patches
* Sylwester as a module author
* Myself as a person who has the hardware and can test the patches

Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Hugues Fruchet <hugues.fruchet@st.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov13858: Use false for boolean value
Gustavo A. R. Silva [Tue, 23 Jan 2018 17:49:29 +0000 (12:49 -0500)]
media: ov13858: Use false for boolean value

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov13858: Avoid possible null first frame
Chiranjeevi Rapolu [Thu, 25 Jan 2018 04:34:39 +0000 (23:34 -0500)]
media: ov13858: Avoid possible null first frame

Previously, the sensor, with default settings, was outputting SOF without
data. This results in frame sync error on the receiver side.

Now, configure the sensor to output SOF with MIPI data for all frames. This
avoids possible null first frame on the bus.

Signed-off-by: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Signed-off-by: Tianshu Qiu <tian.shu.qiu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov2685: Assign ret in default case in s_ctrl callback
Sakari Ailus [Fri, 19 Jan 2018 10:49:02 +0000 (05:49 -0500)]
media: ov2685: Assign ret in default case in s_ctrl callback

Assign ret in the default case for s_ctrl callback. This can't happen but
still may result in compiler warnings.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov2685: add support for OV2685 sensor
Shunqian Zheng [Tue, 16 Jan 2018 09:22:01 +0000 (04:22 -0500)]
media: ov2685: add support for OV2685 sensor

This patch adds driver for Omnivision's ov2685 sensor.
Though the ov2685 can output yuv data, this driver only
supports the raw bayer format, including the following features:
  - output 1600x1200 at 30fps
  - test patterns
  - manual exposure/gain control
  - vblank and hblank
  - media controller
  - runtime pm

[Sakari Ailus: trivial: ov5695_of_match -> ov2685_of_match]

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: media: Add bindings for OV2685
Shunqian Zheng [Tue, 16 Jan 2018 09:22:00 +0000 (04:22 -0500)]
media: dt-bindings: media: Add bindings for OV2685

Add device tree binding documentation for the OV2685 sensor.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5695: add support for OV5695 sensor
Shunqian Zheng [Tue, 16 Jan 2018 09:21:59 +0000 (04:21 -0500)]
media: ov5695: add support for OV5695 sensor

This patch adds driver for Omnivision's ov5695 sensor,
the driver supports following features:
 - supported resolutions
   + 2592x1944 at 30fps
   + 1920x1080 at 30fps
   + 1296x972 at 60fps
   + 1280x720 at 30fps
   + 640x480 at 120fps
 - test patterns
 - manual exposure/gain(analog and digital) control
 - vblank and hblank
 - media controller
 - runtime pm

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: media: Add bindings for OV5695
Shunqian Zheng [Tue, 16 Jan 2018 09:21:58 +0000 (04:21 -0500)]
media: dt-bindings: media: Add bindings for OV5695

Add device tree binding documentation for the OV5695 sensor.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mt9t031: deprecate, move to staging
Hans Verkuil [Tue, 16 Jan 2018 11:02:45 +0000 (06:02 -0500)]
media: mt9t031: deprecate, move to staging

This driver is unused and depends on the deprecated soc-camera framework.
Move it to staging in preparation for being removed unless someone does
the work to convert it to a proper V4L2 subdev driver.

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>
6 years agomedia: imx074: deprecate, move to staging
Hans Verkuil [Tue, 16 Jan 2018 11:02:44 +0000 (06:02 -0500)]
media: imx074: deprecate, move to staging

This driver is unused and depends on the deprecated soc-camera framework.
Move it to staging in preparation for being removed unless someone does
the work to convert it to a proper V4L2 subdev driver.

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>
6 years agomedia: intel-ipu3: cio2: Use SPDX license headers
Yong Zhi [Fri, 16 Feb 2018 23:48:34 +0000 (18:48 -0500)]
media: intel-ipu3: cio2: Use SPDX license headers

Adopt SPDX license headers for ipu3 cio2 driver.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: intel-ipu3: cio2: Disable and sync irq before stream off
Yong Zhi [Fri, 9 Feb 2018 00:14:24 +0000 (19:14 -0500)]
media: intel-ipu3: cio2: Disable and sync irq before stream off

This is to avoid pending interrupts to be handled during
stream off, in which case, the ready buffer will be removed
from buffer list, thus not all buffers can be returned to VB2
as expected. Disable CIO2 irq at cio2_hw_exit() so no new
interrupts are generated.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Tianshu Qiu <tian.shu.qiu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Fixed ktime_t to ns conversion
Jasmin Jessich [Sun, 14 Jan 2018 10:21:43 +0000 (05:21 -0500)]
media: uvcvideo: Fixed ktime_t to ns conversion

Commit 828ee8c71950 ("media: uvcvideo: Use ktime_t for timestamps")
changed to use ktime_t for timestamps. Older Kernels use a struct for
ktime_t, which requires the conversion function ktime_to_ns to be used on
some places. With this patch it will compile now also for older Kernel
versions.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Use parentheses around sizeof operand
Laurent Pinchart [Tue, 16 Jan 2018 17:45:36 +0000 (12:45 -0500)]
media: uvcvideo: Use parentheses around sizeof operand

While the sizeof is an operator and not a function, the preferred coding
style in the kernel is to enclose its operand in parentheses. To avoid
mixing multiple coding styles in the driver, use parentheses around all
sizeof operands.

While at it replace a kmalloc() with a kmalloc_array() to silence a
checkpatch warning triggered by this patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Use internal kernel integer types
Laurent Pinchart [Tue, 16 Jan 2018 17:45:36 +0000 (12:45 -0500)]
media: uvcvideo: Use internal kernel integer types

Replace the __[su]{8,16,32} variant of integer types with the
non-underscored types as the code is internal to the driver, not exposed
to userspace.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Use kernel integer types
Laurent Pinchart [Tue, 16 Jan 2018 17:35:17 +0000 (12:35 -0500)]
media: uvcvideo: Use kernel integer types

Replace the uint_{8,16,32} types with the corresponding native kernel
types u{8,16,32}.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Drop extern keyword in function declarations
Laurent Pinchart [Tue, 16 Jan 2018 17:32:54 +0000 (12:32 -0500)]
media: uvcvideo: Drop extern keyword in function declarations

The extern keyword isn't needed to declare functions in header files.
Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Support multiple frame descriptors with the same dimensions
Philipp Zabel [Thu, 4 Jan 2018 22:51:29 +0000 (17:51 -0500)]
media: uvcvideo: Support multiple frame descriptors with the same dimensions

The Microsoft HoloLens Sensors device has two separate frame descriptors
with the same dimensions, each with a single different frame interval:

      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1280
        wHeight                           481
        dwMinBitRate                147763200
        dwMaxBitRate                147763200
        dwMaxVideoFrameBufferSize      615680
        dwDefaultFrameInterval         333333
        bFrameIntervalType                  1
        dwFrameInterval( 0)            333333
      VideoStreaming Interface Descriptor:
        bLength                            30
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1280
        wHeight                           481
        dwMinBitRate                443289600
        dwMaxBitRate                443289600
        dwMaxVideoFrameBufferSize      615680
        dwDefaultFrameInterval         111111
        bFrameIntervalType                  1
        dwFrameInterval( 0)            111111

Skip duplicate dimensions in enum_framesizes, let enum_frameintervals list
the intervals from both frame descriptors. Change set_streamparm to switch
to the correct frame index when changing the interval. This enables 90 fps
capture on a Lenovo Explorer Windows Mixed Reality headset.

[laurent.pinchart@ideasonboard.com: Renamed tmp_ival to ival]

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: uvcvideo: Apply flags from device to actual properties
Edgar Thier [Thu, 12 Oct 2017 07:54:17 +0000 (03:54 -0400)]
media: uvcvideo: Apply flags from device to actual properties

Use flags the device exposes for UVC controls.
This allows the device to define which property flags are set.

Since some cameras offer auto-adjustments for properties (e.g. auto-gain),
the values of other properties (e.g. gain) can change in the camera.
Examining the flags ensures that the driver is aware of such properties.

Signed-off-by: Edgar Thier <info@edgarthier.net>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agotda1997x: get rid of an unused var
Mauro Carvalho Chehab [Thu, 22 Feb 2018 17:54:28 +0000 (12:54 -0500)]
tda1997x: get rid of an unused var

1 warning regressions:
  + drivers/media/i2c/tda1997x.c: warning: variable 'last_irq_status' set but not used [-Wunused-but-set-variable]:  => 1421:17

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: i2c: Add TDA1997x HDMI receiver driver
Tim Harvey [Thu, 15 Feb 2018 17:55:34 +0000 (12:55 -0500)]
media: i2c: Add TDA1997x HDMI receiver driver

Add support for the TDA1997x HDMI receivers.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix type 'testin' -> 'testing']
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dt-bindings: Add bindings for TDA1997X
Tim Harvey [Thu, 15 Feb 2018 17:55:33 +0000 (12:55 -0500)]
media: dt-bindings: Add bindings for TDA1997X

Define the device tree bindings for the TDA1997X.

Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: make a proper commit message]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: MAINTAINERS: add entry for NXP TDA1997x driver
Tim Harvey [Thu, 15 Feb 2018 17:55:32 +0000 (12:55 -0500)]
media: MAINTAINERS: add entry for NXP TDA1997x driver

Add new MAINTAINERS entry.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: make a proper commit message]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add digital video decoder entity functions
Tim Harvey [Thu, 15 Feb 2018 17:55:31 +0000 (12:55 -0500)]
media: add digital video decoder entity functions

Add a new media entity function definition for digital TV decoders:
MEDIA_ENT_F_DTV_DECODER

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l-ioctl: fix clearing pad for VIDIOC_DV_TIMINGS_CAP
Tim Harvey [Thu, 15 Feb 2018 17:55:30 +0000 (12:55 -0500)]
media: v4l-ioctl: fix clearing pad for VIDIOC_DV_TIMINGS_CAP

The pad field was inadvertently cleared. Fix this. It's needed for subdevs.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: make a proper commit message]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-dv-timings: add v4l2_hdmi_colorimetry()
Hans Verkuil [Thu, 15 Feb 2018 17:55:29 +0000 (12:55 -0500)]
media: v4l2-dv-timings: add v4l2_hdmi_colorimetry()

Add the v4l2_hdmi_colorimetry() function so we have a single function
that determines the colorspace, YCbCr encoding, quantization range and
transfer function from the InfoFrame data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: vidioc-g-parm.rst: also allow _MPLANE buffer types
Hans Verkuil [Mon, 22 Jan 2018 10:02:19 +0000 (05:02 -0500)]
media: vidioc-g-parm.rst: also allow _MPLANE buffer types

The specification mentions that type can be V4L2_BUF_TYPE_VIDEO_CAPTURE,
but the v4l2 core implementation also allows the _MPLANE variant.

Document this.

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>
6 years agomedia: v4l2-subdev.h: remove obsolete g/s_parm
Hans Verkuil [Fri, 19 Jan 2018 13:57:44 +0000 (08:57 -0500)]
media: v4l2-subdev.h: remove obsolete g/s_parm

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Drop g_parm and s_parm subdev ops use
Sakari Ailus [Sun, 21 Jan 2018 21:49:47 +0000 (16:49 -0500)]
media: staging: atomisp: Drop g_parm and s_parm subdev ops use

The s_parm and g_parm did nothing. Remove them.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: mt9m114: Drop empty s_parm callback
Sakari Ailus [Sun, 21 Jan 2018 21:48:45 +0000 (16:48 -0500)]
media: staging: atomisp: mt9m114: Drop empty s_parm callback

The s_parm callback in mt9m114 driver did nothing, remove it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: i2c: Drop g_parm support in sensor drivers
Sakari Ailus [Sun, 21 Jan 2018 21:47:29 +0000 (16:47 -0500)]
media: staging: atomisp: i2c: Drop g_parm support in sensor drivers

These drivers already support g_frame_interval. Therefore just dropping
g_parm is enough.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: i2c: Disable non-preview configurations
Sakari Ailus [Mon, 19 Feb 2018 13:27:19 +0000 (08:27 -0500)]
media: staging: atomisp: i2c: Disable non-preview configurations

These sensor drivers have use case specific mode lists. This is currently
not used nor there is a standard API for selecting the mode list. Disable
configurations for non-preview modes until configuration selection is
improved so that all the configurations are always usable.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[hans.verkuil@cisco.com: clarify that this functionality it currently unused]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Kill subdev s_parm abuse
Sakari Ailus [Sun, 21 Jan 2018 21:43:42 +0000 (16:43 -0500)]
media: staging: atomisp: Kill subdev s_parm abuse

Remove sensor driver's interface for setting the use case specific mode
list as well as the mode lists that are related to other than
CI_MODE_PREVIEW. This removes s_parm abuse in using driver specific values
in v4l2_streamparm.capture.capturemode. The drivers already support
[gs]_frame_interval so removing support for [gs]_parm is enough.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: convert g/s_parm to g/s_frame_interval in subdevs
Hans Verkuil [Mon, 22 Jan 2018 09:00:45 +0000 (04:00 -0500)]
media: convert g/s_parm to g/s_frame_interval in subdevs

Convert all g/s_parm calls to g/s_frame_interval. This allows us
to remove the g/s_parm ops since those are a duplicate of
g/s_frame_interval.

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>
6 years agomedia: v4l2-common: create v4l2_g/s_parm_cap helpers
Hans Verkuil [Mon, 22 Jan 2018 08:58:36 +0000 (03:58 -0500)]
media: v4l2-common: create v4l2_g/s_parm_cap helpers

Create helpers to handle VIDIOC_G/S_PARM by querying the
g/s_frame_interval v4l2_subdev ops.

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>
6 years agomedia: v4l2-subdev: clear reserved fields
Hans Verkuil [Sat, 3 Feb 2018 13:20:21 +0000 (08:20 -0500)]
media: v4l2-subdev: clear reserved fields

Clear the reserved fields for these ioctls according to the specification:

VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
VIDIOC_SUBDEV_ENUM_FRAME_SIZE
VIDIOC_SUBDEV_ENUM_MBUS_CODE
VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP
VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT
VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION

Found with v4l2-compliance.

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>
6 years agomedia: rc: get start time just before calling driver tx
Sean Young [Mon, 12 Feb 2018 14:00:28 +0000 (09:00 -0500)]
media: rc: get start time just before calling driver tx

The current code gets the start time before copying the IR from
userspace (could cause page faults) and encoding IR. This means
that the gap calculation could be off.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: remove useless if statement
Sean Young [Mon, 12 Feb 2018 13:59:00 +0000 (08:59 -0500)]
media: rc: remove useless if statement

ret is always 0, so remove if statement.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: remove obsolete comment
Sean Young [Mon, 12 Feb 2018 13:58:01 +0000 (08:58 -0500)]
media: rc: remove obsolete comment

This comment is no longer relevant.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: remove IR_dprintk() from rc-core
Sean Young [Mon, 12 Feb 2018 12:27:50 +0000 (07:27 -0500)]
media: rc: remove IR_dprintk() from rc-core

Use dev_dbg() rather than custom debug function.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: replace IR_dprintk() with dev_dbg in IR decoders
Sean Young [Mon, 12 Feb 2018 12:20:52 +0000 (07:20 -0500)]
media: rc: replace IR_dprintk() with dev_dbg in IR decoders

Use dev_dbg() rather than custom debug function.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: ir-spi: fix duty cycle
Sean Young [Sat, 27 Jan 2018 14:05:37 +0000 (09:05 -0500)]
media: rc: ir-spi: fix duty cycle

Calculate the pulse rather than having a few preset values.

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: ir-hix5hd2: fix error handling of clk_prepare_enable()
Alexey Khoroshilov [Fri, 26 Jan 2018 22:10:17 +0000 (17:10 -0500)]
media: rc: ir-hix5hd2: fix error handling of clk_prepare_enable()

Return code of clk_prepare_enable() is ignored in many places.
The patch adds error handling for all of them.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: don't mark IR decoders default y
Andi Kleen [Thu, 25 Jan 2018 22:19:08 +0000 (17:19 -0500)]
media: rc: don't mark IR decoders default y

I usually update my config with make oldconfig and pressing return,
trusting that whoever updates Kconfig sets sensible defaults.

But my recent kernels ended up with all kinds of IR decoders
built in that are not used by anything because they are all
marked with default y.

default y should only be set for something that prevents
booting on common systems, never for some random weirdo
driver feature like this.

Remove all the "default y" in drivers/media/rc/Kconfig

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add video control handlers using V4L2 control framework
Florian Echtler [Thu, 8 Feb 2018 08:43:06 +0000 (03:43 -0500)]
media: add video control handlers using V4L2 control framework

This patch registers four standard control handlers using the corresponding
V4L2 framework.

Signed-off-by: Florian Echtler <floe@butterbrot.org>
[hans.verkuil@cisco.com: lower-cased 0x0F and 0xF0]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add panel register access functions
Florian Echtler [Thu, 8 Feb 2018 08:43:05 +0000 (03:43 -0500)]
media: add panel register access functions

These functions provide write access to the internal LCD panel registers
which also control the sensor. They can be used to disable the
preprocessor, set the illumination brightness, and adjust gain/contrast
(which are stored together in one register internally called "vsvideo").

Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add default settings and module parameters for video controls
Florian Echtler [Thu, 8 Feb 2018 08:43:04 +0000 (03:43 -0500)]
media: add default settings and module parameters for video controls

This patch adds parameter definitions and module parameters for the four
userspace controls that the SUR40 can currently provide.

Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add missing blob structure field for tag id
Florian Echtler [Thu, 8 Feb 2018 08:43:03 +0000 (03:43 -0500)]
media: add missing blob structure field for tag id

The SUR40 can recognize specific printed patterns directly in hardware;
this information (i.e. the pattern id) is present but currently unused
in the blob structure.

Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: include/(uapi/)media: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:05:46 +0000 (09:05 -0500)]
media: include/(uapi/)media: add SPDX license info

Replace the old license information with the corresponding SPDX
license for those headers that I authored.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:34:55 +0000 (09:34 -0500)]
media: add SPDX license info

Replace the old license information with the corresponding SPDX
license for the remaining media drivers that Cisco authored.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: i2c: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:34:26 +0000 (09:34 -0500)]
media: i2c: add SPDX license info

Replace the old license information with the corresponding SPDX
license for those drivers Cisco authored.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cec: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:34:03 +0000 (09:34 -0500)]
media: cec: add SPDX license info

Replace the old license information with the corresponding SPDX
license.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cobalt: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:27:12 +0000 (09:27 -0500)]
media: cobalt: add SPDX license info

Replace the old license information with the corresponding SPDX
license.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: vivid: add SPDX license info
Hans Verkuil [Wed, 7 Feb 2018 14:12:45 +0000 (09:12 -0500)]
media: vivid: add SPDX license info

Replace the old license information with the corresponding SPDX
license.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agoLinux 4.16-rc1
Linus Torvalds [Sun, 11 Feb 2018 23:04:29 +0000 (15:04 -0800)]
Linux 4.16-rc1

6 years agounify {de,}mangle_poll(), get rid of kernel-side POLL...
Al Viro [Thu, 1 Feb 2018 20:13:18 +0000 (15:13 -0500)]
unify {de,}mangle_poll(), get rid of kernel-side POLL...

except, again, POLLFREE and POLL_BUSY_LOOP.

With this, we finally get to the promised end result:

 - POLL{IN,OUT,...} are plain integers and *not* in __poll_t, so any
   stray instances of ->poll() still using those will be caught by
   sparse.

 - eventpoll.c and select.c warning-free wrt __poll_t

 - no more kernel-side definitions of POLL... - userland ones are
   visible through the entire kernel (and used pretty much only for
   mangle/demangle)

 - same behavior as after the first series (i.e. sparc et.al. epoll(2)
   working correctly).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6 years agovfs: do bulk POLL* -> EPOLL* replacement
Linus Torvalds [Sun, 11 Feb 2018 22:34:03 +0000 (14:34 -0800)]
vfs: do bulk POLL* -> EPOLL* replacement

This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6 years agoMerge branch 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sun, 11 Feb 2018 21:57:19 +0000 (13:57 -0800)]
Merge branch 'work.poll2' of git://git./linux/kernel/git/viro/vfs

Pull more poll annotation updates from Al Viro:
 "This is preparation to solving the problems you've mentioned in the
  original poll series.

  After this series, the kernel is ready for running

      for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
            L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
            for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
      done

  as a for bulk search-and-replace.

  After that, the kernel is ready to apply the patch to unify
  {de,}mangle_poll(), and then get rid of kernel-side POLL... uses
  entirely, and we should be all done with that stuff.

  Basically, that's what you suggested wrt KPOLL..., except that we can
  use EPOLL... instead - they already are arch-independent (and equal to
  what is currently kernel-side POLL...).

  After the preparations (in this series) switch to returning EPOLL...
  from ->poll() instances is completely mechanical and kernel-side
  POLL... can go away. The last step (killing kernel-side POLL... and
  unifying {de,}mangle_poll() has to be done after the
  search-and-replace job, since we need userland-side POLL... for
  unified {de,}mangle_poll(), thus the cherry-pick at the last step.

  After that we will have:

   - POLL{IN,OUT,...} *not* in __poll_t, so any stray instances of
     ->poll() still using those will be caught by sparse.

   - eventpoll.c and select.c warning-free wrt __poll_t

   - no more kernel-side definitions of POLL... - userland ones are
     visible through the entire kernel (and used pretty much only for
     mangle/demangle)

   - same behavior as after the first series (i.e. sparc et.al. epoll(2)
     working correctly)"

* 'work.poll2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  annotate ep_scan_ready_list()
  ep_send_events_proc(): return result via esed->res
  preparation to switching ->poll() to returning EPOLL...
  add EPOLLNVAL, annotate EPOLL... and event_poll->event
  use linux/poll.h instead of asm/poll.h
  xen: fix poll misannotation
  smc: missing poll annotations

6 years agoMerge tag 'xtensa-20180211' of git://github.com/jcmvbkbc/linux-xtensa
Linus Torvalds [Sun, 11 Feb 2018 21:54:52 +0000 (13:54 -0800)]
Merge tag 'xtensa-20180211' of git://github.com/jcmvbkbc/linux-xtensa

Pull xtense fix from Max Filippov:
 "Build fix for xtensa architecture with KASAN enabled"

* tag 'xtensa-20180211' of git://github.com/jcmvbkbc/linux-xtensa:
  xtensa: fix build with KASAN

6 years agoMerge tag 'nios2-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan...
Linus Torvalds [Sun, 11 Feb 2018 21:52:32 +0000 (13:52 -0800)]
Merge tag 'nios2-v4.16-rc1' of git://git./linux/kernel/git/lftan/nios2

Pull nios2 update from Ley Foon Tan:

 - clean up old Kconfig options from defconfig

 - remove leading 0x and 0s from bindings notation in dts files

* tag 'nios2-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
  nios2: defconfig: Cleanup from old Kconfig options
  nios2: dts: Remove leading 0x and 0s from bindings notation

6 years agoxtensa: fix build with KASAN
Max Filippov [Sun, 11 Feb 2018 09:07:54 +0000 (01:07 -0800)]
xtensa: fix build with KASAN

The commit 917538e212a2 ("kasan: clean up KASAN_SHADOW_SCALE_SHIFT
usage") removed KASAN_SHADOW_SCALE_SHIFT definition from
include/linux/kasan.h and added it to architecture-specific headers,
except for xtensa. This broke the xtensa build with KASAN enabled.
Define KASAN_SHADOW_SCALE_SHIFT in arch/xtensa/include/asm/kasan.h

Reported by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 917538e212a2 ("kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage")
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
6 years agonios2: defconfig: Cleanup from old Kconfig options
Krzysztof Kozlowski [Sun, 11 Feb 2018 15:01:17 +0000 (23:01 +0800)]
nios2: defconfig: Cleanup from old Kconfig options

Remove old, dead Kconfig option INET_LRO. It is gone since
commit 7bbf3cae65b6 ("ipv4: Remove inet_lro library").

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agonios2: dts: Remove leading 0x and 0s from bindings notation
Mathieu Malaterre [Sun, 11 Feb 2018 14:59:18 +0000 (22:59 +0800)]
nios2: dts: Remove leading 0x and 0s from bindings notation

Improve the DTS files by removing all the leading "0x" and zeros to fix the
following dtc warnings:

Warning (unit_address_format): Node /XXX unit name should not have leading "0x"

and

Warning (unit_address_format): Node /XXX unit name should not have leading 0s

Converted using the following command:

find . -type f \( -iname *.dts -o -iname *.dtsi \) -exec sed -E -i -e "s/@0x([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" -e "s/@0+([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" {} +

For simplicity, two sed expressions were used to solve each warnings separately.

To make the regex expression more robust a few other issues were resolved,
namely setting unit-address to lower case, and adding a whitespace before the
the opening curly brace:

https://elinux.org/Device_Tree_Linux#Linux_conventions

This is a follow up to commit 4c9847b7375a ("dt-bindings: Remove leading 0x from bindings notation")

Reported-by: David Daney <ddaney@caviumnetworks.com>
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
6 years agoMerge tag 'pci-v4.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
Linus Torvalds [Sat, 10 Feb 2018 22:08:26 +0000 (14:08 -0800)]
Merge tag 'pci-v4.16-fixes-1' of git://git./linux/kernel/git/helgaas/pci

Pull PCI fix from Bjorn Helgaas:
 "Fix a POWER9/powernv INTx regression from the merge window (Alexey
  Kardashevskiy)"

* tag 'pci-v4.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  powerpc/pci: Fix broken INTx configuration via OF

6 years agoMerge tag 'for-linus-20180210' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 10 Feb 2018 22:05:11 +0000 (14:05 -0800)]
Merge tag 'for-linus-20180210' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A few fixes to round off the merge window on the block side:

   - a set of bcache fixes by way of Michael Lyle, from the usual bcache
     suspects.

   - add a simple-to-hook-into function for bpf EIO error injection.

   - fix blk-wbt that mischarectized flushes as reads. Improve the logic
     so that flushes and writes are accounted as writes, and only reads
     as reads. From me.

   - fix requeue crash in BFQ, from Paolo"

* tag 'for-linus-20180210' of git://git.kernel.dk/linux-block:
  block, bfq: add requeue-request hook
  bcache: fix for data collapse after re-attaching an attached device
  bcache: return attach error when no cache set exist
  bcache: set writeback_rate_update_seconds in range [1, 60] seconds
  bcache: fix for allocator and register thread race
  bcache: set error_limit correctly
  bcache: properly set task state in bch_writeback_thread()
  bcache: fix high CPU occupancy during journal
  bcache: add journal statistic
  block: Add should_fail_bio() for bpf error injection
  blk-wbt: account flush requests correctly

6 years agoMerge tag 'platform-drivers-x86-v4.16-3' of git://github.com/dvhart/linux-pdx86
Linus Torvalds [Sat, 10 Feb 2018 21:55:33 +0000 (13:55 -0800)]
Merge tag 'platform-drivers-x86-v4.16-3' of git://github.com/dvhart/linux-pdx86

Pull x86 platform driver updates from Darren Hart:
 "Mellanox fixes and new system type support.

  Mostly data for new system types with a correction and an
  uninitialized variable fix"

[ Pulling from github because git.infradead.org currently seems to be
  down for some reason, but Darren had a backup location    - Linus ]

* tag 'platform-drivers-x86-v4.16-3' of git://github.com/dvhart/linux-pdx86:
  platform/x86: mlx-platform: Add support for new 200G IB and Ethernet systems
  platform/x86: mlx-platform: Add support for new msn201x system type
  platform/x86: mlx-platform: Add support for new msn274x system type
  platform/x86: mlx-platform: Fix power cable setting for msn21xx family
  platform/x86: mlx-platform: Add define for the negative bus
  platform/x86: mlx-platform: Use defines for bus assignment
  platform/mellanox: mlxreg-hotplug: Fix uninitialized variable

6 years agoMerge tag 'chrome-platform-for-linus-4.16' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sat, 10 Feb 2018 21:50:23 +0000 (13:50 -0800)]
Merge tag 'chrome-platform-for-linus-4.16' of git://git./linux/kernel/git/bleung/chrome-platform

Pull chrome platform updates from Benson Leung:

 - move cros_ec_dev to drivers/mfd

 - other small maintenance fixes

[ The cros_ec_dev movement came in earlier through the MFD tree  - Linus ]

* tag 'chrome-platform-for-linus-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform:
  platform/chrome: Use proper protocol transfer function
  platform/chrome: cros_ec_lpc: Add support for Google Glimmer
  platform/chrome: cros_ec_lpc: Register the driver if ACPI entry is missing.
  platform/chrome: cros_ec_lpc: remove redundant pointer request
  cros_ec: fix nul-termination for firmware build info
  platform/chrome: chromeos_laptop: make chromeos_laptop const

6 years agoMerge tag 'kvm-4.16-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sat, 10 Feb 2018 21:16:35 +0000 (13:16 -0800)]
Merge tag 'kvm-4.16-1' of git://git./virt/kvm/kvm

Pull KVM updates from Radim Krčmář:
 "ARM:

   - icache invalidation optimizations, improving VM startup time

   - support for forwarded level-triggered interrupts, improving
     performance for timers and passthrough platform devices

   - a small fix for power-management notifiers, and some cosmetic
     changes

  PPC:

   - add MMIO emulation for vector loads and stores

   - allow HPT guests to run on a radix host on POWER9 v2.2 CPUs without
     requiring the complex thread synchronization of older CPU versions

   - improve the handling of escalation interrupts with the XIVE
     interrupt controller

   - support decrement register migration

   - various cleanups and bugfixes.

  s390:

   - Cornelia Huck passed maintainership to Janosch Frank

   - exitless interrupts for emulated devices

   - cleanup of cpuflag handling

   - kvm_stat counter improvements

   - VSIE improvements

   - mm cleanup

  x86:

   - hypervisor part of SEV

   - UMIP, RDPID, and MSR_SMI_COUNT emulation

   - paravirtualized TLB shootdown using the new KVM_VCPU_PREEMPTED bit

   - allow guests to see TOPOEXT, GFNI, VAES, VPCLMULQDQ, and more
     AVX512 features

   - show vcpu id in its anonymous inode name

   - many fixes and cleanups

   - per-VCPU MSR bitmaps (already merged through x86/pti branch)

   - stable KVM clock when nesting on Hyper-V (merged through
     x86/hyperv)"

* tag 'kvm-4.16-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (197 commits)
  KVM: PPC: Book3S: Add MMIO emulation for VMX instructions
  KVM: PPC: Book3S HV: Branch inside feature section
  KVM: PPC: Book3S HV: Make HPT resizing work on POWER9
  KVM: PPC: Book3S HV: Fix handling of secondary HPTEG in HPT resizing code
  KVM: PPC: Book3S PR: Fix broken select due to misspelling
  KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs()
  KVM: PPC: Book3S PR: Fix svcpu copying with preemption enabled
  KVM: PPC: Book3S HV: Drop locks before reading guest memory
  kvm: x86: remove efer_reload entry in kvm_vcpu_stat
  KVM: x86: AMD Processor Topology Information
  x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested
  kvm: embed vcpu id to dentry of vcpu anon inode
  kvm: Map PFN-type memory regions as writable (if possible)
  x86/kvm: Make it compile on 32bit and with HYPYERVISOR_GUEST=n
  KVM: arm/arm64: Fixup userspace irqchip static key optimization
  KVM: arm/arm64: Fix userspace_irqchip_in_use counting
  KVM: arm/arm64: Fix incorrect timer_is_pending logic
  MAINTAINERS: update KVM/s390 maintainers
  MAINTAINERS: add Halil as additional vfio-ccw maintainer
  MAINTAINERS: add David as a reviewer for KVM/s390
  ...

6 years agopowerpc/pci: Fix broken INTx configuration via OF
Alexey Kardashevskiy [Fri, 9 Feb 2018 06:23:58 +0000 (17:23 +1100)]
powerpc/pci: Fix broken INTx configuration via OF

59f47eff03a0 ("powerpc/pci: Use of_irq_parse_and_map_pci() helper")
replaced of_irq_parse_pci() + irq_create_of_mapping() with
of_irq_parse_and_map_pci(), but neglected to capture the virq
returned by irq_create_of_mapping(), so virq remained zero, which
caused INTx configuration to fail.

Save the virq value returned by of_irq_parse_and_map_pci() and correct
the virq declaration to match the of_irq_parse_and_map_pci() signature.

Fixes: 59f47eff03a0 "powerpc/pci: Use of_irq_parse_and_map_pci() helper"
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>