summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* media: platform: fix several typosMauro Carvalho Chehab2019-03-0146-70/+70
| | | | | | | | | | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Houlong Wei <houlong.wei@mediatek.com> Reviewed-by: Yong Deng <yong.deng@magewell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: pci: fix several typosMauro Carvalho Chehab2019-03-0138-64/+64
| | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: i2c: fix several typosMauro Carvalho Chehab2019-03-0128-38/+38
| | | | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dvb-core: fix several typosMauro Carvalho Chehab2019-03-012-2/+2
| | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: radio: fix several typosMauro Carvalho Chehab2019-03-012-3/+3
| | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dvb-frontends: fix several typosMauro Carvalho Chehab2019-03-0128-83/+83
| | | | | | | | Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx7_mipi_csis: remove internal opsRui Miguel Silva2019-03-011-27/+0
| | | | | | | | | Remove code that is not called anywhere, just remove the internal ops. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: Revert "media: rc: some events are dropped by userspace"Sean Young2019-03-011-1/+12
| | | | | | | | | | | | | | | | | | | When an rc device is created, we do not know what key codes it will support, since a new keymap might be loaded at some later point. So, we set all keybit in the input device. The uevent for the input device includes all the key codes, of which there are now 768. This overflows the size of the uevent (UEVENT_BUFFER_SIZE) and no event is generated. Revert for now until we figure out a different solution. This reverts commit fec225a04330d0f222d24feb5bea045526031675. Cc: <stable@vger.kernel.org> # 4.20+ Reported-by: Christian Holpert <christian@holpert.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ipu3-mmu: fix some kernel-doc macrosMauro Carvalho Chehab2019-02-191-2/+3
| | | | | | Some kernel-doc markups are wrong. fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ipu3: shut up warnings produced with W=1Mauro Carvalho Chehab2019-02-192-0/+8
| | | | | | | | | | | There are lots of warnings produced by this driver. It is not as much as atomisp, but it is still a lot. So, use the same solution to hide most of them. Those need to be fixed before promoting it out of staging, so add it at the TODO list. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx7-media-csi: get rid of unused varMauro Carvalho Chehab2019-02-191-3/+0
| | | | | | | | | drivers/staging/media/imx/imx7-media-csi.c: In function 'imx7_csi_enum_mbus_code': drivers/staging/media/imx/imx7-media-csi.c:926:33: warning: variable 'in_cc' set but not used [-Wunused-but-set-variable] const struct imx_media_pixfmt *in_cc; ^~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx7-media-csi: don't store a floating pointerMauro Carvalho Chehab2019-02-191-7/+11
| | | | | | | | if imx7_csi_try_fmt() fails, outcc variable won't be initialized and csi->cc[IMX7_CSI_PAD_SRC] would be pointing to a random location. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: imx7-media-csi.c: fix merge breakageHans Verkuil2019-02-191-2/+3
| | | | | | | | | | | | | | | | Commit 5964cbd86922 ("imx: Set capture compose rectangle in capture_device_set_format") broke the compilation of commit 05f634040c0d ("staging/imx7: add imx7 CSI subdev driver"). These patches came in through different pull requests and nobody noticed that the first changed functions that the second relied upon. Update imx7-media-csi.c accordingly. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: video-mux: add bayer formatsRui Miguel Silva2019-02-181-0/+20
| | | | | | | | | | Add non vendor bayer formats to the allowed format array. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> 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: staging/imx: add i.MX7 entries to TODO fileRui Miguel Silva2019-02-181-0/+9
| | | | | | | | | Add some i.MX7 related entries to TODO file. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> 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: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7Rui Miguel Silva2019-02-182-0/+1188
| | | | | | | | | | Adds MIPI CSI-2 subdev for i.MX7 to connect with sensors with a MIPI CSI-2 interface. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: clean up some alignment warnings] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: staging/imx7: add imx7 CSI subdev driverRui Miguel Silva2019-02-183-1/+1377
| | | | | | | | | | | This add the media entity subdevice and control driver for the i.MX7 CMOS Sensor Interface. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: clean up some alignment warnings] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: staging/imx: rearrange group id to take in account IPURui Miguel Silva2019-02-187-50/+55
| | | | | | | | | | | | | Some imx system do not have IPU, so prepare the imx media drivers to support this kind of devices. Rename the group ids to include an _IPU_ prefix, add a new group id to support systems with only a CSI without IPU, and also rename the create internal links to make it clear that only systems with IPU have internal subdevices. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> 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: staging/imx: refactor imx media device probeRui Miguel Silva2019-02-185-70/+127
| | | | | | | | | | Refactor and move media device initialization code to a new common module, so it can be used by other devices, this will allow for example a near to introduce imx7 CSI driver, to use this media device. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: smipcie: add universal ir capabilityPatrick Lerda2019-02-182-88/+45
| | | | | | | | smipcie: switch to RC_DRIVER_IR_RAW. Signed-off-by: Patrick Lerda <patrick9876@free.fr> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rc: ir-rc6-decoder: enable toggle bit for Zotac remotesMatthias Reichl2019-02-181-0/+2
| | | | | | | | | | | | | The Zotac RC2604323/01G and RC2604329/02BG remotes use the 32-bit rc6 protocol and toggle bit 15 (0x8000) on repeated button presses, like MCE remotes. Add the customer code 0x80340000 to the 32-bit rc6 toggle handling code to get proper scancodes and toggle reports. Signed-off-by: Matthias Reichl <hias@horus.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rc: rcmm decoder and encoderPatrick Lerda2019-02-185-0/+282
| | | | | | | | media: add support for RCMM infrared remote controls. Signed-off-by: Patrick Lerda <patrick9876@free.fr> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: ov7740: fix runtime pm initializationAkinobu Mita2019-02-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The runtime PM of this device is enabled after v4l2_ctrl_handler_setup(), and this makes this device's runtime PM usage count a negative value. The ov7740_set_ctrl() tries to do something only if the device's runtime PM usage counter is nonzero. ov7740_set_ctrl() { if (!pm_runtime_get_if_in_use(&client->dev)) return 0; <do something>; pm_runtime_put(&client->dev); return ret; } However, the ov7740_set_ctrl() is called by v4l2_ctrl_handler_setup() while the runtime PM of this device is not yet enabled. In this case, the pm_runtime_get_if_in_use() returns -EINVAL (!= 0). Therefore we can't bail out of this function and the usage count is decreased by pm_runtime_put() without increment. This fixes this problem by enabling the runtime PM of this device before v4l2_ctrl_handler_setup() so that the ov7740_set_ctrl() is always called when the runtime PM is enabled. Cc: Wenyou Yang <wenyou.yang@microchip.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vicodec: Add a flag for I-frames in fwht headerDafna Hirschfeld2019-02-183-4/+7
| | | | | | | | | | | | | | | Add a flag 'FWHT_FL_I_FRAME' that indicates that this is an I-frame. This requires incrementing to version 3 This flag is needed for the upcoming stateless FWHT decoder since it has to know if an encoded frame is an I or a P frame. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> [hverkuil-cisco@xs4all.nl: added the last paragraph of the commit msg] Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: cedrus: mpeg2: Use v4l2_m2m_get_vq helper for capture queuePaul Kocialkowski2019-02-181-5/+5
| | | | | | | | | | | Since there's a v4l2_m2m_get_vq helper, use it instead of accessing the queue directly, which slightly increases readability. Also reformat the code using the queue a bit while at it. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: cedrus: Forbid setting new formats on busy queuesPaul Kocialkowski2019-02-181-0/+10
| | | | | | | | | | Check that our queues are not busy before setting the format or return EBUSY if that's the case. This ensures that our format can't change once buffers are allocated for the queue. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: exynos4-is: remove redundant check on typeColin Ian King2019-02-181-3/+1
| | | | | | | | | | | | | The check to see if type is V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE is redundant as this has been already checked at the start of the function and if it's not that value then -ENOSYS is returned. Hence the sprintf can be replaced by a simpler string copy. Detected by CoverityScan, CID#1309450 ("Logically dead code") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-mem2mem: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the return type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove which currently return void pointer. In every case, the actual return type is a struct vb2_v4l2_buffer pointer. Change the return type of the listed functions, so type checking can be properly used. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: clean up line-too-long checkpatch warnings] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/vpu: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-182-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sh_veu: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-jpeg: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: s5p-g2d: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: rockchip/rga: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mx2_emmaprp: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-vcodec: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-182-80/+54
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-mdp: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: mtk-jpeg: Correct return type for mem2mem buffer helpersEzequiel Garcia2019-02-181-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the assigned type of mem2mem buffer handling API. Namely, these functions: v4l2_m2m_next_buf v4l2_m2m_last_buf v4l2_m2m_buf_remove v4l2_m2m_next_src_buf v4l2_m2m_next_dst_buf v4l2_m2m_last_src_buf v4l2_m2m_last_dst_buf v4l2_m2m_src_buf_remove v4l2_m2m_dst_buf_remove return a struct vb2_v4l2_buffer, and not a struct vb2_buffer. Fixing this is necessary to fix the mem2mem buffer handling API, changing the return to the correct struct vb2_v4l2_buffer instead of a void pointer. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: tda1997x: fix get_edidTim Harvey2019-02-181-0/+4
| | | | | | | | | | | set_edid never wrote the new EDID to state->edid.edid, it was only written to the hardware. Since get_edid returned state->edid.edid, it was never returning the right EDID. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: added missing commit log] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add support for JPEG media bus formatChen-Yu Tsai2019-02-183-0/+8
| | | | | | | | | | | | | | | | | The CSI controller can take raw data from the data bus and output it directly to capture buffers. This can be used to support the JPEG media bus format. While the controller can report minimum and maximum bytes per line, it has no way to report how many lines were captured in the last frame. Thus, even when the on-bus data is framed correctly, we have no way to accertain the actual amount of data captured, unless we scan the buffer for JPEG EOI markers, or sequential zeros. For now we leave bytesused alone, and leave it up to userspace applications to parse the data. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add support for RGB565 formatsChen-Yu Tsai2019-02-183-2/+21
| | | | | | | | | | | | The CSI controller can take raw data from the data bus and output RGB565 format. The controller does not distinguish between RGB565 LE and BE. Instead this is determined by the media bus format, i.e. the format or order the sensor is sending data in. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Fix CSI regmap's max_registerChen-Yu Tsai2019-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | max_register is currently set to 0x1000. This is beyond the mapped address range of the hardware, so attempts to dump the regmap from debugfs would trigger a kernel exception. Furthermore, the useful registers only occupy a small section at the beginning of the full range. Change the value to 0x9c, the last known register on the V3s and H3. On the A31, the register range is extended to support additional capture channels. Since this is not yet supported, ignore it for now. Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s") Cc: <stable@vger.kernel.org> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: vsp1: Fix smatch warningHans Verkuil2019-02-181-3/+3
| | | | | | | | | | | | | | | | drivers/media/platform/vsp1/vsp1_drm.c: drivers/media/platform/vsp1/vsp1_drm.c:336 vsp1_du_pipeline_setup_brx() error: we previously assumed 'pipe->brx' could be null (see line 244) smatch missed that if pipe->brx was NULL, then later on it will be set with a non-NULL value. But it is easier to just use the brx pointer so smatch doesn't get confused. Tested-on: Salvator-XS-ES2.0, Salvator-XS-M3N Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: uvcvideo: Use usb_make_path to fill in usb_infoHans Verkuil2019-02-181-1/+1
| | | | | | | | | | | | The uvc driver uses this function to fill in bus_info for VIDIOC_QUERYCAP, so use the same function when filling in the bus_info for the media device. The current implementation only fills in part of the info. E.g. if the full bus_info is usb-0000:01:00.0-1.4.2, then the media bus_info only has 1.4.2. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: uvcvideo: Fix smatch warningHans Verkuil2019-02-181-2/+4
| | | | | | | | | drivers/media/usb/uvc/uvc_video.c: drivers/media/usb/uvc/uvc_video.c:1893 uvc_video_start_transfer() warn: argument 2 to %u specifier is cast from pointer Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: sun6i: Add A64 CSI block supportJagan Teki2019-02-181-0/+11
| | | | | | | | | | | | | | | | | | CSI block in Allwinner A64 has similar features as like in H3, but the default CSI_SCLK rate cannot work properly to drive the connected sensor interface. The tested mod cock rate is 300 MHz and BSP vfe media driver is also using the same rate. Unfortunately there is no valid information about clock rate in manual or any other sources except the BSP driver. so more faith on BSP code, because same has tested in mainline. So, add support for A64 CSI block by setting updated mod clock rate. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: dvb-core: fix epoll() by calling poll_wait firstHans Verkuil2019-02-182-7/+6
| | | | | | | | | | | | The epoll function expects that whenever the poll file op is called, the poll_wait function is also called. That didn't always happen in dvb_demux_poll(), dvb_dvr_poll() and dvb_ca_en50221_io_poll(). Fix this, otherwise epoll() can timeout when it shouldn't. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: videobuf: fix epoll() by calling poll_wait firstHans Verkuil2019-02-181-3/+3
| | | | | | | | | | The epoll function expects that whenever the poll file op is called, the poll_wait function is also called. That didn't always happen in videobuf_poll_stream(). Fix this, otherwise epoll() would timeout when it shouldn't. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-mem2mem: add q->error check to v4l2_m2m_poll()Hans Verkuil2019-02-181-2/+4
| | | | | | | | The v4l2_m2m_poll function didn't check whether q->error was set for either of the two queues. Add support for this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-mem2mem: fix epoll() by calling poll_wait firstHans Verkuil2019-02-181-12/+7
| | | | | | | | | | The epoll function expects that whenever the poll file op is called, the poll_wait function is also called. That didn't always happen in v4l2_m2m_poll(). Fix this, otherwise epoll() would timeout when it shouldn't. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: v4l2-ctrls.c: fix epoll() by calling poll_wait firstHans Verkuil2019-02-181-1/+1
| | | | | | | | | | The epoll function expects that whenever the poll file op is called, the poll_wait function is also called. That didn't always happen in v4l2_ctrl_poll(). Fix this, otherwise epoll() would timeout when it shouldn't. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>