summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-03media: solo6x10: switch from 'pci_' to 'dma_' APIChristophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'snd_solo_pcm_open()' (solo6x10-g723.c) GFP_KERNEL can be used because this flag is already used jew a few lines above. When memory is allocated in 'solo_enc_alloc()' (solo6x10-v4l2-enc.c) GFP_KERNEL can be used because this flag is already used jew a few lines above. When memory is allocated in 'solo_enc_v4l2_init()' (solo6x10-v4l2-enc.c) GFP_KERNEL can be used because calls 'solo_enc_alloc()' which already uses this flag. @@ @@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ @@ - PCI_DMA_NONE + DMA_NONE @@ expression e1, e2, e3; @@ - pci_alloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3; @@ - pci_zalloc_consistent(e1, e2, e3) + dma_alloc_coherent(&e1->dev, e2, e3, GFP_) @@ expression e1, e2, e3, e4; @@ - pci_free_consistent(e1, e2, e3, e4) + dma_free_coherent(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4, e5; @@ - pci_map_page(e1, e2, e3, e4, e5) + dma_map_page(&e1->dev, e2, e3, e4, e5) @@ expression e1, e2, e3, e4; @@ - pci_unmap_page(e1, e2, e3, e4) + dma_unmap_page(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_map_sg(e1, e2, e3, e4) + dma_map_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_sg(e1, e2, e3, e4) + dma_unmap_sg(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_cpu(e1, e2, e3, e4) + dma_sync_single_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_single_for_device(e1, e2, e3, e4) + dma_sync_single_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_cpu(e1, e2, e3, e4) + dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_dma_sync_sg_for_device(e1, e2, e3, e4) + dma_sync_sg_for_device(&e1->dev, e2, e3, e4) @@ expression e1, e2; @@ - pci_dma_mapping_error(e1, e2) + dma_mapping_error(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_dma_mask(e1, e2) + dma_set_mask(&e1->dev, e2) @@ expression e1, e2; @@ - pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(&e1->dev, e2) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: si4713: remove trailing semicolon in macro definitionTom Rix
The macro use will already have a semicolon. [hverkuil: also add () around p in the macro] Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: staging/imx: Increase IMX_MEDIA_EOF_TIMEOUTFabio Estevam
When trying to capture video on a imx6dl-based board with an ADV7280, the following timeout error is observed: v4l2-ctl --stream-mmap -d /dev/video2 [ 22.792049] ipu1_csi1: EOF timeout VIDIOC_DQBUF: failed: Input/output error Increase the IMX_MEDIA_EOF_TIMEOUT to avoid such problem. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: camss: Make use of V4L2_CAP_IO_MCAndrey Konovalov
Implement mbus_code filtering for format enumeration. Without this patch libcamera errors out with: "ERROR V4L2 v4l2_videodevice.cpp:982 /dev/video0[cap]: Media bus code filtering not supported by the device" This is the second version of this change which handles the case of several pixel formats corresponding to one media bus format correctly. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: Revert "media: camss: Make use of V4L2_CAP_IO_MC"Andrey Konovalov
This reverts commit c90f1178dcac30dee5ddd29ec0513e7589aa866e. The assumption of "Each entry in formats[] table has unique mbus_code" is valid for the RDI entities, but not for the PIX ones. Reverting this patch and creating a new one which handles the PIX entities correctly results in smaller and more straightforward patch than doing the changes on top of the current version. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: rockchip: rkisp1: Fix typos in comments and macro definitionsPeilin Ye
Fix 4 typos under drivers/media/platform/rockchip/rkisp1/ found by checkpatch, including the RKISP1_CIF_MI_{M,S}P_PINGPONG_ENABLE macro definitions. Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: rcar-vin: Remove unused macroJacopo Mondi
The VNCSI_IFMD_CSI_CHSEL_MASK is not used: remove it. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: fsl-viu: Use the ioread/write32be() accessorsFabio Estevam
Since commit 29d750686331 ("media: fsl-viu: allow building it with COMPILE_TEST") there were several attempts to fix build failures on PPC, MICROBLAZE and M68K. However, such errors are still present as reported by kbuild robot. Fix the problem by using the ioread/write32be() accessors, which build fine on all platforms. Reported-by: kernel test robot <lkp@intel.com> Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: platform: exynos4-is: remove all references to physical addressesMarek Szyprowski
This driver always operates on the DMA/IOVA addresses, so calling them physical addresses is misleading, although when no IOMMU is used they equal each other. Fix this by renaming all such entries to 'addr' and adjusting comments. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: adv748x: Configure device when resuming from sleepNiklas Söderlund
If the device is powered off (for example during system suspend to ram) the devices loses its configuration, especially the slave i2c mappings and other configuration set at probe time. This renders the device unusable and the only way to recover is to unbind and rebind the device to the driver to run the probe setup again. Add an early resume callback that reinitializes the device and setup the slave i2c address mappings and other probe time configuration. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: adv748x: csi2: Set virtual channel when device is resetNiklas Söderlund
It's not enough to set the CSI-2 virtual channel for TXA and TXB during probe: it also needs to be set when the device is reset. Move the virtual channel selection to adv748x_reset() that is called during probe and when the device needs to be reset. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: adv748x: afe: Select input port when device is resetNiklas Söderlund
It's not enough to select the AFE input port during probe: it also needs to be set when the device is reset. Move the port selection to adv748x_reset() that is called during probe and when the device needs to be reset. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: adv748x: Only set i2c addresses once during probeNiklas Söderlund
During probe the i2c slave addresses are set two times in a row, once in adv748x_initialise_clients() and once directly after in adv748x_reset(). Remove the call to adv748x_set_slave_addresses() in adv748x_initialise_clients() as it's only called during probe while adv748x_reset() is called during probe and normal operation. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: saa7146: fix array overflow in vidioc_s_audio()Dan Carpenter
The "a->index" value comes from the user via the ioctl. The problem is that the shift can wrap resulting in setting "mxb->cur_audinput" to an invalid value, which later results in an array overflow. Fixes: 6680427791c9 ("[media] mxb: fix audio handling") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: meson: vdec: add G12/SM1 to module descriptionChristian Hewitt
The meson vdec driver also supports Amlogic G12/SM1 hardware. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: s5p-jpeg: handle error condition in s5p_jpeg_probeBaskov Evgeniy
If an error happens in jpeg_get_drv_data(), i.e. match fails, jpeg->variant field is NULL, so we cannot access it. Consider device probe failed if jpeg->variant is NULL. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Baskov Evgeniy <baskov@ispras.ru> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: cedrus: Add support for VP8 decodingJernej Skrabec
VP8 in Cedrus shares same engine as H264. Note that it seems necessary to call bitstream parsing functions, to parse frame header, otherwise decoded image is garbage. This is contrary to what is driver supposed to do. However, values are not really used, so this might be acceptable. It's possible that bitstream parsing functions set some internal VPU state, which is later necessary for proper decoding. Biggest suspect is "VP8 probs update" trigger. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: hantro: Use VP8 lengths defined in uapiEmmanuel Gil Peyrot
Use the new defines instead of hardcoding the VP8 lengths. [hverkuil: add commit log] Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: uapi: Expose VP8 probability lengths as definesEmmanuel Gil Peyrot
These values will be used by various drivers implementing the VP8 stateless API. This had been suggested by Ezequiel Garcia for the Cedrus VP8 driver. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: mtk-vpu: dump VPU status when IPI times outIrui Wang
when IPI time out, dump VPU status to get more debug information Signed-off-by: Irui Wang <irui.wang@mediatek.com> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: mtk-vpu: VPU should be in idle state before system is suspendedIrui Wang
VPU should be in idle state before system is suspended or it will work abnormally like VPU program counter not in a correct address or VPU reset Signed-off-by: Irui Wang <irui.wang@mediatek.com> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: coda: Convert the driver to DT-onlyFabio Estevam
Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code by removing the unused non-DT support. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: tvp5150: Fix wrong return value of tvp5150_parse_dt()Zhang Xiaoxu
If of_graph_get_endpoint_by_regs() return NULL, it will return 0 rather than an errno, because we doesn't initialize the return value. Fixes: 0556f1d580d4 ("media: tvp5150: add input source selection of_graph support") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: cx88: use ARRAY_SIZEXu Wang
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: cedrus: Add support for V3sMartin Cerveny
V3s video engine runs at lower speed and support video decoder for H.264 and JPEG/MJPEG only. Signed-off-by: Martin Cerveny <m.cerveny@computer.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: dt-bindings: media: cedrus: Add V3s compatibleMartin Cerveny
Allwinner V3s SoC contains video engine. Add compatible for it. Signed-off-by: Martin Cerveny <m.cerveny@computer.org> Acked-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: cedrus: Register all codecs as capabilityMartin Cerveny
All codecs should have capabilities. For example "Allwinner V3s" does not support "MPEG2". Signed-off-by: Martin Cerveny <m.cerveny@computer.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: cx23885: add more quirks for reset DMA on some AMD IOMMUDaniel Lee Kruse
On AMD Family 15h (Models 30h-3fh), I/O Memory Management Unit RiSC engine sometimes stalls, requiring a reset. As result, MythTV and w-scan won't scan channels on the AMD Kaveri APU with the Hauppauge QuadHD TV tuner card. For the solution I added the Input/Output Memory Management Unit's PCI Identity of 0x1423 to the broken_dev_id[] array, which is used by a quirks logic meant to fix similar problems with other AMD chipsets. Signed-off-by: Daniel Lee Kruse <daniel.lee.kruse@protonmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03media: rockchip: rkisp1: Constify static structsRikard Falkeborn
These 'ops' structs are never modified, so make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: i2c: imx219: Selection compliance fixesHans Verkuil
To comply with the intended usage of the V4L2 selection target when used to retrieve a sensor image properties, adjust the rectangles returned by the imx219 driver. The top/left crop coordinates of the TGT_CROP rectangle were set to (0, 0) instead of (8, 8) which is the offset from the larger physical pixel array rectangle. This was also a mismatch with the default values crop rectangle value, so this is corrected. Found with v4l2-compliance. While at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and CROP_BOUNDS have the same size as the non-active pixels are not readable using the selection API. Found with v4l2-compliance. [reword commit message, use macros for pixel offsets] Fixes: e6d4ef7d58aa7 ("media: i2c: imx219: Implement get_selection") Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: media: Use OF graph schemaRob Herring
Now that we have a graph schema, rework the media related schemas to use it. Mostly this is adding a reference to graph.yaml and dropping duplicate parts from schemas. Cc: Maxime Ripard <mripard@kernel.org> Cc: Jacopo Mondi <jacopo@jmondi.org> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: rdacm20: Enable GPIO1 explicitlyJacopo Mondi
The MAX9271 GPIO1 line that controls the sensor reset is by default enabled after a serializer chip reset. As rdacm20 does not go through an explicit serializer reset, make sure GPIO1 is enabled to make the camera module driver more robust. Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: max9271: Fix GPIO enable/disableJacopo Mondi
Fix GPIO enable/disable operations which wrongly read the 0x0f register to obtain the current mask of the enabled lines instead of using the correct 0x0e register. Also fix access to bit 0 of the register which is marked as reserved. Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: v4l2-fwnode: Remove v4l2_async_notifier_parse_fwnode_endpoints_by_port()Niklas Söderlund
There are no users left of this helper and as it implements an undesirable and too simple behaviour that should instead be implemented directly by drivers remove it to prevent future uses of it. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: rcar-vin: Rework CSI-2 firmware parsingNiklas Söderlund
Rework the CSI-2 firmware parsing code to not use the soon to be removed v4l2_async_notifier_parse_fwnode_endpoints_by_port() helper. The change only aims to prepare for the removing of the old helper and there are no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: rcar-vin: Use v4l2_async_subdev instead of fwnode_handle to match ↵Niklas Söderlund
subdevices In preparation of removing the usage of the old helper v4l2_async_notifier_parse_fwnode_endpoints_by_port() use the v4l2_async_subdev instead of fwnode_handle to match subdevices. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: rcar-vin: Rework parallel firmware parsingNiklas Söderlund
Rework the parallel firmware parsing code to not use the soon to be removed v4l2_async_notifier_parse_fwnode_endpoints_by_port() helper. The change only aims to prepare for the removing of the old helper and there are no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: rcar-vin: Only dynamically allocate v4l2_async_subdevNiklas Söderlund
In preparation of removing the usage of the old helper v4l2_async_notifier_parse_fwnode_endpoints_by_port() do not dynamically allocate the whole structure containing the parameters for the parallel interface, instead only allocate the v4l2_async_subdev structure. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: ov2740: fix dereference before null check on pointer nvmColin Ian King
Currently pointer nvm is being dereferenced before it is being null checked. Fix this by moving the assignments of pointers client and ov2740 so that are after the null check hence avoiding any potential null pointer dereferences on pointer nvm. Fixes: 5e6fd339b68d ("media: ov2740: allow OTP data access during streaming") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: i2c: add OV02A10 image sensor driverDongchun Zhu
Add a V4L2 sub-device driver for OmniVision OV02A10 image sensor. Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: media: i2c: document OV02A10 DT bindingsDongchun Zhu
Add device-tree binding documentation for OV02A10 image sensor driver, and the relevant MAINTAINERS entries. Signed-off-by: Dongchun Zhu <dongchun.zhu@mediatek.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: ov9734: hold lock to check streaming stateBingbu Cao
The lock in ov9734 is used to protect the streaming state and serialize the stream on and off callbacks, it should be hold before checking the streaming state in ov9734_set_stream(). Reported-by: Tomasz Figa <tfiga@chromium.org> Reported-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: v4l: subdev: Set sd->devnode before registering the subdevSakari Ailus
The subdev's video device node was only assigned after registering the device node in the system. While it is unlikely that a driver needed to use this field in handling system calls to its file handle, there remains a slim chance the devnode field remains NULL while the driver expects to find a video node there. Assign the devnode field before registering the device, and assign it back to NULL if the registration failed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: omap3isp: Remove misleading commentThomas Gleixner
in_interrupt() covers hard and soft interrupt servicing and bottom half disabled contexts, which is semantically undefined and useless. The comment for __ccdc_lsc_configure() "Context: in_interrupt()" is therefore as useful as "Context: unknown'. Remove it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: ccs: Request for "reset" GPIOSakari Ailus
The DT bindings documented "reset-gpios" property but the driver never made use of it. Instead it used a GPIO called "xshutdown", with apprently wrong polarity. Fix this by requesting "reset" GPIO with the right polarity first, and if that fails, then request "xshutdown" GPIO with the old polarity. This way it works for new users as expected while if someone, somewhere, depended on "xshutdown" GPIO, that continues to work as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: mipi-ccs: Add bus-type for C-PHY supportSakari Ailus
The bus-type property is required for C-PHY support. Add it, including values for CCP2 and CSI-2 D-PHY. Also require the bus-type property. Effectively all new sensors are MIPI D-PHY or C-PHY that cannot be told apart without the bus-type property. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: nokia,smia: Amend SMIA bindings with MIPI CCS supportSakari Ailus
Amend the existing SMIA bindings by adding MIPI CCS support, with separate compatible strings for CCS 1.0 and CCS 1.1. Rename the old bindings accordingly as CCS is the current standard. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: nokia,smia: Use better active polarity for resetSakari Ailus
Generally reset signal is active low on camera sensors. The example had it high. Make it low, and use GPIO_ACTIVE_LOW in gpio.h for that. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: nokia,smia: Convert to YAMLSakari Ailus
Convert nokia,smia DT bindings to YAML. Also add explicit license to bindings. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-02media: dt-bindings: nokia,smia: Remove nokia,nvm-size propertySakari Ailus
nokia,nvm-size property was removed from the bindings but it was left in the example. Remove it from the example, too. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>