summaryrefslogtreecommitdiff
path: root/drivers/media/platform/coda.c
AgeCommit message (Collapse)Author
2013-09-26media: media: coda: Fix DT driver data pointer for i.MX27Alexander Shiyan
commit 7b0dd9e60e714951b5400dd0740b3c4c3c3cb76f upstream. The data pointer should point to DT data, and not to the ID array. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: "Series of fixes for 3.10. There are some usual driver fixes (mostly on s5p/exynos playform drivers), plus some fixes at V4L2 core" * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (40 commits) [media] soc_camera: error dev remove and v4l2 call [media] sh_veu: fix the buffer size calculation [media] sh_veu: keep power supply until the m2m context is released [media] sh_veu: invoke v4l2_m2m_job_finish() even if a job has been aborted [media] v4l2-ioctl: don't print the clips list [media] v4l2-ctrls: V4L2_CTRL_CLASS_FM_RX controls are also valid radio controls [media] cx88: fix NULL pointer dereference [media] DocBook/media/v4l: update version number [media] exynos4-is: Remove "sysreg" clock handling [media] exynos4-is: Fix reported colorspace at FIMC-IS-ISP subdev [media] exynos4-is: Ensure fimc-is clocks are not enabled until properly configured [media] exynos4-is: Prevent NULL pointer dereference when firmware isn't loaded [media] s5p-mfc: Add NULL check for allocated buffer [media] s5p-mfc: added missing end-of-lines in debug messages [media] s5p-mfc: v4l2 controls setup routine moved to initialization code [media] s5p-mfc: separate encoder parameters for h264 and mpeg4 [media] s5p-mfc: Remove special clock usage in driver [media] s5p-mfc: Remove unused s5p_mfc_get_decoded_status_v6() function [media] v4l2: mem2mem: save irq flags correctly [media] coda: v4l2-compliance fix: add VIDIOC_CREATE_BUFS support ...
2013-06-03[media] coda: v4l2-compliance fix: add VIDIOC_CREATE_BUFS supportPhilipp Zabel
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-30Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media update from Mauro Carvalho Chehab: - OF documentation and patches at core and drivers, to be used by for embedded media systems - some I2C drivers used on go7007 were rewritten/promoted from staging: sony-btf-mpx, tw2804, tw9903, tw9906, wis-ov7640, wis-uda1342 - add fimc-is driver (Exynos) - add a new radio driver: radio-si476x - add a two new tuners: r820t and tuner_it913x - split camera code on em28xx driver and add more models - the cypress firmware load is used outside dvb usb drivers. So, move it to a common directory to make easier to re-use it - siano media driver updated to work with sms2270 devices - several work done in order to promote go7007 and solo6x1x out of staging (still, there are some pending issues) - several API compliance fixes at v4l2 drivers that don't behave as expected - as usual, lots of driver fixes, improvements, cleanups and new device addition at the existing drivers. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (831 commits) [media] cx88: make core less verbose [media] em28xx: fix oops at em28xx_dvb_bus_ctrl() [media] s5c73m3: fix indentation of the help section in Kconfig [media] cx25821-alsa: get rid of a __must_check warning [media] cx25821-video: declare cx25821_vidioc_s_std as static [media] cx25821-video: remove maxw from cx25821_vidioc_try_fmt_vid_cap [media] r820t: Remove a warning for an unused value [media] dib0090: Fix a warning at dib0090_set_EFUSE [media] dib8000: fix a warning [media] dib8000: Fix sub-channel range [media] dib8000: store dtv_property_cache in a temp var [media] dib8000: warning fix: declare internal functions as static [media] r820t: quiet gcc warning on n_ring [media] r820t: memory leak in release() [media] r820t: precendence bug in r820t_xtal_check() [media] videodev2.h: Remove the unused old V4L1 buffer types [media] anysee: Grammar s/report the/report to/ [media] anysee: Initialize ret = 0 in anysee_frontend_attach() [media] media: videobuf2: fix the length check for mmap [media] em28xx: save isoc endpoint number for DVB only if endpoint has alt settings with xMaxPacketSize != 0 ...
2013-04-29media: coda: use genalloc APIPhilipp Zabel
This patch depends on "genalloc: add devres support, allow to find a managed pool by device", which provides the of_get_named_gen_pool and dev_get_gen_pool functions. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Michal Simek <monstr@monstr.eu> Cc: Dong Aisheng <dong.aisheng@linaro.org> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Huang Shijie <shijie8@gmail.com> Cc: Matt Porter <mporter@ti.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-25[media] coda: Add copy time stamp handlingKamil Debski
Since the introduction of the timestamp_type field, it is necessary that the driver chooses which type it will use. This patch adds support for the timestamp_type. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-24Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - Some cleanups at V4L2 documentation - new drivers: ts2020 frontend, ov9650 sensor, s5c73m3 sensor, sh-mobile veu mem2mem driver, radio-ma901, davinci_vpfe staging driver - Lots of missing MAINTAINERS entries added - several em28xx driver improvements, including its conversion to videobuf2 - several fixups on drivers to make them to better comply with the API - DVB core: add support for DVBv5 stats, allowing the implementation of statistics for new standards like ISDB - mb86a20s: add statistics to the driver - lots of new board additions, cleanups, and driver improvements. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (596 commits) [media] media: Add 0x3009 USB PID to ttusb2 driver (fixed diff) [media] rtl28xxu: Add USB IDs for Compro VideoMate U620F [media] em28xx: add usb id for terratec h5 rev. 3 [media] media: rc: gpio-ir-recv: add support for device tree parsing [media] mceusb: move check earlier to make smatch happy [media] radio-si470x doc: add info about v4l2-ctl and sox+alsa [media] staging: media: Remove unnecessary OOM messages [media] sh_vou: Use vou_dev instead of vou_file wherever possible [media] sh_vou: Use video_drvdata() [media] drivers/media/platform/soc_camera/pxa_camera.c: use devm_ functions [media] mt9t112: mt9t111 format set up differs from mt9t112 [media] sh-mobile-ceu-camera: fix SHARPNESS control default Revert "[media] fc0011: Return early, if the frequency is already tuned" [media] cx18/ivtv: fix regression: remove __init from a non-init function [media] em28xx: fix analog streaming with USB bulk transfers [media] stv0900: remove unnecessary null pointer check [media] fc0011: Return early, if the frequency is already tuned [media] fc0011: Add some sanity checks and cleanups [media] fc0011: Fix xin value clamping Revert "[media] [PATH,1/2] mxl5007 move reset to attach" ...
2013-01-24Merge branch 'v4l_for_linus' into staging/for_v3.9Mauro Carvalho Chehab
* v4l_for_linus: (464 commits) [media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures [media] uvcvideo: Cleanup leftovers of partial revert [media] uvcvideo: Return -EACCES when trying to set a read-only control Linux 3.8-rc3 mm: reinstante dropped pmd_trans_splitting() check cred: Remove tgcred pointer from struct cred drm/ttm: fix fence locking in ttm_buffer_object_transfer ARM: clps711x: Fix bad merge of clockevents setup ARM: highbank: save and restore L2 cache and GIC on suspend ARM: highbank: add a power request clear ARM: highbank: fix secondary boot and hotplug ARM: highbank: fix typos with hignbank in power request functions ARM: dts: fix highbank cpu mpidr values ARM: dts: add device_type prop to cpu nodes on Calxeda platforms drm/prime: drop reference on imported dma-buf come from gem xen/netfront: improve truesize tracking ARM: mx5: Fix MX53 flexcan2 clock ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array sctp: fix Kconfig bug in default cookie hmac selection EDAC: Cleanup device deregistering path ... Conflicts: drivers/media/pci/dm1105/dm1105.c drivers/media/platform/soc_camera/mx2_camera.c
2013-01-22Merge tag 'imx-fixes-rc' of git://git.pengutronix.de/git/imx/linux-2.6 into ↵Olof Johansson
fixes From Sascha Hauer: ARM i.MX fixes for -rc. This contains a single compilation fix for the CODA driver. * tag 'imx-fixes-rc' of git://git.pengutronix.de/git/imx/linux-2.6: [media] coda: Fix build due to iram.h rename
2013-01-08[media] coda: Fix build due to iram.h renameSascha Hauer
commit c045e3f13 (ARM: imx: include iram.h rather than mach/iram.h) changed the location of iram.h, which causes the following build error when building the coda driver: drivers/media/platform/coda.c:27:23: error: mach/iram.h: No such file or directory drivers/media/platform/coda.c: In function 'coda_probe': drivers/media/platform/coda.c:2000: error: implicit declaration of function 'iram_alloc' drivers/media/platform/coda.c:2001: warning: assignment makes pointer from integer without a cast drivers/media/platform/coda.c: In function 'coda_remove': drivers/media/platform/coda.c:2024: error: implicit declaration of function 'iram_free' Since the content of iram.h is not imx specific, move it to include/linux/platform_data/imx-iram.h instead. This is an intermediate solution until the i.MX iram allocator is converted to the generic SRAM allocator. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-03Drivers: media: remove __dev* attributes.Greg Kroah-Hartman
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-21[media] media: coda: Fix H.264 header alignment - v2Javier Martin
Length of H.264 headers is variable and thus it might not be aligned for the coda to append the encoded frame. This causes the first frame to overwrite part of the H.264 PPS. In order to solve that, a filler NAL must be added between the headers and the first frame to preserve alignment. [mchehab@redhat.com: applied only v2 diff here, as v1 ended by mistakenly being applied] Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-21[media] media: coda: Fix H.264 header alignmentJavier Martin
Length of H.264 headers is variable and thus it might not be aligned for the coda to append the encoded frame. This causes the first frame to overwrite part of the H.264 PPS. In order to solve that, a filler NAL must be added between the headers and the first frame to preserve alignment. [mchehab@redhat.com: Fix a few CodingStyle issues] Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-27[media] coda: Fix 'driver_data' for mx53Fabio Estevam
CODA_7541 is the coda_product type for mx53. The 'driver_data' for mx53 is CODA_IMX53 instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-27[media] coda: Do not use __cancel_delayed_work()Fabio Estevam
commit 136b5721d (workqueue: deprecate __cancel_delayed_work()) made __cancel_delayed_work deprecated. Use cancel_delayed_work instead and get rid of the following warning: drivers/media/platform/coda.c:1543: warning: '__cancel_delayed_work' is deprecated (declared at include/linux/workqueue.h:437) Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: set up buffers to be sized as negotiated with s_fmtPhilipp Zabel
This fixes a failure in vb2_qbuf in user pointer mode where __qbuf_userptr checks if the buffer queued by userspace is large enough. The failure would happen if coda_queue_setup was called with empty fmt (and thus set the expected buffer size to the maximum resolution), and userspace queues buffers of smaller size - corresponding to the negotiated dimensions - were queued. Explicitly setting sizeimage to the value negotiated via s_fmt fixes the issue. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: add byte size slice limit controlPhilipp Zabel
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: add horizontal / vertical flipping supportPhilipp Zabel
The hardware can also rotate in 90° steps, but there is no corresponding V4L2_CID defined yet. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: fix sizeimage setting in try_fmtPhilipp Zabel
VIDIOC_TRY_FMT would incorrectly return bytesperline * height, instead of width * height * 3 / 2. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: wait for picture run completion in start/stop_streamingPhilipp Zabel
While the CODA is running a PIC_RUN command, its registers are not to be touched. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: enable user pointer supportPhilipp Zabel
USERPTR buffer support is provided by the videobuf2 framework. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: stop all queues in case of lockupPhilipp Zabel
Add a 1 second timeout for each PIC_RUN command to the CODA. In case it locks up, stop all queues and dequeue remaining buffers. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: keep track of active instancesPhilipp Zabel
Determining the next free instance just by incrementing and decrementing an instance counter does not work: if there are two instances opened, 0 and 1, and instance 0 is released, the next call to coda_open will create a new instance with index 1, but instance 1 is already in use. Instead, scan a bitfield of active instances to determine the first free instance index. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: ignore coda busy status in coda_job_readyPhilipp Zabel
job_ready is supposed to signal whether a context is ready to be added to the job queue, not whether the CODA is ready to run it immediately. Calling v4l2_m2m_job_finish at the end of coda_irq_handler already guarantees that the coda is ready when v4l2-mem2mem eventually tries to run the next queued job. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: allocate internal framebuffers separately from v4l2 buffersPhilipp Zabel
Some codecs running on CODA need internal framebuffers for reference and reconstructed frames. Allocate them separately, and do not use the input vb2_buffers: those will be handed off to userspace regularly, and there is no way to signal to the CODA which of the registered framebuffers are off limits. As a consequence, userspace is now free to choose the number of v4l2 buffers. This patch also includes the code to set up the parameter buffer for CODA7 and above with 64-bit AXI bus width. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Javier Martin <javier.martin@vista-silicon.com> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: fix IRAM/AXI handling for i.MX53Philipp Zabel
This uses the ARCH_MXC specific iram_alloc API to allocate a work buffer in the SoC's on-chip SRAM and sets up the AXI_SRAM_USE register. In the future, the allocation will be converted to use the genalloc API. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: add i.MX53 / CODA7541 platform supportPhilipp Zabel
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] media: coda: firmware loading for 64-bit AXI bus widthPhilipp Zabel
Add support for loading a raw firmware with 16-bit chars ordered in little-endian 64-bit words, corresponding to the memory access pattern of CODA7 and above: When writing the boot code into the code download register, the chars have to be reordered back. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] coda: Add V4L2_CAP_VIDEO_M2M capability flagSylwester Nawrocki
New mem-to-mem video drivers should use V4L2_CAP_VIDEO_M2M capability, rather than ORed V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT flags, as outlined in commit a1367f1b260d29e9b9fb20d8e2f39f1e74fa6c3b. Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-26[media] Set vfl_dir for all display or m2m driversHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15[media] coda: Remove unneeded struct vb2_queue clear on queue_init()Ezequiel García
queue_init() is always called by v4l2_m2m_ctx_init(), which allocates a context struct v4l2_m2m_ctx with kzalloc. Therefore, there is no need to clear vb2_queue src/dst structs. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-15[media] media: coda: remove duplicated call of fh_to_ctx in vidioc_s_fmt_vid_outRichard Zhao
Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] media: coda: add const qualifiersEmil Goode
The commit 98d7bbb9 changed *of_device_id.data to const which introduced warnings in various places that have mostly been fixed. This patch fixes one such warning by introducing two const qualifiers. GCC warning: drivers/media/platform/coda.c:1785:16: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] rename drivers/media/video as .../platformMauro Carvalho Chehab
The remaining drivers are mostly platform drivers. Name the dir to reflect it. It makes sense to latter break it into a few other dirs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>