Steve Longerbeam [Sun, 11 Jun 2017 17:46:11 +0000 (14:46 -0300)]
[media] MAINTAINERS: add entry for OV5640 sensor driver
Add maintainer entry for the OV5640 V4L2 sensor driver.
Signed-off-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>
Steve Longerbeam [Wed, 7 Jun 2017 18:33:56 +0000 (15:33 -0300)]
[media] add Omnivision OV5640 sensor driver
This driver is based on ov5640_mipi.c from Freescale imx_3.10.17_1.0.0_beta
branch, modified heavily to bring forward to latest interfaces and code
cleanup.
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.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>
Steve Longerbeam [Wed, 7 Jun 2017 18:33:42 +0000 (15:33 -0300)]
[media] dt/bindings: Add bindings for OV5640
Add device tree binding documentation for the OV5640 camera sensor.
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Mon, 12 Jun 2017 12:24:24 +0000 (09:24 -0300)]
[media] MAINTAINERS: add maintainer entry for video multiplexer v4l2 subdevice driver
Add maintainer entry for the video multiplexer v4l2 subdevice driver that
will control video bus multiplexers via the multiplexer framework.
Signed-off-by: Philip Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Wed, 7 Jun 2017 18:33:55 +0000 (15:33 -0300)]
[media] platform: add video-multiplexer subdevice driver
This driver can handle SoC internal and external video bus multiplexers,
controlled by mux controllers provided by the mux controller framework,
such as MMIO register bitfields or GPIOs. The subdevice passes through
the mbus configuration of the active input to the output side.
Since the mux framework is not yet merged, this driver contains
temporary mmio-mux support to work without the framework. The driver
should be converted to use the multiplexer API once the "mux: minimal
mux subsystem" and "mux: mmio-based syscon mux controller" patches are
merged.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
[hans.verkuil@cisco.com: add 'select REGMAP' to Kconfig]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Wed, 7 Jun 2017 18:33:54 +0000 (15:33 -0300)]
[media] add mux and video interface bridge entity functions
Add two new media entity function definitions for video multiplexers
and video interface bridges.
- renamed MEDIA_ENT_F_MUX to MEDIA_ENT_F_VID_MUX
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.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>
Philipp Zabel [Wed, 7 Jun 2017 18:33:40 +0000 (15:33 -0300)]
[media] dt-bindings: Add bindings for video-multiplexer device
Add bindings documentation for the video multiplexer device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Tue, 20 Jun 2017 10:11:15 +0000 (07:11 -0300)]
[media] max2175: remove an useless comparision
load is an unsigned integer. So, it is always bigger or equal
to zero, as reported by gcc:
drivers/media/i2c/max2175.c: In function 'max2175_refout_load_to_bits':
drivers/media/i2c/max2175.c:1272:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if (load >= 0 && load <= 40)
^~
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:20 +0000 (10:26 -0300)]
[media] MAINTAINERS: Add entry for R-Car DRIF & MAX2175 drivers
Add maintainter entry for the R-Car DRIF and MAX2175 drivers.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:19 +0000 (10:26 -0300)]
[media] media: platform: rcar_drif: Add DRIF support
This patch adds Digital Radio Interface (DRIF) support to R-Car Gen3 SoCs.
The driver exposes each instance of DRIF as a V4L2 SDR device. A DRIF
device represents a channel and each channel can have one or two
sub-channels respectively depending on the target board.
DRIF supports only Rx functionality. It receives samples from a RF
frontend tuner chip it is interfaced with. The combination of DRIF and the
tuner device, which is registered as a sub-device, determines the receive
sample rate and format.
In order to be compliant as a V4L2 SDR device, DRIF needs to bind with
the tuner device, which can be provided by a third party vendor. DRIF acts
as a slave device and the tuner device acts as a master transmitting the
samples. The driver allows asynchronous binding of a tuner device that
is registered as a v4l2 sub-device. The driver can learn about the tuner
it is interfaced with based on port endpoint properties of the device in
device tree. The V4L2 SDR device inherits the controls exposed by the
tuner device.
The device can also be configured to use either one or both of the data
pins at runtime based on the master (tuner) configuration.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:18 +0000 (10:26 -0300)]
[media] dt-bindings: media: Add Renesas R-Car DRIF binding
Add binding documentation for Renesas R-Car Digital Radio Interface
(DRIF) controller.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:17 +0000 (10:26 -0300)]
[media] doc_rst: media: New SDR formats PC16, PC18 & PC20
This patch adds documentation for the three new SDR formats
V4L2_SDR_FMT_PCU16BE
V4L2_SDR_FMT_PCU18BE
V4L2_SDR_FMT_PCU20BE
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:16 +0000 (10:26 -0300)]
[media] media: Add new SDR formats PC16, PC18 & PC20
This patch adds support for the three new SDR formats. These formats
were prefixed with "planar" indicating I & Q data are not interleaved
as in other formats. Here, I & Q data constitutes the top half and bottom
half of the received buffer respectively.
V4L2_SDR_FMT_PCU16BE - 14-bit complex (I & Q) unsigned big-endian sample
inside 16-bit. V4L2 FourCC: PC16
V4L2_SDR_FMT_PCU18BE - 16-bit complex (I & Q) unsigned big-endian sample
inside 18-bit. V4L2 FourCC: PC18
V4L2_SDR_FMT_PCU20BE - 18-bit complex (I & Q) unsigned big-endian sample
inside 20-bit. V4L2 FourCC: PC20
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Tue, 13 Jun 2017 12:54:47 +0000 (09:54 -0300)]
[media] media: i2c: max2175: Add MAX2175 support
This patch adds driver support for the MAX2175 chip. This is Maxim
Integrated's RF to Bits tuner front end chip designed for software-defined
radio solutions. This driver exposes the tuner as a sub-device instance
with standard and custom controls to configure the device.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:14 +0000 (10:26 -0300)]
[media] dt-bindings: media: Add MAX2175 binding description
Add device tree binding documentation for MAX2175 RF to bits tuner
device.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Ramesh Shanmugasundaram [Mon, 12 Jun 2017 13:26:13 +0000 (10:26 -0300)]
[media] media: v4l2-ctrls: Reserve controls for MAX217X
Reserve controls for MAX217X RF to Bits tuner family. These hybrid
radio receiver chips are highly programmable and hence reserving 32
controls.
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Fri, 9 Jun 2017 17:54:01 +0000 (14:54 -0300)]
[media] dt-bindings: media/s5p-cec.txt, media/stih-cec.txt: refer to cec.txt
Now that there is a cec.txt with common CEC bindings, update the two
driver-specific bindings to refer to cec.txt.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Fri, 9 Jun 2017 17:54:00 +0000 (14:54 -0300)]
[media] dt-bindings: add media/cec.txt
Document common HDMI CEC bindings. Add this to the MAINTAINERS file
as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:15 +0000 (11:46 -0300)]
[media] s5p_cec: set the CEC_CAP_NEEDS_HPD flag if needed
Use the needs-hpd DT property to determine if the CEC_CAP_NEEDS_HPD
should be set.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:14 +0000 (11:46 -0300)]
[media] dt-bindings: media/s5p-cec.txt: document needs-hpd property
Needed for boards that wire the CEC pin in such a way that it
is unavailable when the HPD is low.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:13 +0000 (11:46 -0300)]
[media] cec-ioc-adap-g-caps.rst: document CEC_CAP_NEEDS_HPD
Document the new CEC_CAP_NEEDS_HPD capability.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:12 +0000 (11:46 -0300)]
[media] cec: add CEC_CAP_NEEDS_HPD
Add a new capability CEC_CAP_NEEDS_HPD. If this capability is set
then the hardware can only use CEC if the HDMI Hotplug Detect pin
is high. Such hardware cannot handle the corner case in the CEC specification
where it is possible to transmit messages even if no hotplug signal is
present (needed for some displays that turn off the HPD when in standby,
but still have CEC enabled).
Typically hardware that needs this capability have the HPD wired to the CEC
block, often to a 'power' or 'active' pin.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:11 +0000 (11:46 -0300)]
[media] stih-cec/vivid/pulse8/rainshadow: use cec_transmit_attempt_done
Use the helper function cec_transmit_attempt_done instead of
cec_transmit_done to simplify the code.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:10 +0000 (11:46 -0300)]
[media] cec: add cec_transmit_attempt_done helper function
A simpler variant of cec_transmit_done to be used where the HW does
just a single attempt at a transmit. So if the status indicates an
error, then the corresponding error count will always be 1 and this
function figures that out based on the status argument.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:09 +0000 (11:46 -0300)]
[media] cec: add cec_phys_addr_invalidate() helper function
Simplifies setting the physical address to CEC_PHYS_ADDR_INVALID.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 7 Jun 2017 14:46:08 +0000 (11:46 -0300)]
[media] cec: add cec_s_phys_addr_from_edid helper function
This function simplifies the integration of CEC in DRM drivers.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Gustavo A. R. Silva [Fri, 2 Jun 2017 03:43:41 +0000 (00:43 -0300)]
[media] s3c-camif: fix arguments position in a function call
Fix the position of arguments so camif->colorfx_cb, camif->colorfx_cr
are passed in proper order to the camif_hw_set_effect() function.
Addresses-Coverity-ID: 1248800
Addresses-Coverity-ID: 1269141
[s.nawrocki@samsung.com: edited commit message ]
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Nicholas Mc Guire [Tue, 13 Dec 2016 01:58:02 +0000 (23:58 -0200)]
[media] s5k6aa: set usleep_range() range greater than 0
As this is not in atomic context and it does not seem like a critical
timing setting a range of 1ms allows the timer subsystem to optimize
the hrtimer here.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Thibault Saunier [Wed, 1 Mar 2017 11:51:07 +0000 (08:51 -0300)]
[media] exynos-gsc: Use user configured colorspace if provided
Use colorspace provided by the user as we are only doing scaling and
color encoding conversion, we won't be able to transform the colorspace
itself and the colorspace won't mater in that operation.
Also always use output colorspace on the capture side.
If the user does not provide a colorspace do not make it up, we might
later while processing need to figure out the colorspace, which
is possible depending on the frame size but do not ever guess and
leak that guess to the userspace.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Thibault Saunier <thibault.saunier@osg.samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Benjamin Gaignard [Mon, 29 May 2017 15:46:03 +0000 (12:46 -0300)]
[media] exynos4-is: use devm_of_platform_populate()
Usage of devm_of_platform_populate() simplify driver code
and save somes lines
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Colin Ian King [Sun, 14 May 2017 16:47:41 +0000 (13:47 -0300)]
[media] s5p-mfc: fix spelling mistake: "destionation" -> "destination"
Trivial fix to spelling mistake in mfc_err error messages
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alexandre Courbot [Tue, 25 Apr 2017 06:19:43 +0000 (03:19 -0300)]
[media] s5p-jpeg: fix recursive spinlock acquisition
v4l2_m2m_job_finish(), which is called from the interrupt handler with
slock acquired, can call the device_run() hook immediately if another
context was in the queue. This hook also acquires slock, resulting in
a deadlock for this scenario.
Fix this by releasing slock right before calling v4l2_m2m_job_finish().
This is safe to do as the state of the hardware cannot change before
v4l2_m2m_job_finish() is called anyway.
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
David Härdeman [Thu, 27 Apr 2017 20:34:08 +0000 (17:34 -0300)]
[media] rc-core: cleanup rc_register_device pt2
Now that rc_register_device() is reorganised, the dev->initialized
hack can be removed. Any driver which calls rc_register_device()
must be prepared for the device to go live immediately.
The dev->initialized commits that are relevant are commit
c73bbaa4ec3e
("[media] rc-core: don't lock device at rc_register_device()") and
commit
08aeb7c9a42a ("[media] rc: add locking to fix register/show race").
The original problem was that show_protocols() would access
dev->rc_map.* and various other bits which are now properly
initialized before device_add() is called.
At the same time, remove the bogus "device is being removed" check.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
David Härdeman [Wed, 3 May 2017 10:04:00 +0000 (07:04 -0300)]
[media] rc-core: cleanup rc_register_device
The device core infrastructure is based on the presumption that
once a driver calls device_add(), it must be ready to accept
userspace interaction.
This requires splitting rc_setup_rx_device() into two functions
and reorganizing rc_register_device() so that as much work
as possible is performed before calling device_add().
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sean Young [Fri, 2 Jun 2017 10:19:39 +0000 (07:19 -0300)]
[media] sir_ir: annotate hardware config module parameters
This module was merged after commit
5a8fc6a3cebb ("Annotate hardware
config module parameters in drivers/media/"), so add add the missing
hardware annotations.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Benjamin Gaignard [Wed, 31 May 2017 13:23:48 +0000 (10:23 -0300)]
[media] cec: add STM32 cec driver
This patch add cec driver for STM32 platforms.
cec hardware block isn't not always used with hdmi so
cec notifier is not implemented. That will be done later
when STM32 DSI driver will be available.
Driver compliance has been tested with cec-ctl and cec-compliance
tools.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
[hans.verkuil@cisco.com: modified platform/Makefile to use obj-y]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Benjamin Gaignard [Wed, 31 May 2017 12:13:55 +0000 (09:13 -0300)]
[media] dt-bindings: media: stm32 cec driver
Add bindings documentation for stm32 CEC driver.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kieran Bingham [Wed, 7 Jun 2017 09:52:07 +0000 (06:52 -0300)]
[media] v4l: subdev: tolerate null in media_entity_to_v4l2_subdev
Return NULL, if a null entity is parsed for it's v4l2_subdev
Currently, the callers of media_entity_to_v4l2_subdev() need to
make sure that the subdev is non-NULL, for example, when it is
obtained from media_entity_remote_pad().
As this is a recurring pattern, add the check at the macro in order
to avoid additional checks at the callers.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alexandre Courbot [Wed, 7 Jun 2017 09:33:02 +0000 (06:33 -0300)]
[media] media-ioc-g-topology.rst: fix typos
Fix what seems to be a few typos induced by copy/paste.
[mchehab@s-opensource.com: fix a typo]
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Wed, 31 May 2017 14:17:26 +0000 (11:17 -0300)]
[media] vb2: Move buffer cache synchronisation to prepare from queue
The buffer cache should be synchronised in buffer preparation, not when
the buffer is queued to the device. Fix this.
Mmap buffers do not need cache synchronisation since they are always
coherent.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Wed, 31 May 2017 14:17:25 +0000 (11:17 -0300)]
[media] vb2: Rename confusingly named internal buffer preparation functions
Rename __qbuf_*() functions which are specific to a buffer type as
__prepare_*() which matches with what they do. The naming was there for
historical reasons; the purpose of the functions was changed without
renaming them.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 8 Jun 2017 16:29:21 +0000 (13:29 -0300)]
[media] atomisp: use correct dialect to disable warnings
There's a Macro that checks if gcc supports a warning before
disabling it. Use it, in order to avoid warnings when building
with older gcc versions.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 8 Jun 2017 15:34:44 +0000 (12:34 -0300)]
[media] staging: css2400/Makefile: don't include non-existing files
The atomisp css2400/Makefile includes a Makefile.common:
include $(srctree)/$(src)/../Makefile.common
Well, this file doesn't exist at the Kernel tree :-)
So, don't include it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Wolfram Sang [Sun, 28 May 2017 09:30:50 +0000 (06:30 -0300)]
[media] v4l: rcar_fdp1: use proper name for the R-Car SoC
It is 'R-Car', not 'RCar'. No code or binding changes, only descriptive text.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Wolfram Sang [Sun, 28 May 2017 09:30:49 +0000 (06:30 -0300)]
[media] rcar_vin: use proper name for the R-Car SoC
It is 'R-Car', not 'RCar'. No code or binding changes, only descriptive text.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Fri, 26 May 2017 13:00:48 +0000 (10:00 -0300)]
[media] ad5820: unregister async sub-device
The async sub-device was not unregistered in ad5820_remove() as it should
have been; do it now. Also remove the now-redundant
v4l2_device_unregister_subdev().
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Thu, 8 Jun 2017 15:14:09 +0000 (12:14 -0300)]
[media] platform/Makefile: don't depend on arch to include dirs
Depending on arch configs to include dirs is evil, and makes
harder to change drivers to work with COMPILE_TEST.
Replace them by obj-y.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Thu, 8 Jun 2017 15:04:07 +0000 (12:04 -0300)]
[media] davinci: Switch from V4L2 OF to V4L2 fwnode
The DaVinci VPIF capture driver V4L2 OF support was added after the V4L2
OF framework got removed. Switch VPIF capture driver to V4L2 fwnode.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Colin Ian King [Sun, 7 May 2017 18:33:05 +0000 (15:33 -0300)]
[media] pvrusb2: remove redundant check on cnt > 8
The 2nd check of cnt > 8 is redundant as cnt is already checked
and thresholded to a maximum of 8 a few statements earlier.
Remove this redundant 2nd check.
Detected by CoverityScan, CID#114281 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jasmin Jessich [Sun, 7 May 2017 21:23:34 +0000 (18:23 -0300)]
[media] dvb_ca_en50221: Fix wrong EXPORT_SYMBOL order
Some EXPORT_SYMBOL() on this file don't match the name of functions
that preceeds them.
Also, some kernel-doc markups also have a wrong name. Fix it.
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jasmin Jessich [Sun, 7 May 2017 21:23:28 +0000 (18:23 -0300)]
[media] dvb_ca_en50221: use foo *bar, instead of foo * bar
Make checkpatch happier by fixing this warning:
ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Fri, 2 Jun 2017 20:04:23 +0000 (17:04 -0300)]
[media] staging: atomisp: Fix endless recursion in hmm_init
hmm_init calls hmm_alloc to set dummy_ptr, hmm_alloc calls
hmm_init when dummy_ptr is not yet set, which is the case in
the call from hmm_init, so it calls hmm_init again, this continues
until we have a stack overflow due to the recursion.
This commit fixes this by adding a separate flag for tracking if
hmm_init has been called. Not pretty, but it gets the job done,
eventually we should be able to remove the hmm_init call from
hmm_alloc.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Chen Guanqiao [Sun, 28 May 2017 18:06:41 +0000 (15:06 -0300)]
[media] staging: atomisp: lm3554: fix sparse warnings(was not declared. Should it be static?)
Fix "symbol 'xxxxxxx' was not declared. Should it be static?" sparse warnings.
Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:53 +0000 (09:31 -0300)]
[media] staging: atomisp: Make ov2680 driver less chatty
There is no reason for all this printk spamming and certainly
not at an error log level.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:52 +0000 (09:31 -0300)]
[media] staging: atomisp: Ignore errors from second gpio in ov2680 driver
As the existing comment in the driver indicates the sensor has only 1 pin,
but some boards may have 2 gpios defined and we toggle both as we we don't
know which one is the right one. However if the ACPI resources table
defines only 1 gpio (as expected) the gpio1_ctrl call will always fail,
causing the probing of the driver to file.
This commit ignore the return value of the gpio1_ctrl call, fixing this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:51 +0000 (09:31 -0300)]
[media] staging: atomisp: Add OVTI2680 ACPI id to ov2680 driver
Add OVTI2680 ACPI id to ov2680 driver
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:50 +0000 (09:31 -0300)]
[media] staging: atomisp: Add INT0310 ACPI id to gc0310 driver
Add INT0310 ACPI id to gc0310 driver
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:49 +0000 (09:31 -0300)]
[media] staging: atomisp: Set step to 0 for mt9m114 menu control
menu controls are not allowed to have a step size, set step to 0 to
fix an oops from the WARN_ON in v4l2_ctrl_new_custom() triggering
because of this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:48 +0000 (09:31 -0300)]
[media] staging: atomisp: Do not call dev_warn with a NULL device
Do not call dev_warn with a NULL device, this silence the following 2
warnings:
[ 14.392194] (NULL device *): Failed to find gmin variable gmin_V2P8GPIO
[ 14.392257] (NULL device *): Failed to find gmin variable gmin_V1P8GPIO
We could switch to using pr_warn for dev == NULL instead, but as comments
in the source indicate, the check for these 2 special gmin variables with
a NULL device is a workaround for 2 specific evaluation boards, so
completely silencing the missing warning for these actually is a good
thing.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans de Goede [Sun, 28 May 2017 12:31:47 +0000 (09:31 -0300)]
[media] staging: atomisp: Fix calling efivar_entry_get() with unaligned arguments
efivar_entry_get has certain alignment requirements and the atomisp
platform code was not honoring these, causing an oops by triggering the
WARN_ON in arch/x86/platform/efi/efi_64.c: virt_to_phys_or_null_size().
This commit fixes this by using the members of the efivar struct embedded
in the efivar_entry struct we kzalloc as arguments to efivar_entry_get(),
which is how all the other callers of efivar_entry_get() do this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:29:48 +0000 (12:29 -0300)]
[media] atomisp: de-duplicate sh_css_mmu_set_page_table_base_index
Between the ISP2400 and ISP2401 code base this function moved file. The merge
of the drivers left us with two version in ifdefs. Resolve this down to a
single copy.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:29:36 +0000 (12:29 -0300)]
[media] atomisp: remove sh_css_irq - it contains nothing
We won't be adding abstractions or moving them here so kill it.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:29:25 +0000 (12:29 -0300)]
[media] atomisp: Unify lut free logic
ISP2401 introduced a helper for this which we can use just as well on the
ISP2400 and remove some more noise differences.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:29:15 +0000 (12:29 -0300)]
[media] atomisp: Unify load_preview_binaries for the most part
ISP2401 introduced a rather sensible change to cut through the structure
spaghetti. Adopt that for the ISP2400 as well. It makes no difference to the
actual code other than readability.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:28:55 +0000 (12:28 -0300)]
[media] atomisp: unify sh_css_hmm_buffer_record_acquire
The ISP2401 version of this function returns a pointer to the buffer, whilst
the ISP2400 version returns a boolean if a slot is found. We can trivially
unify the code to use the ISP2401 version.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:28:41 +0000 (12:28 -0300)]
[media] atomisp: eliminate dead code under HAS_RES_MGR
This define is never set and these code paths are never used so they can go
away.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Dan Carpenter [Fri, 26 May 2017 15:28:05 +0000 (12:28 -0300)]
[media] atomisp2: off by one in atomisp_s_input()
The isp->inputs[] array has isp->input_cnt elements which have been
initialized so this > should be >=.
This bug is harmless. The check against ATOM_ISP_MAX_INPUTS prevents us
from reading beyond the end of the array. The uninitialized elements
are zeroed out so we will end up returning -EINVAL a few lines later
because the .camera pointer is NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:27:54 +0000 (12:27 -0300)]
[media] atomisp2: tidy up confused ifdefs
The two drivers were machine merged and in this case the machine output was to
say the least not optimal.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:27:40 +0000 (12:27 -0300)]
[media] atomisp2: remove HRT_UNSCHED
HRT_UNSCHED is never defined or set in the driver, so this is dead code that
can be retired, simplifying the code a bit further.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:27:29 +0000 (12:27 -0300)]
[media] atomisp: remove NUM_OF_BLS
With the removal of the HAS_BL bootloader code the value of NUM_OF_BLS is an
invariant zero. So let's get rid of it.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alan Cox [Fri, 26 May 2017 15:27:18 +0000 (12:27 -0300)]
[media] atompisp: HAS_BL is never defined so lose it
Kill off the HAS_BL define and the code and includes it brackets. We never
define HAS_BL or use that functionality.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Juan Antonio Pedreira Martos [Wed, 24 May 2017 00:27:11 +0000 (21:27 -0300)]
[media] staging: media: atomisp: fix non static symbol warnings
Fix a couple of sparse warnings:
drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:59:14: warning: symbol 'repool_pgnr' was not declared. Should it be static?
drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:387:6: warning: symbol 'punit_ddr_dvfs_enable' was not declared. Should it be static?
Mark these symbols as static, so they are no longer incorrectly exported.
Signed-off-by: Juan Antonio Pedreira Martos <juanpm1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Paolo Cretaro [Mon, 22 May 2017 21:04:46 +0000 (18:04 -0300)]
[media] atomisp: use NULL instead of 0 for pointers
Fix warning issued by sparse: Using plain integer as NULL pointer
Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Christoph Fanelsa [Tue, 16 May 2017 20:07:40 +0000 (17:07 -0300)]
[media] staging: media: cxd2099: Fix checkpatch issues
Fix checkpatch warnings of prefered using '%s..", __func__' as function
name in a string
Signed-off-by: Christoph Fanelsa <eddi1983@gmx.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hirokazu Honda [Tue, 30 May 2017 09:53:58 +0000 (06:53 -0300)]
[media] mtk-vcodec: Show mtk driver error without DEBUG definition
A driver error message is shown without DEBUG definition
to find an error and debug easily.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Daniel Kurtz [Tue, 23 May 2017 03:24:11 +0000 (00:24 -0300)]
[media] media: mtk-mdp: Fix mdp device tree
If the mdp_* nodes are under an mdp sub-node, their corresponding
platform device does not automatically get its iommu assigned properly.
Fix this by moving the mdp component nodes up a level such that they are
siblings of mdp and all other SoC subsystems. This also simplifies the
device tree.
Although it fixes iommu assignment issue, it also break compatibility
with old device tree. So, the patch in driver is needed to iterate over
sibling mdp device nodes, not child ones, to keep driver work properly.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Minghsiu Tsai [Tue, 23 May 2017 03:24:09 +0000 (00:24 -0300)]
[media] dt-bindings: mt8173: Fix mdp device tree
If the mdp_* nodes are under an mdp sub-node, their corresponding
platform device does not automatically get its iommu assigned properly.
Fix this by moving the mdp component nodes up a level such that they are
siblings of mdp and all other SoC subsystems. This also simplifies the
device tree.
Although it fixes iommu assignment issue, it also break compatibility
with old device tree. So, the patch in driver is needed to iterate over
sibling mdp device nodes, not child ones, to keep driver work properly.
Signed-off-by: Minghsiu Tsai <minghsiu.tsai@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Tue, 6 Jun 2017 15:59:02 +0000 (12:59 -0300)]
[media] coda: copy headers in front of every I-frame
That way we don't have to rely on userspace to inject the headers on IDR
requests, and there is always enough information to start decoding at an
I-frame.
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>
Philipp Zabel [Tue, 6 Jun 2017 15:59:01 +0000 (12:59 -0300)]
[media] coda: implement forced key frames
Implement the V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME control to force IDR
frames. This is useful to implement VFU (Video Fast Update) on RTP
transmissions.
We already force an IDR frame at the beginning of each GOP to work
around a firmware bug on i.MX27, use the same mechanism to service IDR
requests from userspace.
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>
Jia-Ju Bai [Thu, 1 Jun 2017 07:17:51 +0000 (04:17 -0300)]
[media] cx18: Fix a sleep-in-atomic bug in snd_cx18_pcm_hw_free
The driver may sleep under a spin lock, and the function call path is:
snd_cx18_pcm_hw_free (acquire the lock by spin_lock_irqsave)
vfree --> may sleep
To fix it, the "substream->runtime->dma_area" is passed to a temporary
value, and mark it NULL when holding the lock. The memory is freed by
vfree through the temporary value outside the lock holding.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
[hans.verkuil@cisco.com: removed unnecessary 'if (dma_area)']
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jia-Ju Bai [Thu, 1 Jun 2017 07:13:54 +0000 (04:13 -0300)]
[media] ivtv: Fix a sleep-in-atomic bug in snd_ivtv_pcm_hw_free
The driver may sleep under a spin lock, and the function call path is:
snd_ivtv_pcm_hw_free (acquire the lock by spin_lock_irqsave)
vfree --> may sleep
To fix it, the "substream->runtime->dma_area" is passed to a temporary
value, and mark it NULL when holding the lock. The memory is freed by
vfree through the temporary value outside the lock holding.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
[hans.verkuil@cisco.com: removed unnecessary 'if (dma_area)']
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kevin Hilman [Tue, 6 Jun 2017 23:37:40 +0000 (20:37 -0300)]
[media] davinci: vpif_capture: cleanup raw camera support
The current driver has a handful of hard-coded assumptions based on its
primary use for capture of video signals. Cleanup those assumptions,
and also query the subdev for format information and use that if
available.
Tested with 10-bit raw bayer input (SGRBG10) using the aptina,mt9v032
sensor, and also tested that composite video input still works from
ti,tvp514x decoder. Both tests done on the da850-evm board with the
add-on UI board.
NOTE: Will need further testing for other sensors with different bus
formats.
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kevin Hilman [Tue, 6 Jun 2017 23:37:39 +0000 (20:37 -0300)]
[media] davinci: vpif_capture: get subdevs from DT when available
Enable getting of subdevs from DT ports and endpoints.
The _get_pdata() function was larely inspired by (i.e. stolen from)
am437x-vpfe.c
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kevin Hilman [Tue, 6 Jun 2017 23:37:38 +0000 (20:37 -0300)]
[media] davinci: vpif_capture: drop compliance hack
Capture driver silently overrides pixel format with a hack (according to
the comments) to pass v4l2 compliance tests. This isn't needed for
normal functionality, and works for composite video and raw camera capture
without.
In addition, the hack assumes that it only supports raw capture with a
single format (SBGGR8) which isn't true. VPIF can also capture 10- and
12-bit raw formats as well. Forthcoming patches will enable VPIF
input with raw-camera support and has been tested with 10-bit format
from the aptina,mt9v032 sensor.
Any compliance failures should be fixed with a real fix.
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Anton Blanchard [Sun, 7 May 2017 01:00:11 +0000 (22:00 -0300)]
[media] ir-spi: Fix issues with lirc API
The ir-spi driver has 2 issues which prevents it from working with
lirc:
1. The ir-spi driver uses 16 bits of SPI data to create one cycle of
the waveform. As such our SPI clock needs to be 16x faster than the
carrier frequency.
The driver is inconsistent in how it currently handles this. It
initializes it to the carrier frequency:
But the commit message has some example code which initialises it
to 16x the carrier frequency:
val = 608000;
ret = ioctl(fd, LIRC_SET_SEND_CARRIER, &val);
To maintain compatibility with lirc, always do the frequency adjustment
in the driver.
2. lirc presents pulses in microseconds, but the ir-spi driver treats
them as cycles of the carrier. Similar to other lirc drivers, do the
conversion with DIV_ROUND_CLOSEST().
Fixes:
fe052da49201 ("[media] rc: add support for IR LEDs driven through SPI")
Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Johan Hovold [Thu, 1 Jun 2017 07:46:00 +0000 (04:46 -0300)]
[media] mceusb: drop redundant urb reinitialisation
Drop a since commit
e1159cb35712 ("[media] mceusb: remove pointless
mce_flush_rx_buffer function") redundant reinitialisation of two urb
fields immediately after they have been initialised.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Johan Hovold [Thu, 1 Jun 2017 07:45:59 +0000 (04:45 -0300)]
[media] mceusb: fix memory leaks in error path
Fix urb and transfer-buffer leaks in an urb-submission error path which
may be hit when a device is disconnected.
Fixes:
66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")
Cc: stable <stable@vger.kernel.org> # 2.6.36
Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Dave Stevenson [Fri, 2 Jun 2017 12:18:14 +0000 (09:18 -0300)]
[media] tc358743: Add support for platforms without IRQ line
interrupts is listed as an optional property in the DT
binding, but in reality the driver didn't work without it.
The existing driver relied on having the interrupt line
connected to the SoC to trigger handling various events.
Add the option to poll the interrupt status register via
a timer if no interrupt source is defined.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Dave Stevenson [Fri, 2 Jun 2017 12:18:13 +0000 (09:18 -0300)]
[media] tc358743: Setup default mbus_fmt before registering
Previously the mbus_fmt_code was set after the device was
registered. If a connected sub-device called tc358743_get_fmt
prior to that point it would get an invalid code back.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Dave Stevenson [Fri, 2 Jun 2017 12:18:12 +0000 (09:18 -0300)]
[media] tc358743: Add enum_mbus_code
There was no way to query the supported mbus formats from this
driver. enum_mbus_code is the function to expose that, so
implement it.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Wed, 31 May 2017 09:50:26 +0000 (06:50 -0300)]
[media] cec: improve debug messages
- use __func__ instead of writing the full function name
- drop debug message in cec_config_log_addr since the same information
will be reported later
- use debug level 1 for errors and infrequent events, use level 2 for
debugging CEC message traffic
- log when a transmit is retried, very useful to know when debugging
- debug messages now all start with lower case
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Arvind Yadav [Wed, 31 May 2017 09:31:54 +0000 (06:31 -0300)]
[media] tc358743: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Sakari Ailus [Mon, 29 May 2017 14:45:43 +0000 (11:45 -0300)]
[media] v4l2-ctrls: Correctly destroy mutex in v4l2_ctrl_handler_free()
The mutex that was initialised in v4l2_ctrl_handler_init_class() was not
destroyed in v4l2_ctrl_handler_free(). Do that.
Additionally, explicitly refer to the ctrl handler's mutex in mutex
initialisation for clarity.
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>
Sakari Ailus [Fri, 26 May 2017 08:21:37 +0000 (05:21 -0300)]
[media] v4l2-ctrls.c: Implement unlocked variant of v4l2_ctrl_handler_setup()
Sometimes the caller is already holding the control handler mutex and
using it to serialise something. Provide an unlocked variant of the same
function to be used in those cases.
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>
Hugues Fruchet [Fri, 19 May 2017 10:04:52 +0000 (07:04 -0300)]
[media] atmel-isi: code cleanup
Ensure that ISI is clocked before starting sensor sub device.
Remove un-needed type check in try_fmt().
Use clamp() macro for hardware capabilities.
Fix wrong tabulation to space.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Wed, 7 Jun 2017 10:50:43 +0000 (07:50 -0300)]
Merge tag 'media/v4.12-2' into patchwork
media fixes for v4.12-rc4
* tag 'media/v4.12-2': (598 commits)
[media] rc-core: race condition during ir_raw_event_register()
[media] cec: drop MEDIA_CEC_DEBUG
[media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER
[media] cec: select CEC_CORE instead of depend on it
[media] rainshadow-cec: ensure exit_loop is intialized
[media] atomisp: don't treat warnings as errors
Linux 4.12-rc3
x86/ftrace: Make sure that ftrace trampolines are not RWX
x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range()
selftests/ftrace: Add a testcase for many kprobe events
kprobes/x86: Fix to set RWX bits correctly before releasing trampoline
ftrace: Fix memory leak in ftrace_graph_release()
ipv4: add reference counting to metrics
net: ethernet: ax88796: don't call free_irq without request_irq first
ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets
sctp: fix ICMP processing if skb is non-linear
net: llc: add lock_sock in llc_ui_bind to avoid a race condition
PCI/msi: fix the pci_alloc_irq_vectors_affinity stub
blk-mq: Only register debugfs attributes for blk-mq queues
x86/timers: Move simple_udelay_calibration past init_hypervisor_platform
...
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Steven Toth [Tue, 6 Jun 2017 12:30:27 +0000 (09:30 -0300)]
[media] saa7164: fix double fetch PCIe access condition
Avoid a double fetch by reusing the values from the prior transfer.
Originally reported via https://bugzilla.kernel.org/show_bug.cgi?id=195559
Thanks to Pengfei Wang <wpengfeinudt@gmail.com> for reporting.
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Reported-by: Pengfei Wang <wpengfeinudt@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Pavel Machek [Sat, 27 May 2017 08:12:40 +0000 (05:12 -0300)]
[media] Doc*/media/uapi: fix control name
V4L2_CID_EXPOSURE_BIAS does not exist, fix documentation.
Signed-off-by: Pavel Machek <pavel@ucw.cz>
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>
Nori, Sekhar [Fri, 26 May 2017 10:55:27 +0000 (07:55 -0300)]
[media] davinci: vpif_capture: fix default pixel format for BT.656/BT.1120 video
For both BT.656 and BT.1120 video, the pixel format
used by VPIF is Y/CbCr 4:2:2 in semi-planar format
(Luma in one plane and Chroma in another). This
corresponds to NV16 pixel format.
This is documented in section 36.2.3 of OMAP-L138
Technical Reference Manual, SPRUH77A.
The VPIF driver incorrectly sets the default format
to V4L2_PIX_FMT_YUV422P. Fix it.
Reported-by: Alejandro Hernandez <ajhernandez@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Philipp Zabel [Mon, 22 May 2017 16:34:48 +0000 (13:34 -0300)]
[media] coda: improve colorimetry handling
The hardware codec is not colorspace aware. We should trust userspace to
set the correct colorimetry information on the OUTPUT queue and mirror
the exact same setting on the CAPTURE queue.
There is no reason to restrict colorspace to JPEG or REC709 only. Also,
set the default colorspace, as returned by calling VIDIOC_TRY/S_FMT with
V4L2_COLORSPACE_DEFAULT, initially.
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>