cvbs: add video mute test api [1/1]

PD#SWPL-167292

Problem:
need cvbs video mute api for special test

Solution:
add cvbs video mute api for drm: call
cvbs_video_mute(true / false) to mute/unmute
CVBS video output, it will keep video mute
even set cvbs output again, until drm call unmute.

Verify:
s1a

Test:
CVBS video mute/unmute + hotplug hdmitx and check cvbs mute

Change-Id: I5f6d5c28596f0cdf26c9356a2500b1fe8fe43fd7
Signed-off-by: hang cheng <hang.cheng@amlogic.com>
This commit is contained in:
hang cheng
2024-04-15 20:29:56 +08:00
committed by Luan Yuan
parent 3e31fafe2f
commit c6fc740445
3 changed files with 26 additions and 1 deletions
+15 -1
View File
@@ -62,6 +62,7 @@
#include <linux/component.h>
#include <linux/amlogic/gki_module.h>
#include <drm/amlogic/meson_drm_bind.h>
#include <linux/amlogic/media/vout/cvbs.h>
#ifdef CONFIG_AMLOGIC_VOUT_CC_BYPASS
/* interrupt source */
@@ -466,6 +467,7 @@ static int cvbs_out_setmode(void)
cvbs_out_reg_write(ENCI_VIDEO_EN, 0);
set_vmode_clk();
ret = cvbs_out_set_venc(local_cvbs_mode);
cvbs_bist_test(cvbs_drv->video_mute ? 8 : 0, NULL);
if (ret) {
mutex_lock(&setmode_mutex);
return -1;
@@ -910,6 +912,14 @@ static void cvbs_bist_test(unsigned int bist, void *data)
}
}
void cvbs_video_mute(bool mute)
{
mutex_lock(&setmode_mutex);
cvbs_bist_test(mute ? 8 : 0, NULL);
cvbs_drv->video_mute = mute;
mutex_unlock(&setmode_mutex);
}
static ssize_t aml_CVBS_attr_vdac_power_show(struct class *class,
struct class_attribute *attr,
char *buf)
@@ -1314,6 +1324,10 @@ static void cvbs_debug_store(const char *buf)
pr_info("cvbs: invalid bist\n");
goto DEBUG_END;
}
if (bist == 0)
cvbs_drv->video_mute = false;
else
cvbs_drv->video_mute = true;
cvbs_bist_test(bist, NULL);
break;
@@ -2109,7 +2123,7 @@ static int cvbsout_probe(struct platform_device *pdev)
cvbs_drv->cvbs_data = (struct meson_cvbsout_data *)match->data;
cvbs_log_dbg("%s, cpu_id:%d,name:%s\n", __func__,
cvbs_drv->cvbs_data->cpu_id, cvbs_drv->cvbs_data->name);
cvbs_drv->video_mute = false;
if (cvbs_drv->cvbs_data->cpu_id <= CVBS_CPU_TYPE_S1A &&
cvbs_drv->cvbs_data->cpu_id >= CVBS_CPU_TYPE_S4)
cvbsout_clktree_probe(&pdev->dev);
+2
View File
@@ -116,6 +116,8 @@ struct cvbs_drv_s {
/*DRM related*/
int drm_cvbs_id;
/* for external video mute */
bool video_mute;
};
static DEFINE_MUTEX(cvbs_mutex);
+9
View File
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef __CVBS_H__
#define __CVBS_H__
void cvbs_video_mute(bool mute);
#endif