Commit graph

2390 commits

Author SHA1 Message Date
Hans Verkuil 5809ecdd6c [media] pxa_camera: allow building it if COMPILE_TEST is set
Allow building this driver if COMPILE_TEST is set.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:55:13 -03:00
Robert Jarzmik 855f5aa432 [media] media: platform: pxa_camera: fix style
This is a tiny fix for a switch case which quiets 2 checkpatch harmless
warnings. The generated code is not affected.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:54:52 -03:00
Robert Jarzmik 4bb738f228 [media] media: platform: pxa_camera: move pxa_camera out of soc_camera
As the conversion to a v4l2 standalone device is finished, move
pxa_camera one directory up and finish severing any dependency to
soc_camera.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:54:11 -03:00
Robert Jarzmik fcdf9bbc91 [media] media: platform: pxa_camera: change stop_streaming semantics
Instead of the legacy behavior where it was required to wait for all
video buffers to be finished by the hardware, use a cancel like strategy
: as soon as the stop_streaming() call is done, abort all DMA transfers,
report the already buffers as failed and return.

This makes stop_streaming() more a "cancel capture" than a "wait for end
of capture" semantic.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:53:31 -03:00
Robert Jarzmik cdd657eb44 [media] media: platform: pxa_camera: add debug register access
Add pxa_camera registers access through advanced video debugging.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:52:56 -03:00
Robert Jarzmik 283e4a8299 [media] media: platform: pxa_camera: make a standalone v4l2 device
This patch removes the soc_camera API dependency from pxa_camera.
In the current status :
 - all previously captures are working the same on pxa270
 - the s_crop() call was removed, judged not working
   (see what happens soc_camera_s_crop() when get_crop() == NULL)
 - if the pixel clock is provided by then sensor, ie. not MCLK, the dual
   stage change is not handled yet.
   => there is no in-tree user of this, so I'll let it that way

 - the MCLK is not yet finished, it's as in the legacy way,
   ie. activated at video device opening and closed at video device
   closing.
   In a subsequence patch pxa_camera_mclk_ops should be used, and
   platform data MCLK ignored. It will be the sensor's duty to request
   the clock and enable it, which will end in pxa_camera_mclk_ops.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:52:31 -03:00
Robert Jarzmik 226ad6a18f [media] media: platform: pxa_camera: remove set_selection
This is to be seen as a regression as the set_selection (former
set_crop) function is removed. This is a temporary situation in the v4l2
porting, and will have to be added later.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:50:38 -03:00
Robert Jarzmik 61634976a9 [media] media: platform: pxa_camera: add buffer sequencing
Add sequence numbers to completed buffers.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:49:59 -03:00
Robert Jarzmik 295ab497d6 [media] media: platform: pxa_camera: make printk consistent
Make all print consistent by always using :
 - dev_xxx(pcdev_to_dev(pcdev), ....)

This prepares the soc_camera adherence removal by making these call rely
on only pcdev, and not the soc_camera icd structure.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:46:10 -03:00
Robert Jarzmik b36bcbd6f2 [media] media: platform: pxa_camera: introduce sensor_call
Introduce sensor_call(), which will be used for all sensor invocations.
This is a preparation move to v4l2 device conversion, ie. soc_camera
adherence removal.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:45:16 -03:00
Robert Jarzmik 6f28435d1c [media] media: platform: pxa_camera: trivial move of functions
Move the functions in the file to be regrouped into meaningful blocks :
 1. pxa camera core handling functions, manipulating the herdware
 2. videobuf2 functions, dealing with video buffers
 3. video ioctl (vidioc) related functions
 4. driver probing, removal, suspend and resume

This patch doesn't modify a single line of code.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:43:59 -03:00
Robert Jarzmik e009ebd57b [media] media: platform: pxa_camera: convert to vb2
Convert pxa_camera from videobuf to videobuf2.

As the soc_camera was already compatible with videobuf2, the port is
quite straightforward.

