Compare commits

...

2 Commits

Author SHA1 Message Date
dchvs 5cede1ef85 Fix dotted image 2021-03-10 13:56:55 -06:00
dchvs 3f911eb3f3 Merge pull request 'Fix low framerate' (#7) from jetpack-4.4.1 into master
Reviewed-on: #7
2021-03-08 22:59:41 +00:00
2 changed files with 32 additions and 32 deletions

View File

@ -98,25 +98,25 @@ i2c8 = "/i2c@31e0000";
inherent_gain = "1"; inherent_gain = "1";
pix_clk_hz = "74250000"; pix_clk_hz = "74250000";
gain_factor = "3125"; gain_factor = "3";
framerate_factor = "1000000"; framerate_factor = "1000000";
exposure_factor = "1000000"; exposure_factor = "1000000"; //"1000000";
min_gain_val = "100000"; min_gain_val = "100";
max_gain_val = "796000"; max_gain_val = "762";
step_gain_val = "1"; step_gain_val = "1";
default_gain = "100000"; default_gain = "100";
min_hdr_ratio = "1"; min_hdr_ratio = "1";
max_hdr_ratio = "1"; max_hdr_ratio = "1";
min_framerate = "2000000"; min_framerate = "2000000";
max_framerate = "60000000"; max_framerate = "60000000";
step_framerate = "1"; step_framerate = "1";
default_framerate = "60000000"; // 60.0 fps default_framerate = "60000000"; // 60.0 fps
min_exp_time = "500"; // us min_exp_time = "23000"; // us
max_exp_time = "16000"; // us max_exp_time = "1000000"; // us
step_exp_time = "1"; step_exp_time = "1";
default_exp_time = "12000"; // us default_exp_time = "40000"; // us
}; };
ports { ports {
#address-cells = <0x1>; #address-cells = <0x1>;
@ -185,25 +185,25 @@ i2c8 = "/i2c@31e0000";
inherent_gain = "1"; inherent_gain = "1";
pix_clk_hz = "74250000"; pix_clk_hz = "74250000";
gain_factor = "3125"; gain_factor = "3";
framerate_factor = "1000000"; framerate_factor = "1000000";
exposure_factor = "1000000"; exposure_factor = "1000000";
min_gain_val = "100000"; min_gain_val = "100";
max_gain_val = "796000"; max_gain_val = "762";
step_gain_val = "1"; step_gain_val = "1";
default_gain = "100000"; default_gain = "100";
min_hdr_ratio = "1"; min_hdr_ratio = "1";
max_hdr_ratio = "1"; max_hdr_ratio = "1";
min_framerate = "2000000"; min_framerate = "2000000";
max_framerate = "60000000"; max_framerate = "60000000";
step_framerate = "1"; step_framerate = "1";
default_framerate = "60000000"; // 60.0 fps default_framerate = "60000000"; // 60.0 fps
min_exp_time = "500"; // us min_exp_time = "23000"; // us
max_exp_time = "16000"; // us max_exp_time = "1000000"; // us
step_exp_time = "1"; step_exp_time = "1";
default_exp_time = "12000"; // us default_exp_time = "40000"; // us
}; };
ports { ports {
#address-cells = <0x1>; #address-cells = <0x1>;

View File

@ -135,8 +135,8 @@
#define MT9M021_ANALOG_GAIN_SHIFT 4 #define MT9M021_ANALOG_GAIN_SHIFT 4
#define MT9M021_ANALOG_GAIN_MASK 0x0030 #define MT9M021_ANALOG_GAIN_MASK 0x0030
#define MT9M021_GLOBAL_GAIN_MIN 100000 #define MT9M021_GLOBAL_GAIN_MIN 100
#define MT9M021_GLOBAL_GAIN_MAX 796000 #define MT9M021_GLOBAL_GAIN_MAX 762
#define MT9M021_GLOBAL_GAIN_DEF 100 #define MT9M021_GLOBAL_GAIN_DEF 100
#define MT9M021_COARSE_INT_TIME_MIN 0x0001 #define MT9M021_COARSE_INT_TIME_MIN 0x0001
@ -420,15 +420,15 @@ static int mt9m021_set_gain(struct tegracam_device *tc_dev, s64 val)
* GAIN: VAL / STEPS; * GAIN: VAL / STEPS;
* STEPS: 1/32 * STEPS: 1/32
* *
* SCALE FACTOR = 100.000 * SCALE FACTOR = 32
* *
* min_gain_val = 100.000 * min_gain_val = 100
* max_gain_val = 797.000 * max_gain_val = 762
* gain_factor = 3125 * gain_factor = 3
* *
* gain maps to range 32 - 255 * gain maps to range 32 - 255
*/ */
gain = val / 3125; gain = val / 3;
/* Update analog gain multiplier */ /* Update analog gain multiplier */
err = mt9m021_read_reg16(s_data, MT9M021_DIGITAL_TEST, &reg16); err = mt9m021_read_reg16(s_data, MT9M021_DIGITAL_TEST, &reg16);
@ -527,12 +527,12 @@ static int mt9m021_set_coarse_time(struct mt9m021 *priv, s64 val)
static int mt9m021_set_exposure(struct tegracam_device *tc_dev, s64 val) static int mt9m021_set_exposure(struct tegracam_device *tc_dev, s64 val)
{ {
struct camera_common_data *s_data = tc_dev->s_data; struct camera_common_data *s_data = tc_dev->s_data;
struct mt9m021 *priv = (struct mt9m021 *)tc_dev->priv; struct mt9m021 *priv = (struct mt9m021 *)tc_dev->priv;
struct device *dev = tc_dev->dev; struct device *dev = tc_dev->dev;
const struct sensor_mode_properties *mode = const struct sensor_mode_properties *mode =
&s_data->sensor_props.sensor_modes[s_data->mode]; &s_data->sensor_props.sensor_modes[s_data->mode];
u64 coarse_time; u64 coarse_time;
int err = 0; int err = 0;
dev_dbg(dev, "Setting Exposure Time to : %lld", val); dev_dbg(dev, "Setting Exposure Time to : %lld", val);