From db3ac63cf32281e9445ba6dd91fe1e0917771f15 Mon Sep 17 00:00:00 2001 From: Jian Cao Date: Mon, 17 Dec 2018 14:19:16 +0800 Subject: [PATCH] osd: need information whether current OSD is blanked or not [1/1] PD#SWPL-3254 Problem: need information whether current OSD is blanked or not Solution: add sysfs node osd_status Verify: verified on u212 Change-Id: Ie73417f08c648a750a881af375800aae57a48762 Signed-off-by: Jian Cao --- drivers/amlogic/media/osd/osd_fb.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 6b4d432..2467616 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -3061,6 +3061,15 @@ static ssize_t store_osd_plane_alpha( return count; } +static ssize_t show_osd_status(struct device *device, + struct device_attribute *attr, + char *buf) +{ + struct fb_info *fb_info = dev_get_drvdata(device); + + return snprintf(buf, PAGE_SIZE, "osd[%d] enable: %d\n", + fb_info->node, osd_hw.enable[fb_info->node]); +} static inline int str2lower(char *str) { @@ -3270,6 +3279,8 @@ static struct device_attribute osd_attrs[] = { show_osd_dimm, store_osd_dimm), __ATTR(osd_plane_alpha, 0644, show_osd_plane_alpha, store_osd_plane_alpha), + __ATTR(osd_status, 0444, + show_osd_status, NULL), }; @@ -3318,6 +3329,8 @@ static struct device_attribute osd_attrs_viu2[] = { show_osd_afbc_format, store_osd_afbc_format), __ATTR(osd_rotate, 0644, show_osd_rotate, store_osd_rotate), + __ATTR(osd_status, 0444, + show_osd_status, NULL), }; #ifdef CONFIG_PM -- 2.7.4