Files
bananarchy/overlay/rootfs/usr/bin/bananarchy-cover-dpms.sh
T

25 lines
704 B
Bash
Raw Normal View History

#!/bin/sh
# Replay the kernel panel-mipi-dbi-spi init sequence onto whichever GC9305 is
# currently behind the gpio13 bus switch. A DPMS off/on cycle makes
# mipi_dbi_enable() rerun the firmware command stack with CS0 and gpio110 D/C;
# with the mux on the cover that initialises the 240x240 external panel.
set -u
export DISPLAY="${DISPLAY:-:0}"
case "${1:-}" in
reinit)
xset dpms force off >/dev/null 2>&1 || true
sleep 0.08
xset dpms force on >/dev/null 2>&1 || true
;;
on)
xset dpms force on >/dev/null 2>&1 || true
;;
off)
xset dpms force off >/dev/null 2>&1 || true
;;
*)
printf 'Usage: %s [reinit|on|off]\n' "${0##*/}" >&2
exit 1
;;
esac
exit 0