aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-07-25media: ti: cal: Implement get_frame_desc for camera-rxTomi Valkeinen3-47/+47
CAL uses get_frame_desc to get the VC and DT for the incoming CSI-2 stream, but does it in a bit hacky way. Clean this up by implementing .get_frame_desc to camera-rx, and calling that from cal.c. No functional change intended. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-25media: ti: cal: Use subdev stateTomi Valkeinen3-107/+53
Change TI CAL driver to use subdev state. No functional changes (intended). This allows us to get rid of the 'formats' field, as the formats are kept in the state, and also the 'mutex' as we already have state locking. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-25media: ti: cal: Fix cal_camerarx_create() error handlingTomi Valkeinen1-10/+13
We don't do a proper job at freeing resources in cal_camerarx_create's error paths. Fix these, and also switch the phy allcation from kzalloc to devm_kzalloc to simplify the code further. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-25media: ti: cal: Clean up mbus formats usesTomi Valkeinen3-32/+8
Clean up the CAL drivers uses of mbus formats: - Switch all YUV formats from 2X8 formats to 1X16, as those are what should be used for CSI-2 bus. - Drop 24 and 32 bit formats, as the driver doesn't support them (see cal_ctx_pix_proc_config()). - Switch RGB565_2X8_LE to RGB565_1X16 (for the same reason as for the YUV formats) and drop RGB565_2X8_BE as it cannot be supported with CSI-2. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-25media: imx: Unstage the imx8mq-mipi-csi2 driverMartin Kepplinger6-13/+17
The imx8mq-mipi-csi2 MIPI CSI-2 receiver driver is used and maintained. There is no reason to keep it in staging. The accompanying CSI bridge driver that uses it is in drivers/media/platform/nxp as well. One TODO is to get rid of csi_state's "state" and "lock" variables. Especially make sure suspend/resume is working without them. That can very well be worked on from the new location. Also add a MAINTAINERS section for the imx8mq-mipi-csi2 mipi receiver driver. Signed-off-by: Martin Kepplinger <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-25staging: media: ipu3: code style fix - avoid multiple line dereferenceNikolay Kyx1-8/+6
This patch fixes the following checkpatch.pl warning: WARNING: Avoid multiple line dereference in file ipu3-css.c Signed-off-by: Nikolay Kyx <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: i2c: ov01a10: Switch back to use struct i2c_driver::probeUwe Kleine-König1-1/+1
struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: aspeed: Fix memory overwrite if timing is 1600x900Jammy Huang1-2/+2
When capturing 1600x900, system could crash when system memory usage is tight. The way to reproduce this issue: 1. Use 1600x900 to display on host 2. Mount ISO through 'Virtual media' on OpenBMC's web 3. Run script as below on host to do sha continuously #!/bin/bash while [ [1] ]; do find /media -type f -printf '"%h/%f"\n' | xargs sha256sum done 4. Open KVM on OpenBMC's web The size of macro block captured is 8x8. Therefore, we should make sure the height of src-buf is 8 aligned to fix this issue. Signed-off-by: Jammy Huang <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: ds90ub9xx: switch three more drivers back to use struct ↵Uwe Kleine-König3-3/+3
i2c_driver::probe() struct i2c_driver::probe_new() is about to go away. Since I converted all drivers below drivers/media use struct i2c_driver::probe, three more drivers were added in the following commits that use .probe_new(): commit 6363db1c9d45 ("media: i2c: add DS90UB953 driver") commit c158d0d4ff15 ("media: i2c: add DS90UB913 driver") commit afe267f2d368 ("media: i2c: add DS90UB960 driver") Switch these driver to use the probe callback. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: use proper commit description style]
2023-07-19media: i2c: ds90ub960: fix error handling in ub960_rxport_add_serializer()Harshit Mogalapalli1-2/+2
Smatch warns: drivers/media/i2c/ds90ub960.c:1671 ub960_rxport_add_serializer(): err: 'rxport->ser.client' dereferencing possible ERR_PTR() i2c_new_client_device() returns error pointers on failure and in dev_dbg statement we are dereferencing error pointer which is a bug. Fix this by using IS_ERR() which checks for error pointers. Fixes: afe267f2d368 ("media: i2c: add DS90UB960 driver") Signed-off-by: Harshit Mogalapalli <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: i2c: ds90ub953: No need to set device_driver ownerYang Li1-1/+0
Remove .owner field if calls are used which set it automatically. to silence the warning: ./drivers/media/i2c/ds90ub953.c:1390:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5902 Signed-off-by: Yang Li <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: Explicitly include correct DT includesRob Herring59-71/+44
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dvb-usb-v2: gl861: Fix null-ptr-deref in gl861_i2c_master_xferZhang Shurong1-1/+1
In gl861_i2c_master_xfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach gl861_i2c_master_xfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dvb-usb: opera1: fix uninit-value in dvb_usb_adapter_dvb_initZhang Shurong1-2/+7
If opera1_xilinx_rw fails, the mac address is not initialized. And opera1_read_mac_address does not handle this failure, which leads to the uninit-value in dvb_usb_adapter_dvb_init. Fix this by handling the failure of opera1_xilinx_rw. Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: az6007: Fix null-ptr-deref in az6007_i2c_xfer()Zhang Shurong1-0/+8
In az6007_i2c_xfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach az6007_i2c_xfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: anysee: fix null-ptr-deref in anysee_master_xferZhang Shurong1-1/+1
In anysee_master_xfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach anysee_master_xfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: add spaces around +]
2023-07-19media: af9005: Fix null-ptr-deref in af9005_i2c_xferZhang Shurong1-0/+5
In af9005_i2c_xfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach af9005_i2c_xfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dw2102: Fix null-ptr-deref in dw2102_i2c_transfer()Zhang Shurong1-0/+24
In dw2102_i2c_transfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach dw2102_i2c_transfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 950e252cb469 ("[media] dw2102: limit messages to buffer size") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: sh_vou: Convert to devm_platform_ioremap_resource()Yangtao Li1-6/+6
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: fimc-core: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: platform: ti: Use devm_platform_get_and_ioremap_resource()Yangtao Li1-2/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: retained the line wrap]
2023-07-19media: stm32-dcmi: Use devm_platform_get_and_ioremap_resource()Yangtao Li1-13/+4
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: verisilicon: Convert to devm_platform_ioremap_resource() and ↵Yangtao Li1-6/+3
devm_platform_ioremap_resource_byname() Use devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: microchip-sama7g5-isc: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: fimc-lite: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: microchip-sama5d2-isc: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: marvell: Use devm_platform_get_and_ioremap_resource()Yangtao Li1-2/+1
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: pxa_camera: Use devm_platform_get_and_ioremap_resource()Yangtao Li1-9/+8
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: atmel-isi: Convert to devm_platform_ioremap_resource()Yangtao Li1-3/+1
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dvb-usb-v2: af9035: Fix null-ptr-deref in af9035_i2c_master_xferZhang Shurong1-4/+5
In af9035_i2c_master_xfer, msg is controlled by user. When msg[i].buf is null and msg[i].len is zero, former checks on msg[i].buf would be passed. Malicious data finally reach af9035_i2c_master_xfer. If accessing msg[i].buf[0] without sanity check, null ptr deref would happen. We add check on msg[i].len to prevent crash. Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()") Signed-off-by: Zhang Shurong <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19drivers: saa7164: remove duplicate assignmentsMinjie Du1-1/+0
make second_timeout avoid double assignment. Signed-off-by: Minjie Du <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: wl128x: Fix spelling mistake "Transfered" -> "Transferred"Colin Ian King1-1/+2
There is a spelling mistake in a fmdbg message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: split overly long line over two lines]
2023-07-19media: docs: qcom_camss: Update Code Aurora referencesJeffrey Hugo1-3/+3
source.codeaurora.org is no longer accessible and so the reference links in the documentation are not useful. The content was mirrored over to Code Linaro so lets update the references to point there instead. Signed-off-by: Jeffrey Hugo <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: cx24120: Add retval check for cx24120_message_send()Daniil Dulov1-1/+3
If cx24120_message_send() returns error, we should keep local struct unchanged. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 5afc9a25be8d ("[media] Add support for TechniSat Skystar S2") Signed-off-by: Daniil Dulov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: mdp3: Fix resource leaks in of_find_device_by_nodeLu Hongfei1-0/+2
Use put_device to release the object get through of_find_device_by_node, avoiding resource leaks. Signed-off-by: Lu Hongfei <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dvb-usb: m920x: Fix a potential memory leak in m920x_i2c_xfer()Christophe JAILLET1-2/+3
'read' is freed when it is known to be NULL, but not when a read error occurs. Revert the logic to avoid a small leak, should a m920x_read() call fail. Fixes: a2ab06d7c4d6 ("media: m920x: don't use stack on USB reads") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: tc358743: Add error code to error messageAlexander Stein1-4/+4
Add the error code of a failed i2c transfer to the error message. Signed-off-by: Alexander Stein <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: dib7000p: Fix potential division by zeroDaniil Dulov1-1/+1
Variable loopdiv can be assigned 0, then it is used as a denominator, without checking it for 0. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 713d54a8bd81 ("[media] DiB7090: add support for the dib7090 based") Signed-off-by: Daniil Dulov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: (bw != NULL) -> bw]
2023-07-19media: cx18: remove unnecessary (void*) conversionsYu Zhe2-2/+2
Pointer variables of void * type do not require type cast. Signed-off-by: Yu Zhe <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: ttpci: remove unnecessary (void*) conversionsYu Zhe4-45/+45
Pointer variables of void * type do not require type cast. Signed-off-by: Yu Zhe <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: ttusb-dec: remove unnecessary (void*) conversionsYu Zhe1-6/+6
Pointer variables of void * type do not require type cast. Signed-off-by: Yu Zhe <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19drivers: usb: smsusb: fix error handling code in smsusb_init_deviceDongliang Mu1-10/+11
The previous commit 4b208f8b561f ("[media] siano: register media controller earlier")moves siano_media_device_register before smscore_register_device, and adds corresponding error handling code if smscore_register_device fails. However, it misses the following error handling code of smsusb_init_device. Fix this by moving error handling code at the end of smsusb_init_device and adding a goto statement in the following error handling parts. Fixes: 4b208f8b561f ("[media] siano: register media controller earlier") Signed-off-by: Dongliang Mu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19drivers/media/common/siano/smsendian.c : eliminate unnecessary type conversionsDong Chuanjian1-1/+1
remove unnecessary void* type casting. Signed-off-by: Dong Chuanjian <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: siano: Convert to use sysfs_emit_at() APIye xingchen1-217/+117
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-19media: pvrusb2: use sysfs_emit() to instead of scnprintf()ye xingchen1-10/+10
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2023-07-14media: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link()Christophe JAILLET1-4/+14
If fwnode_graph_get_remote_endpoint() fails, 'fwnode' is known to be NULL, so fwnode_handle_put() is a no-op. Release the reference taken from a previous fwnode_graph_get_port_parent() call instead. Also handle fwnode_graph_get_port_parent() failures. In order to fix these issues, add an error handling path to the function and the needed gotos. Fixes: ca50c197bd96 ("[media] v4l: fwnode: Support generic fwnode for parsing standardised properties") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-14media: i2c: add DS90UB953 driverTomi Valkeinen3-0/+1414
Add driver for TI DS90UB953 FPD-Link III Serializer. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-14media: i2c: add DS90UB913 driverTomi Valkeinen3-0/+920
Add driver for TI DS90UB913 FPD-Link III Serializer. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-14media: i2c: add DS90UB960 driverTomi Valkeinen5-0/+4103
Add driver for TI DS90UB960 FPD-Link III Deserializer. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-07-14media: dt-bindings: media: add TI DS90UB960 FPD-Link III DeserializerTomi Valkeinen1-0/+427
Add DT bindings for TI DS90UB960 FPD-Link III Deserializer. Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>