The special case of this code in which the vb2 to prepare is "too
big" in terms of size for the new capture format, the pxa_camera will
fail.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:42:36 -03:00
Jean-Christophe Trotin ba4616b7d9 [media] st-hva: add H.264 video encoding support
This patch adds the H.264 video encoding capability in the V4L2 HVA
video encoder driver for STMicroelectronics SoC (hva-h264.c).

The main supported features are:
- profile: baseline, main, high, stereo high
- level: up to 4.2
- bitrate mode: CBR, VBR
- entropy mode: CABAC, CAVLC
- video aspect: 1x1 only

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:34:32 -03:00
Jean-Christophe Trotin 57b2c0628b [media] st-hva: multi-format video encoder V4L2 driver
This patch adds V4L2 HVA (Hardware Video Accelerator) video encoder
driver for STMicroelectronics SoC. It uses the V4L2 mem2mem framework.

This patch only contains the core parts of the driver:
- the V4L2 interface with the userland (hva-v4l2.c)
- the hardware services (hva-hw.c)
- the memory management utilities (hva-mem.c)

This patch doesn't include the support of specific codec (e.g. H.264)
video encoding: this support is part of subsequent patches.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 10:32:34 -03:00
Hans Verkuil 66de877c95 [media] vivid: update EDID
Update the vivid EDID, fixing various incorrect values (wrong name,
product code, various video capabilities).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-06 16:46:17 -03:00
Songjun Wu 846c4a7b3a [media] atmel-isc: remove the warning
Replace the 'IS_ERR_VALUE(irq)' with 'ret < 0' in
function 'atmel_isc_probe'.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-06 16:42:36 -03:00
Tiffany Lin 3a549beef9 [media] vcodec: mediatek: Add g/s_selection support for V4L2 Encoder
This patch add g/s_selection for MT8173 V4L2 Encoder.
Only output queue support g/s_selection to configure crop.
The top/left of active rectangle should always be (0,0)

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-06 16:21:58 -03:00
Peter Ujfalusi 8c87a44c96 [media] m2m-deinterlace: Fix error print during probe
v4l2_err() can not be used for printing error for missing interleaved
support in DMA as this point the pcdev->v4l2_dev is not valid.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-25 09:47:12 -03:00
Geert Uytterhoeven ba75faf43d [media] rcar-fcp: Make sure rcar_fcp_enable() returns 0 on success
When resuming from suspend-to-RAM on r8a7795/salvator-x:

    dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1
    PM: Device fe940000.fdp1 failed to resume noirq: error 1
    dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1
    PM: Device fe944000.fdp1 failed to resume noirq: error 1
    dpm_run_callback(): pm_genpd_resume_noirq+0x0/0x90 returns 1
    PM: Device fe948000.fdp1 failed to resume noirq: error 1

According to its documentation, rcar_fcp_enable() returns 0 on success
or a negative error code if an error occurs.  Hence
fdp1_pm_runtime_resume() and vsp1_pm_runtime_resume() forward its return
value to their callers.

However, rcar_fcp_enable() forwards the return value of
pm_runtime_get_sync(), which can actually be 1 on success, leading to
the resume failure above.

To fix this, consider only negative values returned by
pm_runtime_get_sync() to be failures.

Fixes: 7b49235e83 ("[media] v4l: Add Renesas R-Car FCP driver")

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 14:00:01 -03:00
Geert Uytterhoeven 69d4a52158 [media] VIDEO_MEDIATEK_VPU should depend on HAS_DMA
If NO_DMA=y:

    ERROR: "bad_dma_ops" [drivers/media/platform/mtk-vpu/mtk-vpu.ko] undefined!

Add a dependency on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:39:02 -03:00
Wolfram Sang c7930f37c1 [media] exynos4-is: fimc-is-i2c: don't print error when adding adapter fails
The core will do this for us now.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:37:35 -03:00
Bhaktipriya Shridhar ed90013e40 [media] s5p-mfc: Remove deprecated create_singlethread_workqueue
alloc_workqueue replaces deprecated create_singlethread_workqueue().

The MFC device driver is a v4l2 driver which can encode/decode video
raw/elementary streams and has support for all popular video codecs.

