blob: cbfe9ff26840f9c760da853ae2d85e189556e44c [file] [log] [blame]
Zvikomborero VIncent Zvikarambaafbd7b52016-08-08 12:38:07 -04001#!/system/bin/sh
2# Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7# * Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# * Redistributions in binary form must reproduce the above
10# copyright notice, this list of conditions and the following
11# disclaimer in the documentation and/or other materials provided
12# with the distribution.
13# * Neither the name of The Linux Foundation nor the names of its
14# contributors may be used to endorse or promote products derived
15# from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29# This script will check the type of the bluetooth device and set the
30# symbolic links to UCM files accordingly
31
32target="$1"
33btsoc="$2"
34if [ -f /sys/devices/soc0/soc_id ]; then
35 soc_hwid=`cat /sys/devices/soc0/soc_id`
36else
37 soc_hwid=`cat /sys/devices/system/soc/soc0/id`
38fi
39
40# No path is set up at this point so we have to do it here.
41PATH=/sbin:/system/sbin:/system/bin:/system/xbin
42export PATH
43
44case "$target" in
45 msm8960*)
46 echo "The TARGET ID is $target"
47 case $soc_hwid in
48 "130")
49 echo "The BTSOC ID is $btsoc"
50 echo "Setting soft links for auxpcm files"
51 rm /etc/snd_soc_msm/snd_soc_msm 2>/dev/null
52 rm /etc/snd_soc_msm/snd_soc_msm_2x 2>/dev/null
53 rm /etc/snd_soc_msm/snd_soc_msm_2x_mpq 2>/dev/null
54 rm /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3 2>/dev/null
55 rm /etc/snd_soc_msm/snd_soc_msm_Sitar 2>/dev/null
56 ln -s /etc/snd_soc_msm/snd_soc_msm_auxpcm /etc/snd_soc_msm/snd_soc_msm 2>/dev/null
57 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x 2>/dev/null
58 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_mpq_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x_mpq 2>/dev/null
59 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3 2>/dev/null
60 ln -s /etc/snd_soc_msm/snd_soc_msm_Sitar_auxpcm /etc/snd_soc_msm/snd_soc_msm_Sitar 2>/dev/null
61 setprop qcom.audio.init complete
62 exit 0
63 ;;
64 *)
65 ;;
66 esac
67 ;;
68*)
69 ;;
70esac
71
72echo "The BTSOC ID is $btsoc"
73case "$btsoc" in
74 "ath3k")
75 case "$target" in
76 msm8974*)
77 echo "Setting soft links for auxpcm files"
78 rm /etc/snd_soc_msm/snd_soc_msm_Taiko_liquid 2>/dev/null
79 ln -s /etc/snd_soc_msm/snd_soc_msm_Taiko_liquid_auxpcm /etc/snd_soc_msm/snd_soc_msm_Taiko_liquid 2>/dev/null
80 ;;
81 msm8960*)
82 echo "Setting soft links for auxpcm files"
83 rm /etc/snd_soc_msm/snd_soc_msm 2>/dev/null
84 rm /etc/snd_soc_msm/snd_soc_msm_2x 2>/dev/null
85 rm /etc/snd_soc_msm/snd_soc_msm_2x_mpq 2>/dev/null
86 rm /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3 2>/dev/null
87 rm /etc/snd_soc_msm/snd_soc_msm_Sitar 2>/dev/null
88 ln -s /etc/snd_soc_msm/snd_soc_msm_auxpcm /etc/snd_soc_msm/snd_soc_msm 2>/dev/null
89 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x 2>/dev/null
90 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_mpq_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x_mpq 2>/dev/null
91 ln -s /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3_auxpcm /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3 2>/dev/null
92 ln -s /etc/snd_soc_msm/snd_soc_msm_Sitar_auxpcm /etc/snd_soc_msm/snd_soc_msm_Sitar 2>/dev/null
93 ;;
94 *)
95 ;;
96 esac
97 ;;
98 *)
99 case "$target" in
100 msm8974*)
101 echo "Not setting soft links, remove Auxpcm UCM files"
102 rm /etc/snd_soc_msm/snd_soc_msm_Taiko_liquid_auxpcm 2>/dev/null
103 ;;
104 msm8960*)
105 echo "Not setting soft links, remove Auxpcm UCM files"
106 rm /etc/snd_soc_msm/snd_soc_msm_auxpcm 2>/dev/null
107 rm /etc/snd_soc_msm/snd_soc_msm_2x_auxpcm 2>/dev/null
108 rm /etc/snd_soc_msm/snd_soc_msm_2x_mpq_auxpcm 2>/dev/null
109 rm /etc/snd_soc_msm/snd_soc_msm_2x_Fusion3_auxpcm 2>/dev/null
110 rm /etc/snd_soc_msm/snd_soc_msm_Sitar_auxpcm 2>/dev/null
111 ;;
112 *)
113 ;;
114 esac
115 ;;
116esac
117
118setprop qcom.audio.init complete
119exit 0
120