[Gta04-owner] [PATCH v2 4/7] rootdir: fix mixer settings file selection
Andreas Kemnade
andreas at kemnade.info
Sun Apr 23 13:25:34 CEST 2017
formerly the presence of gpio 186 was used to detect whether hw or
sw routing setting was needed.
Now use model name from devicetree instead.
amixer | grep some_control fails because
amixer is not available
Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
---
rootdir/voice-routing-init.sh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/rootdir/voice-routing-init.sh b/rootdir/voice-routing-init.sh
index 24219d1..4da7cb1 100755
--- a/rootdir/voice-routing-init.sh
+++ b/rootdir/voice-routing-init.sh
@@ -1,17 +1,19 @@
#!/system/bin/sh
-MODEM_GPIO="/sys/class/gpio/gpio186/value" #available on GTA04a4++
-if [ ! -e $MODEM_GPIO ]
-then
+case "$(cat /proc/device-tree/model)" in
+ *GTA04A[1-3]* )
# Software Voice Routing
echo "LOADING tinyalsa-audio_swrouting.xml"
rm /system/etc/tinyalsa-audio.xml
cp /system/etc/tinyalsa-audio_swrouting.xml /system/etc/tinyalsa-audio.xml
-else
+ ;;
+*GTA04A[4-9]* )
# Hardware Voice Routing
echo "LOADING tinyalsa-audio_hwrouting.xml"
rm /system/etc/tinyalsa-audio.xml
cp /system/etc/tinyalsa-audio_hwrouting.xml /system/etc/tinyalsa-audio.xml
-fi
+ ;;
+esac
+
chown 502.50 /system/etc/tinyalsa-audio.xml
chmod 644 /system/etc/tinyalsa-audio.xml
--
2.1.4
More information about the Gta04-owner
mailing list