aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/i2c
AgeCommit message (Collapse)AuthorFilesLines
2024-11-08Merge tag 'media/v6.12-2' of ↵Linus Torvalds2-11/+19
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - dvb-core fixes for vb2 check and device registration - v4l2-core: fix an issue with error handling for VIDIOC_G_CTRL - vb2 core: fix an issue with vb plane copy logic - videobuf2-core: copy vb planes unconditionally - vivid: fix buffer overwrite when using > 32 buffers - vivid: fix a potential division by zero due to an issue at v4l2-tpg - some spectre vulnerability fixes - several OOM access fixes - some buffer overflow fixes * tag 'media/v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: videobuf2-core: copy vb planes unconditionally media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set media: vivid: fix buffer overwrite when using > 32 buffers media: pulse8-cec: fix data timestamp at pulse8_setup() media: cec: extron-da-hd-4k-plus: don't use -1 as an error code media: stb0899_algo: initialize cfr before using it media: adv7604: prevent underflow condition when reporting colorspace media: cx24116: prevent overflows on SNR calculus media: ar0521: don't overflow when checking PLL values media: s5p-jpeg: prevent buffer overflows media: av7110: fix a spectre vulnerability media: mgb4: protect driver against spectre media: dvb_frontend: don't play tricks with underflow values media: dvbdev: prevent the risk of out of memory access media: v4l2-tpg: prevent the risk of a division by zero media: v4l2-ctrls-api: fix error handling for v4l2_g_ctrl() media: dvb-core: add missing buffer index check
2024-10-18media: adv7604: prevent underflow condition when reporting colorspaceMauro Carvalho Chehab1-9/+17
Currently, adv76xx_log_status() reads some date using io_read() which may return negative values. The current logic doesn't check such errors, causing colorspace to be reported on a wrong way at adv76xx_log_status(), as reported by Coverity. If I/O error happens there, print a different message, instead of reporting bogus messages to userspace. Fixes: 54450f591c99 ("[media] adv7604: driver for the Analog Devices ADV7604 video decoder") Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Hans Verkuil <[email protected]>
2024-10-18media: ar0521: don't overflow when checking PLL valuesMauro Carvalho Chehab1-2/+2
The PLL checks are comparing 64 bit integers with 32 bit ones, as reported by Coverity. Depending on the values of the variables, this may underflow. Fix it ensuring that both sides of the expression are u64. Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver") Cc: [email protected] Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Sakari Ailus <[email protected]>
2024-10-02move asm/unaligned.h to linux/unaligned.hAl Viro25-25/+25
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
2024-08-31media: i2c: mt9v111: Drop redundant commaLiao Chen1-1/+1
Drop the redundant comma from mt9v111_of_match array to make the code clean. Signed-off-by: Liao Chen <[email protected]> Reviewed-by: Biju Das <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: mt9v111: Enable module autoloadingLiao Chen1-0/+1
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Liao Chen <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: imx335: Fix reset-gpio handlingUmang Jain1-5/+4
Rectify the logical value of reset-gpio so that it is set to 0 (disabled) during power-on and to 1 (enabled) during power-off. Set the reset-gpio to GPIO_OUT_HIGH at initialization time to make sure it starts off in reset. Also drop the "Set XCLR" comment which is not-so-informative. The existing usage of imx335 had reset-gpios polarity inverted (GPIO_ACTIVE_HIGH) in their device-tree sources. With this patch included, those DTS will not be able to stream imx335 anymore. The reset-gpio polarity will need to be rectified in the device-tree sources as shown in [1] example, in order to get imx335 functional again (as it remains in reset prior to this fix). Cc: [email protected] Fixes: 45d19b5fb9ae ("media: i2c: Add imx335 camera sensor driver") Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/linux-media/[email protected]/ Signed-off-by: Umang Jain <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: og01a1b: Add management of optional sensor supply linesVladimir Zapolskiy1-1/+80
Omnivision OG01A1B camera sensor is supplied by three power rails, if supplies are present as device properties, include them into sensor power up sequence. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: og01a1b: Add management of optional reset GPIOVladimir Zapolskiy1-1/+16
Omnivision OG01A1B camera sensor may have a connected active low GPIO to XSHUTDOWN pad, and if so, include it into sensor power up sequence. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: og01a1b: Add support of xvclk supply clock in power managementVladimir Zapolskiy1-6/+40
The OmniVision OG01A1B camera sensor has an xvclk supply clock, which could be described and then explicitly controlled on OF platforms. Signed-off-by: Vladimir Zapolskiy <[email protected]> [Sakari Ailus: Use UL specifier for power-up delay cycle value.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: og01a1b: Add stubs of runtime power management functionsVladimir Zapolskiy1-9/+33
Rearrange initializations and checks in probe before population of the power management functions. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: og01a1b: Add OF support to the image sensor driverVladimir Zapolskiy1-0/+7
The OmniVision OG01A1B image sensor driver currently supports probing only on ACPI platforms, the changes adds support of OF platforms to the driver. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: ccs: Remove unused declarationsYue Haibing1-3/+0
Commit 2989a457171d ("media: ccs: Refactor register reading a little") removed ccs_read_addr_no_quirk() but left declaration. Commit 529322112a3b ("media: ccs: Use V4L2 CCI for accessing sensor registers") removed ccs_write_addr_no_quirk() and ccs_reg_width() but leave their declarations. Signed-off-by: Yue Haibing <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: ar0521: Use cansleep version of gpiod_set_value()Alexander Shiyan1-2/+3
If we use GPIO reset from I2C port expander, we must use *_cansleep() variant of GPIO functions. This was not done in ar0521_power_on()/ar0521_power_off() functions. Let's fix that. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 11 at drivers/gpio/gpiolib.c:3496 gpiod_set_value+0x74/0x7c Modules linked in: CPU: 0 PID: 11 Comm: kworker/u16:0 Not tainted 6.10.0 #53 Hardware name: Diasom DS-RK3568-SOM-EVB (DT) Workqueue: events_unbound deferred_probe_work_func pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : gpiod_set_value+0x74/0x7c lr : ar0521_power_on+0xcc/0x290 sp : ffffff8001d7ab70 x29: ffffff8001d7ab70 x28: ffffff80027dcc90 x27: ffffff8003c82000 x26: ffffff8003ca9250 x25: ffffffc080a39c60 x24: ffffff8003ca9088 x23: ffffff8002402720 x22: ffffff8003ca9080 x21: ffffff8003ca9088 x20: 0000000000000000 x19: ffffff8001eb2a00 x18: ffffff80efeeac80 x17: 756d2d6332692f30 x16: 0000000000000000 x15: 0000000000000000 x14: ffffff8001d91d40 x13: 0000000000000016 x12: ffffffc080e98930 x11: ffffff8001eb2880 x10: 0000000000000890 x9 : ffffff8001d7a9f0 x8 : ffffff8001d92570 x7 : ffffff80efeeac80 x6 : 000000003fc6e780 x5 : ffffff8001d91c80 x4 : 0000000000000002 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000001 Call trace: gpiod_set_value+0x74/0x7c ar0521_power_on+0xcc/0x290 ... Signed-off-by: Alexander Shiyan <[email protected]> Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver") Cc: [email protected] Acked-by: Krzysztof Hałasa <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: ov5675: Fix power on/off delay timingsBryan O'Donoghue1-6/+6
The ov5675 specification says that the gap between XSHUTDN deassert and the first I2C transaction should be a minimum of 8192 XVCLK cycles. Right now we use a usleep_rage() that gives a sleep time of between about 430 and 860 microseconds. On the Lenovo X13s we have observed that in about 1/20 cases the current timing is too tight and we start transacting before the ov5675's reset cycle completes, leading to I2C bus transaction failures. The reset racing is sometimes triggered at initial chip probe but, more usually on a subsequent power-off/power-on cycle e.g. [ 71.451662] ov5675 24-0010: failed to write reg 0x0103. error = -5 [ 71.451686] ov5675 24-0010: failed to set plls The current quiescence period we have is too tight. Instead of expressing the post reset delay in terms of the current XVCLK this patch converts the power-on and power-off delays to the maximum theoretical delay @ 6 MHz with an additional buffer. 1.365 milliseconds on the power-on path is 1.5 milliseconds with grace. 85.3 microseconds on the power-off path is 90 microseconds with grace. Fixes: 49d9ad719e89 ("media: ov5675: add device-tree support and support runtime PM") Cc: [email protected] Signed-off-by: Bryan O'Donoghue <[email protected]> Tested-by: Johan Hovold <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Tested-by: Quentin Schulz <[email protected]> # RK3399 Puma with Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: imx355: Parse and register propertiesRobert Mader1-1/+11
Analogous to e.g. the imx219 driver. This enables propagating the V4L2_CID_CAMERA_SENSOR_ROTATION and V4L2_CID_CAMERA_ORIENTATION values so that userspace - e.g. libcamera - can detect the correct rotation and orientation from the device tree. Signed-off-by: Robert Mader <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: max96714: coding style fixesJulien Massot1-9/+9
Coding style fixes suggested by Sakari during the driver review. Reviewed-by: Tommaso Merciai <[email protected]> Tested-by: Tommaso Merciai <[email protected]> Signed-off-by: Julien Massot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: max96717: coding style fixesJulien Massot1-19/+12
Coding style fixes suggested by Sakari during the driver review. Signed-off-by: Julien Massot <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Tested-by: Tommaso Merciai <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: max96717: add test pattern ctrlTommaso Merciai1-16/+197
Add v4l2 test pattern control. Signed-off-by: Tommaso Merciai <[email protected]> Reviewed-by: Julien Massot <[email protected]> Tested-by: Julien Massot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: tc358746: Move clk_prepare to its own functionRicardo Ribalda1-1/+11
Smatch is very confused by a clk_prepare_enable() being called in an error-path. Fix this warning by moving the clk_prepare_enable() to its own function. drivers/media/i2c/tc358746.c:1631 tc358746_suspend() warn: 'tc358746->refclk' from clk_prepare_enable() not released on lines: 1631. Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: s5c73m3: Move clk_prepare to its own functionRicardo Ribalda1-1/+12
Smatch is very confused by a clk_prepare_enable() being called in an error-path. Fix this warning by moving the clk_prepare_enable() to its own function. drivers/media/i2c/s5c73m3/s5c73m3-core.c:1425 __s5c73m3_power_off() warn: 'state->clock' from clk_prepare_enable() not released on lines: 1425. Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: i2c: ov5645: Refactor ov5645_set_power_off()Ricardo Ribalda1-3/+12
Factor out all the power off logic, except clk_disable_unprepare(), to a new function __ov5645_set_power_off(). This allows ov5645_set_power_on() to excplicitly clean-out the clock during the error-path. The following smatch warning is fixed: drivers/media/i2c/ov5645.c:690 ov5645_set_power_on() warn: 'ov5645->xclk' from clk_prepare_enable() not released on lines: 690. Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: ar0521: Refactor ar0521_power_off()Ricardo Ribalda1-4/+13
Factor out all the power off logic, except the clk_disable_unprepare(), to a new function __ar0521_power_off(). This allows ar0521_power_on() to explicitly clean-out the clock during the error-path. The following smatch warning is fixed: drivers/media/i2c/ar0521.c:912 ar0521_power_on() warn: 'sensor->extclk' from clk_prepare_enable() not released on lines: 912. Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-31media: imx283: Add 3/3 binning modeUmang Jain1-0/+33
IMX283 supports 12-bit 3/3 binning mode with 1824x1216 resolution. Introduce the mode config for the same. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-25media: mt9p031: Drop CONFIG_OF ifdefferyBiju Das1-3/+2
Drop of_match_ptr() from mt9p031_i2c_driver and get rid of ugly CONFIG_OF if check. This slightly increases the size of mt9p031_i2c_driver on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-08-25media: mt9p031: Extend match support for OF tablesBiju Das1-22/+11
The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using MEDIA_BUS_FMT as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data() and simplifly probe() and mt9p031_init_state(). While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-08-09media: i2c: tda1997x: constify snd_soc_component_driver structJavier Carrasco1-1/+1
`tda1997x_codec_driver` is not modified after its declaration, and it is only passed to `devm_snd_soc_register_component()`, which expects a constant `snd_soc_component_driver`. Move `tda1997x_codec_driver` to a read-only section by declaring it const. Signed-off-by: Javier Carrasco <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-09media: i2c: GC08A3: Fix spelling mistake "STRAEMING_REG" -> "STREAMING_REG"Colin Ian King1-1/+1
There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-09media: i2c: GC05A2: Fix spelling mistake "Horizental" -> "Horizontal"Colin Ian King1-1/+1
There is a spelling mistake in a string in the gc05a2_test_pattern_menu array. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-09media: i2c: thp7312: Convert comma to semicolonChen Ni1-1/+1
Replace a comma between expression statements by a semicolon. Signed-off-by: Chen Ni <[email protected]> Reviewed-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-09media: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König77-103/+106
These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-08-09media: i2c: tvp5150: Constify some structuresChristophe JAILLET1-2/+2
'vbi_ram_default' and 'tvp5150_config' are not modified in this diver and are only used as a const struct. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 57197 2936 36 60169 eb09 drivers/media/i2c/tvp5150.o After: text data bss dec hex filename 57517 2608 36 60161 eb01 drivers/media/i2c/tvp5150.o Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-29media: uda1342: add missing MODULE_DESCRIPTION() macroJeff Johnson1-0/+1
With ARCH=x86, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/media/i2c/uda1342.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-27media: i2c: gc2145: use CCI_REG16_LE for little-endian registersAlain Volmat1-10/+5
Use CCI_REG16_LE macro in order to access little-endian encoded registers of the P3 (CSI) section. Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-27media: i2c: gc2145: addition of RAW8 formats supportAlain Volmat1-8/+67
Adds support for RAW8 formats (BGGR/RGGB/RBRG/BRBG). Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: fix typo: colospace -> colorspace]
2024-06-26Merge tag 'tags/next-media-20240626' of ↵Hans Verkuil1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git - fix typo in v4l2-subdev.h - imx-pxp bug fix - media i2c Kconfig: add missing FW_UPLOAD select Signed-off-by: Hans Verkuil <[email protected]>
2024-06-26Merge tag 'tags/next-media-renesas-20240619' of ↵Hans Verkuil4-166/+165
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git - Conversion of max9286 and adv748x to V4L2 subdev active state - Cleanups and fixes for the Renesas R-Car VSP and VIN drivers - Miscellaneous cleanups to V4L2 core Signed-off-by: Hans Verkuil <[email protected]>
2024-06-26media: i2c: Kconfig: Fix missing firmware upload config selectKory Maincent1-0/+1
FW_LOADER config only selects the firmware loader API, but we also need the sysfs_upload symbols for firmware_upload_unregister() and firmware_upload_register() to function properly. Fixes: 7a52ab415b43 ("media: i2c: Add driver for THine THP7312") Cc: [email protected] Signed-off-by: Kory Maincent <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-24media: i2c: Add GC05A2 image sensor driverZhi Mao3-0/+1370
Add a V4L2 sub-device driver for Galaxycore GC05A2 image sensor. Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Zhi Mao <[email protected]> [Sakari Ailus: Fold in MAINTAINERS change.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-24media: i2c: Add GC08A3 image sensor driverZhi Mao3-0/+1350
Add a V4L2 sub-device driver for Galaxycore GC08A3 image sensor. Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Zhi Mao <[email protected]> [Sakari Ailus: Fold in MAINTAINERS change.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-19media: max9286: Use frame interval from subdev stateJacopo Mondi1-28/+24
Use the frame interval stored in the subdev state instead of storing a copy in the driver private structure. Initialize the frame interval to the special case 0/0 that in the max9286 driver represents automatic handling of frame sync. As the frame sync mode is set at s_stream() time, we can remove it from max9286_setup(). Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: max9286: Use the subdev active stateJacopo Mondi1-85/+44
Use the subdev active state in the max9286 driver to store the image format. Replace the .open() function call with the .init_state() one and simplify the set/get_pad_fmt() operations. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: max9286: Fix enum_mbus_codeJacopo Mondi1-2/+2
The max9286 driver supports multiple output formats but only a single one is reported through the .enum_mbus_code operation. Fix that. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: adv748x-csi2: Use the subdev active stateJacopo Mondi2-66/+42
Initialize and use the subdev active state to store the subdevice format. This simplifies the implementation of the get_fmt and set_fmt pad operations. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: adv748x-csi2: Validate the image formatJacopo Mondi1-0/+23
The adv748x-csi2 driver configures the CSI-2 transmitter to automatically infer the image stream format from the connected frontend (HDMI or AFE). Setting a new format on the subdevice hence does not actually control the CSI-2 output format, but it's only there for the purpose of pipeline validation. However, there is currently no validation that the supplied media bus code is valid and supported by the device. With the introduction of enum_mbus_codes a list of supported format is now available, use it to validate that the supplied format is correct and use the default UYVY8 one if that's not the case. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: adv748x-afe: Use 1X16 media bus codeJacopo Mondi1-2/+2
Now that the adv748x CSI-2 transmitter driver validates the supported formats, it is required for subdevices along the pipeline to produce and consume the same media bus codes. The adv748x analog front end driver use the 2X8 variant of the UYVY8 media bus code, while the CSI-2 transmitter use the 1X16 variant, which is the correct one to use for the serial bus. Make the adv748x afe use the 1X16 format variant to maintain the pipeline validation correct. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-19media: adv748x-csi2: Implement enum_mbus_codesJacopo Mondi1-0/+45
Define a list of supported mbus codes for the TXA and TXB CSI-2 transmitters and implement the enum_mbus_code operation. The TXB transmitter only support YUV422 while the TXA one supports multiple formats as reported by the chip's manual in section 9.7. but the HDMI and AFE subdevices only provide RGB888 and YUV422, so only list those ones here. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
2024-06-15media: i2c: ov5647: replacing of_node_put with __free(device_node)Abdulrasaq Lawani1-7/+4
Replace instance of of_node_put with __free(device_node) to protect against any memory leaks due to future changes in control flow. Signed-off-by: Abdulrasaq Lawani <[email protected]> Acked-by: Dave Stevenson <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-15media: i2c: vgxy61: Fix device nameBenjamin Mugnier3-3/+3
Rename 'st-vgxy61' to 'vgxy61', dropping the vendor prefix to follow the same naming scheme as the vast majority of device drivers. The device tree binding does not fall into binding rename exceptions and therefore must not be changed. Keep its legacy name. Signed-off-by: Benjamin Mugnier <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-06-15media: i2c: imx219: fix msr access command sequenceConor Dooley1-1/+1
It was reported to me that the imx219 didn't work on one of our development kits partly because the access sequence is incorrect. The datasheet I could find [1] for this camera has the access sequence: Seq. No. Address (Hex) data 1 30EB 05 2 30EB 0C 3 300A FF 4 300B FF 5 30EB 05 6 30EB 09 but the driver swaps the first two elements. Laurent pointed out on IRC that the original code used the correct sequence for 1920x1080 but the current sequence for 3280x2464 and 1640x1232. During refactoring of the init sequence the current order was used for all formats. Switch to using the documented sequence. Link: https://www.opensourceinstruments.com/Electronics/Data/IMX219PQ.pdf [1] Fixes: 8508455961d5 ("media: i2c: imx219: Split common registers from mode tables") Fixes: 1283b3b8f82b ("media: i2c: Add driver for Sony IMX219 sensor") Signed-off-by: Conor Dooley <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Tested-by: Dave Stevenson <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Tested-by: Adam Ford <[email protected]> #imx8mp-beacon-kit Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>