summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-11-27media: bt8xx: avoid a useless memsetChristophe JAILLET
Avoid a memset after a call to 'dma_alloc_coherent()'. This is useless since commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: bt8xx: 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 'bt878_mem_alloc()' (bt878.c), GFP_KERNEL can be used because it is only called from the probe function (i.e. 'bt878_probe()') and no lock is taken. When memory is allocated in 'btcx_riscmem_alloc()' (btcx-risc.c), GFP_KERNEL can be used because all the callers either already use GFP_KERNEL or are called from a probe function or are called from a .buf_prepare function. The 4 callers are all in 'bttv-risc.c'. - bttv_risc_packed() and bttv_risc_planar(): only called from 'videobuf_queue_ops''s '.buf_prepare' functions. The call chains are: .buf_prepare (in 'bttv-driver.c') --> buffer_prepare (in 'bttv-driver.c') --> bttv_prepare_buffer --> bttv_buffer_risc --> bttv_risc_packed (x8 times) --> bttv_risc_planar (x6 times) .buf_prepare (in 'bttv-vbi.c') --> vbi_buffer_prepare (in 'bttv-vbi.c') --> bttv_risc_packed (x2 times) - bttv_risc_overlay(): already uses GFP_KERNEL - bttv_risc_init_main(): only called from the 'bttv_probe()' probe function and no spin_lock is taken in the between @@ @@ - 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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: b2c2: 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 'flexcop_dma_allocate()', GFP_KERNEL can be used because it is only called from the probe function (i.e. 'flexcop_pci_probe()') and no lock is taken. The call chain is: flexcop_pci_probe --> flexcop_pci_dma_init --> flexcop_dma_allocate @@ @@ - 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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: tuners: reduce stack usage in mxl5005s_reconfigureBixuan Cui
Fix the warning: [-Werror=-Wframe-larger-than=] drivers/media/tuners/mxl5005s.c: In function 'mxl5005s_reconfigure': drivers/media/tuners/mxl5005s.c:3953:1: warning: the frame size of 1152 bytes is larger than 1024 bytes Signed-off-by: Bixuan Cui <cuibixuan@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Replace HTTP links with HTTPS ones: SI2165 MEDIA DRIVERAlexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation/driver-api: media/dtv-frontend: drop doubled wordRandy Dunlap
Drop the doubled word "errors". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation/driver-api: media/v4l2-dev: drop doubled wordRandy Dunlap
Drop the doubled word "device". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation/driver-api: media/v4l2-controls: drop doubled wordsRandy Dunlap
Drop the doubled words "type" and "the". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation/driver-api: media/cec-core: drop doubled wordRandy Dunlap
Drop the doubled word "the". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/audio: drop doubled wordRandy Dunlap
Drop the doubled word "and". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/net: drop doubled wordRandy Dunlap
Drop the doubled word "and". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/audio: drop doubled wordRandy Dunlap
Drop the doubled word "Any". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: v4l/selection-api-config: drop ↵Randy Dunlap
doubled word Drop the doubled word "in". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: v4l/vidioc-g-ext-ctrls: drop ↵Randy Dunlap
doubled word Drop the doubled word "controls". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: v4l/vidioc-g-output: drop doubled ↵Randy Dunlap
word Drop the doubled word "standard.". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: v4l/vidioc-qbuf: drop doubled wordRandy Dunlap
Drop the doubled word "the". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/video: drop doubled wordRandy Dunlap
Drop the doubled word "and". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/dmx-qbuf: drop doubled wordRandy Dunlap
Drop the doubled word "the". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/demux: drop doubled wordRandy Dunlap
Drop the doubled word "and". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Documentation: userspace-api/media: dvb/ca: drop doubled wordRandy Dunlap
Drop the doubled word "and". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-doc@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: Remove superfluous dependency for MEDIA_SUPPORT_FILTERGeert Uytterhoeven
The MEDIA_SUPPORT_FILTER configuration option is located inside a block protected by "#if MEDIA_SUPPORT", so there is no need to have an explicit dependency on MEDIA_SUPPORT. Drop it. Fixes: c6774ee035dcb878 ("media: Kconfig: make filtering devices optional") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: i2c: imx219: remove redundant writesSameer Puri
These writes to 0x162, 0x163 already appear earlier in the struct for the 1920x1080 mode and do not need to be repeated. Signed-off-by: Sameer Puri <purisame@spuri.io> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: mantis: remove redundant assignment to variable errColin Ian King
The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: max2175: fix max2175_set_csm_mode() error codeDan Carpenter
This is supposed to return negative error codes but the type is bool so it returns true instead. Fixes: b47b79d8a231 ("[media] media: i2c: max2175: Add MAX2175 support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: c8sectpfe: clean up some indentingDan Carpenter
The "seg_num," line wasn't indented. All the arguments can fit nicely on two lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: uvcvideo: Use DIV_ROUND_CLOSEST directly to make it readablezhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: imx214: Fix stop streamingDaniel Gomez
Stop video streaming when requested. When s_stream is called to stop the video streaming, if/else condition calls start_streaming function instead of the one for stopping it. Fixes: 436190596241 ("media: imx214: Add imx214 camera sensor driver") Signed-off-by: Daniel Gomez <daniel@qtec.com> Signed-off-by: Ricardo Ribalda <ribalda@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: msi2500: assign SPI bus number dynamicallyAntti Palosaari
SPI bus number must be assigned dynamically for each device, otherwise it will crash when multiple devices are plugged to system. Reported-and-tested-by: syzbot+c60ddb60b685777d9d59@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: usb: msi2500: Fix a possible null-pointer dereference in ↵Jia-Ju Bai
msi2500_stop_streaming() In msi2500_stop_streaming(), there is an if statement on line 870 to check whether dev->udev is NULL: if (dev->udev) When dev->udev is NULL, it is used on line 877: msi2500_ctrl_msg(dev, CMD_STOP_STREAMING, 0) usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), ...) Thus, a possible null-pointer dereference may occur. To fix this bug, dev->udev is checked before calling msi2500_ctrl_msg(). This bug is found by a static analysis tool STCheck written by us. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: platform: sti: c8sectpfe: core: Add of_node_put() at gotoNishka Dasgupta
Each iteration of for_each_child_of_node puts the previous node, but in the case of a goto from the middle of the loop, there is no put, thus causing a memory leak. Hence add a new label that puts the last used node, and edit the goto statements in the middle of the loop to first go to the new label. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-27media: gp8psk: initialize stats at power control logicMauro Carvalho Chehab
As reported on: https://lore.kernel.org/linux-media/20190627222020.45909-1-willemdebruijn.kernel@gmail.com/ if gp8psk_usb_in_op() returns an error, the status var is not initialized. Yet, this var is used later on, in order to identify: - if the device was already started; - if firmware has loaded; - if the LNBf was powered on. Using status = 0 seems to ensure that everything will be properly powered up. So, instead of the proposed solution, let's just set status = 0. Reported-by: syzbot <syzkaller@googlegroups.com> Reported-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-26media: lirc: fix lirc.h documentation generationSean Young
The rc_proto enum values should be ignored for now, otherwise we get warnings like: Documentation/output/lirc.h.rst:6: WARNING: undefined label: rc-proto-max (if the link has no caption the label must precede a section header) Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 72e637fec558 ("media: rc: validate that "rc_proto" is reasonable") Fixes: cea357bc2571 ("media: lirc: ensure RC_PROTO_MAX has documentation") Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-26media: rc: add keymap for KHAMSIN remoteChristian Hewitt
This remote ships with the Amlogic SML-5442TW IPTV/VOD Set-Top Box used by O2.cz. This keymap adds support for the default IR controls. Signed-off-by: Christian Hewitt <christianshewitt@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-26media: dvb-usb: Add Hauppauge MAX S2's USB-IDsKai Muenz
Hauppauge MAX S2 or WinTV NOVA HD USB2.0. Signed-off-by: Kai Muenz <squ@tent.at> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-26media: siano: fix memory leak of debugfs members in smsdvb_hotplugKeita Suzuki
When dvb_create_media_graph fails, the debugfs kept inside client should be released. However, the current implementation does not release them. Fix this by adding a new goto label to call smsdvb_debugfs_release. Fixes: 0d3ab8410dcb ("[media] dvb core: must check dvb_create_media_graph()") Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-26media: rc: improve LIRC documentationMauro Carvalho Chehab
Add documentation for enum rc_proto and struct lirc_scancode at the generated docs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sean Young <sean@mess.org>
2020-11-26media: docs: uAPI: rc: dual-license the docs with GPL v2Mauro Carvalho Chehab
Make the license for those documents also compatible with GPLv2. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sean Young <sean@mess.org>
2020-11-25media: camss: csiphy: Set rate on csiX_phy clock on SDM630/660AngeloGioacchino Del Regno
The SDM630/660 SoCs (and variants) have another clock source for the PHY, which must be set to a rate that's equal or greater than the CSI PHY timer clock: failing to do this will produce PHY overflows when trying to get a stream from a very high bandwidth camera sensor and outputting no frame or a partial one. Since I haven't found any usecase in which the csiX_phy clock needs to be higher than the csiXphy_timer, let's just set the same rate on both, which seems to work just perfect. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: camss: csiphy-3ph: Add support for SDM630/660AngeloGioacchino Del Regno
The CSIPHY on SDM630/660 needs a slightly longer T_HS_CLK_MISS configuration on lanes CFG4. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: camss: Add support for SDM630/636/660 camera subsystemAngeloGioacchino Del Regno
Add support for the Qualcomm SDM630/636/660 and SDA variants' camera subsystem. These SoCs are equipped with: - 3x CSI PHY 3-Phase v1.0 (downstream csiphy-v3.5) - 4x CSID v5.0 - 2x ISPIF v3.0 - 2x VFE 4.8 As a note, this camera subsystem is very similar to the one that is found in the MSM8998/APQ8098 SoCs. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: dt-bindings: media: qcom,camss: Add bindings for SDM660 camssAngeloGioacchino Del Regno
Add bindings for qcom,sdm660-camss in order to support the camera subsystem on SDM630/660 and SDA variants. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> Reviewed-by: Robert Foss <robert.foss@linaro.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-11-25media: camss: vfe: Add support for VFE 4.8AngeloGioacchino Del Regno
Add the support for VFE 4.8 in the camss-vfe-4-7 driver, as this one really is a minor revision, requiring the very same management and basically having the same register layout as VFE 4.7, but needing a different QoS and DS configuration, using a different register to enable the wm and habing the same UB size for both instances (instead of a different size between instance 0 and 1). Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: camss: vfe-4-7: Rename get_ub_size, set_qos, set_ds, wm_enableAngeloGioacchino Del Regno
In preparation to add support for VFE 4.8, rename these functions by adding the vfe version that they are referred to (for example, vfe_get_ub_size -> vfe47_get_ub_size), as these are the only ones that will be different for the VFE version 4.8. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: camss: ispif: Correctly reset based on the VFE IDAngeloGioacchino Del Regno
Resetting the ISPIF VFE0 context is wrong if we are using the VFE1 for dual-camera or simply because a secondary camera is connected to it: in this case the reset will always happen on the VFE0 ctx of the ISPIF, which is .. useless. Fix this usecase by adding the ISPIF_RST_CMD_1 address and choose where to do the (or what to) reset based on the VFE line id. Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com> 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-11-25media: lirc: ensure RC_PROTO_MAX has documentationSean Young
The enum rc_proto value RC_PROTO_MAX has no documentation, this is causing a warning while building the documentation. Fixes: 72e637fec558 ("media: rc: validate that "rc_proto" is reasonable") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-25media: sunxi-cir: allow timeout to be set at runtimeSean Young
This allows the timeout to be set with the LIRC_SET_REC_TIMEOUT ioctl. The timeout was hardcoded at just over 20ms, but returned 120ms when queried with the LIRC_GET_REC_TIMEOUT ioctl. This also ensures the idle threshold is set correctly with a base clock other than 8Mhz. Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-25media: sunxi-cir: ensure IR is handled when it is continuousSean Young
If a user holds a button down on a remote, then no ir idle interrupt will be generated until the user releases the button, depending on how quickly the remote repeats. No IR is processed until that point, which means that holding down a button may not do anything. This also resolves an issue on a Cubieboard 1 where the IR receiver is picking up ambient infrared as IR and spews out endless "rc rc0: IR event FIFO is full!" messages unless you choose to live in the dark. Cc: stable@vger.kernel.org Tested-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Maxime Ripard <mripard@kernel.org> Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-25media: i2c: imx219: Declare that the driver can create eventsDave Stevenson
The flag V4L2_SUBDEV_FL_HAS_EVENTS is required if the subdev can generate events. It can create events from the ctrl handler, therefore this is required. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> 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-11-25media: dt-bindings: imx7-mipi-csi2: convert bindings to yamlRui Miguel Silva
Convert imx7 mipi csi2 bindings documentation to yaml schema, remove the textual document and update MAINTAINERS entry. Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> 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-11-25media: dt-bindings: imx7-csi: convert bindings to yamlRui Miguel Silva
Convert imx7-csi bindings documentation to yaml schema, remove the textual bindings document and update MAINTAINERS entry. Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> 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>