media: i2c: imx334: Configure lane mode dynamically

Configure the lane mode dynamically from the streaming
function instead of using a hardcoded value.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
[Sakari Ailus: Fix checkpatch.pl issue, lower Dynamically.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
Tarang Raval 2025-03-29 11:13:26 +05:30 committed by Hans Verkuil
parent 731c8efd5b
commit 9e089a649a

View File

@ -47,6 +47,8 @@
#define IMX334_EXPOSURE_DEFAULT 0x0648
#define IMX334_REG_LANEMODE CCI_REG8(0x3a01)
#define IMX334_CSI_4_LANE_MODE 3
#define IMX334_CSI_8_LANE_MODE 7
/* Window cropping Settings */
#define IMX334_REG_AREA3_ST_ADR_1 CCI_REG16_LE(0x3074)
@ -240,7 +242,6 @@ static const struct cci_reg_sequence common_mode_regs[] = {
{ IMX334_REG_HADD_VADD, 0x00 },
{ IMX334_REG_VALID_EXPAND, 0x03 },
{ IMX334_REG_TCYCLE, 0x00 },
{ IMX334_REG_LANEMODE, 0x03 },
{ IMX334_REG_TCLKPOST, 0x007f },
{ IMX334_REG_TCLKPREPARE, 0x0037 },
{ IMX334_REG_TCLKTRAIL, 0x0037 },
@ -876,6 +877,13 @@ static int imx334_start_streaming(struct imx334 *imx334)
return ret;
}
ret = cci_write(imx334->cci, IMX334_REG_LANEMODE,
IMX334_CSI_4_LANE_MODE, NULL);
if (ret) {
dev_err(imx334->dev, "failed to configure lanes\n");
return ret;
}
ret = imx334_set_framefmt(imx334);
if (ret) {
dev_err(imx334->dev, "%s failed to set frame format: %d\n",