Hans Verkuil [Sat, 3 Feb 2018 13:24:44 +0000 (08:24 -0500)]
media: v4l2-subdev: implement VIDIOC_DBG_G_CHIP_INFO ioctl
The VIDIOC_DBG_G/S_REGISTER ioctls imply that VIDIOC_DBG_G_CHIP_INFO is also
present, since without that you cannot use v4l2-dbg.
Just like the implementation in v4l2-ioctl.c this can be implemented in the
core and no drivers need to be modified.
It also makes it possible for v4l2-compliance to properly test the
VIDIOC_DBG_G/S_REGISTER ioctls.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Fri, 2 Feb 2018 13:05:23 +0000 (08:05 -0500)]
media: v4l2-subdev: without controls return -ENOTTY
If the subdev did not define any controls, then return -ENOTTY if
userspace attempts to call these ioctls.
The control framework functions will return -EINVAL, not -ENOTTY if
vfh->ctrl_handler is NULL.
Several of these framework functions are also called directly from
drivers, so I don't want to change the error code there.
Found with vimc and 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>
Hans Verkuil [Wed, 7 Feb 2018 17:06:30 +0000 (12:06 -0500)]
media: vimc: use correct subdev functions
Instead of calling everything a MEDIA_ENT_F_ATV_DECODER, pick the
correct functions for these blocks.
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>
Hans Verkuil [Fri, 2 Feb 2018 13:00:32 +0000 (08:00 -0500)]
media: vimc: fix control event handling
The sensor subdev didn't handle control events. Add support for this.
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>
Mauro Carvalho Chehab [Mon, 26 Feb 2018 14:25:26 +0000 (09:25 -0500)]
media: tw9910: solve coding style issues
As we're adding this as a new driver, make checkpatch happier by
solving several style issues, using --fix-inplace at strict mode.
Some issues required manual work.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Mon, 26 Feb 2018 14:23:32 +0000 (09:23 -0500)]
media: ov772x: fix whitespace issues
As we're adding this as a new driver, make checkpatch happier by
solving some whitespace issues, using --fix-inplace.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Wed, 21 Feb 2018 17:48:04 +0000 (12:48 -0500)]
media: arch: sh: migor: Use new renesas-ceu camera driver
Migo-R platform uses sh_mobile_ceu camera driver, which is now being
replaced by a proper V4L2 camera driver named 'renesas-ceu'.
Move Migo-R platform to use the v4l2 renesas-ceu camera driver
interface and get rid of soc_camera defined components used to register
sensor drivers and of platform specific enable/disable routines.
Register clock source and GPIOs for sensor drivers, so they can use
clock and gpio APIs.
Also, memory for CEU video buffers is now reserved with membocks APIs,
and need to be declared as dma_coherent during machine initialization to
remove that architecture specific part from CEU driver.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
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>
Jacopo Mondi [Thu, 22 Feb 2018 09:47:19 +0000 (04:47 -0500)]
media: MAINTAINERS: Add entry for Techwell TW9910
Add entry for Techwell TW9910 video decoder. The driver is currently
orphaned.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Wed, 21 Feb 2018 17:48:03 +0000 (12:48 -0500)]
media: i2c: tw9910: Remove soc_camera dependencies
Remove soc_camera framework dependencies from tw9910 sensor driver.
- Handle clock and gpios
- Register async subdevice
- Remove soc_camera specific g/s_mbus_config operations
- Add kernel doc to driver interface header file
- Adjust build system
This commit does not remove the original soc_camera based driver as long
as other platforms depends on soc_camera-based CEU driver.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
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>
Jacopo Mondi [Wed, 21 Feb 2018 17:48:02 +0000 (12:48 -0500)]
media: i2c: Copy tw9910 soc_camera sensor driver
Copy the soc_camera based driver in v4l2 sensor driver directory.
This commit just copies the original file without modifying it.
No modification to KConfig and Makefile as soc_camera framework
dependencies need to be removed first in next commit.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Thu, 22 Feb 2018 09:47:18 +0000 (04:47 -0500)]
media: MAINTAINERS: Add entry for Omnivision OV772x
Add entry for Omnivision OV772x image sensor listing myself as maintainer
for 'Odd fixes' only, as I currently have access to a platform for
testing.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Wed, 21 Feb 2018 17:48:01 +0000 (12:48 -0500)]
media: i2c: ov772x: Support frame interval handling
Add support to ov772x driver for frame intervals handling and enumeration.
Tested with 10MHz and 24MHz input clock at VGA and QVGA resolutions for
10, 15 and 30 frame per second rates.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
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>
Jacopo Mondi [Wed, 21 Feb 2018 17:48:00 +0000 (12:48 -0500)]
media: i2c: ov772x: Remove soc_camera dependencies
Remove soc_camera framework dependencies from ov772x sensor driver.
- Handle clock and gpios
- Register async subdevice
- Remove soc_camera specific g/s_mbus_config operations
- Change image format colorspace from JPEG to SRGB as the two use the
same colorspace information but JPEG makes assumptions on color
components quantization that do not apply to the sensor
- Remove sizes crop from get_selection as driver can't scale
- Add kernel doc to driver interface header file
- Adjust build system
This commit does not remove the original soc_camera based driver as long
as other platforms depends on soc_camera-based CEU driver.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
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>
Jacopo Mondi [Wed, 21 Feb 2018 17:47:59 +0000 (12:47 -0500)]
media: i2c: Copy ov772x soc_camera sensor driver
Copy the soc_camera based driver in v4l2 sensor driver directory.
This commit just copies the original file without modifying it.
No modification to KConfig and Makefile as soc_camera framework
dependencies need to be removed first in next commit.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Thu, 22 Feb 2018 09:47:17 +0000 (04:47 -0500)]
media: MAINTAINERS: Add entry for Renesas CEU
Add entry for Renesas Capture Engine Interface listing myself as
maintainer.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Thu, 22 Feb 2018 10:37:19 +0000 (05:37 -0500)]
media: platform: Add Renesas CEU driver
Add driver for Renesas Capture Engine Unit (CEU).
The CEU interface supports capturing 'data' (YUV422) and 'images'
(NV[12|21|16|61]).
This driver aims to replace the soc_camera-based sh_mobile_ceu one.
Tested with ov7670 camera sensor, providing YUYV_2X8 data on Renesas RZ
platform GR-Peach.
Tested with ov7725 camera sensor on SH4 platform Migo-R.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: added two 'fall-through' comments]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Jacopo Mondi [Wed, 21 Feb 2018 17:47:56 +0000 (12:47 -0500)]
media: include: media: Add Renesas CEU driver interface
Add renesas-ceu header file.
Do not remove the existing sh_mobile_ceu.h one as long as the original
driver does not go away.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
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>
Jacopo Mondi [Wed, 21 Feb 2018 17:47:55 +0000 (12:47 -0500)]
media: dt-bindings: media: Add Renesas CEU bindings
Add bindings documentation for Renesas Capture Engine Unit (CEU).
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
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>
Mauro Carvalho Chehab [Mon, 26 Feb 2018 13:33:41 +0000 (08:33 -0500)]
media: imx: Don't initialize vars that won't be used
As reported by gcc:
+ drivers/staging/media/imx/imx-media-csi.c: warning: variable 'input_fi' set but not used [-Wunused-but-set-variable]: => 671:33
+ drivers/staging/media/imx/imx-media-csi.c: warning: variable 'pinctrl' set but not used [-Wunused-but-set-variable]: => 1742:18
input_fi is not used, so just remove it.
However, pinctrl should be used, as it devm_pinctrl_get_select_default()
is declared with attribute warn_unused_result. What's missing there
is an error handling code, in case it fails. Add it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Mon, 26 Feb 2018 13:31:28 +0000 (08:31 -0500)]
media: tvp541x: fix some kernel-doc parameters
Solve the following warnings:
+ drivers/media/i2c/tvp514x.c: warning: Excess function parameter 'a' description in 'tvp514x_g_frame_interval': => 759
+ drivers/media/i2c/tvp514x.c: warning: Excess function parameter 'a' description in 'tvp514x_s_frame_interval': => 784
+ drivers/media/i2c/tvp514x.c: warning: Function parameter or member 'ival' not described in 'tvp514x_g_frame_interval': => 759
+ drivers/media/i2c/tvp514x.c: warning: Function parameter or member 'ival' not described in 'tvp514x_s_frame_interval': => 784
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Mauro Carvalho Chehab [Mon, 26 Feb 2018 13:28:22 +0000 (08:28 -0500)]
media: ov7740: remove an unused var
Fix this warning regression:
drivers/media/i2c/ov7740.c: warning: variable 'ret' set but not used [-Wunused-but-set-variable]: => 276:6
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kieran Bingham [Mon, 8 Jan 2018 18:14:04 +0000 (13:14 -0500)]
media: i2c: adv748x: fix HDMI field heights
The ADV748x handles interlaced media using V4L2_FIELD_ALTERNATE field
types. The correct specification for the height on the mbus is the
image height, in this instance, the field height.
The AFE component already correctly adjusts the height on the mbus, but
the HDMI component got left behind.
Adjust the mbus height to correctly describe the image height of the
fields when processing interlaced video for HDMI pipelines.
Fixes:
3e89586a64df ("media: i2c: adv748x: add adv748x driver")
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Kieran Bingham [Mon, 8 Jan 2018 17:55:23 +0000 (12:55 -0500)]
media: v4l: doc: Clarify v4l2_mbus_fmt height definition
The v4l2_mbus_fmt width and height corresponds directly with the
v4l2_pix_format definitions, yet the differences in documentation make
it ambiguous what to do in the event of field heights.
Clarify this using the same text as is provided for the v4l2_pix_format
which is explicit on the matter, and by matching the terminology of
'image height' rather than the misleading 'frame height'.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antonio Cardace [Mon, 12 Feb 2018 18:35:25 +0000 (13:35 -0500)]
media: gspca: dtcs033: use %*ph to print small buffer
Use %*ph format to print small buffer as hex string.
Remove newline at the end of the format string as it would be duplicated
by the one supplied as last argument.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Antonio Cardace <anto.cardace@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Mon, 12 Feb 2018 11:45:32 +0000 (06:45 -0500)]
media: vivid: check if the cec_adapter is valid
If CEC is not enabled for the vivid driver, then the adap pointer is NULL
and 'adap->phys_addr' will fail.
Cc: <stable@vger.kernel.org> # for v4.12 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Antonio Cardace [Fri, 9 Feb 2018 14:13:26 +0000 (09:13 -0500)]
media: em28xx: use %*phC to print small buffers
Use %*phC format to print small buffers as hex strings
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Antonio Cardace <anto.cardace@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Thu, 8 Feb 2018 16:55:48 +0000 (11:55 -0500)]
media: cec: improve debugging
cec_transmit_msg_fh() first checked the message for errors, and only
after the message was found to be valid did it log the message contents.
However, that makes it hard to associate an error in the kernel log with
the message since the message contents was never logged in that case.
So swap the order: first log the message (once some very basic checks
are done), and only after that check for errors.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Corentin Labbe [Thu, 8 Feb 2018 08:31:07 +0000 (03:31 -0500)]
media: ivtv: remove ivtv-alsa-mixer
ivtv-alsa-mixer functions was introduced in commit
269c11fbac4f
("[media] ivtv, ivtv-alsa: Add initial ivtv-alsa interface driver for ivtv")
But according to commit message, ivtv-alsa-mixer.c was already dead code.
5 years after, we should remove it.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: removed forgotten ivtv-alsa-mixer.h include]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Corentin Labbe [Thu, 8 Feb 2018 08:26:14 +0000 (03:26 -0500)]
media: cx18: remove unused cx18-alsa-mixer
cx18-alsa-mixer functions are not used since commit
4cb565cc2700
("V4L/DVB: cx18: make it so cx18-alsa-main.c compiles") 9 year later,
let's just remove them.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:53:44 +0000 (11:53 -0500)]
media: platform: vivid-cec: use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 10 in order to give the compiler complete
information about the proper arithmetic to use. Notice that this
constant is used in a context that expects an expression of type
u64 (64 bits, unsigned).
The expression len * 10 * CEC_TIM_DATA_BIT_TOTAL is currently being
evaluated using 32-bit arithmetic.
Also, remove unnecessary parentheses and add a code comment to make it
clear what is the reason of the code change.
Addresses-Coverity-ID:
1454996 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:52:24 +0000 (11:52 -0500)]
media: platform: sh_veu: use 64-bit arithmetic instead of 32-bit
Cast left and top to dma_addr_t in order to give the compiler complete
information about the proper arithmetic to use. Notice that these
variables are being used in contexts that expect expressions of
type dma_addr_t (64 bit, unsigned).
Such expressions are currently being evaluated using 32-bit arithmetic.
Also, move the expression (((dma_addr_t)left * veu->vfmt_out.fmt->depth) >> 3)
at the end in order to avoid a line wrapping checkpatch.pl warning.
Addresses-Coverity-ID:
1056807 ("Unintentional integer overflow")
Addresses-Coverity-ID:
1056808 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:51:18 +0000 (11:51 -0500)]
media: rockchip/rga: use 64-bit arithmetic instead of 32-bit
Cast p to dma_addr_t in order to avoid a potential integer overflow.
This variable is being used in a context that expects an expression
of type dma_addr_t (u64).
The expression p << PAGE_SHIFT is currently being evaluated
using 32-bit arithmetic.
Addresses-Coverity-ID:
1458347 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:49:04 +0000 (11:49 -0500)]
media: pci: cx88-input: use 64-bit arithmetic instead of 32-bit
Add suffix LL to constant
1000000 in order to give the compiler
complete information about the proper arithmetic to use. Notice
that this constant is used in a context that expects an expression
of type ktime_t (64 bits, signed).
The expression ir->polling *
1000000 is currently being evaluated
using 32-bit arithmetic.
Addresses-Coverity-ID:
1392628 ("Unintentional integer overflow")
Addresses-Coverity-ID:
1392630 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:47:37 +0000 (11:47 -0500)]
media: i2c: max2175: use 64-bit arithmetic instead of 32-bit
Add suffix LL to constant 2 in order to give the compiler complete
information about the proper arithmetic to use. Notice that this
constant is used in a context that expects an expression of type
s64 (64 bits, signed).
The expression 2 * (clock_rate - abs_nco_freq) is currently being
evaluated using 32-bit arithmetic.
Addresses-Coverity-ID:
1446589 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:47:09 +0000 (11:47 -0500)]
media: dvb-frontends: ves1820: use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 10 in order to give the compiler complete
information about the proper arithmetic to use. Notice that this
constant is used in a context that expects an expression of type
u64 (64 bits, unsigned).
The expression fpxin = state->config->xin * 10 is currently being
evaluated using 32-bit arithmetic.
Addresses-Coverity-ID: 200604 ("Unintentional integer overflow")
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>
Gustavo A. R. Silva [Tue, 6 Feb 2018 16:46:59 +0000 (11:46 -0500)]
media: rtl2832: use 64-bit arithmetic instead of 32-bit in rtl2832_set_frontend
Add suffix ULL to constant 7 in order to give the compiler complete
information about the proper arithmetic to use. Notice that this
constant is used in a context that expects an expression of type
u64 (64 bits, unsigned).
The expression dev->pdata->clk * 7 is currently being evaluated
using 32-bit arithmetic.
Addresses-Coverity-ID:
1271223 ("Unintentional integer overflow")
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>
Masami Hiramatsu [Tue, 6 Feb 2018 08:02:23 +0000 (03:02 -0500)]
media: vb2: Fix videobuf2 to map correct area
Fixes vb2_vmalloc_get_userptr() to ioremap correct area.
Since the current code does ioremap the page address, if the offset > 0,
it does not do ioremap the last page and results in kernel panic.
This fixes to pass the size + offset to ioremap so that ioremap
can map correct area. Also, this uses __pfn_to_phys() to get the physical
address of given PFN.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Takao Orito <orito.takao@socionext.com>
Reported-by: Fumihiro ATSUMI <atsumi@infinitegra.co.jp>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alexandre Courbot [Mon, 5 Feb 2018 02:33:04 +0000 (21:33 -0500)]
media: v4l2_fh.h: add missing kconfig.h include
v4l2_fh.h uses the IS_ENABLED() macro and thus should include kconfig.h.
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Alexandre Courbot [Mon, 5 Feb 2018 02:24:43 +0000 (21:24 -0500)]
media: v4l: vidioc-prepare-buf.rst: fix link to VIDIOC_QBUF
The description for VIDIOC_PREPARE_BUF results in the following
sentence: "...before actually enqueuing it, using the ioctl VIDIOC_QBUF,
VIDIOC_DQBUF ioctl...".
The intent is to only refer to VIDIOC_QBUF though, so fix this.
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Hans Verkuil [Sat, 3 Feb 2018 13:18:14 +0000 (08:18 -0500)]
media: v4l2-ctrls.h: fix wrong copy-and-paste comment
The __v4l2_ctrl_modify_range is the unlocked variant, so the comment about
taking a lock is obviously wrong.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.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>
Sakari Ailus [Fri, 2 Feb 2018 10:08:59 +0000 (05:08 -0500)]
media: vb2: core: Finish buffers at the end of the stream
If buffers were prepared or queued and the buffers were released without
starting the queue, the finish mem op (corresponding to the prepare mem
op) was never called to the buffers.
Before commit
a136f59c0a1f there was no need to do this as in such a case
the prepare mem op had not been called yet. Address the problem by
explicitly calling finish mem op when the queue is stopped if the buffer
is in either prepared or queued state.
Fixes:
a136f59c0a1f ("[media] vb2: Move buffer cache synchronisation to prepare from queue")
Cc: stable@vger.kernel.org # for v4.13 and up
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>