device-display: Add device brightness node creation condition log 73/320673/4 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20250306.094546 accepted/tizen/unified/x/20250306.134920
authorYunhee Seo <yuni.seo@samsung.com>
Wed, 5 Mar 2025 11:27:43 +0000 (20:27 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 5 Mar 2025 11:54:40 +0000 (20:54 +0900)
In this hal-backend-device-rpi, using brightness node is created from
MIPI Interface Display.
Other than, brightness node won't be created.
To figure out brightness node creation, this log is necessary.

Change-Id: I78ef4fedaef85cce32b4789f52ab7e07c6d097e3
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
hw/display/display.c

index e4c9fe00deb612cb7287187e674c307d41c2d692..346f63ff161b92f91d2f2c421f592e3f299e408e 100644 (file)
@@ -22,6 +22,8 @@
 #include <string.h>
 #include <errno.h>
 #include <linux/limits.h>
+#include <unistd.h>
+#include <dirent.h>
 
 #include <hal/hal-device-display-interface.h>
 #include <hal/hal-common-interface.h>
@@ -44,6 +46,9 @@ static int display_get_max_brightness(int *val)
        if (!val)
                return -EINVAL;
 
+       if (access(BACKLIGHT_PATH"/max_brightness", F_OK) != 0)
+               _W("%s node is created from MIPI Interface Display", BACKLIGHT_PATH"/max_brightness");
+
        if (max < 0) {
                r = sysfs_read_int(BACKLIGHT_PATH"/max_brightness", &max);
                if (r < 0)
@@ -63,6 +68,9 @@ static int display_get_brightness(int *brightness)
                return -EINVAL;
        }
 
+       if (access(BACKLIGHT_PATH"/brightness", F_OK) != 0)
+               _W("%s node is created from MIPI Interface Display", BACKLIGHT_PATH"/brightness");
+
        r = sysfs_read_int(BACKLIGHT_PATH"/brightness", &v);
        if (r < 0) {
                _E("fail to get brightness (errno:%d)", r);
@@ -88,6 +96,9 @@ static int display_set_brightness(int brightness)
                return -EINVAL;
        }
 
+       if (access(BACKLIGHT_PATH"/brightness", F_OK) != 0)
+               _W("%s node is created from MIPI Interface Display", BACKLIGHT_PATH"/brightness");
+
        r = sysfs_write_int(BACKLIGHT_PATH"/brightness", brightness);
        if (r < 0) {
                _E("fail to set brightness (errno:%d)", r);