@@ -29,6 +29,22 @@ static int trigger_mode;
29
29
module_param (trigger_mode , int , 0644 );
30
30
MODULE_PARM_DESC (trigger_mode , "Set vsync trigger mode: 1=source, 2=sink" );
31
31
32
+ static int fstrobe_enable ;
33
+ module_param (fstrobe_enable , int , 0644 );
34
+ MODULE_PARM_DESC (fstrobe_enable , "Enable fstrobe signal" );
35
+
36
+ static int fstrobe_cont_trig ;
37
+ module_param (fstrobe_cont_trig , int , 0644 );
38
+ MODULE_PARM_DESC (fstrobe_cont_trig , "Configure fstrobe to be one-shot (0) or continuous (1)" );
39
+
40
+ static int fstrobe_width = 1 ;
41
+ module_param (fstrobe_width , int , 0644 );
42
+ MODULE_PARM_DESC (fstrobe_width , "Set fstrobe pulse width in units of INCK" );
43
+
44
+ static int fstrobe_delay ;
45
+ module_param (fstrobe_delay , int , 0644 );
46
+ MODULE_PARM_DESC (fstrobe_delay , "Set fstrobe delay from end all lines starting to expose and the start of the strobe pulse" );
47
+
32
48
#define IMX477_REG_VALUE_08BIT 1
33
49
#define IMX477_REG_VALUE_16BIT 2
34
50
@@ -1791,6 +1807,8 @@ static int imx477_start_streaming(struct imx477 *imx477)
1791
1807
struct i2c_client * client = v4l2_get_subdevdata (& imx477 -> sd );
1792
1808
const struct imx477_reg_list * reg_list , * freq_regs ;
1793
1809
const struct imx477_reg_list * extra_regs ;
1810
+ unsigned int fst_width ;
1811
+ unsigned int fst_mult ;
1794
1812
int ret , tm ;
1795
1813
1796
1814
if (!imx477 -> common_regs_written ) {
@@ -1825,6 +1843,29 @@ static int imx477_start_streaming(struct imx477 *imx477)
1825
1843
return ret ;
1826
1844
}
1827
1845
1846
+ fst_width = max ((unsigned int )fstrobe_width , 1U );
1847
+ fst_mult = 1 ;
1848
+
1849
+ while (fst_width / fst_mult > 0xffff && fst_mult < 255 )
1850
+ fst_mult ++ ;
1851
+
1852
+ fst_width /= fst_mult ;
1853
+
1854
+ // FLASH_MD_RS
1855
+ imx477_write_reg (imx477 , 0x0c1A , IMX477_REG_VALUE_08BIT ,
1856
+ ((fstrobe_cont_trig ? 1 : 0 ) << 0 ) | (1 << 1 ));
1857
+ // FLASH_STRB_WIDTH
1858
+ imx477_write_reg (imx477 , 0x0c18 , IMX477_REG_VALUE_16BIT , fst_width );
1859
+ // FLASH_STRB_WIDTH adjust
1860
+ imx477_write_reg (imx477 , 0x0c12 , IMX477_REG_VALUE_08BIT , fst_mult );
1861
+ // FLASH_STRB_START_POINT
1862
+ imx477_write_reg (imx477 , 0x0c14 , IMX477_REG_VALUE_16BIT , fstrobe_delay );
1863
+ // FLASH_STRB_DLY_RS
1864
+ imx477_write_reg (imx477 , 0x0c16 , IMX477_REG_VALUE_16BIT , 0 );
1865
+ // FLASH_TRIG_RS
1866
+ imx477_write_reg (imx477 , 0x0c1B , IMX477_REG_VALUE_08BIT ,
1867
+ fstrobe_enable ? 1 : 0 );
1868
+
1828
1869
/* Set on-sensor DPC. */
1829
1870
imx477_write_reg (imx477 , 0x0b05 , IMX477_REG_VALUE_08BIT , !!dpc_enable );
1830
1871
imx477_write_reg (imx477 , 0x0b06 , IMX477_REG_VALUE_08BIT , !!dpc_enable );
0 commit comments