summaryrefslogtreecommitdiff
path: root/drivers/media/i2c
AgeCommit message (Collapse)AuthorFilesLines
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 <quic_jjohnson@quicinc.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [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 <hverkuil-cisco@xs4all.nl>
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 <hverkuil-cisco@xs4all.nl>
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: stable@vger.kernel.org Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Link: https://lore.kernel.org/r/20240620102544.1918105-1-kory.maincent@bootlin.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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 <angelogioacchino.delregno@collabora.com> Signed-off-by: Zhi Mao <zhi.mao@mediatek.com> [Sakari Ailus: Fold in MAINTAINERS change.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <angelogioacchino.delregno@collabora.com> Signed-off-by: Zhi Mao <zhi.mao@mediatek.com> [Sakari Ailus: Fold in MAINTAINERS change.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240617161135.130719-12-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20240617161135.130719-11-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20240617161135.130719-10-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://lore.kernel.org/r/20240617161135.130719-9-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240617161135.130719-8-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://lore.kernel.org/r/20240617161135.130719-7-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://lore.kernel.org/r/20240617161135.130719-6-jacopo.mondi@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
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 <abdulrasaqolawani@gmail.com> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <benjamin.mugnier@foss.st.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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 <conor.dooley@microchip.com> Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Adam Ford <aford173@gmail.com> #imx8mp-beacon-kit Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: ov2680: Pass correct number of controls to v4l2_ctrl_handler_init()Hans de Goede1-1/+1
The ov2680 driver has 9 controls now and the call to v4l2_ctrl_new_fwnode_properties() adds 2 more. Tell v4l2_ctrl_handler_init() to pre-allocate space for 11 controls to match this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: i2c: alvium: Move V4L2_CID_GAIN to V4L2_CID_ANALOG_GAINTommaso Merciai1-3/+3
Into alvium cameras REG_BCRM_GAIN_RW control the analog gain. Let's use the right V4L2_CID_ANALOGUE_GAIN ctrl. Fixes: 0a7af872915e ("media: i2c: Add support for alvium camera") Cc: stable@vger.kernel.org Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: i2c: alvium: implement enum_frame_sizeTommaso Merciai1-0/+22
Implement the enum_frame_size pad operation. The sensor supports a continuous size range of resolutions. Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: i2c: alvium: enable acquisition frame rateTommaso Merciai1-0/+14
Alvium camera by default is in free running mode. Datasheet say that acquisition frame rate reg can only be used if frame start trigger mode is set to off. Enable r/w acquisition frame rate and turn off trigger mode. Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> [Sakari Ailus: Fix spelling of "acquisition".] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: i2c: alvium: rename acquisition frame rate enable regTommaso Merciai1-1/+1
Acquisition frame rate enable reg have a very long name let's reduce this with an abbreviation. Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> [Sakari Ailus: Fix spelling of "acquisition".] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-15media: i2c: alvium: fix alvium_get_fw_version()Tommaso Merciai2-15/+22
Instead of reading device_fw reg as multiple regs let's read the entire 64bit reg using one i2c read and use bit masks and bit shifts to get fw info. Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-14media: imx283: drop CENTERED_RECTANGLE due to clang failureHans Verkuil1-11/+18
The CENTERED_RECTANGLE define fails to compile on clang and old gcc versions. Just drop it and fill in the crop rectangles explicitly. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-06-04media: ov5693: Drop privacy-LED GPIO controlHans de Goede1-10/+0
Drop privacy-LED GPIO control, after the privacy-LED GPIO control was added to the ov5693 driver it was decided to model privacy-LEDs as LED class devices and have them be controlled by the v4l2-core. So this is dead code since on devices with privacy LEDs the led is not a GPIO on the ov5693 fwnode, but rather is a LED class devices controlled by the v4l2-core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04drivers: media: max96717: stop the csi receiver before the sourceJulien Massot1-12/+11
Stopping the CSI source before stopping the serializer CSI port may make the serializer not respond. Then all the next writes to the device will fail. max96717 1-0040: Error writing reg 0x0308: -121 max96717 1-0040: Error writing reg 0x0006: -121 Fix that by stopping the CSI receiver first and then CSI source. Seen on max96717f revision 4. Signed-off-by: Julien Massot <julien.massot@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: add MAX96714 driverJulien Massot3-0/+1042
This driver handles the MAX96714 deserializer in tunnel mode. The CSI output will replicate all the CSI traffic forwarded by the remote serializer. The MAX96714 driver can handle MAX96714 and MAX96714F variants with the same "maxim,max96714f" compatible. Signed-off-by: Julien Massot <julien.massot@collabora.com> [Sakari Ailus: Adapt to changed i2c_mux_add_adapter arguments.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: add MAX96717 driverJulien Massot3-0/+946
This driver handles the MAX96717 serializer in tunnel mode. All incoming CSI traffic will be tunneled through the GMSL2 link. The MAX96717 driver can handle MAX96717 and MAX96717F variants with the same "maxim,max96717f" compatible. Signed-off-by: Julien Massot <julien.massot@collabora.com> [Sakari Ailus: Adapt to changed i2c_mux_add_adapter arguments.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: adv7511: remove unused struct 'i2c_reg_value'Dr. David Alan Gilbert1-5/+0
'i2c_reg_value' is unused since the original commit 5a544cce2177 ("[media] adv7511: add new video encoder"). Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: tw9910: remove unused strust 'regval_list'Dr. David Alan Gilbert1-5/+0
'regval_list' has been unused since commit 398994c1e104 ("V4L/DVB (13666): tw9910: modify V/H outpit pin setting to use VALID"). Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: ks0127: remove unused struct 'adjust'Dr. David Alan Gilbert1-8/+0
'adjust' has been unused since original commit fbe60daac4c3 ("V4L/DVB (3916): AverMedia 6 Eyes AVS6EYES support"). Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: dw9768: remove unused struct 'regval_list'Dr. David Alan Gilbert1-5/+0
'regval_list' is unused since the original commit 859891228e56 ("media: i2c: dw9768: Add DW9768 VCM driver") Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: Add imx283 camera sensor driverKieran Bingham3-0/+1616
Add a v4l2 subdevice driver for the Sony IMX283 image sensor. The IMX283 is a 20MP Diagonal 15.86 mm (Type 1) CMOS Image Sensor with Square Pixel for Color Cameras. The following features are supported: - Manual exposure an gain control support - vblank/hblank/link freq control support - Test pattern support control - Arbitrary horizontal and vertical cropping - Supported resolution: - 5472x3648 @ 20fps (SRGGB12) - 5472x3648 @ 25fps (SRGGB10) - 2736x1824 @ 50fps (SRGGB12) Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> [Sakari Ailus: Take upstream runtime PM API changes into account.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Convert to new CCI register access helpersLuis Garcia2-469/+349
Use the new comon CCI register access helpers to replace the private register access helpers in the imx258 driver. Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Use v4l2_link_freq_to_bitmap helperLuis Garcia1-0/+12
Use the v4l2_link_freq_to_bitmap() helper to figure out which driver-supported link freq can be used on a given system. Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Make HFLIP and VFLIP controls writableDave Stevenson1-35/+65
The sensor supports H & V flips, but the controls were READ_ONLY. Note that the Bayer order changes with these flips, therefore they set the V4L2_CTRL_FLAG_MODIFY_LAYOUT property. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Change register settings for variants of the sensorDave Stevenson1-4/+43
Sony have advised that there are variants of the IMX258 sensor which require slightly different register configuration to the mainline imx258 driver defaults. There is no available run-time detection for the variant, so add configuration via the DT compatible string. The Vision Components imx258 module supports PDAF, so add the register differences for that variant Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Support faster pixel rate on binned modesDave Stevenson1-38/+71
With the binned modes, there is little point in faithfully reproducing the horizontal line length of 5352 pixels on the CSI2 bus, and the FIFO between the pixel array and MIPI serialiser allows us to remove that dependency. Allow the pixel array to run with the normal settings, with the MIPI serialiser at half the rate. This requires some additional information for the link frequency to pixel rate function that needs to be added to the configuration tables. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Set pixel_rate range to the same as the valueDave Stevenson1-12/+7
With a read only control there is limited point in advertising a minimum and maximum for the control, so change to set the value, min, and max all to the selected pixel rate. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Issue reset before starting streamingDave Stevenson1-0/+12
Whilst not documented, register 0x0103 bit 0 is the soft reset for the sensor, so send it before trying to configure the sensor. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Correct max FRM_LENGTH_LINES valueDave Stevenson1-1/+1
The data sheet states that the maximum value for registers 0x0340/0x0341 FRM_LENGTH_LINES is 65525(decimal), not the 0xFFFF defined in this driver. Correct this limit. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Allow configuration of clock lane behaviourDave Stevenson1-0/+13
The sensor supports the clock lane either remaining in HS mode during frame blanking, or dropping to LP11. Add configuration of the mode via V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Add get_selection for pixel array informationDave Stevenson1-0/+90
Libcamera requires the cropping information for each mode, so add this information to the driver. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Follow normal V4L2 behaviours for clipping exposureDave Stevenson1-2/+23
V4L2 sensor drivers are expected to clip the supported exposure range based on the VBLANK configured. IMX258 wasn't doing that as register 0x350 (FRM_LENGTH_CTL) switches it to a mode where frame length tracks coarse exposure time. Disable this mode and clip the range for V4L2_CID_EXPOSURE appropriately based on V4L2_CID_VBLANK. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Add support for running on 2 CSI data lanesDave Stevenson1-24/+190
Extends the driver to also support 2 data lanes. Frame rates are obviously more restricted on 2 lanes, but some hardware simply hasn't wired more up. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Add support for 24MHz clockDave Stevenson1-28/+102
There's no reason why only a clock of 19.2MHz is supported. Indeed this isn't even a frequency listed in the datasheet. Add support for 24MHz as well. The PLL settings result in slightly different link frequencies, so parameterise those. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Split out common registers from the mode based onesDave Stevenson1-215/+21
Out of all the registers that are defined for each mode, only around 10 differ between the modes. Split the table into common and mode specific ones. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Make V4L2_CID_VBLANK configurable.Dave Stevenson1-9/+7
The values and ranges of V4L2_CID_VBLANK are all computed, so there is no reason for it to be a read only control. Remove the register values from the mode lists, add the handler, and remove the read only flag. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-06-04media: i2c: imx258: Add regulator controlDave Stevenson1-1/+41
The device tree bindings define the relevant regulators for the sensor, so update the driver to request the regulators and control them at the appropriate times. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Luis Garcia <git@luigi311.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>