Compare commits

..

No commits in common. "e00ce6abcc010a623fbddddd537a7dbca468d9ea" and "809d88dd935595fb8165ce2c15dcda02bb13792e" have entirely different histories.

2 changed files with 20 additions and 5 deletions

View File

@ -189,7 +189,7 @@ i2c8 = "/i2c@31e0000";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "160" ;
max_gain_val = "160" ; //"762";
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";

View File

@ -417,15 +417,16 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
* Digital gain equation:
*
* RANGE: 1x, 7.97x
* GAIN: VAL / STEPS;
* STEPS: 1/32
*
* SCALE FACTOR = 3
* SCALE FACTOR = 32
*
* min_gain_val = 102
* max_gain_val = 160
* min_gain_val = 100
* max_gain_val = 762
* gain_factor = 3
*
* gain accepts mapping to range 32 - 53
* gain maps to range 32 - 255
*/
gain = val / 3;
@ -444,6 +445,7 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
/* Update global gain */
err =
mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN, gain);
// msleep(10);
if (err)
goto exit;
err =
@ -451,6 +453,8 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
if (err)
goto exit;
// usleep_range(1000, 1500);
return 0;
exit:
@ -517,6 +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);
if (err)
return err;
//msleep(30);
return 0;
}
@ -567,6 +572,7 @@ static int mt9m021_set_analog_gain(struct tegracam_device *tc_dev, s64 val)
((val << MT9M021_ANALOG_GAIN_SHIFT) &
MT9M021_ANALOG_GAIN_MASK);
err = mt9m021_write_reg16(s_data, MT9M021_DIGITAL_TEST, reg16);
// msleep(30);
if (err)
goto exit;
@ -622,6 +628,7 @@ static int mt9m021_set_digital_gain(struct tegracam_device *tc_dev, s64 val,
err = mt9m021_write_reg16(s_data, gain_cb_reg, val);
if (err)
goto exit;
// msleep(30);
return 0;
@ -644,6 +651,7 @@ static int mt9m021_set_test_pattern(struct tegracam_device *tc_dev, s32 val)
else
err = mt9m021_write_reg16(s_data, MT9M021_TEST_PATTERN,
val);
// msleep(30);
if (err)
goto exit;
@ -956,10 +964,15 @@ static int mt9m021_col_correction(struct mt9m021 *priv)
if (ret < 0)
return ret;
// msleep(200);
// usleep(200);
/* Enable Streaming */
ret = mt9m021_write_table(priv, mode_table[MT9M021_MODE_START_STREAM]);
if (ret < 0)
return ret;
// msleep(200);
// usleep(200);
/* Disable Streaming */
ret = mt9m021_write_table(priv, mode_table[MT9M021_MODE_STOP_STREAM]);
@ -970,6 +983,8 @@ static int mt9m021_col_correction(struct mt9m021 *priv)
ret = mt9m021_write_reg16(s_data, MT9M021_COLUMN_CORRECTION, 0xE007);
if (ret < 0)
return ret;
// msleep(200);
// usleep(200);
return ret;
}