summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dmaengine-fix-5.3-rc5' of ↵Linus Torvalds2019-08-161-2/+1Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.infradead.org/users/vkoul/slave-dma Pull dmaengine fixes from Vinod Koul: "Fixes in dmaengine drivers for: - dw-edma: endianess, _iomem type and stack usages - ste_dma40: unneeded variable and null-pointer dereference - tegra210-adma: unused function - omap-dma: off-by-one fix" * tag 'dmaengine-fix-5.3-rc5' of git://git.infradead.org/users/vkoul/slave-dma: omap-dma/omap_vout_vrfb: fix off-by-one fi value dmaengine: stm32-mdma: Fix a possible null-pointer dereference in stm32_mdma_irq_handler() dmaengine: tegra210-adma: Fix unused function warnings dmaengine: ste_dma40: fix unneeded variable warning dmaengine: dw-edma: fix endianess confusion dmaengine: dw-edma: fix __iomem type confusion dmaengine: dw-edma: fix unnecessary stack usage
| * omap-dma/omap_vout_vrfb: fix off-by-one fi valueHans Verkuil2019-08-091-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OMAP 4 TRM specifies that when using double-index addressing the address increases by the ES plus the EI value minus 1 within a frame. When a full frame is transferred, the address increases by the ES plus the frame index (FI) value minus 1. The omap-dma code didn't account for the 'minus 1' in the FI register. To get correct addressing, add 1 to the src_icg value. This was found when testing a hacked version of the media m2m-deinterlace.c driver on a Pandaboard. The only other source that uses this feature is omap_vout_vrfb.c, and that adds a + 1 when setting the dst_icg. This is a workaround for the broken omap-dma.c behavior. So remove the workaround at the same time that we fix omap-dma.c. I tested the omap_vout driver with a Beagle XM board to check that the '+ 1' in omap_vout_vrfb.c was indeed a workaround for the omap-dma bug. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Link: https://lore.kernel.org/r/952e7f51-f208-9333-6f58-b7ed20d2ea0b@xs4all.nl Signed-off-by: Vinod Koul <vkoul@kernel.org>
* | media: vivid: fix missing cec adapter nameHans Verkuil2019-07-301-4/+4
|/ | | | | | | | | | | | Commit "vivid: reorder CEC allocation and control set-up" missed that the CEC adapter needs a valid vfd->name, and that was now filled in after the CEC adapter was created, leading to an empty adapter name. Fill in the name earlier. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 4ee895e71abb ("media: vivid: reorder CEC allocation and control set-up") Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* Merge tag 'media/v5.3-1' of ↵Linus Torvalds2019-07-09127-1927/+3191
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new Atmel microship ISC driver - coda has gained support for mpeg2 and mpeg4 - cxusb gained support for analog TV - rockchip staging driver was split into two separate staging drivers - added a new staging driver for Allegro DVT video IP core - added a new staging driver for Amlogic Meson video decoder - lots of improvements and cleanups * tag 'media/v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (398 commits) media: allegro: use new v4l2_m2m_ioctl_try_encoder_cmd funcs media: doc-rst: Fix typos media: radio-raremono: change devm_k*alloc to k*alloc media: stv0297: fix frequency range limit media: rc: Prefer KEY_NUMERIC_* for number buttons on remotes media: dvb_frontend: split dvb_frontend_handle_ioctl function media: mceusb: disable "nonsensical irdata" messages media: rc: remove redundant dev_err message media: cec-notifier: add new notifier functions media: cec: add struct cec_connector_info support media: cec-notifier: rename variables, check kstrdup and n->conn_name media: MAINTAINERS: Add maintainers for Media Controller media: staging: media: tegra-vde: Defer dmabuf's unmapping media: staging: media: tegra-vde: Add IOMMU support media: hdpvr: fix locking and a missing msleep media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom() media: atmel: atmel-isc: fix i386 build error media: v4l2-ctrl: Move compound control initialization media: hantro: Use vb2_get_buffer media: pci: cx88: Change the type of 'missed' to u64 ...
| * media: cec: add struct cec_connector_info supportDariusz Marcinkiewicz2019-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define struct cec_connector_info in media/cec.h and define CEC_CAP_CONNECTOR_INFO. In a later patch this will be moved to uapi/linux/cec.h. The CEC_CAP_CONNECTOR_INFO capability can be set by drivers, but cec_allocate_adapter() will remove it again until the public API for this can be enabled once all drm drivers wire this up correctly. Also add the cec_fill_conn_info_from_drm and cec_s_conn_info functions, which are needed by drm drivers to fill in the cec_connector info based on a drm_connector. The cec_notifier_(un)register and cec_register_cec_notifier prototypes were moved from cec-notifier.h to cec.h since cec.h no longer includes cec-notifier.h. These headers included each other before, which caused various problems. Due to these changes the seco-cec driver was changed as well: it should include cec-notifier.h, not cec.h. Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: atmel: atmel-isc: fix i386 build errorEugen Hristev2019-06-242-6/+2Star
| | | | | | | | | | | | | | | | | | | | Changed module parameters to static. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vimc: cap: check v4l2_fill_pixfmt return valueAndré Almeida2019-06-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | v4l2_fill_pixfmt() returns -EINVAL if the pixelformat used as parameter is invalid or if the user is trying to use a multiplanar format with the singleplanar API. Currently, the vimc_cap_try_fmt_vid_cap() returns such value, but vimc_cap_s_fmt_vid_cap() is ignoring it. Fix that and returns an error value if vimc_cap_try_fmt_vid_cap() has failed. Signed-off-by: André Almeida <andrealmeid@collabora.com> Suggested-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: encoder parameter change supportPhilipp Zabel2019-06-244-0/+115
| | | | | | | | | | | | | | | | | | | | Add support for dynamically changing the GOP size, bitrate, frame rate, constant intra quantization parameter, number of intra refresh macro blocks and slice mode parameters. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: add coda_slice_mode() functionPhilipp Zabel2019-06-241-21/+24
| | | | | | | | | | | | | | | | | | Changing slice mode dynamically while encoding will require to calculate the register value again, so split it out into a separate function. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: store device pointer in driver structure instead of pdevPhilipp Zabel2019-06-243-23/+19Star
| | | | | | | | | | | | | | | | | | | | Currently the platform device pointer is stored in struct coda_dev, only to convert it into a device pointer wherever it is used. Just store the device pointer directly. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: mark last returned framePhilipp Zabel2019-06-241-0/+17
| | | | | | | | | | | | | | | | | | | | | | If reordering is not enabled, the last decoded frame has to be the last returned buffer. Otherwise wait for the firmware to report no more frame to display. In that case the return buffer is the last one as well, and can be reported as such. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: mark last pending buffer or last meta on decoder stop commandPhilipp Zabel2019-06-243-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | If there is still a buffer pending, mark it as the last buffer. It will create a meta that is flagged as last when the buffer is copied into the bitstream ring buffer. If there are no more buffers pending, find the last bitstream meta and mark it as last. If there is no bitstream meta either, wake up the capture queue as there will be no more decoded frames. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: lock capture queue wakeup against encoder stop commandPhilipp Zabel2019-06-243-5/+27
| | | | | | | | | | | | | | | | | | | | Make sure that an encoder stop command running concurrently with an encoder finish_run always either flags the last returned buffer or wakes up the capture queue to signal the end of stream condition afterwards. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: flag the last encoded bufferPhilipp Zabel2019-06-241-7/+9
| | | | | | | | | | | | | | | | | | | | Use the flagged last output buffer to also flag the corresponding capture buffer after encoding. This causes the end of stream event to be issued and the buffer to be dequeued with the last flag set. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: only wake up capture queue if no pending buffers to encodePhilipp Zabel2019-06-241-8/+9
| | | | | | | | | | | | | | | | | | | | | | If there are no pending queued output buffers to be encoded, waking up the capture queue with -EPIPE signals end of stream. If there are pending buffers on the other hand, setting the V4L2_BUF_FLAG_LAST on the resulting encoded capture buffers is all that is needed. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: retire coda_buf_is_end_of_streamPhilipp Zabel2019-06-241-11/+1Star
| | | | | | | | | | | | | | | | | | | | | | Using the output queue sequence counter to determine the last buffer to be encoded or decoded always was fragile at best. Now that we have the last buffer flag propagating from the output queue to the capture queue correctly, this is not needed anymore. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: mark the last output buffer on encoder stop commandPhilipp Zabel2019-06-241-0/+5
| | | | | | | | | | | | | | | | Mark the last output buffer to be encoded. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: only set the stream end flags if there are no more pending ↵Philipp Zabel2019-06-241-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | output buffers If there are still queued output buffers pending to be copied into the bitstream ring buffer, setting the stream end flag should be deferred until the marked last output buffer is written into the bitstream ring buffer. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: mark the last output buffer on decoder stop commandPhilipp Zabel2019-06-242-0/+9
| | | | | | | | | | | | | | | | | | | | Mark the last output buffer to be decoded and only copy pending queued output buffers into the bitstream ring buffer in the BIT processor decoder case. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: allow flagging last output buffer internallyPhilipp Zabel2019-06-241-1/+19
| | | | | | | | | | | | | | | | | | | | | | Since V4L2_BUF_FLAG_LAST is a CAPTURE only flag, clear it from OUTPUT buffers in QBUF and DQBUF. This allows to use the flag internally to signal the last buffer to decode after a decoder stop command was issued. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: increment sequence offset for the last returned framePhilipp Zabel2019-06-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | If no more frames are decoded in bitstream end mode, and a previously decoded frame has been returned, the firmware still increments the frame number. To avoid a sequence number mismatch after decoder restart, increment the sequence_offset correction parameter. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: flush bitstream ring buffer on decoder restartPhilipp Zabel2019-06-243-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | The bitstream ringbuffer might be in an underrun state after draining, or it might still contain unread data if the previous decoder stop command was flagged as immediate. Flush the bitstream ring buffer during V4L2_DEC_CMD_START to get into a well defined state. Also fill the bitstream with buffers that have been queued during draining, to resume decoding immediately. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: do not enforce 512-byte initial bitstream payload on CODA960Philipp Zabel2019-06-241-1/+3
| | | | | | | | | | | | | | | | | | | | On CODA960, sequence initialization can succeed if less than 512 bytes are ready in the bitstream ring buffer. On other variants, warn about too small payload in start_streaming. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: pad first buffer with repeated MPEG headers to fix sequence initPhilipp Zabel2019-06-244-3/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the first buffer contains only headers, the sequence initialization command fails. On CodaHx4 the buffer must be padded to at least 512 bytes, on CODA960 it seems to be enough to just repeat the sequence and extension headers (MPEG-2) or the VOS and VO headers (MPEG-4) once for for sequence initialization to succeed without further bitstream data. On CodaHx4 the headers can be repeated multiple times until the 512 byte mark is reached. A similar issue was solved for h.264 by padding with a filler NAL in commit 0eef89403ece ("[media] coda: pad first h.264 buffer to 512 bytes"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: make coda_bitstream_queue more versatilePhilipp Zabel2019-06-241-14/+9Star
| | | | | | | | | | | | | | | | | | | | Pass vaddr and size to coda_bitstream_queue instead of a struct vb2_v4l2_buffer to make it reusable for queueing data that is not exactly a whole v4l2 buffer into the bitstream ringbuffer. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: integrate internal frame metadata into a structurePhilipp Zabel2019-06-242-34/+40
| | | | | | | | | | | | | | | | | | Combine the separate auxiliary buffer, buffer meta, frame type, and decode error arrays into an array of struct coda_internal_frame. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: implement decoder source change eventPhilipp Zabel2019-06-241-0/+20
| | | | | | | | | | | | | | | | | | The stateful decoder API requires decoders to signal detection of stream dimensions via the V4L2_EVENT_SOURCE_CHANGE event. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: add sequence initialization workPhilipp Zabel2019-06-243-0/+51
| | | | | | | | | | | | | | | | | | Add a sequence initialization work item to be run when OUTPUT buffers are queued in the initialization state. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: split decoder sequence initialization out of start decodingPhilipp Zabel2019-06-241-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | The sequence initialization already has to happen during the initialization phase, after headers have been queued on the OUTPUT queue. This means that sequence initialization has to be queued as a work item from QBUF on the OUTPUT queue. The internal framebuffer setup should be done later during VIDIOC_REQBUFS() on the CAPTURE queue. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: fix V4L2_DEC_CMD_STOP when all buffers are already consumedMarco Felsch2019-06-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the DEC_CMD_STOP command is issued after the context has already consumed all the queued buffers, we need to make sure to wake the destination queue with last_buffer_dequeued set, to allow userspace to make progress in its EOS handling. As there might still be picture run workers pending at that point, we need to synchronize with them, so the sequence number comparison reads stable values. reword commit message] Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: add coda_wake_up_capture_queuePhilipp Zabel2019-06-241-7/+13
| | | | | | | | | | | | | | | | | | Combine setting the last_buffer_dequeued flag on the capture video queue and waking up its done workqueue into a helper function. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: fix last buffer handling in V4L2_ENC_CMD_STOPMarco Felsch2019-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | coda_encoder_cmd() is racy, as the last scheduled picture run worker can still be in-flight while the ENC_CMD_STOP command is issued. Depending on the exact timing the sequence numbers might already be changed, but the last buffer might not have been put on the destination queue yet. In this case the current implementation would prematurely wake the destination queue with last_buffer_dequeued=true, causing userspace to call streamoff before the last buffer is handled. Close this race window by synchronizing with the pic_run_worker before doing the sequence check. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> [l.stach@pengutronix.de: switch to flush_work, reword commit message] Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: fix mpeg2 sequence number handlingPhilipp Zabel2019-06-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | Sequence number handling assumed that the BIT processor frame number starts counting at 1, but this is not true for the MPEG-2 decoder, which starts at 0. Fix the sequence counter offset detection to handle this. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: use mem2mem try_en/decoder_cmd helpersPhilipp Zabel2019-06-241-17/+2Star
| | | | | | | | | | | | | | | | | | Use mem2mem try_en/decoder_cmd helpers to ensure consistent behaviour with other video codec drivers. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: coda: implement CMD_START to restart decodingMichael Tretter2019-06-241-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The CMD_START shall be used to start the processing after a drain that was initiated with CMD_STOP. Up until now, a drain on coda could only be finished with a STREAMOFF-STREAMON, which resulted in a reset of the device. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: cafe-driver: mark an static var as suchMauro Carvalho Chehab2019-06-241-1/+1
| | | | | | | | | | | | | | | | As warned by sparse: drivers/media/platform/marvell-ccic/cafe-driver.c:475:23: warning: symbol 'ov7670_info' was not declared. Should it be static? Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic: mmp: don't chicken out w/o pdataLubomir Rintel2019-06-241-3/+0Star
| | | | | | | | | | | | | | | | | | It's impossible for mmpcam_calc_dphy() to be called without it. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> 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>
| * media: marvell-ccic: only calculate the DPHY registers when neededLubomir Rintel2019-06-241-7/+2Star
| | | | | | | | | | | | | | | | | | | | | | Avoid pointlessly calling calc_dphy() when the bus is not V4L2_MBUS_CSI2_DPHY. This will make it easier to replace the platform data with devicetree. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> 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>
| * media: marvell-ccic: provide a clock for the sensorLubomir Rintel2019-06-245-181/+157Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sensor needs the MCLK clock running when it's being probed. On platforms where the sensor is instantiated from a DT (MMP2) it is going to happen asynchronously. Therefore, the current modus operandi, where the bridge driver fiddles with the sensor power and clock itself is not going to fly. As the comments wisely note, this doesn't even belong there. Luckily, the ov7670 driver is already able to control its power and reset lines, we can just drop the MMP platform glue altogether. It also requests the clock via the standard clock subsystem. Good -- let's set up a clock instance so that the sensor can ask us to enable the clock. Note that this is pretty dumb at the moment: the clock is hardwired to a particular frequency and parent. It was always the case. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic: use async notifier to get the sensorLubomir Rintel2019-06-244-76/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | An instance of a sensor on DT-based MMP2 platform is always going to be created asynchronously. Let's move the manual device creation away from the core to the Cafe driver (used on OLPC XO-1, not present in DT) and set up appropriate async matches: I2C on Cafe, FWNODE on MMP (OLPC XO-1.75). Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic/mmp: add devicetree supportLubomir Rintel2019-06-241-9/+27
| | | | | | | | | | | | | | | | | | | | The platform data is actually not used anywhere (along with the CSI support) and should be safe to remove. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic: rename the clocksLubomir Rintel2019-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use the names more suitable for devicetree bindings. There are no board files utilizing this, thus we seem to be at liberty at renaming this without consequences. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic/mmp: enable clock before accessing registersLubomir Rintel2019-06-241-2/+1Star
| | | | | | | | | | | | | | | | | | | | The access to REG_CLKCTRL or REG_CTRL1 without the clock enabled hangs the machine. Enable the clock first. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: marvell-ccic: drop unused stuffLubomir Rintel2019-06-243-5/+0Star
| | | | | | | | | | | | | | | | | | | | Remove structure members and headers that are not actually used. Saves us from some noise in subsequent cleanup commits. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: Revert "[media] marvell-ccic: reset ccic phy when stop streaming for ↵Lubomir Rintel2019-06-243-33/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stability" This accesses the clock registers directly and thus is going to stay in the way of making the driver devicetree friendly. No boards seems to actually use this. If it's somehow actually needed it needs to be done differently. This reverts commit 7c269f454e7a51b151d94f99344120efa1cd0acb. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vivid: add CEC support to display present ctrlJohan Korsnes2019-06-213-6/+38
| | | | | | | | | | | | | | | | | | | | | | Set/invalidate physical addresses based on the configuration of the display present control. This is relevant not only when the display present control is modified, but also when the Vivid instance EDID is set/cleared. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vivid: reorder CEC allocation and control set-upJohan Korsnes2019-06-211-42/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CEC adapters and controllers (handlers) are now set up as follows: 1. Allocate CEC adapters: setup of control handlers in next step requires these adapters to be allocated. 2. Setup of control handlers: This must be done prior to registering and exposing the adapters to user space to avoid a race condition. 3. Register CEC adapters: make them available to user space. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: PTR_ERR -> PTR_ERR_OR_ZERO] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vivid: add HDMI (dis)connect RX emulationJohan Korsnes2019-06-212-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds the following bitmask control: -V4L2_CID_DV_RX_POWER_PRESENT The RX_POWER_PRESENT bitmask is set based on the digital video timings signal mode. This also removes 1/1 warnings for v4l2-compliance test on vivid instance with HDMI input. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vivid: add HDMI (dis)connect TX emulationJohan Korsnes2019-06-212-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the following bitmask controls: -V4L2_CID_DV_TX_EDID_PRESENT -V4L2_CID_DV_TX_HOTPLUG -V4L2_CID_DV_TX_RXSENSE The bitmasks are all set based on the custom vivid DISPLAY_PRESENT control. This also removes 2/2 v4l2-compliance warnings for vivid output device. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
| * media: vivid: add number of HDMI ports to device stateJohan Korsnes2019-06-212-0/+4
| | | | | | | | | | | | | | | | | | This will be used for HDMI-specific controls such as hotplug detection and power present. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>