Compare commits

...

2 Commits

Author SHA1 Message Date
dchvs 712fc2f18b Set gain to range 102-160 in order to not have dotted image and blinking 2021-03-29 12:18:11 -06:00
dchvs 855ce6a4d5 Fix identation 2021-03-29 09:33:30 -06:00
3 changed files with 218 additions and 219 deletions

View File

@ -102,7 +102,7 @@ i2c8 = "/i2c@31e0000";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "250";
max_gain_val = "160";
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
@ -116,7 +116,7 @@ i2c8 = "/i2c@31e0000";
min_exp_time = "100"; // us
max_exp_time = "16620"; // us
step_exp_time = "1";
default_exp_time = "15000"; // us
default_exp_time = "16620"; // us
};
mode1 {
mclk_khz = "24000";
@ -141,7 +141,7 @@ i2c8 = "/i2c@31e0000";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "250";
max_gain_val = "160";
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
@ -155,7 +155,7 @@ i2c8 = "/i2c@31e0000";
min_exp_time = "100"; // us
max_exp_time = "22220"; // us
step_exp_time = "1";
default_exp_time = "15000"; // us
default_exp_time = "22220"; // us
};
ports {
@ -229,7 +229,7 @@ i2c8 = "/i2c@31e0000";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "250" ;
max_gain_val = "160" ;
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
@ -243,7 +243,7 @@ i2c8 = "/i2c@31e0000";
min_exp_time = "100"; // us
max_exp_time = "16620"; // us
step_exp_time = "1";
default_exp_time = "15000"; // us
default_exp_time = "16620"; // us
};
mode1 {
mclk_khz = "24000";
@ -268,7 +268,7 @@ i2c8 = "/i2c@31e0000";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "250";
max_gain_val = "160";
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
@ -282,7 +282,7 @@ i2c8 = "/i2c@31e0000";
min_exp_time = "100"; // us
max_exp_time = "22220"; // us
step_exp_time = "1";
default_exp_time = "15000"; // us
default_exp_time = "22220"; // us
};
ports {
#address-cells = <0x1>;

View File

@ -442,12 +442,10 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
goto exit;
/* Update global gain */
err =
mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN, gain);
err = mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN, gain);
if (err)
goto exit;
err =
mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN_CB, gain);
err = mt9m021_write_reg16(s_data, MT9M021_GLOBAL_GAIN_CB, gain);
if (err)
goto exit;
@ -564,8 +562,7 @@ static int mt9m021_set_analog_gain(struct tegracam_device *tc_dev, s64 val)
goto exit;
reg16 =
(reg16 & ~MT9M021_ANALOG_GAIN_MASK) |
((val << MT9M021_ANALOG_GAIN_SHIFT) &
MT9M021_ANALOG_GAIN_MASK);
((val << MT9M021_ANALOG_GAIN_SHIFT) & MT9M021_ANALOG_GAIN_MASK);
err = mt9m021_write_reg16(s_data, MT9M021_DIGITAL_TEST, reg16);
if (err)
goto exit;
@ -642,8 +639,7 @@ static int mt9m021_set_test_pattern(struct tegracam_device *tc_dev, s32 val)
err = mt9m021_write_reg16(s_data, MT9M021_TEST_PATTERN,
MT9M021_TEST_PATTERN_VAL);
else
err = mt9m021_write_reg16(s_data, MT9M021_TEST_PATTERN,
val);
err = mt9m021_write_reg16(s_data, MT9M021_TEST_PATTERN, val);
if (err)
goto exit;
@ -1116,7 +1112,8 @@ static int mt9m021_verify_chip_id(struct mt9m021 *priv)
err = mt9m021_read_reg16(s_data, MT9M021_CHIP_ID_REG, &chip_id);
if (!err)
break;
dev_info(&client->dev, "Failed to read Chip ID, trying again\n");
dev_info(&client->dev,
"Failed to read Chip ID, trying again\n");
max_retries--;
msleep(30);
}

View File

@ -173,8 +173,10 @@ static const int mt9m021_framerates_1280x960[] = {
};
static const struct camera_common_frmfmt mt9m021_frmfmt[] = {
{{1280, 720}, mt9m021_framerates_1280x720, 1, 0, MT9M021_MODE_1280x720_60FPS},
{{1280, 960}, mt9m021_framerates_1280x960, 1, 0, MT9M021_MODE_1280x960_45FPS},
{{1280, 720}, mt9m021_framerates_1280x720, 1, 0,
MT9M021_MODE_1280x720_60FPS},
{{1280, 960}, mt9m021_framerates_1280x960, 1, 0,
MT9M021_MODE_1280x960_45FPS},
};
#endif /* __MT9M021_I2C_TABLES__ */