Skip to content

Commit

Permalink
chore: fetch update upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nullptr authored Mar 29, 2024
2 parents 995b97c + 5602f04 commit 6976881
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "hx_drv_gpio.h"
#include "hx_drv_inp.h"

#define IMG_640_480 1

typedef enum
{
APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X,
Expand All @@ -50,6 +52,18 @@ typedef enum
#define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130)
#define DYNAMIC_ADDRESS

#ifdef IMG_640_480
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 1280
#define IMX708_INP_CROP_HEIGHT 960
#define IMX708_INP_OUT_WIDTH 640
#define IMX708_INP_OUT_HEIGHT 480
#define IMX708_HW2x2_CROP_WIDTH 640
#define IMX708_HW2x2_CROP_HEIGHT 480
#define IMX708_HW5x5_CROP_WIDTH 640
#define IMX708_HW5x5_CROP_HEIGHT 480
#else
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 2304
Expand All @@ -60,6 +74,7 @@ typedef enum
#define IMX708_HW2x2_CROP_HEIGHT 264
#define IMX708_HW5x5_CROP_WIDTH 576
#define IMX708_HW5x5_CROP_HEIGHT 320
#endif

#define IMX708_QBC_ADJUST (0x02)
#define IMX708_REG_BASE_SPC_GAINS_L (0x7b10)
Expand Down Expand Up @@ -108,10 +123,17 @@ typedef enum
*
* CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0
*/
#ifdef IMG_640_480
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 504
#define DP_INP_CROP_START_Y 168
#else
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 0
#define DP_INP_CROP_START_Y 0
#endif
#define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH
#define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT
#define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void IMX708_set_pll200()
cfg.mipiclk.hscmipiclkdiv = 0;
}

cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M;
hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1);

uint32_t mipi_pixel_clk = 96;
Expand Down Expand Up @@ -463,12 +464,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, evthandlerdp_CBEven
crop.start_y = DP_INP_CROP_START_Y;

if(DP_INP_CROP_WIDTH >= 1)
crop.last_x = DP_INP_CROP_WIDTH - 1;
crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1;
else
crop.last_x = 0;

if(DP_INP_CROP_HEIGHT >= 1)
crop.last_y = DP_INP_CROP_HEIGHT - 1;
crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1;
else
crop.last_y = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "hx_drv_gpio.h"
#include "hx_drv_inp.h"

#define IMG_640_480 1

typedef enum
{
APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X,
Expand All @@ -50,6 +52,18 @@ typedef enum
#define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130)
#define DYNAMIC_ADDRESS

#ifdef IMG_640_480
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 1280
#define IMX708_INP_CROP_HEIGHT 960
#define IMX708_INP_OUT_WIDTH 640
#define IMX708_INP_OUT_HEIGHT 480
#define IMX708_HW2x2_CROP_WIDTH 640
#define IMX708_HW2x2_CROP_HEIGHT 480
#define IMX708_HW5x5_CROP_WIDTH 640
#define IMX708_HW5x5_CROP_HEIGHT 480
#else
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 2304
Expand All @@ -60,6 +74,7 @@ typedef enum
#define IMX708_HW2x2_CROP_HEIGHT 264
#define IMX708_HW5x5_CROP_WIDTH 576
#define IMX708_HW5x5_CROP_HEIGHT 320
#endif

#define IMX708_QBC_ADJUST (0x02)
#define IMX708_REG_BASE_SPC_GAINS_L (0x7b10)
Expand Down Expand Up @@ -108,10 +123,17 @@ typedef enum
*
* CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0
*/
#ifdef IMG_640_480
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 504
#define DP_INP_CROP_START_Y 168
#else
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 0
#define DP_INP_CROP_START_Y 0
#endif
#define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH
#define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT
#define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void IMX708_set_pll200()
cfg.mipiclk.hscmipiclkdiv = 0;
}

cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M;
hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1);

uint32_t mipi_pixel_clk = 96;
Expand Down Expand Up @@ -466,12 +467,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, sensordplib_CBEvent
crop.start_y = DP_INP_CROP_START_Y;

if(DP_INP_CROP_WIDTH >= 1)
crop.last_x = DP_INP_CROP_WIDTH - 1;
crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1;
else
crop.last_x = 0;

if(DP_INP_CROP_HEIGHT >= 1)
crop.last_y = DP_INP_CROP_HEIGHT - 1;
crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1;
else
crop.last_y = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "hx_drv_gpio.h"
#include "hx_drv_inp.h"

#define IMG_640_480 1

typedef enum
{
APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X,
Expand All @@ -50,6 +52,18 @@ typedef enum
#define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130)
#define DYNAMIC_ADDRESS

#ifdef IMG_640_480
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 1280
#define IMX708_INP_CROP_HEIGHT 960
#define IMX708_INP_OUT_WIDTH 640
#define IMX708_INP_OUT_HEIGHT 480
#define IMX708_HW2x2_CROP_WIDTH 640
#define IMX708_HW2x2_CROP_HEIGHT 480
#define IMX708_HW5x5_CROP_WIDTH 640
#define IMX708_HW5x5_CROP_HEIGHT 480
#else
#define IMX708_SENSOR_WIDTH 2304
#define IMX708_SENSOR_HEIGHT 1296
#define IMX708_INP_CROP_WIDTH 2304
Expand All @@ -60,6 +74,7 @@ typedef enum
#define IMX708_HW2x2_CROP_HEIGHT 264
#define IMX708_HW5x5_CROP_WIDTH 576
#define IMX708_HW5x5_CROP_HEIGHT 320
#endif

#define IMX708_QBC_ADJUST (0x02)
#define IMX708_REG_BASE_SPC_GAINS_L (0x7b10)
Expand Down Expand Up @@ -108,10 +123,17 @@ typedef enum
*
* CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0
*/
#ifdef IMG_640_480
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 504
#define DP_INP_CROP_START_Y 168
#else
#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B
#define DP_INP_BINNING INP_BINNING_DISABLE
#define DP_INP_CROP_START_X 0
#define DP_INP_CROP_START_Y 0
#endif
#define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH
#define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT
#define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void IMX708_set_pll200()
cfg.mipiclk.hscmipiclkdiv = 0;
}

cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M;
hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1);

uint32_t mipi_pixel_clk = 96;
Expand Down Expand Up @@ -463,12 +464,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, evthandlerdp_CBEven
crop.start_y = DP_INP_CROP_START_Y;

if(DP_INP_CROP_WIDTH >= 1)
crop.last_x = DP_INP_CROP_WIDTH - 1;
crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1;
else
crop.last_x = 0;

if(DP_INP_CROP_HEIGHT >= 1)
crop.last_y = DP_INP_CROP_HEIGHT - 1;
crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1;
else
crop.last_y = 0;

Expand Down

0 comments on commit 6976881

Please sign in to comment.