Philipp Zabel [Fri, 14 Sep 2018 07:10:56 +0000 (03:10 -0400)]
media: imx-pxp: fix compilation on i386 or x86_64
Include the missing interrupt.h header to fix compilation on i386 or
x86_64:
../drivers/media/platform/imx-pxp.c:988:1: error: unknown type name 'irqreturn_t'
static irqreturn_t pxp_irq_handler(int irq, void *dev_id)
^
../drivers/media/platform/imx-pxp.c: In function 'pxp_irq_handler':
../drivers/media/platform/imx-pxp.c:1012:9: error: 'IRQ_HANDLED' undeclared (first use in this function)
return IRQ_HANDLED;
^
../drivers/media/platform/imx-pxp.c:1012:9: note: each undeclared identifier is reported only once for each function it appears in
../drivers/media/platform/imx-pxp.c: In function 'pxp_probe':
../drivers/media/platform/imx-pxp.c:1660:2: error: implicit declaration of function 'devm_request_threaded_irq' [-Werror=implicit-function-declaration]
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, pxp_irq_handler,
^
../drivers/media/platform/imx-pxp.c:1661:4: error: 'IRQF_ONESHOT' undeclared (first use in this function)
IRQF_ONESHOT, dev_name(&pdev->dev), dev);
Fixes:
51abcf7fdb70 ("media: imx-pxp: add i.MX Pixel Pipeline driver")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Ezequiel Garcia [Mon, 10 Sep 2018 15:21:54 +0000 (11:21 -0400)]
media: vicodec: Drop unused job_abort()
The vicodec does not use the aborting field. In fact, this driver
can't really cancel any work, since it performs all the work
in device_run().
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Ezequiel Garcia [Mon, 10 Sep 2018 15:21:53 +0000 (11:21 -0400)]
media: vicodec: Drop unneeded symbol dependency
The vicodec doesn't use the Subdev API, so drop the dependency.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Mon, 10 Sep 2018 15:00:40 +0000 (11:00 -0400)]
media: vicodec: set state->info before calling the encode/decode funcs
state->info was NULL since I completely forgot to set state->info.
Oops.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Ezequiel Garcia <ezequiel@collabora.com>
[hans.verkuil@cisco.com: re-add q_out which was removed by commit
703fe34bac]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Mon, 10 Sep 2018 15:00:39 +0000 (11:00 -0400)]
media: vicodec: check for valid format in v4l2_fwht_en/decode
These functions did not return an error if state->info was NULL
or an unsupported pixelformat was selected (should not happen,
but just to be on the safe side).
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Alexandre GRIVEAUX [Sun, 2 Sep 2018 12:36:40 +0000 (08:36 -0400)]
media: saa7134: add P7131_4871 analog inputs
The saa7134 Tiger board has a front panel connector at the back (labeled
panel 2 on the PCB), with S-VIDEO, composite and audio.
This patch adds those inputs.
Signed-off-by: Alexandre GRIVEAUX <agriveaux@deutnet.info>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Jia-Ju Bai [Sat, 1 Sep 2018 11:44:09 +0000 (07:44 -0400)]
media: pci: ivtv: Fix a sleep-in-atomic-context bug in ivtv_yuv_init()
The driver may sleep in a interrupt handler.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] kzalloc(GFP_KERNEL)
drivers/media/pci/ivtv/ivtv-yuv.c, 938:
kzalloc in ivtv_yuv_init
drivers/media/pci/ivtv/ivtv-yuv.c, 960:
ivtv_yuv_init in ivtv_yuv_next_free
drivers/media/pci/ivtv/ivtv-yuv.c, 1126:
ivtv_yuv_next_free in ivtv_yuv_setup_stream_frame
drivers/media/pci/ivtv/ivtv-irq.c, 827:
ivtv_yuv_setup_stream_frame in ivtv_irq_dec_data_req
drivers/media/pci/ivtv/ivtv-irq.c, 1013:
ivtv_irq_dec_data_req in ivtv_irq_handler
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 13 Aug 2018 21:32:17 +0000 (17:32 -0400)]
media: imx: work around false-positive warning, again
A warning that I thought to be solved by a previous patch of mine
has resurfaced with gcc-8:
media/imx/imx-media-csi.c: In function 'csi_link_validate':
media/imx/imx-media-csi.c:1025:20: error: 'upstream_ep' may be used uninitialized in this function [-Werror=maybe-uninitialized]
media/imx/imx-media-csi.c:1026:24: error: 'upstream_ep.bus_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
media/imx/imx-media-csi.c:127:19: error: 'upstream_ep.bus.parallel.bus_width' may be used uninitialized in this function [-Werror=maybe-uninitialized]
media/imx/imx-media-csi.c: In function 'csi_enum_mbus_code':
media/imx/imx-media-csi.c:132:9: error: '*((void *)&upstream_ep+12)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
media/imx/imx-media-csi.c:132:48: error: 'upstream_ep.bus.parallel.bus_width' may be used uninitialized in this function [-Werror=maybe-uninitialized]
I spent some more time digging in this time, and think I have a better
fix, bailing out of the function that either initializes or errors
out here, which simplifies the code enough for gcc to figure out
what is going on. The earlier partial workaround can be removed now,
as the new workaround is better.
Fixes:
890f27693f2a ("media: imx: work around false-positive warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Thu, 13 Sep 2018 12:00:39 +0000 (08:00 -0400)]
media: cec: remove cec-edid.c
Move cec_get_edid_phys_addr() to cec-adap.c. It's not worth keeping
a separate source for this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Thu, 13 Sep 2018 07:40:56 +0000 (03:40 -0400)]
media: cec/v4l2: move V4L2 specific CEC functions to V4L2
Several CEC functions are actually specific for use with receivers,
i.e. they should be part of the V4L2 subsystem, not CEC.
These functions deal with validating and modifying EDIDs for (HDMI)
receivers, and they do not actually have anything to do with the CEC
subsystem and whether or not CEC is enabled. The problem was that if
the CEC_CORE config option was not set, then these functions would
become stubs, but that's not right: they should always be valid.
So replace the cec_ prefix by v4l2_ and move them to v4l2-dv-timings.c.
Update all drivers that call these accordingly.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: <stable@vger.kernel.org> # for v4.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Thu, 13 Sep 2018 07:36:29 +0000 (03:36 -0400)]
media: cec: integrate cec_validate_phys_addr() in cec-api.c
The cec_phys_addr_validate() function will be moved to V4L2,
so use a simplified variant of that function in cec-api.c.
cec now no longer calls cec_phys_addr_validate() and it can
be safely moved to V4L2.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hans Verkuil [Thu, 13 Sep 2018 07:25:59 +0000 (03:25 -0400)]
media: cec: make cec_get_edid_spa_location() an inline function
This function is needed by both V4L2 and CEC, so move this to
cec.h as a static inline since there are no obvious shared
modules between the two subsystems.
This patch, together with the following ones, fixes a
dependency bug: if CEC_CORE is disabled, then building adv7604
(and other HDMI receivers) will fail because an essential
function is now stubbed out.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hugues Fruchet [Tue, 11 Sep 2018 13:48:21 +0000 (09:48 -0400)]
media: ov5640: fix restore of last mode set
Mode setting depends on last mode set, in particular
because of exposure calculation when downscale mode
change between subsampling and scaling.
At stream on the last mode was wrongly set to current mode,
so no change was detected and exposure calculation
was not made, fix this.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hugues Fruchet [Tue, 11 Sep 2018 13:48:20 +0000 (09:48 -0400)]
media: ov5640: fix auto controls values when switching to manual mode
When switching from auto to manual mode, V4L2 core is calling
g_volatile_ctrl() in manual mode in order to get the manual initial value.
Remove the manual mode check/return to not break this behaviour.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hugues Fruchet [Tue, 11 Sep 2018 13:48:19 +0000 (09:48 -0400)]
media: ov5640: fix wrong binning value in exposure calculation
ov5640_set_mode_exposure_calc() is checking binning value but
binning value read is buggy, fix this.
Rename ov5640_binning_on() to ov5640_get_binning() as per other
similar functions.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hugues Fruchet [Tue, 11 Sep 2018 13:48:18 +0000 (09:48 -0400)]
media: ov5640: fix auto gain & exposure when changing mode
Ensure that auto gain and auto exposure are well restored
when changing mode.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Hugues Fruchet [Tue, 11 Sep 2018 13:48:17 +0000 (09:48 -0400)]
media: ov5640: fix exposure regression
Symptom was black image when capturing HD or 5Mp picture
due to manual exposure set to 1 while it was intended to
set autoexposure to "manual", fix this.
Fixes:
bf4a4b518c20 ("media: ov5640: Don't force the auto exposure state at start time").
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Jacopo Mondi [Wed, 18 Jul 2018 10:06:23 +0000 (06:06 -0400)]
media: ov5640: Fix timings setup code
As of: commit
476dec012f4c ("media: ov5640: Add horizontal and vertical
totals") the timings parameters gets programmed separately from the
static register values array.
When changing capture mode, the vertical and horizontal totals gets
inspected by the set_mode_exposure_calc() functions, and only later
programmed with the new values. This means exposure, light banding
filter and shutter gain are calculated using the previous timings, and
are thus not correct.
Fix this by programming timings right after the static register value
table has been sent to the sensor in the ov5640_load_regs() function.
Fixes:
476dec012f4c ("media: ov5640: Add horizontal and vertical totals")
Tested-by: Steve Longerbeam <slongerbeam@gmail.com> # i.MX6q SabreSD, CSI-2
Tested-by: Loic Poulain <loic.poulain@linaro.org> # Dragonboard-410c, CSI-2
Signed-off-by: Samuel Bobrowicz <sam@elite-embedded.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Jacopo Mondi [Fri, 6 Jul 2018 09:51:52 +0000 (05:51 -0400)]
media: ov5640: Re-work MIPI startup sequence
Rework the MIPI interface startup sequence with the following changes:
- Remove MIPI bus initialization from the initial settings blob
- At set_power(1) time power up MIPI Tx/Rx and set data and clock lanes in
LP11 during 'sleep' and 'idle' with MIPI clock in non-continuous mode.
- At s_stream time enable/disable the MIPI interface output.
- Restore default settings at set_power(0) time.
Before this commit the sensor MIPI interface was initialized with settings
that require a start/stop sequence at power-up time in order to force lanes
into LP11 state, as they were initialized in LP00 when in 'sleep mode',
which is assumed to be the sensor manual definition for the D-PHY defined
stop mode.
The stream start/stop was performed by enabling disabling clock gating,
and had the side effect to change the lanes sleep mode configuration when
stream was stopped.
Clock gating/ungating:
- ret = ov5640_mod_reg(sensor, OV5640_REG_MIPI_CTRL00, BIT(5),
- on ? 0 : BIT(5));
- if (ret)
Set lanes in LP11 when in 'sleep mode':
- ret = ov5640_write_reg(sensor, OV5640_REG_PAD_OUTPUT00,
- on ? 0x00 : 0x70);
This commit fixes an issue reported by Jagan Teki on i.MX6 platforms that
prevents the host interface from powering up correctly:
https://lkml.org/lkml/2018/6/1/38
It also improves MIPI capture operations stability on my testing platform
where MIPI capture often failed and returned all-purple frames.
Fixes:
f22996db44e2 ("media: ov5640: add support of DVP parallel interface")
Tested-by: Steve Longerbeam <slongerbeam@gmail.com> (i.MX6q SabreSD, CSI-2)
Tested-by: Loic Poulain <loic.poulain@linaro.org> (Dragonboard-410c, CSI-2)
Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Javier Martinez Canillas [Sat, 1 Sep 2018 12:46:30 +0000 (08:46 -0400)]
media: ov2680: rename ov2680_v4l2_init() to ov2680_v4l2_register()
The function not only does initialization but also registers the subdevice
so change its name to make this more clear.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Javier Martinez Canillas [Sat, 1 Sep 2018 12:46:29 +0000 (08:46 -0400)]
media: ov2680: don't register the v4l2 subdevice before checking chip ID
The driver registers the v4l2 subdevice before attempting to power on the
chip and checking its ID. This means that a media device driver that it's
waiting for this subdevice to be bound, will prematurely expose its media
device node to userspace because if something goes wrong the media entity
will be cleaned up again on the ov2680 probe function.
This also simplifies the probe function error path since no initialization
is made before attempting to enable the resources or checking the chip ID.
Fixes:
3ee47cad3e69 ("media: ov2680: Add Omnivision OV2680 sensor driver")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Dan Carpenter [Fri, 31 Aug 2018 13:20:18 +0000 (09:20 -0400)]
media: sr030pc30: remove NULL in sr030pc30_base_config()
This code doesn't check for NULL consistently and it generates a Smatch
warning:
drivers/media/i2c/sr030pc30.c:575 sr030pc30_base_config()
error: we previously assumed 'info->pdata' could be null (see line 572)
Fortunately, "info->pdata" can't be NULL to that check can be removed.
The other thing is that if "ret" is an error code here, then we don't
want to do the next call to cam_i2c_write(), so actually let's flip that
test around and return the error. This is more of a theoretical issue
than something which is likely to affect real life.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Sakari Ailus [Wed, 29 Aug 2018 10:01:48 +0000 (06:01 -0400)]
media: v4l: sr030pc30: Remove redundant setting of sub-device name
The sub-device name is set right after in v4l2_i2c_subdev_init(). Remove
the redundant strcpy() call.
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+samsung@kernel.org>
Sakari Ailus [Wed, 29 Aug 2018 09:57:36 +0000 (05:57 -0400)]
media: smiapp: Use v4l2_i2c_subdev_set_name
Use v4l2_i2c_subdev_set_name() to set the name of the smiapp driver's
sub-devices. There is no functional change.
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+samsung@kernel.org>
Sakari Ailus [Wed, 29 Aug 2018 09:52:46 +0000 (05:52 -0400)]
media: v4l: subdev: Add a function to set an I²C sub-device's name
v4l2_i2c_subdev_set_name() can be used to assign a name to a sub-device.
This way uniform names can be formed easily without having to resort to
things such as snprintf in drivers.
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+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:25 +0000 (12:35 -0400)]
media: imx274: switch to SPDX license identifier
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:24 +0000 (12:35 -0400)]
media: imx274: add helper to read multibyte registers
Currently 2-bytes and 3-bytes registers are read one byte at a time,
doing the needed shift & mask each time.
Replace all of this code by a unique helper function that calls
regmap_bulk_read(), which has two advantages:
- reads all the bytes in a unique I2C transaction
- simplifies code to read multibyte registers
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:23 +0000 (12:35 -0400)]
media: imx274: fix error in function docs
This parameter holds the number of bytes, not bits.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:22 +0000 (12:35 -0400)]
media: imx274: rename frmfmt and format to "mode"
A mix of "mode", "format" and "frmfmt" is used to refer to the sensor
readout mode. Use the term "mode" for all of them. Now "format" is
only used in the V4L2 meaning.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:21 +0000 (12:35 -0400)]
media: imx274: don't hard-code the subdev name to DRIVER_NAME
Forcibly setting the subdev name to DRIVER_NAME (i.e. "IMX274") makes
it non-unique and less informative.
Let the driver use the default name from i2c, e.g. "IMX274 2-001a".
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:20 +0000 (12:35 -0400)]
media: imx274: rearrange sensor startup register tables
Rearrange the imx274_start_<N> register tables to better match the
datasheet and slightly simplify code:
- collapes tables 1 and 2, they are applied one after each other and
together they implement the fixed part 1 of the startup procedure
in the datasheet
- while there, cleanup comments
- rename tables 3 and 4 -> 2 and 3, coherently with the datasheet
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Luca Ceresoli [Fri, 24 Aug 2018 16:35:19 +0000 (12:35 -0400)]
media: imx274: rename IMX274_DEFAULT_MODE to IMX274_DEFAULT_BINNING
The "mode" has been renamed to "binning" in commit
39dd23dc9d4c
("media: imx274: add cropping support via SELECTION API"), but this
define has not been updated.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Sakari Ailus [Fri, 20 Jul 2018 21:04:50 +0000 (17:04 -0400)]
media: dw9807-vcm: Remove redundant pm_runtime_set_suspended in remove
The device is already suspended when it's the driver's remove function is
called. Remove redundant pm_runtime_set_suspended call.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Sakari Ailus [Thu, 19 Jul 2018 11:54:28 +0000 (07:54 -0400)]
media: dt-bindings: dw9714, dw9807-vcm: Add files to MAINTAINERS, rename files
Add the DT binding documentation for dw9714 and dw9807-vcm to the
MAINTAINERS file. The dw9807-vcm binding documentation file is renamed to
match the dw9807's VCM bit's compatible string.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Fri, 14 Sep 2018 14:26:52 +0000 (10:26 -0400)]
media: vsp1: Document max_width restriction on UDS
The UDS is currently restricted based on a partition size of 256 pixels.
Document the actual restrictions, but don't increase the implementation.
The extended partition algorithm may later choose to utilise a larger
partition size to support overlapping partitions which will improve the
quality of the output images.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Fri, 14 Sep 2018 14:26:51 +0000 (10:26 -0400)]
media: vsp1: Document max_width restriction on SRU
The SRU is currently restricted to 256 pixels as part of the current
partition algorithm. Document that the actual capability of this
component is 288 pixels, but don't increase the implementation.
The extended partition algorithm may later choose to utilise a larger
input to support overlapping partitions which will improve the quality
of the output images.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Fri, 31 Aug 2018 14:40:44 +0000 (10:40 -0400)]
media: vsp1: use periods at the end of comment sentences
The style of this driver uses periods at the end of sentences in
comments, but it is applied inconsitently.
Update a selection of comments which were discovered to be missing their
period. Also fix the spelling of one usage of 'instantiate'
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Fri, 31 Aug 2018 14:40:39 +0000 (10:40 -0400)]
media: vsp1: Remove artificial minimum width/height limitation
The VSP1 has a minimum width and height of a single pixel, with the
exception of pixel formats with sub-sampling.
Remove the artificial minimum width and minimum height limitation, and
instead clamp the minimum dimensions based upon the sub-sampling
parameter of that dimension.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Koji Matsuoka [Thu, 26 Oct 2017 06:27:51 +0000 (02:27 -0400)]
media: vsp1: Fix YCbCr planar formats pitch calculation
YCbCr planar formats can have different pitch values for the luma and
chroma planes. This isn't taken into account in the driver. Fix it.
Based on a BSP patch from Koji Matsuoka <koji.matsuoka.xm@renesas.com>.
Fixes:
7863ac504bc5 ("drm: rcar-du: Add tri-planar memory formats support")
[Updated documentation of the struct vsp1_du_atomic_config pitch field]
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Laurent Pinchart [Thu, 26 Oct 2017 06:27:51 +0000 (02:27 -0400)]
media: vsp1: Update LIF buffer thresholds
The LIF module has a data buffer to accommodate clock rate differences
between the DU and the VSP. Several programmable threshold values
control DU start of frame notification by the VSP and VSP clock
stop/resume. The R-Car Gen2 and Gen3 datasheets recommend values for the
different SoCs. Update the driver to use the recommended values for
optimal operation.
Based on a BSP patch from Koji Matsuoka <koji.matsuoka.xm@renesas.com>,
with Gen2 and V3H/V3M updates.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Laurent Pinchart [Fri, 27 Apr 2018 21:41:12 +0000 (17:41 -0400)]
media: vsp1: Fix vsp1_regs.h license header
All source files of the vsp1 driver are licensed under the GPLv2+ except
for vsp1_regs.h which is licensed under GPLv2. This is caused by a bad
copy&paste that dates back from the initial version of the driver. Fix
it.
Acked-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Sergei Shtylyov<sergei.shtylyov@cogentembedded.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Mon, 6 Aug 2018 14:39:02 +0000 (10:39 -0400)]
media: MAINTAINERS: VSP1: Add co-maintainer
Add myself as a co-maintainer for the Renesas VSP driver.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 14:16:48 +0000 (10:16 -0400)]
media: tvp5150: get rid of some warnings
The recent tvp5150 patchset added two new warnings:
drivers/media/i2c/tvp5150.c: In function 'tvp5150_querystd':
drivers/media/i2c/tvp5150.c:829:18: warning: unused variable 'decoder' [-Wunused-variable]
struct tvp5150 *decoder = to_tvp5150(sd);
^~~~~~~
drivers/media/i2c/tvp5150.c:1522:6: warning: no previous prototype for 'tvp5150_volatile_reg' [-Wmissing-prototypes]
bool tvp5150_volatile_reg(struct device *dev, unsigned int reg)
^~~~~~~~~~~~~~~~~~~~
Get rid of them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 14:09:24 +0000 (10:09 -0400)]
media: tvp5150: implement decoder lock when irq is not used
When irq is used, the lock is set via IRQ code. When it isn't,
the driver just assumes it is always locked. Instead, read the
lock status from the status register.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:48 +0000 (12:20 -0400)]
media: tvp5150: add querystd
Add the querystd video_op and make it return V4L2_STD_UNKNOWN while the
TVP5150 is not locked to a signal.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:49 +0000 (12:20 -0400)]
media: tvp5150: add g_std callback
Add callback to retrieve the current set norm.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:47 +0000 (12:20 -0400)]
media: tvp5150: add sync lock/loss signal debug messages
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:46 +0000 (12:20 -0400)]
media: tvp5150: issue source change events
Issue a V4L2_EVENT_SOURCE_CHANGE notification when the TVP5150 locks
onto a signal and when it loses the lock.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[m.felsch@pengutronix.de: partly mainline part port]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:45 +0000 (12:20 -0400)]
media: tvp5150: disable output while signal not locked
To avoid short frames on stream start, keep output pins at high impedance
while we are not properly locked onto the input signal.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:44 +0000 (12:20 -0400)]
media: tvp5150: Add sync lock interrupt handling
This patch adds an optional interrupt handler to handle the sync
lock interrupt and sync lock status.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[m.felsch@pengutronix.de: move added .g_std callback to separate patch]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:43 +0000 (12:20 -0400)]
media: tvp5150: remove pin configuration from initialization tables
To allow optional interrupt support, we want to configure the pin settings
dynamically. Move those register accesses out of the static initialization
tables.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[m.felsch@pengutronix.de: drop init_default register remove]
[m.felsch@pengutronix.de: fix regmap access during reset()]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:42 +0000 (12:20 -0400)]
media: tvp5150: split reset/enable routine
To trigger standard autodetection only the reset part of the routine
is necessary during probe(). Split this out to make it callable on its own.
[m.felsch@pengutronix.de: adapt commit message]
[m.felsch@pengutronix.de: add tvp5150_enable() to tvp5150_s_stream()]
[m.chehab@samsung.com: fix a compilation breakage]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:41 +0000 (12:20 -0400)]
media: tvp5150: fix standard autodetection
Make sure to not overwrite decoder->norm when setting the standard
in hardware, but only when instructed by V4L2 API calls.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:40 +0000 (12:20 -0400)]
media: tvp5150: trigger autodetection on subdev open to reset cropping
If cropping isn't set explicitly by userspace, reset it to the maximum
possible rectangle in subdevice open if a standard change is detected.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[m.felsch@pengutronix.de: move code from internal_ops.open() to pad_ops.init_cfg()]
[m.felsch@pengutronix.de: make use of tvp5150_set_default() helper]
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:39 +0000 (12:20 -0400)]
media: tvp5150: add default format helper
The patch adds three macros to bundle the mbus_framefmt default
values and a helper function to set the the default crop and
mbus_framefmt values.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:37 +0000 (12:20 -0400)]
media: v4l2-rect.h: add position and equal helpers
Add two helper functions to check if two rectangles have the same
position (top/left) and if two rectangles equals (same size and
same position).
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:36 +0000 (12:20 -0400)]
media: tvp5150: make use of regmap_update_bits
Since commit
9a4c7e68f7e0 ("media: tvp5150: convert register
access to regmap")' the driver supports regmap. Now we can drop
the handmade bit update sequence and move to the regmap provided
helpers.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Philipp Zabel [Thu, 28 Jun 2018 16:20:35 +0000 (12:20 -0400)]
media: tvp5150: convert register access to regmap
Regmap provides built in debugging, caching and provides dedicated
accessors for bit manipulations in registers, which make the following
changes a lot simpler.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:34 +0000 (12:20 -0400)]
media: tvp5150: fix switch exit in set control handler
The function only consists of a single switch case block without a
default case. Unsupported control requests are indicated by the -EINVAL
return code trough the last return statement at the end of the function. So
exiting just the switch case block returns the -EINVAL error code but the
hue control is supported and a zero should be returned instead.
Replace the break by a 'return 0' to fix this behaviour.
Fixes:
d183e4efcae8 ("[media] v4l: tvp5150: Add missing break in set
control handler")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Marco Felsch [Thu, 28 Jun 2018 16:20:33 +0000 (12:20 -0400)]
media: tvp5150: fix width alignment during set_selection()
The driver ignored the width alignment which exists due to the UYVY
colorspace format. Fix the width alignment and make use of the the
provided v4l2 helper function to set the width, height and all
alignments in one.
Fixes:
963ddc63e20d ("[media] media: tvp5150: Add cropping support")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:58:38 +0000 (06:58 -0400)]
media: v4l2-mc: get rid of global pad indexes
Now that all drivers are using pad signal types, we can get
rid of the global static definition, as routes are stablished
using the pad signal type.
The tuner and IF-PLL pads are now used only by the tuner core,
so move the definitions to be there.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:57:19 +0000 (06:57 -0400)]
media: mxl111sf: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:20:27 +0000 (06:20 -0400)]
media: saa7134: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:15:22 +0000 (06:15 -0400)]
media: si2157: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:10:05 +0000 (06:10 -0400)]
media: tvp5150: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:07:09 +0000 (06:07 -0400)]
media: saa7115: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 10:04:13 +0000 (06:04 -0400)]
media: msp3400: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 09:06:39 +0000 (05:06 -0400)]
media: au8522: declare its own pads
As we don't need anymore to share pad numbers with similar
drivers, use its own pad definition instead of a global
model.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Wed, 1 Aug 2018 09:36:15 +0000 (05:36 -0400)]
media: au0828: use signals instead of hardcoding a pad number
When creating the audio link, use pad signals, instead of
hardcoding using the pad index number.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Tue, 31 Jul 2018 16:43:39 +0000 (12:43 -0400)]
media: dvb: use signal types to discover pads
On tuner pads, multiple signals are present. Be sure to get
the right PAD by using them.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Sat, 15 Sep 2018 04:00:31 +0000 (00:00 -0400)]
media: v4l2-mc: add print messages when media graph fails
It is not trivial to debug troubles at media graph build.
So, add print messages to help debug what's happening,
in the case of an error occurs.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Tue, 31 Jul 2018 13:22:40 +0000 (09:22 -0400)]
media: v4l2-mc: switch it to use the new approach to setup pipelines
Instead of relying on a static map for pids, use the new sig_type
"taint" type to setup the pipelines with the same tipe between
different entities.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Tue, 31 Jul 2018 12:03:48 +0000 (08:03 -0400)]
media: v4l2: taint pads with the signal types for consumer devices
Consumer devices are provided with a wide different range of types
supported by the same driver, allowing different configutations.
In order to make easier to setup media controller links, "taint"
pads with the signal type it carries.
While here, get rid of DEMOD_PAD_VBI_OUT, as the signal it carries
is actually the same as the normal video output.
The difference happens at the video/VBI interface:
- for VBI, only the hidden lines are streamed;
- for video, the stream is usually cropped to hide the
vbi lines.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Tue, 31 Jul 2018 16:48:05 +0000 (12:48 -0400)]
media: v4l2: remove VBI output pad
The signal there is the same as the video output (well,
except for sliced VBI, but let's simplify the model and ignore
it, at least for now - as it is routed together with raw
VBI).
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Fri, 14 Sep 2018 02:46:29 +0000 (22:46 -0400)]
media: em28xx: make v4l2-compliance happier by starting sequence on zero
The v4l2-compliance tool complains if a video doesn't start
with a zero sequence number.
While this shouldn't cause any real problem for apps, let's
make it happier, in order to better check the v4l2-compliance
differences before and after patchsets.
This is actually an old issue. It is there since at least its
videobuf2 conversion, e. g. changeset
3829fadc461 ("[media]
em28xx: convert to videobuf2"), if VB1 wouldn't suffer from
the same issue.
Cc: stable@vger.kernel.org
Fixes:
d3829fadc461 ("[media] em28xx: convert to videobuf2")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Fri, 14 Sep 2018 04:20:21 +0000 (00:20 -0400)]
media: em28xx: fix input name for Terratec AV 350
Instead of using a register value, use an AMUX name, as otherwise
VIDIOC_G_AUDIO would fail.
Cc: stable@vger.kernel.org
Fixes:
766ed64de554 ("V4L/DVB (11827): Add support for Terratec Grabster AV350")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Fri, 14 Sep 2018 03:22:40 +0000 (23:22 -0400)]
media: em28xx: use a default format if TRY_FMT fails
Follow the V4L2 spec, as warned by v4l2-compliance:
warn: v4l2-test-formats.cpp(732): TRY_FMT cannot handle an invalid pixelformat.
warn: v4l2-test-formats.cpp(733): This may or may not be a problem. For more information see:
warn: v4l2-test-formats.cpp(734): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html
Cc: stable@vger.kernel.org
Fixes:
bddcf63313c6 ("V4L/DVB (9927): em28xx: use a more standard way to specify video formats")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Fri, 14 Sep 2018 17:13:15 +0000 (13:13 -0400)]
media: em28xx: fix handler for vidioc_s_input()
The a->index is not the name of the internal amux entry,
but, instead a value from zero to the maximum number
of audio inputs.
As the actual available inputs depend on each board, build
it dynamically.
This is broken for a really long time. On a quick check,
since at least commit
195a4ef627e1 ("V4L/DVB (6585): Convert
em28xx to video_ioctl2") this was not implemented right.
Fixes:
195a4ef627e1 ("V4L/DVB (6585): Convert em28xx to video_ioctl2")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mauro Carvalho Chehab [Thu, 13 Sep 2018 20:49:51 +0000 (16:49 -0400)]
media: tvp5150: avoid going past array on v4l2_querymenu()
The parameters of v4l2_ctrl_new_std_menu_items() are tricky: instead of
the number of possible values, it requires the number of the maximum
value. In other words, the ARRAY_SIZE() value should be decremented,
otherwise it will go past the array bounds, as warned by KASAN:
[ 279.839688] BUG: KASAN: global-out-of-bounds in v4l2_querymenu+0x10d/0x180 [videodev]
[ 279.839709] Read of size 8 at addr
ffffffffc10a4cb0 by task v4l2-compliance/16676
[ 279.839736] CPU: 1 PID: 16676 Comm: v4l2-compliance Not tainted 4.18.0-rc2+ #120
[ 279.839741] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017
[ 279.839743] Call Trace:
[ 279.839758] dump_stack+0x71/0xab
[ 279.839807] ? v4l2_querymenu+0x10d/0x180 [videodev]
[ 279.839817] print_address_description+0x1c9/0x270
[ 279.839863] ? v4l2_querymenu+0x10d/0x180 [videodev]
[ 279.839871] kasan_report+0x237/0x360
[ 279.839918] v4l2_querymenu+0x10d/0x180 [videodev]
[ 279.839964] __video_do_ioctl+0x2c8/0x590 [videodev]
[ 279.840011] ? copy_overflow+0x20/0x20 [videodev]
[ 279.840020] ? avc_ss_reset+0xa0/0xa0
[ 279.840028] ? check_stack_object+0x21/0x60
[ 279.840036] ? __check_object_size+0xe7/0x240
[ 279.840080] video_usercopy+0xed/0x730 [videodev]
[ 279.840123] ? copy_overflow+0x20/0x20 [videodev]
[ 279.840167] ? v4l_enumstd+0x40/0x40 [videodev]
[ 279.840177] ? __handle_mm_fault+0x9f9/0x1ba0
[ 279.840186] ? __pmd_alloc+0x2c0/0x2c0
[ 279.840193] ? __vfs_write+0xb6/0x350
[ 279.840200] ? kernel_read+0xa0/0xa0
[ 279.840244] ? video_usercopy+0x730/0x730 [videodev]
[ 279.840284] v4l2_ioctl+0xa1/0xb0 [videodev]
[ 279.840295] do_vfs_ioctl+0x117/0x8a0
[ 279.840303] ? selinux_file_ioctl+0x211/0x2f0
[ 279.840313] ? ioctl_preallocate+0x120/0x120
[ 279.840319] ? selinux_capable+0x20/0x20
[ 279.840332] ksys_ioctl+0x70/0x80
[ 279.840342] __x64_sys_ioctl+0x3d/0x50
[ 279.840351] do_syscall_64+0x6d/0x1c0
[ 279.840361] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 279.840367] RIP: 0033:0x7fdfb46275d7
[ 279.840369] Code: b3 66 90 48 8b 05 b1 48 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 81 48 2d 00 f7 d8 64 89 01 48
[ 279.840474] RSP: 002b:
00007ffee1179038 EFLAGS:
00000202 ORIG_RAX:
0000000000000010
[ 279.840483] RAX:
ffffffffffffffda RBX:
00007ffee1179180 RCX:
00007fdfb46275d7
[ 279.840488] RDX:
00007ffee11790c0 RSI:
00000000c02c5625 RDI:
0000000000000003
[ 279.840493] RBP:
0000000000000002 R08:
0000000000000020 R09:
00000000009f0902
[ 279.840497] R10:
0000000000000000 R11:
0000000000000202 R12:
00007ffee117a5a0
[ 279.840501] R13:
00007ffee11790c0 R14:
0000000000000002 R15:
0000000000000000
[ 279.840515] The buggy address belongs to the variable:
[ 279.840535] tvp5150_test_patterns+0x10/0xffffffffffffe360 [tvp5150]
Fixes:
c43875f66140 ("[media] tvp5150: replace MEDIA_ENT_F_CONN_TEST by a control")
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Gustavo A. R. Silva [Mon, 3 Sep 2018 20:26:13 +0000 (16:26 -0400)]
media: drxj: fix spelling mistake in fall-through annotations
Replace "falltrough" with a proper "fall through" annotation.
This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Rob Herring [Tue, 28 Aug 2018 01:52:29 +0000 (21:52 -0400)]
media: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.
Cc: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Cc: Benoit Parrot <bparrot@ti.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Hyun Kwon <hyun.kwon@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 27 Aug 2018 19:56:25 +0000 (15:56 -0400)]
media: dvb: move compat handlers into drivers
The VIDEO_STILLPICTURE is only implemented by one driver, while
VIDEO_GET_EVENT has two users in tree. In both cases, it is fairly
easy to handle the compat ioctls in the native handler rather
than relying on translation in fs/compat_ioctls.
In effect, this means that now the drivers implement both structure
layouts in both native and compat mode, but I don't see anything
wrong with that.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 27 Aug 2018 19:56:24 +0000 (15:56 -0400)]
media: dvb: move most compat_ioctl handling into drivers
Most DVB audio and video ioctl commands are completely compatible,
and are implemented by just two drivers: ttpci and ivtv. In both
cases, we can use the same ioctl handler for both native and
compat ioctl handling, and remove the entries from the global
lookup table.
In case of ttpci, this directly hooks into the file_operations
structure, and for ivtv, we have to set the compat_ioctl32
method in v4l2_file_operations. For all I can tell, setting it
to video_ioctl2 will still do the right thing for all commands.
Note that for the VIDEO_STILLPICTURE and VIDEO_GET_EVENT commands,
a translation handler in fs/compat_ioctl.c is still used. This
works because the command numbers are different on 32-bit
systems.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 27 Aug 2018 19:56:23 +0000 (15:56 -0400)]
media: cec: move compat_ioctl handling to cec-api.c
All the CEC ioctls are compatible, and they are only implemented
in one driver, so we can simply let this driver handle them
natively.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 27 Aug 2018 19:56:22 +0000 (15:56 -0400)]
media: dvb: dmxdev: move compat_ioctl handling to dmxdev.c
All dmx ioctls are compatible, and they are only implemented
in one file, so we can replace the list of commands in
fs/compat_ioctl.c with a single line in dmxdev.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Arnd Bergmann [Mon, 27 Aug 2018 19:56:21 +0000 (15:56 -0400)]
media: dvb: fix compat ioctl translation
The VIDEO_GET_EVENT and VIDEO_STILLPICTURE was added back in 2005 but
it never worked because the command number is wrong.
Using the right command number means we have a better chance of them
actually doing the right thing, though clearly nobody has ever tried
it successfully.
I noticed these while auditing the remaining users of compat_time_t
for y2038 bugs. This one is fine in that regard, it just never did
anything.
Fixes:
6e87abd0b8cb ("[DVB]: Add compat ioctl handling.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Wed, 22 Aug 2018 02:00:09 +0000 (22:00 -0400)]
media: i2c: max2175: convert to SPDX identifiers
This patch updates license to use SPDX-License-Identifier
instead of verbose license text.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
zhong jiang [Sat, 18 Aug 2018 15:16:55 +0000 (11:16 -0400)]
media: mtk_vcodec_util: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset
dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset(),
We prefer to dma_zalloc_coherent instead of open-codeing.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Lao Wei [Mon, 9 Jul 2018 12:15:53 +0000 (08:15 -0400)]
media: fix: media: pci: meye: validate offset to avoid arbitrary access
Motion eye video4linux driver for Sony Vaio PictureBook desn't validate user-controlled parameter
'vma->vm_pgoff', a malicious process might access all of kernel memory from user space by trying
pass different arbitrary address.
Discussion: http://www.openwall.com/lists/oss-security/2018/07/06/1
Signed-off-by: Lao Wei <zrlw@qq.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Thu, 9 Aug 2018 19:29:44 +0000 (15:29 -0400)]
media: dt-bindings: media: adv748x: Document re-mappable addresses
The ADV748x supports configurable slave addresses for its I2C pages.
Document the page names, and provide an example for setting each of the
pages explicitly.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Wed, 8 Aug 2018 16:33:51 +0000 (12:33 -0400)]
media: dt-bindings: media: adv7604: Fix slave map documentation
The reg-names property in the documentation is missing an '='. Add it.
Fixes:
9feb786876c7 ("media: dt-bindings: media: adv7604: Extend
bindings to allow specifying slave map addresses")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kieran Bingham [Mon, 6 Aug 2018 14:39:03 +0000 (10:39 -0400)]
media: MAINTAINERS: FDP1: Update e-mail address.
This entry was created with my personal e-mail address. Update with
the correct work related account.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:19:00 +0000 (23:19 -0400)]
media: backlight: as3711_bl: convert to SPDX identifiers
This patch updates license to use SPDX-License-Identifier
instead of verbose license text.
As original license mentioned, it is GPL-2.0 in SPDX.
Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL".
See ${LINUX}/include/linux/module.h
"GPL" [GNU Public License v2 or later]
"GPL v2" [GNU Public License v2]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:18:42 +0000 (23:18 -0400)]
media: fbdev: sh7760fb: convert to SPDX identifiers
This patch updates license to use SPDX-License-Identifier
instead of verbose license text.
As original license mentioned, it is GPL-2.0 in SPDX.
Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL".
See ${LINUX}/include/linux/module.h
"GPL" [GNU Public License v2 or later]
"GPL v2" [GNU Public License v2]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:18:22 +0000 (23:18 -0400)]
media: drm: panel-lvds: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:18:05 +0000 (23:18 -0400)]
media: drm: shmobile: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:17:48 +0000 (23:17 -0400)]
media: adv748x: convert to SPDX identifiers
As original license mentioned, it is GPL-2.0+ in SPDX.
Then, MODULE_LICENSE() should be "GPL" instead of "GPL v2".
See ${LINUX}/include/linux/module.h
"GPL" [GNU Public License v2 or later]
"GPL v2" [GNU Public License v2]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:17:30 +0000 (23:17 -0400)]
media: adv7180: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:17:01 +0000 (23:17 -0400)]
media: rcar-fcp: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Kuninori Morimoto [Mon, 6 Aug 2018 03:16:40 +0000 (23:16 -0400)]
media: vsp1: convert to SPDX identifiers
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>