From d0929427b4b84051f86b49c9c90f5e8598603d84 Mon Sep 17 00:00:00 2001 From: jintao xu Date: Mon, 9 Apr 2018 11:20:20 +0800 Subject: [PATCH] amvideo: add video_global_output sysfs control interface PD#163190: screen still displays the last frame after HDMI disconnect Change-Id: Ic3b31a6af6a00a83a58d5d293a2fcab2a4369b04 Signed-off-by: jintao xu --- drivers/amlogic/media/video_sink/video.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 44bd093..e1a03a9 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -7839,6 +7839,27 @@ static ssize_t video_disable_store(struct class *cla, return count; } +static ssize_t video_global_output_show(struct class *cla, + struct class_attribute *attr, char *buf) +{ + return sprintf(buf, "%d\n", video_global_output); +} + +static ssize_t video_global_output_store(struct class *cla, + struct class_attribute *attr, + const char *buf, size_t count) +{ + size_t r; + + r = kstrtoint(buf, 0, &video_global_output); + if (r < 0) + return -EINVAL; + + pr_info("%s(%d)\n", __func__, video_global_output); + + return count; +} + static ssize_t video_freerun_mode_show(struct class *cla, struct class_attribute *attr, char *buf) { @@ -8545,6 +8566,10 @@ static struct class_attribute amvideo_class_attrs[] = { 0664, video_disable_show, video_disable_store), + __ATTR(video_global_output, + 0664, + video_global_output_show, + video_global_output_store), __ATTR(zoom, 0664, video_zoom_show, -- 2.7.4