@@ -113,6 +113,8 @@ MODULE_PARM_DESC(trigger_mode, "Set vsync trigger mode: 1=source, 2=sink");
113
113
#define IMX477_REG_XVS_IO_CTRL 0x3040
114
114
#define IMX477_REG_EXTOUT_EN 0x4b81
115
115
116
+ #define IMX477_REG_FRAME_BLANKSTOP_CLK 0xE000
117
+
116
118
/* Embedded metadata stream structure */
117
119
#define IMX477_EMBEDDED_LINE_WIDTH 16384
118
120
#define IMX477_NUM_EMBEDDED_LINES 1
@@ -170,7 +172,6 @@ static const struct imx477_reg mode_common_regs[] = {
170
172
{0x0136 , 0x18 },
171
173
{0x0137 , 0x00 },
172
174
{0x0138 , 0x01 },
173
- {0xe000 , 0x00 },
174
175
{0xe07a , 0x01 },
175
176
{0x0808 , 0x02 },
176
177
{0x4ae9 , 0x18 },
@@ -964,6 +965,11 @@ struct imx477 {
964
965
/* Streaming on/off */
965
966
bool streaming ;
966
967
968
+ /* Flags field from parsing the endpoint - used for (non)continuous
969
+ * clock mode
970
+ */
971
+ unsigned int csi2_flags ;
972
+
967
973
/* Rewrite common registers on stream on? */
968
974
bool common_regs_written ;
969
975
@@ -1557,6 +1563,12 @@ static int imx477_start_streaming(struct imx477 *imx477)
1557
1563
__func__ );
1558
1564
return ret ;
1559
1565
}
1566
+
1567
+ imx477_write_reg (imx477 , IMX477_REG_FRAME_BLANKSTOP_CLK ,
1568
+ IMX477_REG_VALUE_08BIT ,
1569
+ imx477 -> csi2_flags & V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK ?
1570
+ 1 : 0 );
1571
+
1560
1572
imx477 -> common_regs_written = true;
1561
1573
}
1562
1574
@@ -1937,7 +1949,7 @@ static void imx477_free_controls(struct imx477 *imx477)
1937
1949
mutex_destroy (& imx477 -> mutex );
1938
1950
}
1939
1951
1940
- static int imx477_check_hwcfg (struct device * dev )
1952
+ static int imx477_check_hwcfg (struct device * dev , struct imx477 * imx477 )
1941
1953
{
1942
1954
struct fwnode_handle * endpoint ;
1943
1955
struct v4l2_fwnode_endpoint ep_cfg = {
@@ -1975,6 +1987,8 @@ static int imx477_check_hwcfg(struct device *dev)
1975
1987
goto error_out ;
1976
1988
}
1977
1989
1990
+ imx477 -> csi2_flags = ep_cfg .bus .mipi_csi2 .flags ;
1991
+
1978
1992
ret = 0 ;
1979
1993
1980
1994
error_out :
@@ -2033,7 +2047,7 @@ static int imx477_probe(struct i2c_client *client)
2033
2047
(const struct imx477_compatible_data * )match -> data ;
2034
2048
2035
2049
/* Check the hardware configuration in device tree */
2036
- if (imx477_check_hwcfg (dev ))
2050
+ if (imx477_check_hwcfg (dev , imx477 ))
2037
2051
return - EINVAL ;
2038
2052
2039
2053
/* Default the trigger mode from OF to -1, which means invalid */
0 commit comments