The driver's watchdog_workqueue has been replaced with system_wq since
it queues a single work item, &dev->watchdog_work, which calls for no
ordering requirement. The work item is involved in running the watchdog
timer and is not being used on a memory reclaim path.

Work item has been flushed in s5p_mfc_remove() to ensure
that there are no pending tasks while disconnecting the driver.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:37:18 -03:00
Shuah Khan 605b892061 [media] media: s5p-jpeg add missing blank lines after declarations
Missing blank lines after declarations are making it hard to read the
code. Fix them and also fix other checkpatch warnings at the same time.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:36:57 -03:00
Shuah Khan 06f0a57f35 [media] media: s5p-mfc remove unnecessary error messages
Removed unnecessary error message as appropriate error code is returned.
Changed error message into a debug.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:32:56 -03:00
Shuah Khan 8fe47dca12 [media] media: s5p-mfc Fix misspelled error message and checkpatch errors
Fix misspelled error message and existing checkpatch errors in the
error message conditional.

WARNING: suspect code indent for conditional statements (8, 24)
        if (ctx->state != MFCINST_HEAD_PARSED &&
[...]
        mfc_err("Can not get crop information\n");

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:51 -03:00
Wei Yongjun 05b72d4392 [media] s5p-mfc: remove redundant return value check of platform_get_resource()
Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:13 -03:00
Shuah Khan 02d9a33a02 [media] media: s5p-mfc remove void function return statement
Remove void function return statement

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:13 -03:00
Shuah Khan d695c12c57 [media] media: s5p-mfc fix invalid memory access from s5p_mfc_release()
If s5p_mfc_release() runs after s5p_mfc_remove(), the former will access
invalid s5p_mfc_dev pointer saved in the s5p_mfc_ctx and runs into kernel
paging request errors.

Clear ctx dev pointer in s5p_mfc_remove() and change s5p_mfc_release() to
avoid work that requires ctx->dev.

odroid kernel: Unable to handle kernel paging request at virtual address
    f17c1104
odroid kernel: pgd = ebca4000
odroid kernel: [f17c1104] *pgd=6e23d811, *pte=00000000, *ppte=00000000
odroid kernel: Internal error: Oops: 807 [#1] PREEMPT SMP ARM
odroid kernel: Modules linked in: cpufreq_userspace cpufreq_powersave
    cpufreq_conservative s5p_mfc s5p_jpeg v4l2_mem2mem
    videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_core
    v4l2_common videodev media
odroid kernel: Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
odroid kernel: task: c2241400 ti: e7018000 task.ti: e7018000
odroid kernel: PC is at s5p_mfc_reset+0x40/0x28c [s5p_mfc]
odroid kernel: LR is at s5p_mfc_reset+0x34/0x28c [s5p_mfc]
odroid kernel: pc : [<bf15bfbc>]    lr : [<bf15bfb0>] psr: 60010013
odroid kernel: [<bf15bfbc>] (s5p_mfc_reset [s5p_mfc]) from [<bf15c62c>]
    (s5p_mfc_deinit_hw+0x14/0x3c [s5p_mfc])
odroid kernel: [<bf15c62c>] (s5p_mfc_deinit_hw [s5p_mfc]) from [<bf155958>]
    (s5p_mfc_release+0xac/0x1c4 [s5p_mfc])
odroid kernel: [<bf155958>] (s5p_mfc_release [s5p_mfc]) from [<bf021344>]
    (v4l2_release+0x38/0x74 [videodev])
odroid kernel: [<bf021344>] (v4l2_release [videodev]) from [<c01e4274>]
    (__fput+0x80/0x1c8)
odroid kernel: [<c01e4274>] (__fput) from [<c0135c58>]
    (task_work_run+0x94/0xc8)
odroid kernel: [<c0135c58>] (task_work_run) from [<c010a9d4>]
    (do_work_pending+0x7c/0xa4)
odroid kernel: [<c010a9d4>] (do_work_pending) from [<c0107794>]
    (slow_work_pending+0xc/0x20)
odroid kernel: Code: eb3edacc e5953078 e3a06000 e2833c11 (e5836004)

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Tested-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:12 -03:00
Shuah Khan d188b679f4 [media] media: Doc s5p-mfc add missing fields to s5p_mfc_dev structure definition
Add missing documentation for s5p_mfc_dev structure definition.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:11 -03:00
Javier Martinez Canillas a4a4b15c68 [media] gsc-m2m: improve v4l2_capability driver and card fields
According to the V4L2 documentation the driver and card fields should be
used to identify the driver and the device but the gsc-m2m driver fills
those field using the platform device name, which in turn is the name of
the device DT node.

So not only the filled information isn't correct but also the same values
are used in the driver, card and bus_info fields.

Before this patch:

Driver Info (not using libv4l2):
        Driver name   : 13e00000.video-
        Card type     : 13e00000.video-scaler
        Bus info      : platform:13e00000.video-scaler
        Driver version: 4.7.0

After this patch:

Driver Info (not using libv4l2):
        Driver name   : exynos-gsc
        Card type     : exynos-gsc gscaler
        Bus info      : platform:13e00000.video-scaler
        Driver version: 4.7.0

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:11 -03:00
Javier Martinez Canillas 3a5a2ac064 [media] gsc-m2m: add device name sufix to bus_info capatiliby field
The driver doesn't set the device in the struct v4l2_capability bus_info
field so v4l2-compliance reports the following error for VIDIOC_QUERYCAP:

Required ioctls:
                fail: v4l2-compliance.cpp(537): missing bus_info prefix ('platform')
        test VIDIOC_QUERYCAP: FAIL

This patch fixes this by filling also the device besides the bus.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:10 -03:00
Javier Martinez Canillas b9f19f00d6 [media] s5p-jpeg: only fill driver's name in capabilities driver field
The driver fills in both the struct v4l2_capability driver and card fields
the same values, that is the driver's name plus the information if the dev
is a decoder or an encoder.

But the driver field has a fixed length of 16 bytes so the filled data is
truncated:

Driver Info (not using libv4l2):
        Driver name   : s5p-jpeg decode
        Card type     : s5p-jpeg decoder
        Bus info      : platform:11f50000.jpeg
        Driver version: 4.7.0

Also, this field should only contain the driver's name so use just that.
The information if the device is a decoder or an encoder is in the card
type field anyways.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:10 -03:00
Javier Martinez Canillas 4f355cb567 [media] exynos4-is: Fix fimc_is_parse_sensor_config() nodes handling
The same struct device_node * is used for looking up the I2C sensor, OF
graph endpoint and port. So the reference count is incremented but not
decremented for the endpoint and port nodes.

Fix this by having separate pointers for each node looked up.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Nicolas Dufresne <nicoas.dufresne@collabora.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:09 -03:00
Javier Martinez Canillas 3b2aa383b3 [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP
The driver doesn't set the struct v4l2_capability cap_info field so the
v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:

Required ioctls:
                VIDIOC_QUERYCAP returned 0 (Success)
                fail: v4l2-compliance.cpp(304): string empty
                fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, sizeof(vcap.bus_info))
        test VIDIOC_QUERYCAP: FAIL

This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:

Required ioctls:
                VIDIOC_QUERYCAP returned 0 (Success)
        test VIDIOC_QUERYCAP: OK

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 13:31:08 -03:00
Hans Verkuil 0d0abef8d4 [media] vivid: return -ENODATA if the current input doesn't support g/s_selection
Returning -EINVAL indicates wrong arguments, but that's not the case
here.

Returning -ENOTTY is also no option, since the ioctl is implemented, but
it just is not valid for this input.

So use -ENODATA instead. This is also used elsewhere when an ioctl isn't
valid for a specific input.

In this case G/S_SELECTION returned -EINVAL for the webcam input. That
input doesn't support cropping, instead it uses ENUM_FRAMESIZES to
enumerate a list of discrete frame sizes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:57:01 -03:00
Hans Verkuil ecf37493f4 [media] v4l2-subdev: rename cropcap to g_pixelaspect
The old cropcap video op is now only used to pass the pixelaspect
ratio, so rename it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:55:15 -03:00
Hans Verkuil 516aca3333 [media] vpbe_display: convert g/s_crop to g/s_selection
This is part of a final push to convert all drivers to g/s_selection.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:52:53 -03:00
Hans Verkuil ffc2a6bb55 [media] vpfe_capture: convert g/s_crop to g/s_selection
This is part of a final push to convert all drivers to g/s_selection.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:51:57 -03:00
Hans Verkuil d1d094618e [media] omap_vout: convert g/s_crop to g/s_selection
This is part of a final push to convert all drivers to g/s_selection.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:49:44 -03:00
Hans Verkuil 10d5509c8d [media] v4l2: remove g/s_crop from video ops
Replace all calls to g/s_crop by calls to the get/set_selection pad ops.

Remove the old g/s_crop video ops since they are now no longer used.

The cropcap video op is now only used to pass pixelaspect information,
and is only needed if the pixelaspect is not 1:1.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 09:46:09 -03:00
Julia Lawall 4319233d79 [media] mtk-vcodec: constify venc_common_if structures
The venc_common_if structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 08:46:19 -03:00
Hans Verkuil d0a3a275e5 [media] vivid: don't mention the obsolete sYCC Y'CbCr encoding
This encoding is identical to the 601 encoding. The old duplicate
SYCC define is about to be removed for use in the kernel, so remove
its use in vivid first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 08:18:21 -03:00
Hans Verkuil d0d44516f8 [media] s5p-tv: remove obsolete driver
The s5p-tv driver has been replaced by the exynos drm driver for quite a
long time now. Remove this driver to avoid having duplicate drivers,
of which this one is considered dead code by Samsung.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 06:35:52 -03:00
Hans Verkuil f304562ed3 [media] soc-camera/sh_mobile_csi2: remove unused driver
The sh_mobile_csi2 isn't used anymore (was it ever?), so remove it.
Especially since the soc-camera framework is being deprecated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-24 06:35:19 -03:00
Niklas Söderlund b50b77e6c9 [media] rcar-vin: move media bus information to struct rvin_graph_entity
The primary reason for this change is to prepare for Gen3 support where
there will be more then one possible video source. Each source will have
its own media bus format and code, so it needs to be moved from the per
device structure to a structure used to represent an individual
connection to a video source.

Signed-off-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>
2016-08-23 16:23:38 -03:00
Niklas Söderlund 83fba2c06f [media] rcar-vin: rework how subdevice is found and bound
The original drivers code to find a subdevice by looking in the DT grpah
and how the callbacks to the v4l2 async bind framework where poorly
written. The most obvious example of badness was the duplication of data
in the struct rvin_graph_entity.

This patch removes the data duplication, simplifies the parsing of the
DT graph and add checks to the v4l2 callbacks.

Signed-off-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>
2016-08-23 14:50:42 -03:00
Niklas Söderlund ee9e2a525c [media] rcar-vin: move chip check for pixelformat support
The check for if the specific pixelformat is supported on the current
chip should happen in VIDIOC_S_FMT and VIDIOC_TRY_FMT and not when we
try to setup the hardware for streaming.

Signed-off-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>
2016-08-23 14:49:08 -03:00
Niklas Söderlund 2fb5910c03 [media] rcar-vin: add dependency on MEDIA_CONTROLLER
This is done in preparation for Gen3 support where media controller
support will be mandatory for the driver.

Signed-off-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>
2016-08-23 14:46:22 -03:00
Niklas Söderlund 64663531a4 [media] rcar-vin: do not use v4l2_device_call_until_err()
Fix a error from the original driver where v4l2_device_call_until_err()
where used for the pad specific v4l2 operation set_fmt.  Also fix up the
error path from this fix so if there is an error it will be propagated
to the caller.

The error path label have also been renamed as a result from a
nitpicking review comment since we are fixing other issues here.

Signed-off-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>
2016-08-23 14:46:19 -03:00
Niklas Söderlund fc738177f8 [media] rcar-vin: return correct error from platform_get_irq()
Fix a error from the original driver where the wrong error code is
returned if the driver fails to get a IRQ number from
platform_get_irq().

Signed-off-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>
2016-08-23 14:46:16 -03:00