Fix dotted image -- still have some blinking

This commit is contained in:
dchvs 2021-03-10 17:59:54 -06:00
parent 5cede1ef85
commit abc331988f
2 changed files with 18 additions and 17 deletions

View File

@ -100,11 +100,11 @@ i2c8 = "/i2c@31e0000";
gain_factor = "3"; gain_factor = "3";
framerate_factor = "1000000"; framerate_factor = "1000000";
exposure_factor = "1000000"; //"1000000"; exposure_factor = "1000000";
min_gain_val = "100"; min_gain_val = "102";
max_gain_val = "762"; max_gain_val = "762";
step_gain_val = "1"; step_gain_val = "1";
default_gain = "100"; default_gain = "102";
min_hdr_ratio = "1"; min_hdr_ratio = "1";
max_hdr_ratio = "1"; max_hdr_ratio = "1";
@ -113,10 +113,10 @@ i2c8 = "/i2c@31e0000";
step_framerate = "1"; step_framerate = "1";
default_framerate = "60000000"; // 60.0 fps default_framerate = "60000000"; // 60.0 fps
min_exp_time = "23000"; // us min_exp_time = "24000"; // us
max_exp_time = "1000000"; // us max_exp_time = "74000"; // us
step_exp_time = "1"; step_exp_time = "1";
default_exp_time = "40000"; // us default_exp_time = "50000"; // us
}; };
ports { ports {
#address-cells = <0x1>; #address-cells = <0x1>;
@ -188,10 +188,10 @@ i2c8 = "/i2c@31e0000";
gain_factor = "3"; gain_factor = "3";
framerate_factor = "1000000"; framerate_factor = "1000000";
exposure_factor = "1000000"; exposure_factor = "1000000";
min_gain_val = "100"; min_gain_val = "102";
max_gain_val = "762"; max_gain_val = "762";
step_gain_val = "1"; step_gain_val = "1";
default_gain = "100"; default_gain = "102";
min_hdr_ratio = "1"; min_hdr_ratio = "1";
max_hdr_ratio = "1"; max_hdr_ratio = "1";
@ -200,10 +200,10 @@ i2c8 = "/i2c@31e0000";
step_framerate = "1"; step_framerate = "1";
default_framerate = "60000000"; // 60.0 fps default_framerate = "60000000"; // 60.0 fps
min_exp_time = "23000"; // us min_exp_time = "24000"; // us
max_exp_time = "1000000"; // us max_exp_time = "74000"; // us
step_exp_time = "1"; step_exp_time = "1";
default_exp_time = "40000"; // us default_exp_time = "50000"; // us
}; };
ports { ports {
#address-cells = <0x1>; #address-cells = <0x1>;

View File

@ -439,14 +439,13 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
((gain_mul << MT9M021_ANALOG_GAIN_SHIFT) & ((gain_mul << MT9M021_ANALOG_GAIN_SHIFT) &
MT9M021_ANALOG_GAIN_MASK); MT9M021_ANALOG_GAIN_MASK);
err = mt9m021_write_reg16(s_data, MT9M021_DIGITAL_TEST, reg16); err = mt9m021_write_reg16(s_data, MT9M021_DIGITAL_TEST, reg16);
// msleep(10);
if (err) if (err)
goto exit; goto exit;
/* Update global gain */ /* Update global gain */
err = err =
mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN, gain); mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN, gain);
// msleep(10); // msleep(10);
if (err) if (err)
goto exit; goto exit;
err = err =
@ -454,6 +453,8 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
if (err) if (err)
goto exit; goto exit;
// usleep_range(1000, 1500);
return 0; return 0;
exit: exit:
@ -473,7 +474,7 @@ static int mt9m021_set_frame_length(struct mt9m021 *priv, s64 val)
err = mt9m021_write_reg16(s_data, MT9M021_FRAME_LENGTH_LINES, val); err = mt9m021_write_reg16(s_data, MT9M021_FRAME_LENGTH_LINES, val);
if (err) if (err)
return err; return err;
msleep(30); msleep(30);
return 0; return 0;
} }
@ -520,7 +521,7 @@ static int mt9m021_set_coarse_time(struct mt9m021 *priv, s64 val)
err = mt9m021_write_reg16(s_data, MT9M021_COARSE_INT_TIME_CB, val); err = mt9m021_write_reg16(s_data, MT9M021_COARSE_INT_TIME_CB, val);
if (err) if (err)
return err; return err;
// msleep(30); //msleep(30);
return 0; return 0;
} }