aboutsummaryrefslogtreecommitdiff
path: root/system/displaylink/displaylink-sleep.sh
diff options
context:
space:
mode:
authorAndre Barboza <bmg.andre@gmail.com>2017-09-15 19:35:51 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-09-15 19:37:57 +0700
commit5a41962c792ee521928d3be2e0b985f8e1a42125 (patch)
tree1d58c748d3da74f512df99392910231f46aeef04 /system/displaylink/displaylink-sleep.sh
parentb819c52d4da97ec188e923e87701bd904f7b930a (diff)
system/displaylink: Added (driver for DisplayLink devices).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/displaylink/displaylink-sleep.sh')
-rw-r--r--system/displaylink/displaylink-sleep.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/system/displaylink/displaylink-sleep.sh b/system/displaylink/displaylink-sleep.sh
new file mode 100644
index 0000000000000..b41e0dd1b7cf0
--- /dev/null
+++ b/system/displaylink/displaylink-sleep.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Copyright (c) 2015 - 2016 DisplayLink (UK) Ltd.
+
+suspend_dlm()
+{
+ #flush any bytes in pipe
+ while read -n 1 -t 1 SUSPEND_RESULT < /tmp/PmMessagesPort_out; do : ; done;
+
+ #suspend DisplayLinkManager
+ echo "S" > /tmp/PmMessagesPort_in
+
+ if [ -f /tmp/PmMessagesPort_out ]; then
+ #wait until suspend of DisplayLinkManager finish
+ read -n 1 -t 10 SUSPEND_RESULT < /tmp/PmMessagesPort_out
+ fi
+}
+
+resume_dlm()
+{
+ #resume DisplayLinkManager
+ echo "R" > /tmp/PmMessagesPort_in
+}