Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 1 | #!/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 met: |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer in the |
| 10 | # documentation and/or other materials provided with the distribution. |
| 11 | # * Neither the name of The Linux Foundation nor |
| 12 | # the names of its contributors may be used to endorse or promote |
| 13 | # products derived from this software without specific prior written |
| 14 | # permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | # |
| 28 | |
| 29 | export PATH=/system/bin |
| 30 | |
| 31 | # Set platform variables |
| 32 | if [ -f /sys/devices/soc0/hw_platform ]; then |
| 33 | soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null |
| 34 | else |
| 35 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null |
| 36 | fi |
| 37 | if [ -f /sys/devices/soc0/soc_id ]; then |
| 38 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null |
| 39 | else |
| 40 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null |
| 41 | fi |
| 42 | if [ -f /sys/devices/soc0/platform_version ]; then |
| 43 | soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null |
| 44 | else |
| 45 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null |
| 46 | fi |
| 47 | |
| 48 | log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'" |
| 49 | |
Zvikomborero VIncent Zvikaramba | 864e885 | 2016-07-22 18:29:01 -0400 | [diff] [blame^] | 50 | #load modules |
| 51 | insmod /system/lib/modules/radio-iris-transport.ko |
| 52 | insmod /system/lib/modules/pronto/pronto_wlan.ko |
| 53 | modprobe wlan |
| 54 | modprobe radio-iris-transport |
| 55 | |
Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 56 | case "$1" in |
| 57 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") |
| 58 | case "$soc_hwplatform" in |
| 59 | "FFA" | "SVLTE_FFA") |
| 60 | # linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that |
| 61 | # the UI keyboard works fine. |
| 62 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin |
| 63 | ;; |
| 64 | "Fluid") |
| 65 | setprop ro.sf.lcd_density 240 |
| 66 | setprop qcom.bt.dev_power_class 2 |
| 67 | ;; |
| 68 | *) |
| 69 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin |
| 70 | ;; |
| 71 | esac |
| 72 | ;; |
| 73 | |
| 74 | "msm8660") |
| 75 | case "$soc_hwplatform" in |
| 76 | "Fluid") |
| 77 | setprop ro.sf.lcd_density 240 |
| 78 | ;; |
| 79 | "Dragon") |
| 80 | setprop ro.sound.alsa "WM8903" |
| 81 | ;; |
| 82 | esac |
| 83 | ;; |
| 84 | |
| 85 | "msm8960") |
| 86 | # lcd density is write-once. Hence the separate switch case |
| 87 | case "$soc_hwplatform" in |
| 88 | "Liquid") |
| 89 | if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku |
| 90 | setprop ro.sf.hwrotation 90 |
| 91 | fi |
| 92 | |
| 93 | setprop ro.sf.lcd_density 160 |
| 94 | ;; |
| 95 | "MTP") |
| 96 | setprop ro.sf.lcd_density 240 |
| 97 | ;; |
| 98 | *) |
| 99 | case "$soc_hwid" in |
| 100 | "109") |
| 101 | setprop ro.sf.lcd_density 160 |
| 102 | ;; |
| 103 | *) |
| 104 | setprop ro.sf.lcd_density 240 |
| 105 | ;; |
| 106 | esac |
| 107 | ;; |
| 108 | esac |
| 109 | |
| 110 | #Set up composition type based on the target |
| 111 | case "$soc_hwid" in |
| 112 | 87) |
| 113 | #8960 |
| 114 | setprop debug.composition.type dyn |
| 115 | ;; |
| 116 | 153|154|155|156|157|138) |
| 117 | #8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB |
| 118 | setprop debug.composition.type c2d |
| 119 | ;; |
| 120 | *) |
| 121 | esac |
| 122 | ;; |
| 123 | |
| 124 | "msm8974") |
| 125 | case "$soc_hwplatform" in |
| 126 | "Liquid") |
| 127 | setprop ro.sf.lcd_density 160 |
| 128 | # Liquid do not have hardware navigation keys, so enable |
| 129 | # Android sw navigation bar |
| 130 | setprop ro.hw.nav_keys 0 |
| 131 | ;; |
| 132 | "Dragon") |
| 133 | setprop ro.sf.lcd_density 240 |
| 134 | ;; |
| 135 | *) |
| 136 | setprop ro.sf.lcd_density 320 |
| 137 | ;; |
| 138 | esac |
| 139 | ;; |
| 140 | |
| 141 | "msm8226") |
| 142 | case "$soc_hwplatform" in |
| 143 | *) |
| 144 | setprop ro.sf.lcd_density 320 |
| 145 | ;; |
| 146 | esac |
| 147 | ;; |
| 148 | |
| 149 | "msm8610" | "apq8084" | "mpq8092") |
| 150 | case "$soc_hwplatform" in |
| 151 | *) |
| 152 | setprop ro.sf.lcd_density 240 |
| 153 | ;; |
| 154 | esac |
| 155 | ;; |
| 156 | "apq8084") |
| 157 | case "$soc_hwplatform" in |
| 158 | "Liquid") |
| 159 | setprop ro.sf.lcd_density 320 |
| 160 | # Liquid do not have hardware navigation keys, so enable |
| 161 | # Android sw navigation bar |
| 162 | setprop ro.hw.nav_keys 0 |
| 163 | ;; |
| 164 | "SBC") |
| 165 | setprop ro.sf.lcd_density 200 |
| 166 | # SBC do not have hardware navigation keys, so enable |
| 167 | # Android sw navigation bar |
| 168 | setprop qemu.hw.mainkeys 0 |
| 169 | ;; |
| 170 | *) |
| 171 | setprop ro.sf.lcd_density 480 |
| 172 | ;; |
| 173 | esac |
| 174 | ;; |
| 175 | esac |
| 176 | |
| 177 | # Setup HDMI related nodes & permissions |
| 178 | # HDMI can be fb1 or fb2 |
| 179 | # Loop through the sysfs nodes and determine |
| 180 | # the HDMI(dtv panel) |
| 181 | for fb_cnt in 0 1 2 |
| 182 | do |
| 183 | file=/sys/class/graphics/fb$fb_cnt |
| 184 | dev_file=/dev/graphics/fb$fb_cnt |
| 185 | if [ -d "$file" ] |
| 186 | then |
| 187 | value=`cat $file/msm_fb_type` |
| 188 | case "$value" in |
| 189 | "dtv panel") |
| 190 | chown -h system.graphics $file/hpd |
| 191 | chown -h system.system $file/hdcp/tp |
| 192 | chown -h system.graphics $file/vendor_name |
| 193 | chown -h system.graphics $file/product_description |
| 194 | chmod -h 0664 $file/hpd |
| 195 | chmod -h 0664 $file/hdcp/tp |
| 196 | chmod -h 0664 $file/vendor_name |
| 197 | chmod -h 0664 $file/product_description |
| 198 | chmod -h 0664 $file/video_mode |
| 199 | chmod -h 0664 $file/format_3d |
| 200 | # create symbolic link |
| 201 | ln -s $dev_file /dev/graphics/hdmi |
| 202 | # Change owner and group for media server and surface flinger |
| 203 | chown -h system.system $file/format_3d;; |
| 204 | esac |
| 205 | fi |
| 206 | done |