-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nick Xie <[email protected]>
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
archives/filesystem/special/Edge2/etc/udev/rules.d/61-dp.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SUBSYSTEM=="typec", ACTION=="remove", DEVPATH=="/devices/platform/feaa0000.i2c/i2c-2/2-0022/typec/port0/port0-partner", RUN+="/usr/local/bin/dp-hotplug.sh remove" | ||
SUBSYSTEM=="typec", ACTION=="add", DEVPATH=="/devices/platform/feaa0000.i2c/i2c-2/2-0022/typec/port0/port0-partner", RUN+="/usr/local/bin/dp-hotplug.sh add" |
23 changes: 23 additions & 0 deletions
23
archives/filesystem/special/Edge2/usr/local/bin/dp-hotplug.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" == "remove" ]; then | ||
if [ -f /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status ]; then | ||
STATUS=$(cat /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status) | ||
if [ "$STATUS" == "connected" ]; then | ||
echo off > /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status | ||
fi | ||
fi | ||
elif [ "$1" == "add" ]; then | ||
if [ -f /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status ]; then | ||
STATUS=$(cat /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status) | ||
if [ "$STATUS" == "disconnected" ]; then | ||
echo on > /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status | ||
sleep 0.5 | ||
echo off > /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status | ||
sleep 1 | ||
echo on > /sys/devices/platform/display-subsystem/drm/card0/card0-DP-1/status | ||
fi | ||
fi | ||
fi | ||
|
||
exit |