Skip to content

Commit

Permalink
Edge2: fix dp screen hotplug issue
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Xie <[email protected]>
  • Loading branch information
numbqq committed Nov 26, 2024
1 parent 8f53388 commit 6b48800
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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 archives/filesystem/special/Edge2/usr/local/bin/dp-hotplug.sh
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

0 comments on commit 6b48800

Please sign in to comment.