summaryrefslogtreecommitdiff
path: root/sync.sh
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2020-05-09 12:29:22 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2020-05-09 12:29:22 -0700
commitc8df7ada33d19859f3f4edf9df4cbdd7ff2ee891 (patch)
tree27e16f24442926b1db130e2805dc0e85d3a30a34 /sync.sh
parentInitial commit (diff)
downloadpinebookpro-audio-master.tar.xz
Synced to upstreamHEADmaster
Diffstat (limited to 'sync.sh')
-rw-r--r--sync.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/sync.sh b/sync.sh
new file mode 100644
index 0000000..9a46879
--- /dev/null
+++ b/sync.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env sh
+
+set -e
+
+# Could get this from dt, fixed for now
+GPIO=8
+
+# Headphone detect gpios are exported by default
+value="$(cat /sys/class/gpio/gpio${GPIO}/value)"
+
+if [ "$value" -gt 0 ]; then
+ action=plug
+else
+ action=unplug
+fi
+
+/etc/acpi/audio_jack_plugged_in.sh jack/headphone HEADPHONE $action