add(media): add mipi switch and sensor sc202cs. [MIPI_SWITCH][CAMERA_V1.2]

This commit is contained in:
kangjun
2024-12-27 20:12:08 +08:00
parent fb4f7b3baf
commit a2ba6d78f2
32 changed files with 11557 additions and 182 deletions

View File

@@ -54,7 +54,7 @@ unsigned int vin_vipp_irq[VIN_MAX_SCALER/DEV_VIRT_NUM] = {
struct vin_clk_info vind_default_clk[VIN_MAX_CLK] = {
[VIN_TOP_CLK] = {
.clock = HAL_CLK_PERIPH_CSI_TOP,
.frequency = 340000000,
.frequency = 300000000,
},
[VIN_TOP_CLK_SRC] = {
.clock = HAL_CLK_PLL_CSIX4,
@@ -590,16 +590,16 @@ struct vin_mclk_info vind_default_mclk[VIN_MAX_CCI] = {
{
.mclk = HAL_CLK_PERIPH_CSI_MASTER0,
.clk_24m = HAL_CLK_SRC_HOSC,
.clk_pll = HAL_CLK_PLL_CSIX4,
.pin = GPIOA(12),
.pin_func = {0x4, 0xf},
.clk_pll = HAL_CLK_PLL_CSI,
.pin = GPIOE(12),
.pin_func = {0x5, 0xf},
},
{
.mclk = HAL_CLK_PERIPH_CSI_MASTER1,
.clk_24m = HAL_CLK_SRC_HOSC,
.clk_pll = HAL_CLK_PLL_CSIX4,
.pin = GPIOA(13),
.pin_func = {0x4, 0xf},
.clk_pll = HAL_CLK_PLL_CSI,
.pin = GPIOE(13),
.pin_func = {0x5, 0xf},
},
{
.mclk = HAL_CLK_PERIPH_CSI_MASTER2,
@@ -721,23 +721,115 @@ struct sensor_list global_sensors[VIN_MAX_CSI] = {
.ir_led_gpio = 0xffff,
},
#endif
#if defined(CONFIG_SENSOR_SC2356_MIPI)
#if 1
/*mipi0 parser0*/
[0] = {
.used = 1,
.sensor_name = "gc2083_mipi",
.sensor_twi_addr = 0x6e,
.sensor_twi_id = 0,
.mclk_id = 0,
.use_isp = 1,
.id = 0,
.addr_width = 16,
.data_width = 8,
.reset_gpio = GPIOF(5),
.pwdn_gpio = GPIOE(8),
.ir_cut_gpio[0] = GPIOF(1),/*-cut*/
.ir_cut_gpio[1] = GPIOF(2),/*+cut*/
.ir_led_gpio = 0xffff,
},
/*mipi1 parser1*/
[1] = {
.used = 1,
.sensor_name = "sc2356_mipi",
.sensor_twi_addr = 0x6c,
.sensor_twi_id = 1,
.mclk_id = 1,
.use_isp = 1,
.id = 1,
.addr_width = 16,
.data_width = 8,
.reset_gpio = GPIOE(6),
.pwdn_gpio = GPIOE(7),
.ir_cut_gpio[0] = 0xffff, /*-cut*/
.ir_cut_gpio[1] =0xffff, /*+cut*/
.ir_led_gpio = 0xffff, //GPIOE(10)
},
#else
/*mipi0 parser0*/
[0] = {
.used = 1,
.sensor_name = "sc2356_mipi",
.sensor_twi_addr = 0x6c,
.sensor_twi_id = 1,
.mclk_id = 1,
.use_isp = 1,
.id = 0,
.addr_width = 16,
.data_width = 8,
.reset_gpio = GPIOE(6),
.pwdn_gpio = GPIOE(7),
.ir_cut_gpio[0] = 0xffff, /*-cut*/
.ir_cut_gpio[1] =0xffff, /*+cut*/
.ir_led_gpio = 0xffff, //GPIOE(10)
},
/*mipi1 parser1*/
[1] = {
.used = 1,
.sensor_name = "gc2083_mipi",
.sensor_twi_addr = 0x6e,
.sensor_twi_id = 0,
.mclk_id = 0,
.use_isp = 1,
.id = 1,
.addr_width = 16,
.data_width = 8,
.reset_gpio = GPIOF(5),
.pwdn_gpio = GPIOE(8),
.ir_cut_gpio[0] = GPIOF(1),/*-cut*/
.ir_cut_gpio[1] = GPIOF(2),/*+cut*/
.ir_led_gpio = 0xffff,
},
#endif
#endif
#if defined(CONFIG_SENSOR_F355P_DVP)
/*dvp*/
[2] = {
.used = 1,
.sensor_name = "f355p_dvp",
.sensor_twi_addr = 0x80,
.sensor_twi_id = 4,
.mclk_id = 2,
.use_isp = 1,
.id = 2,
.addr_width = 8,
.data_width = 8,
.reset_gpio = GPIOI(4),
.pwdn_gpio = 0xffff,
.ir_cut_gpio[0] = 0xffff,/*-cut*/
.ir_cut_gpio[1] = 0xffff,/*+cut*/
.ir_led_gpio = 0xffff,
},
#endif
};
struct vin_core global_video[VIN_MAX_VIDEO] = {
[0] = {
.used = 1,
.id = 0,
.rear_sensor = 2,
.rear_sensor = 0,
.front_sensor = 0,
.csi_sel = 2,
.mipi_sel = 0xff,
.csi_sel = 0,
.mipi_sel = 0,
.isp_sel = 0,
.tdm_rx_sel = 0,
.isp_tx_ch = 0,
.base = CSI_DMA0_REG_BASE,
.irq = SUNXI_IRQ_CSIC_DMA0,
.o_width = 512,
.o_height = 288,
.o_width = 1920,
.o_height = 1080,
//.fourcc = V4L2_PIX_FMT_LBC_2_5X,
.fourcc = V4L2_PIX_FMT_NV12,
.use_sensor_list = 0,
@@ -745,17 +837,18 @@ struct vin_core global_video[VIN_MAX_VIDEO] = {
[1] = {
.used = 1,
.id = 1,
.rear_sensor = 0,
.front_sensor = 0,
.csi_sel = 0,
.mipi_sel = 0,
.rear_sensor = 1,
.front_sensor = 1,
.csi_sel = 1,
.mipi_sel = 1,
.csi_ch = 0x10,
.isp_sel = 1,
.tdm_rx_sel = 1,
.isp_tx_ch = 0,
.base = CSI_DMA0_REG_BASE,
.irq = SUNXI_IRQ_CSIC_DMA0,
.o_width = 512,
.o_height = 288,
.o_width = 1600,
.o_height = 1200,
//.fourcc = V4L2_PIX_FMT_LBC_2_5X,
.fourcc = V4L2_PIX_FMT_NV12,
.use_sensor_list = 0,
@@ -764,16 +857,17 @@ struct vin_core global_video[VIN_MAX_VIDEO] = {
.used = 1,
.id = 2,
.rear_sensor = 1,
.front_sensor = 0,
.csi_sel = 1,
.front_sensor = 1,
.csi_sel =1,
.mipi_sel = 1,
.csi_ch = 0x11,
.isp_sel = 2,
.tdm_rx_sel = 2,
.isp_tx_ch = 0,
.base = CSI_DMA0_REG_BASE,
.irq = SUNXI_IRQ_CSIC_DMA0,
.o_width = 512,
.o_height = 288,
.o_width = 1600,
.o_height = 1200,
//.fourcc = V4L2_PIX_FMT_LBC_2_5X,
.fourcc = V4L2_PIX_FMT_NV12,
.use_sensor_list = 0,