Steve Kondik | 0e9f019 | 2012-09-24 02:12:49 -0700 | [diff] [blame] | 1 | #!/system/bin/sh |
Steve Kondik | 6f60e9e | 2013-04-27 18:02:57 -0700 | [diff] [blame] | 2 | # Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Steve Kondik | 0e9f019 | 2012-09-24 02:12:49 -0700 | [diff] [blame] | 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. |
Steve Kondik | 6f60e9e | 2013-04-27 18:02:57 -0700 | [diff] [blame] | 11 | # * Neither the name of The Linux Foundation nor |
Steve Kondik | 0e9f019 | 2012-09-24 02:12:49 -0700 | [diff] [blame] | 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 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null |
| 33 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null |
| 34 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null |
| 35 | |
| 36 | log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'" |
| 37 | |
| 38 | case "$1" in |
| 39 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") |
| 40 | case "$soc_hwplatform" in |
| 41 | "FFA" | "SVLTE_FFA") |
| 42 | # linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that |
| 43 | # the UI keyboard works fine. |
| 44 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin |
| 45 | ;; |
| 46 | "Fluid") |
| 47 | setprop ro.sf.lcd_density 240 |
| 48 | setprop qcom.bt.dev_power_class 2 |
| 49 | ;; |
| 50 | *) |
| 51 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin |
| 52 | ;; |
| 53 | esac |
| 54 | ;; |
| 55 | |
| 56 | "msm8660") |
| 57 | case "$soc_hwplatform" in |
| 58 | "Fluid") |
| 59 | setprop ro.sf.lcd_density 240 |
| 60 | ;; |
| 61 | "Dragon") |
| 62 | setprop ro.sound.alsa "WM8903" |
| 63 | ;; |
| 64 | esac |
| 65 | ;; |
| 66 | |
| 67 | "msm8960") |
| 68 | # lcd density is write-once. Hence the separate switch case |
| 69 | case "$soc_hwplatform" in |
| 70 | "Liquid") |
| 71 | if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku |
| 72 | setprop ro.sf.hwrotation 90 |
| 73 | fi |
| 74 | |
| 75 | setprop ro.sf.lcd_density 160 |
| 76 | ;; |
| 77 | "MTP") |
| 78 | setprop ro.sf.lcd_density 240 |
| 79 | ;; |
| 80 | *) |
| 81 | case "$soc_hwid" in |
| 82 | "109") |
| 83 | setprop ro.sf.lcd_density 160 |
| 84 | ;; |
| 85 | *) |
| 86 | setprop ro.sf.lcd_density 240 |
| 87 | ;; |
| 88 | esac |
| 89 | ;; |
| 90 | esac |
| 91 | |
Steve Kondik | 6f60e9e | 2013-04-27 18:02:57 -0700 | [diff] [blame] | 92 | #Set up MSM-specific configuration |
Steve Kondik | 775d626 | 2013-05-01 00:32:11 -0700 | [diff] [blame] | 93 | #case "$soc_hwid" in |
| 94 | # 87) |
| 95 | # #8960 |
| 96 | # setprop debug.composition.type dyn |
| 97 | # ;; |
| 98 | # 153 | 154 | 155 | 156 | 157 | 138 | 179 | 180 | 181) |
| 99 | # #8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB | 8130/AA/AB |
| 100 | # setprop debug.composition.type c2d |
| 101 | # ;; |
| 102 | # *) |
| 103 | # ;; |
| 104 | #esac |
Steve Kondik | 6f60e9e | 2013-04-27 18:02:57 -0700 | [diff] [blame] | 105 | |
| 106 | case "$soc_hwid" in |
| 107 | 87 | 116 | 117 | 118 | 119 | 138 | 142 | 143 | 144 | 154 | 155 | 156 | 157 | 179 | 180 | 181) |
| 108 | #Disable subsystem restart for 8x30 and 8960 |
| 109 | setprop persist.sys.ssr.restart_level 1 |
| 110 | ;; |
| 111 | *) |
| 112 | ;; |
Steve Kondik | 0e9f019 | 2012-09-24 02:12:49 -0700 | [diff] [blame] | 113 | esac |
| 114 | ;; |
| 115 | esac |
Steve Kondik | 6f60e9e | 2013-04-27 18:02:57 -0700 | [diff] [blame] | 116 | |
| 117 | # Setup HDMI related nodes & permissions |
| 118 | # HDMI can be fb1 or fb2 |
| 119 | # Loop through the sysfs nodes and determine |
| 120 | # the HDMI(dtv panel) |
| 121 | for file in /sys/class/graphics/fb* |
| 122 | do |
| 123 | value=`cat $file/msm_fb_type` |
| 124 | case "$value" in |
| 125 | "dtv panel") |
| 126 | chown system.graphics $file/hpd |
| 127 | chown system.graphics $file/vendor_name |
| 128 | chown system.graphics $file/product_description |
| 129 | chmod 0664 $file/hpd |
| 130 | chmod 0664 $file/vendor_name |
| 131 | chmod 0664 $file/product_description |
| 132 | chmod 0664 $file/video_mode |
| 133 | chmod 0664 $file/format_3d |
| 134 | # create symbolic link |
| 135 | ln -s $file /dev/graphics/hdmi |
| 136 | # Change owner and group for media server and surface flinger |
| 137 | chown system.system $file/format_3d;; |
| 138 | esac |
| 139 | done |