author | jintao xu <jintao.xu@amlogic.com> | 2018-04-09 03:20:20 (GMT) |
---|---|---|
committer | Xindong Xu <xindong.xu@amlogic.com> | 2018-05-02 02:09:03 (GMT) |
commit | 0e0d0ae12fda402671ee6e2103a9e620f7ff38a1 (patch) | |
tree | 816d215d25083fe8cad65efb6fe11c4033e946f2 | |
parent | c542ff04534c8416cc3b0d316f7e479cb2428078 (diff) | |
download | common-0e0d0ae12fda402671ee6e2103a9e620f7ff38a1.zip common-0e0d0ae12fda402671ee6e2103a9e620f7ff38a1.tar.gz common-0e0d0ae12fda402671ee6e2103a9e620f7ff38a1.tar.bz2 |
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 <jintao.xu@amlogic.com>
-rw-r--r-- | drivers/amlogic/media/video_sink/video.c | 25 |
1 files changed, 25 insertions, 0 deletions
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, |