summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Cho <y0.cho@samsung.com>2021-09-13 14:20:47 +0900
committerYoungjae Cho <y0.cho@samsung.com>2021-09-13 17:33:49 +0900
commit90f9cc716cf29eb5b872a488fa95fc8379b319eb (patch)
tree1e2b8f515b16df1deb8d7a9589a20fccf027d901
parent07336c3149f0f606a715a1de36592d422c2aeb80 (diff)
downloaddeviced-tizen_6.0_hotfix.tar.gz
deviced-tizen_6.0_hotfix.tar.bz2
deviced-tizen_6.0_hotfix.zip
Change-Id: I1801f86f15fc41774b73e410c6baecb155ab44f1 Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r--conf/iot-display.conf5
-rw-r--r--plugins/iot/display/core.c1
-rw-r--r--plugins/mobile/display/core.c1
-rw-r--r--plugins/tv/display/core.c1
-rw-r--r--plugins/wearable/display/core.c1
-rw-r--r--src/display/core.h1
-rw-r--r--src/display/display.c2
-rw-r--r--src/usbhost/usb-host.c20
8 files changed, 30 insertions, 2 deletions
diff --git a/conf/iot-display.conf b/conf/iot-display.conf
index 10769a8e..7e3886ee 100644
--- a/conf/iot-display.conf
+++ b/conf/iot-display.conf
@@ -34,6 +34,11 @@
# If this value is no, LCD is turned off just by external requests.
# TimeoutEnable=(yes or no)
+# Turn on display on changing usbhost state
+# Default: yes
+# DisplayOnUsbConnChanged=(yes or no)
+
LCDAlwaysOn=no
TimeoutEnable=yes
SleepSupport=no
+DisplayOnUsbConnChanged=yes
diff --git a/plugins/iot/display/core.c b/plugins/iot/display/core.c
index 66d51699..0ac87633 100644
--- a/plugins/iot/display/core.c
+++ b/plugins/iot/display/core.c
@@ -202,6 +202,7 @@ static struct display_config display_conf = {
.aod_tsp = true,
.touch_wakeup = false,
.sleep_support = true,
+ .display_on_usb_conn_changed = true,
};
struct display_function_info display_info = {
diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c
index 9ccf78ba..fa6e221a 100644
--- a/plugins/mobile/display/core.c
+++ b/plugins/mobile/display/core.c
@@ -205,6 +205,7 @@ static struct display_config display_conf = {
.aod_tsp = true,
.touch_wakeup = false,
.sleep_support = true,
+ .display_on_usb_conn_changed = true,
};
struct display_function_info display_info = {
diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c
index 6f3667a2..97718bbb 100644
--- a/plugins/tv/display/core.c
+++ b/plugins/tv/display/core.c
@@ -203,6 +203,7 @@ static struct display_config display_conf = {
.aod_tsp = true,
.touch_wakeup = false,
.sleep_support = true,
+ .display_on_usb_conn_changed = true,
};
struct display_function_info display_info = {
diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c
index 8fc8ab3a..c2699fbf 100644
--- a/plugins/wearable/display/core.c
+++ b/plugins/wearable/display/core.c
@@ -225,6 +225,7 @@ static struct display_config display_conf = {
.aod_tsp = true,
.touch_wakeup = false,
.sleep_support = true,
+ .display_on_usb_conn_changed = true,
};
struct display_function_info display_info = {
diff --git a/src/display/core.h b/src/display/core.h
index 00c3e273..12883ccd 100644
--- a/src/display/core.h
+++ b/src/display/core.h
@@ -139,6 +139,7 @@ struct display_config {
bool input_support;
bool touch_wakeup;
bool sleep_support;
+ bool display_on_usb_conn_changed;
};
/*
diff --git a/src/display/display.c b/src/display/display.c
index 7ee25233..73e5d960 100644
--- a/src/display/display.c
+++ b/src/display/display.c
@@ -155,6 +155,8 @@ int display_load_config(struct parse_result *result, void *user_data)
} else if (MATCH(result->name, "SleepSupport")) {
c->sleep_support = (MATCH(result->value, "yes") ? true : false);
_D("SleepSupport is %d", c->sleep_support);
+ } else if (MATCH(result->name, "DisplayOnUsbConnChanged")) {
+ c->display_on_usb_conn_changed = (MATCH(result->value, "yes") ? true : false);
}
return 0;
diff --git a/src/usbhost/usb-host.c b/src/usbhost/usb-host.c
index 83dacf3a..1d275d59 100644
--- a/src/usbhost/usb-host.c
+++ b/src/usbhost/usb-host.c
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <tzplatform_config.h>
#include <libsyscommon/dbus-system.h>
+#include <dlfcn.h>
#include "core/log.h"
#include "core/devices.h"
@@ -33,6 +34,7 @@
#include "apps/apps.h"
#include "extcon/extcon.h"
#include "display/display-ops.h"
+#include "display/core.h"
#include "dd-usbhost.h"
#include "shared/plugin.h"
@@ -54,6 +56,9 @@
#define POLICY_FILENAME "usbhost-policy"
static struct display_plugin *disp_plgn;
+static struct display_config *disp_conf;
+static struct display_config* (*fp_get_var_display_config)(void);
+static bool display_on_usb_conn_changed = true;
static char *POLICY_FILEPATH;
/**
@@ -241,7 +246,7 @@ static int add_usbhost_list(struct udev_device *dev, const char *devpath)
broadcast_usbhost_signal(USB_HOST_ADDED, usbhost);
- if (disp_plgn->pm_change_internal)
+ if (display_on_usb_conn_changed && disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_USB_HOST, LCD_NORMAL);
/* for debugging */
@@ -270,7 +275,7 @@ static int remove_usbhost_list(const char *devpath)
broadcast_usbhost_signal(USB_HOST_REMOVED, usbhost);
- if (disp_plgn->pm_change_internal)
+ if (display_on_usb_conn_changed && disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_USB_HOST, LCD_NORMAL);
/* for debugging */
@@ -1132,6 +1137,17 @@ static void usbhost_init(void *data)
{
int ret;
+ fp_get_var_display_config = dlsym(disp_plgn->handle, "get_var_display_config");
+ if (fp_get_var_display_config) {
+ disp_conf = fp_get_var_display_config();
+ if (!disp_conf)
+ _E("Failed to get display config variable.");
+ else
+ display_on_usb_conn_changed = disp_conf->display_on_usb_conn_changed;
+ } else {
+ _E("Failed to obtain address of get_var_display_config, %s.", dlerror());
+ }
+
/* register usbhost uevent */
ret = register_kernel_uevent_control(&uh);
if (ret < 0)