distribution/packages/hardware/quirks/devices/Anbernic RG552/040-hdmi

21 lines
639 B
Text
Raw Normal View History

2023-07-08 14:03:58 +00:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
2023-10-24 13:59:09 +00:00
# Copyright (C) 2022-present - The JELOS Project (https://github.com/JustEnoughLinuxOS)
2023-07-08 14:03:58 +00:00
. /storage/.config/profile.d/001-device_config
2023-07-08 14:03:58 +00:00
# Set export GPIO for HDMI
if [ ! -d "/sys/class/gpio/gpio${DEVICE_HDMI_GPIO}" ]; then
echo ${DEVICE_HDMI_GPIO} > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/direction
fi
# Check HDMI plug state and switch to HDMI audo if true
HDMI_VALUE=$(cat /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/value)
case ${HDMI_VALUE} in
"0")
sed -i 's/pcm "hw:0,0"/pcm "hw:1,0"'/ /storage/.config/asound.conf
;;
esac