|
|
|
@ -417,16 +417,15 @@ 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 = 32
|
|
|
|
|
* SCALE FACTOR = 3
|
|
|
|
|
*
|
|
|
|
|
* min_gain_val = 100
|
|
|
|
|
* max_gain_val = 762
|
|
|
|
|
* min_gain_val = 102
|
|
|
|
|
* max_gain_val = 160
|
|
|
|
|
* gain_factor = 3
|
|
|
|
|
*
|
|
|
|
|
* gain maps to range 32 - 255
|
|
|
|
|
* gain accepts mapping to range 32 - 53
|
|
|
|
|
*/
|
|
|
|
|
gain = val / 3;
|
|
|
|
|
|
|
|
|
@ -445,7 +444,6 @@ 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 =
|
|
|
|
@ -453,8 +451,6 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
|
|
|
|
|
if (err)
|
|
|
|
|
goto exit;
|
|
|
|
|
|
|
|
|
|
// usleep_range(1000, 1500);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
exit:
|
|
|
|
@ -521,7 +517,6 @@ 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;
|
|
|
|
|
}
|
|
|
|
@ -572,7 +567,6 @@ 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;
|
|
|
|
|
|
|
|
|
@ -628,7 +622,6 @@ 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;
|
|
|
|
|
|
|
|
|
@ -651,7 +644,6 @@ 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;
|
|
|
|
|
|
|
|
|
@ -964,15 +956,10 @@ 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]);
|
|
|
|
@ -983,8 +970,6 @@ 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;
|
|
|
|
|
}
|
|
|
|
|