This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
- return ret;
+ return C;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Kamil Debski [Wed, 14 May 2014 14:31:09 +0000 (11:31 -0300)]
[media] v4l: Fix documentation of V4L2_PIX_FMT_H264_MVC and VP8 pixel formats
The 'Code' column in the documentation should provide the real fourcc
code that is used. Changed the documentation to provide the fourcc
defined in videodev2.h
Laurent Pinchart [Sun, 25 May 2014 19:54:55 +0000 (16:54 -0300)]
[media] m5mols: Replace missing header
The include/media/s5p_fimc.h header has been removed in commit 49b2f4c56fbf70ca693d6df1c491f0566d516aea ("exynos4-is: Remove support
for non-dt platforms"). This broke compilation of the m5mols driver.
Include the include/media/exynos-fimc.h header instead, which contains
the S5P_FIMC_TX_END_NOTIFY definition required by the driver.
Fix sparse warnings by adding __user and __iomem annotations where
necessary and removing certain unnecessary casts. While at it,
also use u32 in place of __u32.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Matt DeVillier [Thu, 24 Apr 2014 14:16:31 +0000 (11:16 -0300)]
[media] fix mceusb endpoint type identification/handling
Change the I/O endpoint handling of the mceusb driver to respect the endpoint
type reported by device (bulk/interrupt), rather than treating all endpoints
as type interrupt, which breaks devices using bulk endpoints when connected
to a xhci controller. Accordingly, change the function calls to initialize
an endpoint's transfer pipe and urb handlers to use the correct function based
on the endpoint type.
[m.chehab@samsung.com: Fix merge conflicts and compilation breakage] Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart [Wed, 29 Jan 2014 13:07:13 +0000 (10:07 -0300)]
[media] v4l: Validate fields in the core code for subdev EDID ioctls
The subdev EDID ioctls receive a pad field that must reference an
existing pad and an EDID field that must point to a buffer. Validate
both fields in the core code instead of duplicating validation in all
drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] s5p-tv: mixer: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: staging: davinci: vpfe: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: davinci: vpif: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Laurent Pinchart [Fri, 31 Jan 2014 12:04:19 +0000 (09:04 -0300)]
[media] media: bfin_capture: Switch to pad-level DV operations
The video-level enum_dv_timings and dv_timings_cap operations are
deprecated in favor of the pad-level versions. All subdev drivers
implement the pad-level versions, switch to them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] ths8200: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] s5p-tv: hdmi: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] adv7842: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] adv7511: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Fri, 31 Jan 2014 11:51:18 +0000 (08:51 -0300)]
[media] ad9389b: Add pad-level DV timings operations
The video enum_dv_timings and dv_timings_cap operations are deprecated.
Implement the pad-level version of those operations to prepare for the
removal of the video version.
Laurent Pinchart [Wed, 29 Jan 2014 13:05:10 +0000 (10:05 -0300)]
[media] v4l: Add pad-level DV timings subdev operations
The dv_timings_cap and enum_dv_timings subdev operations are implemented
at the device level, but apply to pads. Create new variants of those
operations at the pad level. The device level variants will be removed
once all drivers are ported to the pad level DT timings operations.
Ismael Luceno [Sun, 18 May 2014 19:44:11 +0000 (16:44 -0300)]
[media] solo6x10: Reduce OSD writes to the minimum necessary
Instead of unconditionally writing SOLO_EOSD_EXT_SIZE() bytes to the OSD
area (which is 64 or 128 kB depending on the PCI board) we only
write the actual amount of data needed which is 16 * OSD_TEXT_MAX (= 16 * 44).
[media] media: stk1160: Avoid stack-allocated buffer for control URBs
Currently stk1160_read_reg() uses a stack-allocated char to get the
read control value. This is wrong because usb_control_msg() requires
a kmalloc-ed buffer.
This commit fixes such issue by kmalloc'ating a 1-byte buffer to receive
the read value.
While here, let's remove the urb_buf array which was meant for a similar
purpose, but never really used.
Cc: Alan Stern <stern@rowland.harvard.edu> Reported-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: stable@vger.kernel.org # for v3.7 and up Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Arun Kumar K [Wed, 14 May 2014 06:59:42 +0000 (03:59 -0300)]
[media] v4l: Add source change event
This event indicates that the video device has encountered
a source parameter change during runtime. This can typically be a
resolution change detected by a video decoder OR a format change
detected by an input connector.
This needs to be nofified to the userspace and the application may
be expected to reallocate buffers before proceeding. The application
can subscribe to events on a specific pad or input port which
it is interested in.
Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] bt8xx: make driver routines fit into its own namespcae
There is a few conflicts with older symbols on older kernels so we
have to patch this driver when backporting. Instead just make these
routines specific to the driver.
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] technisat-usb2: rename led enums to be specific to driver
The current names clash with include/linux/leds.h namespace,
although there is no compile issue currently this does affect
backports. Drivers should also try to avoid generic namespaces
for things like this.
Cc: Felipe Pena <felipensp@gmail.com> Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Lad, Prabhakar [Fri, 16 May 2014 13:33:46 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: initialize the video device in single place
this patch moves the initalization of video device to a
single place and uses macro to define the driver name and
use it appropriately on the required places.
Lad, Prabhakar [Fri, 16 May 2014 13:33:45 +0000 (10:33 -0300)]
[media] media: davinic: vpif_capture: drop started member from struct common_obj
the started member was indicating whether streaming was started
or not, this can be determined by vb2 offering, this patch replaces
the started member from struct common_obj with appropriate vb2 calls.
Lad, Prabhakar [Fri, 16 May 2014 13:33:43 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: drop reserving memory for device
this patch drops reserving contigiuos memory for the device,
as now with CMA support there is no need of this.
This patch also prepares to removal of config_params.
Lad, Prabhakar [Fri, 16 May 2014 13:33:41 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: use v4l2_fh_open and vb2_fop_release
this patch adds support to use v4l2_fh_open() and vb2_fop_release,
which allows to drop driver specific struct vpif_fh, as this is handeled
by core. This patch also drops vpif_g/s_priority as this handeled
by core.
this patch drops unnecessary check from start_streaming() callback
as this is already done in try/s_fmt and some minor code cleanups,
drops check for vb2_is_streaming() as this check is done by vb2
itself before calling this callback.
Lad, Prabhakar [Fri, 16 May 2014 13:33:38 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: improve vpif_buffer_queue_setup() function
this patch sets the sizes[0] of plane according to the fmt passed
or which is being set in the channel, in both MMAP and USERPTR buffer
type.
This patch also move the calculation of offests(vpif_calculate_offsets())
to queue_setup() callback as after queue_setup() callback the
application is no longer allowed to change format, and prepares to
removal of config_params.
this patch improve vpif_buffer_prepare() callback, as buf_prepare()
callback is never called with invalid state and check for
vb2_plane_vaddr(vb, 0) is dropped as payload check should
be done unconditionally.
Lad, Prabhakar [Fri, 16 May 2014 13:33:35 +0000 (10:33 -0300)]
[media] media: davinci: vpif_capture: release buffers in case start_streaming() call back fails
this patch adds support to release the buffer by calling
vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED
if start_streaming() call back fails.
Lad, Prabhakar [Fri, 16 May 2014 13:33:22 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: initialize the video device in single place
this patch moves the initalization of video device to a
single place and uses macro to define the driver name and
use it appropraitely in required places.
Lad, Prabhakar [Fri, 16 May 2014 13:33:21 +0000 (10:33 -0300)]
[media] media: davinic: vpif_display: drop started member from struct common_obj
the started member was indicating whether streaming was started
or not, this can be determined by vb2 offering, this patch replaces
the started member from struct common_obj with appropriate vb2 calls.
Lad, Prabhakar [Fri, 16 May 2014 13:33:18 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: drop reserving memory for device
this patch drops reserving contigiuos memory for the device,
as now with CMA support there is no need of this.
This patch also prepares to removal of config_params.
Lad, Prabhakar [Fri, 16 May 2014 13:33:15 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: use v4l2_fh_open and vb2_fop_release
this patch adds support to use v4l2_fh_open() and vb2_fop_release,
which allows to drop driver specific struct vpif_fh, as this is handeled
by core. This patch also drops vpif_g/s_priority as this handeled
by core.
this patch drops unnecessary check from start_streaming() callback
as this is already done in try/s_fmt and some minor code cleanups,
drops check for vb2_is_streaming() as this check is done by vb2
itself before calling this callback.
Lad, Prabhakar [Fri, 16 May 2014 13:33:12 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: improve vpif_buffer_queue_setup() function
this patch sets the sizes[0] of plane according to the fmt passed
or which is being set in the channel, in both MMAP and USERPTR buffer
type.
This patch also move the calculation of offests(vpif_calculate_offsets())
to queue_setup() callback as after queue_setup() callback the
application is no longer allowed to change format, and prepares to
removal of config_params.
this patch improve vpif_buffer_prepare() callback, as buf_prepare()
callback is never called with invalid state and check for
vb2_plane_vaddr(vb, 0) is dropped as payload check should
be done unconditionally.
Lad, Prabhakar [Fri, 16 May 2014 13:33:09 +0000 (10:33 -0300)]
[media] media: davinci: vpif_display: release buffers in case start_streaming() call back fails
this patch adds support to release the buffer by calling
vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED
if start_streaming() call back fails.
[media] exynos4-is: Remove support for non-dt platforms
All platforms supported by this driver are going to get device tree
support in this kernel release so remove code that would have been
actually not used any more.
[media] ARM: S5PV210: Remove camera support from mach-goni.c
S5PV210 is going to get DT support, so we can remove the camera
bits from the only board using camera on S5PV210. This allows to
clean the exynos4-is driver by dropping code for non-dt platforms.
This patch can be dropped if a patch removing the whole board
file is applied first.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] exynos4-is: Free FIMC-IS CPU memory only when allocated
Ensure dma_free_coherent() is not called with incorrect arguments
and only when the memory was actually allocated. This will prevent
possible crashes on error paths of the top level media device driver,
when fimc-is device gets unregistered and its driver detached.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: stable@vger.kernel.org # for v3.15 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
[media] exynos4-is: Fix compilation for !CONFIG_COMMON_CLK
CONFIG_COMMON_CLK is not enabled on S5PV210 platform, so include
some clk API data structures conditionally to avoid compilation
errors. These #ifdefs will be removed for next kernel release,
when the S5PV210 platform moves to DT and the common clk API.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: stable@vger.kernel.org # for 3.15 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Kiran AVND [Mon, 19 May 2014 12:50:02 +0000 (09:50 -0300)]
[media] s5p-mfc: Core support for v8 encoder
This patch adds core support for v8 encoder. This
patch also adds register definitions and buffer size
requirements for H264 & VP8 encoding, needed for new
firmware version v8 for MFC
Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
[k.debski@samsung.com: Change MFC version macro name to MFC_V8_BIT] Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Kamil Debski [Tue, 20 May 2014 13:15:13 +0000 (10:15 -0300)]
[media] v4l: s5p-mfc: Limit enum_fmt to output formats of current version
MFC versions support a different set of formats, this specially applies
to the raw YUV formats. This patch changes enum_fmt, so that it only
reports formats that are supported by the used MFC version.