diff --git a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts index 3b696a8da..0d4a09ccc 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_s905x2_u212.dts @@ -1522,7 +1522,7 @@ /*if you want to use vdin just modify status to "ok"*/ &vdin0 { /*memory-region = <&vdin0_cma_reserved>;*/ - status = "disabled"; + /* status = "disabled"; */ /* up to 1920x1080 yuv422 8bit and 5 buffers * 1920x1080x2x5 = 20 M */ @@ -1539,7 +1539,7 @@ &vdin1 { memory-region = <&vdin1_cma_reserved>; - status = "disabled"; + /* status = "disabled"; */ /*vdin write mem color depth support: *bit0:support 8bit *bit1:support 9bit diff --git a/arch/arm64/boot/dts/amlogic/mesong12a.dtsi b/arch/arm64/boot/dts/amlogic/mesong12a.dtsi index 3760139f5..5839ecb96 100644 --- a/arch/arm64/boot/dts/amlogic/mesong12a.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesong12a.dtsi @@ -1139,7 +1139,7 @@ /*if you want to use vdin just modify status to "ok"*/ vdin0: vdin0 { - compatible = "amlogic, vdin"; + compatible = "amlogic, vdin-g12a"; dev_name = "vdin0"; status = "disabled"; reserve-iomap = "true"; @@ -1161,11 +1161,11 @@ vdin_id = <0>; }; vdin1: vdin1 { - compatible = "amlogic, vdin"; + compatible = "amlogic, vdin-g12a"; dev_name = "vdin1"; - status = "disabled"; + status = "okay"; reserve-iomap = "true"; - flag_cma = <0>;/*1:share with codec_mm;0:cma alone*/ + flag_cma = <100>;/*1:share with codec_mm;0:cma alone*/ interrupts = <0 85 1>; rdma-irq = <4>; /*clocks = <&clock CLK_FPLL_DIV5>, diff --git a/drivers/media/vin/tvin/vdin/vdin_ctl.c b/drivers/media/vin/tvin/vdin/vdin_ctl.c index b1bb49dce..e83ca89bc 100644 --- a/drivers/media/vin/tvin/vdin/vdin_ctl.c +++ b/drivers/media/vin/tvin/vdin/vdin_ctl.c @@ -1657,7 +1657,7 @@ static void vdin_manual_matrix_csc(enum vdin_matrix_csc_e *matrix_csc) struct vdin_dev_s *devp; devp = vdin_get_dev(0); - if (!devp->debug.manual_change_csc) + if (!devp || !devp->debug.manual_change_csc) return; if (devp->debug.manual_change_csc >= VDIN_MATRIX_MAX) diff --git a/drivers/media/vin/tvin/vdin/vdin_drv.c b/drivers/media/vin/tvin/vdin/vdin_drv.c index ffe6c733f..a3c80669d 100644 --- a/drivers/media/vin/tvin/vdin/vdin_drv.c +++ b/drivers/media/vin/tvin/vdin/vdin_drv.c @@ -5606,6 +5606,15 @@ static const struct match_data_s vdin_dt_xxx = { .vdin0_line_buff_size = 0xf00, .vdin1_line_buff_size = 0xf00, }; +const struct match_data_s vdin_dt_g12a = { + .name = "vdin", + .hw_ver = VDIN_HW_ORG, + .vdin0_en = 1, .vdin1_en = 1, + .de_tunnel_tunnel = 0, .ipt444_to_422_12bit = 0, + .vdin0_line_buff_size = 0x780, .vdin1_line_buff_size = 0x780, + .vdin0_max_w_h = 0, .vdin1_set_hdr = false, +}; + #ifndef CONFIG_AMLOGIC_ZAPPER_CUT #ifndef CONFIG_AMLOGIC_REMOVE_OLD const struct match_data_s vdin_dt_tl1 = { @@ -5771,6 +5780,10 @@ static const struct of_device_id vdin_dt_match[] = { .compatible = "amlogic, vdin", .data = &vdin_dt_xxx, }, + { + .compatible = "amlogic, vdin-g12a", + .data = &vdin_dt_g12a, + }, #ifndef CONFIG_AMLOGIC_REMOVE_OLD { .compatible = "amlogic, vdin-tl1",