aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-25media: dvb-frontends: fix leak of memory fwYan Lei1-0/+1
Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Yan Lei <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb-frontends: clean up unneeded elseWan Jiabing1-2/+0
Clean up unneeded 'else'. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Wan Jiabing <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb-core: Enhance shared multi-frontend supportRobert Schlabbach3-3/+17
Drivers for devices with multiple frontends which cannot be used concurrently due to hardware limitations which enforce that restriction by setting the mfe_shared field to 1 exhibit rather unfriendly behavior towards applications: The unavailable frontend devices cannot be opened at all, not even for read-only access to query information. Even worse, any open call is blocked for 5 seconds by default. Allow drivers for such devices to behave like regular busy frontend devices instead, i.e. still allowing concurrent read access to the unavailable frontend and denying concurrent write access with -EBUSY without delay. This patch does not alter the behavior of any existing driver to avoid regressions. Driver developers who wish to take advantage of this must ensure their driver can handle all read-only accesses to the unavailable frontend, and indicate the capability by setting the mfe_shared field to 2 instead of 1. Add a check to dvb-usb-init.c when automatically setting the mfe_shared field that when a driver has already set the field to 2, it is not overwritten. Document the additional capability in the code comment about mfe_shared. Link: https://lore.kernel.org/linux-media/trinity-22c77578-26b0-4867-9ff7-2668e5d22c64-1642799929896@3c-app-gmx-bap04 Signed-off-by: Robert Schlabbach <[email protected]> Tested-by: Robert Schlabbach <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb: add DVB-C2 and DVB-S2X parameter valuesRobert Schlabbach2-10/+74
Extend the DVB frontend parameter enums with additional values specified by the DVB-C2 (ETSI EN 302 769) and DVB-S2X (ETSI EN 302 307-2) standards to be ready for frontend drivers for such receivers. While most parameters will be "read-only" due to being autodetected by the receiver and only being reported back for informational purposes, the addition of SYS_DVBC2 to the delivery systems enum is required, because there are DVB-C2 capable receivers which are not capable of DVB-C/C2 autodetection and thus need this enum value to be explicitly instructed to search for a DVB-C2 signal. As for DVB-S2X, as that is an extension to DVB-S2, the same delivery system enum as for DVB-S2 can be used. Add the additional enum values and comments to the documentation. Link: https://lore.kernel.org/linux-media/trinity-1b7c5a66-85d4-4595-a690-0fde965d49b3-1642146228587@3c-app-gmx-bap69 Signed-off-by: Robert Schlabbach <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb_frontend: add missing DSS switch casesRobert Schlabbach1-0/+11
While the documentation mentions the delivery system DSS as a satellite system, it was missing from all but one switch statement in the DVB frontend code, leading to tuning failures, because the frequency was not correctly handled as being in kHz rather than Hz. Add the missing switch cases so that DSS is handled like the other satellite systems. For the rolloff, assume 0.20 as per one publication found via Internet search. Link: https://lore.kernel.org/linux-media/trinity-5f5afda9-657a-4a91-bf15-842f4f249535-1641958421391@3c-app-gmx-bap21 Signed-off-by: Robert Schlabbach <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb-frontends: a8293: fix LNB powerup failure in PCTV 461eChuck Ritola3-3/+161
Fixes a8293 failure to raise LNB voltage in PCTV 461e DVB-S2 Stick affecting multiple users over several years as found here: http://www.linuxquestions.org/questions/linux-hardware-18/pctv-dvb-s2-stick-461e-not-feeding-lnb-4175529374/ https://www.linuxtv.org/wiki/index.php/Pinnacle_PCTV_DVB-S2_Stick_(461e) https://github.com/OpenELEC/OpenELEC.tv/issues/3731 Caused by vIN undervoltage lockout (status register bit 7) when raising LNB to 18V. Addressed by using the higher-precision voltages available on the a8293 to gradually increase (slew) the voltage when voltage increases are requested. Adds volt_slew_nanos_per_mv to a8293_platform_data struct for specifying slew rate. If value is <1 or non-sane (>1600), the original no-slew version for a8293_set_voltage is used. Link: https://lore.kernel.org/linux-media/[email protected] [mchehab: fixed some coding style issues] Signed-off-by: Chuck Ritola <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dvb_ringbuffer: Fix typo in dvb_ringbuffer_pkt_write() kerneldocGeert Uytterhoeven1-1/+1
There is no such error code EVINAL. Link: https://lore.kernel.org/linux-media/270f5b7f79a24dc1a3e81d94f6f54fc0f08daf56.1639732105.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: refer to config VIDEO_DEV to make ov08x40 image sensor driver usableLukas Bulwahn1-1/+1
Commit 9958d30f38b9 ("media: Kconfig: cleanup VIDEO_DEV dependencies") removes the config VIDEO_V4L2 as it is merged with config VIDEO_DEV. Long after this change, commit 38fc5136ac16 ("media: i2c: Add ov08x40 image sensor driver") introduces and refers to the removed config VIDEO_V4L2, basically making this driver impossible to build, test and use due to dependencies that cannot be met. Refer to config VIDEO_DEV instead to make this driver usable. Signed-off-by: Lukas Bulwahn <[email protected]> Fixes: 38fc5136ac16 ("media: i2c: Add ov08x40 image sensor driver") Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov08x40: Make remove callback return voidKieran Bingham1-3/+1
In commit ed5c2f5fd10d ("i2c: Make remove callback return void") drivers were updated to remove the return value of the remove callback, and return void. The OV08x40 was added after this commit but was not compile tested at the time due to a KConfig issue, and this warning was missed. Reported-by: kernel test robot <[email protected]> Fixes: 38fc5136ac16 ("media: i2c: Add ov08x40 image sensor driver") Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: st-vgxy61: Fix smatch warningsBenjamin Mugnier1-9/+10
Fix some 'vgxy61_write_reg' return vars not being signed int. Fix 'expo_long_max' not being initialized. Handle 'pm_runtime_get_sync' call that can return 1. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Benjamin Mugnier <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: Documentation: st-vgxy61: Fix driver specific documentation not being ↵Benjamin Mugnier1-0/+1
included in the index Fixes: 2378be892b6f ("media: Documentation: Add ST VGXY61 driver documentation") Reported-by: kernel test robot <[email protected]> Signed-off-by: Benjamin Mugnier <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: Documentation: st-vgxy61: Remove quotes around 'No HDR' identifierBenjamin Mugnier1-1/+1
Signed-off-by: Benjamin Mugnier <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: Documentation: st-vgxy61: Limit driver specific documentation to 80 ↵Benjamin Mugnier1-4/+6
characters Signed-off-by: Benjamin Mugnier <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: platform: Add Renesas RZ/G2L CRU driverLad Prabhakar6-0/+1821
Add v4l driver for Renesas RZ/G2L Camera data Receiving Unit. Based on a patch in the BSP by Hien Huynh <[email protected]> Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: platform: Add Renesas RZ/G2L MIPI CSI-2 receiver driverLad Prabhakar5-0/+899
Add MIPI CSI-2 receiver driver for Renesas RZ/G2L. The MIPI CSI-2 is part of the CRU module found on RZ/G2L family. Based on a patch in the BSP by Hien Huynh <[email protected]> Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: Document Renesas RZ/G2L CRU blockLad Prabhakar1-0/+157
Document the CRU block found on Renesas RZ/G2L (and alike) SoCs. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: Document Renesas RZ/G2L CSI-2 blockLad Prabhakar1-0/+149
Document the CSI-2 block which is part of CRU found in Renesas RZ/G2L (and alike) SoCs. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Tab-align definitionsJacopo Mondi1-15/+15
Align some register and constant definitions using tab in place of mixed tab+spaces. Cosmetic change only. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Rework startup sequenceJacopo Mondi1-34/+16
The ar0521_write_mode() function explicitly programs the exposure time register and the test pattern register, which are now setup by the call to __v4l2_ctrl_handler_setup() in ar0521_set_stream(). Removing those register writes from ar0521_write_mode() reduces the function to two operations: geometry configuration and pll configuration. Move geomerty configuration in the ar0521_set_stream() caller and rename ar0521_write_mode() to ar0521_pll_config(). Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Setup controls at s_stream timeJacopo Mondi1-1/+1
Setup all the registered controls at s_stream(1) time instead of manually configure gains. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Adjust exposure and blankings limitsJacopo Mondi1-16/+68
Adjust the control limits for V4L2_CID_VBLANK, V4L2_CID_HBLANK and V4L2_CID_EXPOSURE when a new format is applied to the sensor. Update the exposure control limits when a new blanking value is applied and change the controls initialization to use valid values for the default format. The exposure control default value is changed to report the default value of register 0x3012. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Add LINK_FREQ controlJacopo Mondi1-0/+11
Add support for V4L2_CID_LINK_FREQ which currently reports a single hard-coded frequency which depends on the fixed pixel clock. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Refuse unsupported controlsJacopo Mondi1-3/+5
Refuse unsupported controls by returning -EINVAL in the s_ctrl operation. While at it, remove a the default switch case in the first switch as it effectively is now a no-op. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Rework PLL computationJacopo Mondi1-29/+84
Rework the PLL computation procedure to take into account the currently configured format bpp and the number of data lanes. Comment the PLL configuration procedure with information provided by the sensor chip manual and remove the hardcoded divider from the pixel clock calculation. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Set maximum resolution to 2592x1944Jacopo Mondi1-6/+17
Change the largest visibile resolution to 2592x1944, which corresponds to the active pixel array area size. Take into account the horizontal and vertical limits when programming the visible sizes to skip dummy/inactive pixels. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Add V4L2_CID_ANALOG_GAINJacopo Mondi1-0/+16
Add support for V4L2_CID_ANALOG_GAIN. The control programs the global gain register which applies to all color channels. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ar0521: Implement enum_frame_sizesJacopo Mondi1-0/+19
Implement the enum_frame_size pad operation. The sensor supports a continuous size range of resolutions. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: mt9p031: Increase post-reset delayMarek Vasut1-1/+7
The MT9P006 sensor driver sporadically fails to probe because the sensor responds with a NACK condition to I2C address on the bus during an attempt to read the sensor MT9P031_CHIP_VERSION register in mt9p031_registered(). Neither the MT9P006 nor MT9P031 datasheets are clear on reset signal timing. Older MT9M034 [1] datasheet provides those timing figures in Appendix-A and indicates it is necessary to wait 850000 EXTCLK cycles before starting any I2C communication. Add such a delay, which does make the sporadic I2C NACK go away, so it is likely similar constraint applies to this sensor. [1] https://www.onsemi.com/pdf/datasheet/mt9m034-d.pdf Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: Use new video interface bus type macros in examplesLaurent Pinchart5-5/+11
Now that a header exists with macros for the media interface bus-type values, replace hardcoding numerical constants with the corresponding macros in the DT binding examples. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: media: Add macros for video interface bus typesLaurent Pinchart1-0/+16
Add a new dt-bindings/media/video-interfaces.h header that defines macros corresponding to the bus types from media/video-interfaces.yaml. This allows avoiding hardcoded constants in device tree sources. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Paul Elder <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from ↵Marek Vasut1-1/+0
mt9p031_init_cfg() The mt9p031_init_cfg() already calls __mt9p031_get_pad_crop(), which correctly calls v4l2_subdev_get_try_crop() on V4L2_SUBDEV_FORMAT_TRY or returns &mt9p031->crop on V4L2_SUBDEV_FORMAT_ACTIVE. No need to call v4l2_subdev_get_try_crop() in mt9p031_init_cfg() again in case of both V4L2_SUBDEV_FORMAT_TRY and V4L2_SUBDEV_FORMAT_ACTIVE. This also fixes a splat generated by this call since commit 2ba3e38517f5a ("media: v4l: subdev: Fail graciously when getting try data for NULL state") because v4l2_subdev_get_try_crop() is called with sd_state = NULL in mt9p031_init_cfg(). Fixes: 69681cd041648 ("media: mt9p031: Move open subdev op init code into init_cfg") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add support for regulators.Dave Stevenson1-0/+38
The sensor takes 3 supply rails - AVDD, DVDD, and DOVDD. Add hooks into the regulator framework for each of these regulators. Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: media: ovti,ov9282: Add optional regulatorsDave Stevenson1-0/+9
The OV9282 image sensor takes 3 voltage supplies, so define the relevant regulators. Signed-off-by: Dave Stevenson <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: st-vgxy61: Fix regulator counter underflowBenjamin Mugnier1-7/+7
Previously regulators were enabled on probe and never again. However, as regulators are disabled on power off. After a second power off the regulator counter will underflow. Plus regulators are not required for probing the sensor, but for streaming. Fix this by enabling regulators on power on to balance regulator counter properly. Signed-off-by: Benjamin Mugnier <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Use traditional pattern when checking error codesAndy Shevchenko1-6/+4
Instead of 'if (!ret)' switch to "check for the error first" rule. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Add missed \n to the end of the messagesAndy Shevchenko1-6/+6
Add missed \n to the end of the messages. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Switch to use dev_err_probe()Andy Shevchenko1-25/+19
Switch to use dev_err_probe() to simpify error path and unify message template. While at it, add missed \n to the end of the messages. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Drop redundant assignments of ret = 0Andy Shevchenko1-8/+8
In some cases it might hide real bugs, in most cases here it's just redundant as it's being reassigned immediately after initial assignment. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Remove duplicate check for NULL fwnodeAndy Shevchenko1-3/+0
fwnode API does proper checks and returns correct codes, no need to repeat it in the caller. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Switch from __maybe_unused to pm_sleep_ptr() etcAndy Shevchenko1-6/+4
Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less heavier for builds than the use of __maybe_unused attributes. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ov2740: Remove duplicative pointer in struct nvm_dataAndy Shevchenko1-24/+15
The struct i2c_client pointer is used only to get driver data, associated with a struct device or print messages on behalf. Moreover, the very same pointer to a struct device is already assigned by a regmap and can be retrieved from there. No need to keep a duplicative pointer. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: tc358746: drop selecting COMMON_CLKMarco Felsch1-1/+0
Still there are archs/platforms which do not support the common clk framework. If such a platform is used in combination with the module enabled the compiler will throw an error. Since the clock has stubs if not selected we can drop it, so it is up to the arch/platform to select the correct clock framework. Fixes: 80a21da36051 ("media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver") Reported-by: kernel test robot <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: aptina-pll: Remove a useless includeChristophe JAILLET1-1/+0
<linux/lcm.h> is not needed for this driver. Remove the corresponding #include. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: staging: omap4iss: remove cacheflush importIan Cowan1-2/+0
The cacheflush import is never used, so it is safe to remove it as an import. Signed-off-by: Ian Cowan <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: Unstage the imx7-media-csi driverLaurent Pinchart7-38/+39
The imx7-media-csi driver, currently in staging, is ready for prime-time. The staging TODO file lists a few items specific to that driver, that are already addressed (the "all of the above" part) or can be addressed later: - The frame interval monitoring support is a software mechanism to monitor the device for unexpected stalls, and should be part of the V4L2 core if desired. - Restricting the support media bus formats based on the SoC integration only aims at reducing userspace confusion by not enumerating options that are known not to be possible, it won't cause regressions if handled later. Move the description of the media bus format restriction TODO item to the driver, drop the other TODO items, and move the driver out of staging. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Tested-by: Alexander Stein <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: Decouple imx8mq-mipi-csi2 from imx7-media-csiLaurent Pinchart2-1/+11
The imx8mq-mipi-csi2 driver targets SoCs that also run the imx7-media-csi driver, but they are distinct. Decouple them in Kconfig to prepare for destaging of the imx7-media-csi driver. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Tested-by: Alexander Stein <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: imx7-media-csi: Clear BIT_MIPI_DOUBLE_CMPNT for <16b formatsLaurent Pinchart1-3/+3
Commit 9babbbaaeb87 ("media: imx: imx7-media-csi: Use dual sampling for YUV 1X16") set BIT_MIPI_DOUBLE_CMPNT in the CR18 register for 16-bit YUV formats in imx7_csi_configure(). The CR18 register is always updated with read-modify-write cycles, so if a 16-bit YUV format is selected, the bit will stay set forever, even if the format is changed. Fix it by clearing the bit at the beginning of the imx7_csi_configure() function. While at it, swap two of the bits being cleared to match the MSB to LSB order. This doesn't cause any functional change. Fixes: 9babbbaaeb87 ("media: imx: imx7-media-csi: Use dual sampling for YUV 1X16") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: imx7-media-csi: Rename phys variables to dma_addrLaurent Pinchart1-18/+18
All the phys variables and structure fields store a DMA address, not a physical address. Even if the two are effectively identical on all platforms where this driver is used due to the lack of IOMMU, rename the variables to dma_addr to make their usage clearer. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: imx7-media-csi: Move variable to loop scopeLaurent Pinchart1-4/+5
The phys variable is only used as a local loop variable in imx7_csi_setup_vb2_buf(), with each entry in the array being used in the corresponding iteration of the loop only. Move it to loop scope, simplifying the array to a single variable. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: imx: imx7-media-csi: Add support for fast-tracking queued buffersPaul Elder1-0/+76
The CSI hardware compatible with this driver handles buffers using a ping-pong mechanism with two sets of destination addresses. Normally, when an interrupt comes in to signal the completion of one buffer, say FB1, it assigns the next buffer in the queue to the next FB1, and the hardware starts to capture into FB2 in the meantime. In a buffer underrun situation, in the above example without loss of generality, if a new buffer is queued before the interrupt for FB1 comes in, we can program the buffer into FB2 (which is programmed with a dummy buffer, as there is a buffer underrun). This of course races with the interrupt that signals FB1 completion, as once that interrupt comes in, we are no longer guaranteed that the programming of FB2 was in time and must assume it was too late. This race is resolved partly by locking the programming of FB2. If it came after the interrupt for FB1, then the variable that is used to determine which FB to program would have been swapped by the interrupt handler. This alone isn't sufficient, however, because the interrupt could still be generated (thus the hardware starts capturing into the other fb) while the fast-tracking routine has the irq lock. Thus, after programming the fb register to fast-track the buffer, the isr also must be checked to confirm that an interrupt didn't come in the meantime. If it has, we must assume that programming the register for the fast-tracked buffer was not in time, and queue the buffer normally. Signed-off-by: Paul Elder <[email protected]> Acked-by: Rui Miguel Silva <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>