feature/resolution-1280x960 #10

Merged
dchvs merged 4 commits from feature/resolution-1280x960 into master 2021-03-19 21:56:50 -03:00
3 changed files with 131 additions and 6 deletions

View File

@ -5,14 +5,16 @@ The camera sensors should be conencted to a ConnectTech's Elroy board.
## Features
* V4L2 Kernel Driver Version 2.0 supported on L4T32.2.1
* V4L2 Kernel Driver Version 2.0 supported on L4T32.4.4
* V4l2 controls
* test pattern
* individual gains
* vertical/horizontal flip
* flash control
* LibArgus and nvarguscamerasrc
* Resolution supported: 1280x720 @ 60fps
* Resolutions supported:
* 1280x720 @ 60fps
* 1280x960 @ 45fps
* Gain, exposure, and framerate controls
* Camera synchronization

View File

@ -118,6 +118,46 @@ i2c8 = "/i2c@31e0000";
step_exp_time = "1";
default_exp_time = "50000"; // us
};
mode1 {
mclk_khz = "24000";
num_lanes = "1";
tegra_sinterface = "serial_b";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "26";
active_w = "1280";
active_h = "960";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "rggb";
readout_orientation = "0";
line_length = "1650";
inherent_gain = "1";
pix_clk_hz = "74250000";
gain_factor = "3";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "160" ;
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "2000000";
max_framerate = "45000000";
step_framerate = "1";
default_framerate = "45000000"; // 45.0 fps
min_exp_time = "24000"; // us
max_exp_time = "74000"; // us
step_exp_time = "1";
default_exp_time = "50000"; // us
};
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
@ -200,6 +240,45 @@ i2c8 = "/i2c@31e0000";
step_framerate = "1";
default_framerate = "60000000"; // 60.0 fps
min_exp_time = "24000"; // us
max_exp_time = "74000"; // us
step_exp_time = "1";
default_exp_time = "50000"; // us
};
mode1 {
mclk_khz = "24000";
num_lanes = "1";
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = "26";
active_w = "1280";
active_h = "960";
dynamic_pixel_bit_depth = "12";
csi_pixel_bit_depth = "12";
mode_type = "bayer";
pixel_phase = "rggb";
readout_orientation = "0";
line_length = "1650";
inherent_gain = "1";
pix_clk_hz = "74250000";
gain_factor = "3";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "102";
max_gain_val = "160" ;
step_gain_val = "1";
default_gain = "102";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "2000000";
max_framerate = "45000000";
step_framerate = "1";
default_framerate = "45000000"; // 45.0 fps
min_exp_time = "24000"; // us
max_exp_time = "74000"; // us
step_exp_time = "1";

View File

@ -102,8 +102,42 @@ static const mt9m021_reg mt9m021_mode_1280x720_60fps[] = {
{MT9M021_TABLE_END, 0x00}
};
static const mt9m021_reg mt9m021_mode_1280x960_45fps[] = {
/* Rev2 Settings */
{0x307A, 0x0000},
{0x30EA, 0x0C00},
{0x3044, 0x0404},
{0x301E, 0x012C},
{0x3180, 0x8000},
{0x3014, 0x0000},
/* Analog Settings */
{0x3ED6, 0x00FD},
{0x3ED8, 0x0FFF},
{0x3EDA, 0x0003},
{0x3EDC, 0xF87A},
{0x3EDE, 0xE075},
{0x3EE0, 0x077C},
{0x3EE2, 0xA4EB},
{0x3EE4, 0xD208},
/* Size Settings */
{0x3064, 0x1802}, /* EMBEDDED_DATA_CTRL */
{0x3032, 0x0020}, /* DIGITAL_BINNING */
{0x3002, 0x0004}, /* Y ADDR START */
{0x3004, 0x0001}, /* X ADDR START */
{0x3006, 0x03C3}, /* Y ADDR END */
{0x3008, 0x0500}, /* X ADDR END */
{0x300A, 0x03DE}, /* FRAME_LENGTH_LINES */
{0x300C, 0x0672}, /* LINE_LENGTH_PCK */
{0x30A2, 0x0001}, /* X_ODD_INC */
{0x30A6, 0x0001}, /* Y_ODD_INC */
{MT9M021_TABLE_END, 0x00}
};
enum {
MT9M021_MODE_1280x720_60FPS,
MT9M021_MODE_1280x960_45FPS,
MT9M021_MODE_PLL_SETUP,
@ -113,6 +147,7 @@ enum {
static const mt9m021_reg *mode_table[] = {
[MT9M021_MODE_1280x720_60FPS] = mt9m021_mode_1280x720_60fps,
[MT9M021_MODE_1280x960_45FPS] = mt9m021_mode_1280x960_45fps,
[MT9M021_MODE_PLL_SETUP] = mt9m021_pll_setup,
@ -120,7 +155,7 @@ static const mt9m021_reg *mode_table[] = {
[MT9M021_MODE_STOP_STREAM] = mt9m021_stop,
};
static const int mt9m021_framerates[] = {
static const int mt9m021_framerates_1280x720[] = {
10,
20,
30,
@ -129,8 +164,17 @@ static const int mt9m021_framerates[] = {
60,
};
static const int mt9m021_framerates_1280x960[] = {
10,
20,
30,
40,
45,
};
static const struct camera_common_frmfmt mt9m021_frmfmt[] = {
{{1280, 720}, mt9m021_framerates, 1, 0, MT9M021_MODE_1280x720_60FPS},
{{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__ */