clevo/nv4x-audio-fixup: add script

Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
This commit is contained in:
Michał Kopeć
2022-11-14 16:53:11 +01:00
parent 48391a9e68
commit e1ecf25693
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# A script to patch HD audio config to enable headset jack functionality on
# kernel versions < v6.0 (before commit be561ffad708f0cee18aee4231f80ffafaf7a419
# Location of the snd-hda-intel patch file
PATCH="/lib/firmware/hda-init.fw"
# Location of the module config file
MODCONFIG="/etc/modprobe.d/audio-jack.conf"
if [ "$EUID" -ne 0 ]
then echo "This script needs to be executed as root."
exit
fi
echo "
[codec]
0x10ec0256 0x15584041 0
[model]
headset-mode-no-hp-mic
[pincfg]
0x19 0x03a1112
" > $PATCH
echo "
options snd_hda_intel patch=$(echo $PATCH | awk -F'/' '{print $(NF)}')
" > $MODCONFIG
echo "Done. Reboot to apply changes."