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