Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 1 | #!/system/bin/sh |
| 2 | # Copyright (c) 2009-2014, 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 | target=`getprop ro.board.platform` |
| 30 | if [ -f /sys/devices/soc0/soc_id ]; then |
| 31 | platformid=`cat /sys/devices/soc0/soc_id` |
| 32 | else |
| 33 | platformid=`cat /sys/devices/system/soc/soc0/id` |
| 34 | fi |
Zvikomborero VIncent Zvikaramba | 864e885 | 2016-07-22 18:29:01 -0400 | [diff] [blame] | 35 | |
| 36 | #load modules |
| 37 | insmod /system/lib/modules/radio-iris-transport.ko |
| 38 | insmod /system/lib/modules/pronto/pronto_wlan.ko |
| 39 | modprobe wlan |
| 40 | modprobe radio-iris-transport |
| 41 | |
Zvikomborero VIncent Zvikaramba | a25011a | 2016-07-21 16:32:35 -0400 | [diff] [blame] | 42 | # |
| 43 | # Function to start sensors for DSPS enabled platforms |
| 44 | # |
| 45 | start_sensors() |
| 46 | { |
| 47 | if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then |
| 48 | chmod -h 775 /persist/sensors |
| 49 | chmod -h 664 /persist/sensors/sensors_settings |
| 50 | chown -h system.root /persist/sensors/sensors_settings |
| 51 | |
| 52 | mkdir -p /data/misc/sensors |
| 53 | chmod -h 775 /data/misc/sensors |
| 54 | |
| 55 | start sensors |
| 56 | fi |
| 57 | } |
| 58 | |
| 59 | start_battery_monitor() |
| 60 | { |
| 61 | if ls /sys/bus/spmi/devices/qpnp-bms-*/fcc_data ; then |
| 62 | chown -h root.system /sys/module/pm8921_bms/parameters/* |
| 63 | chown -h root.system /sys/module/qpnp_bms/parameters/* |
| 64 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_data |
| 65 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_temp |
| 66 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_chgcyl |
| 67 | chmod 0660 /sys/module/qpnp_bms/parameters/* |
| 68 | chmod 0660 /sys/module/pm8921_bms/parameters/* |
| 69 | mkdir -p /data/bms |
| 70 | chown -h root.system /data/bms |
| 71 | chmod 0770 /data/bms |
| 72 | start battery_monitor |
| 73 | fi |
| 74 | } |
| 75 | |
| 76 | start_charger_monitor() |
| 77 | { |
| 78 | if ls /sys/module/qpnp_charger/parameters/charger_monitor; then |
| 79 | chown -h root.system /sys/module/qpnp_charger/parameters/* |
| 80 | chown -h root.system /sys/class/power_supply/battery/input_current_max |
| 81 | chown -h root.system /sys/class/power_supply/battery/input_current_trim |
| 82 | chown -h root.system /sys/class/power_supply/battery/input_current_settled |
| 83 | chown -h root.system /sys/class/power_supply/battery/voltage_min |
| 84 | chmod 0664 /sys/class/power_supply/battery/input_current_max |
| 85 | chmod 0664 /sys/class/power_supply/battery/input_current_trim |
| 86 | chmod 0664 /sys/class/power_supply/battery/input_current_settled |
| 87 | chmod 0664 /sys/class/power_supply/battery/voltage_min |
| 88 | chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor |
| 89 | start charger_monitor |
| 90 | fi |
| 91 | } |
| 92 | |
| 93 | start_msm_irqbalance_8939() |
| 94 | { |
| 95 | if [ -f /system/bin/msm_irqbalance ]; then |
| 96 | case "$platformid" in |
| 97 | "239" | "241" | "263" | "268" | "269" | "270" | "271") |
| 98 | start msm_irqbalance;; |
| 99 | esac |
| 100 | fi |
| 101 | } |
| 102 | |
| 103 | start_msm_irqbalance() |
| 104 | { |
| 105 | if [ -f /system/bin/msm_irqbalance ]; then |
| 106 | start msm_irqbalance |
| 107 | fi |
| 108 | } |
| 109 | |
| 110 | baseband=`getprop ro.baseband` |
| 111 | # |
| 112 | # Suppress default route installation during RA for IPV6; user space will take |
| 113 | # care of this |
| 114 | # exception default ifc |
| 115 | for file in /proc/sys/net/ipv6/conf/* |
| 116 | do |
| 117 | echo 0 > $file/accept_ra_defrtr |
| 118 | done |
| 119 | echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra_defrtr |
| 120 | |
| 121 | case "$baseband" in |
| 122 | "svlte2a") |
| 123 | start bridgemgrd |
| 124 | ;; |
| 125 | esac |
| 126 | |
| 127 | start_sensors |
| 128 | |
| 129 | case "$target" in |
| 130 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") |
| 131 | if [ -f /sys/devices/soc0/hw_platform ]; then |
| 132 | value=`cat /sys/devices/soc0/hw_platform` |
| 133 | else |
| 134 | value=`cat /sys/devices/system/soc/soc0/hw_platform` |
| 135 | fi |
| 136 | case "$value" in |
| 137 | "Fluid") |
| 138 | start profiler_daemon;; |
| 139 | esac |
| 140 | ;; |
| 141 | "msm8660" ) |
| 142 | if [ -f /sys/devices/soc0/hw_platform ]; then |
| 143 | platformvalue=`cat /sys/devices/soc0/hw_platform` |
| 144 | else |
| 145 | platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` |
| 146 | fi |
| 147 | case "$platformvalue" in |
| 148 | "Fluid") |
| 149 | start profiler_daemon;; |
| 150 | esac |
| 151 | ;; |
| 152 | "msm8960") |
| 153 | case "$baseband" in |
| 154 | "msm") |
| 155 | start_battery_monitor;; |
| 156 | esac |
| 157 | |
| 158 | if [ -f /sys/devices/soc0/hw_platform ]; then |
| 159 | platformvalue=`cat /sys/devices/soc0/hw_platform` |
| 160 | else |
| 161 | platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` |
| 162 | fi |
| 163 | case "$platformvalue" in |
| 164 | "Fluid") |
| 165 | start profiler_daemon;; |
| 166 | "Liquid") |
| 167 | start profiler_daemon;; |
| 168 | esac |
| 169 | ;; |
| 170 | "msm8974") |
| 171 | platformvalue=`cat /sys/devices/soc0/hw_platform` |
| 172 | case "$platformvalue" in |
| 173 | "Fluid") |
| 174 | start profiler_daemon;; |
| 175 | "Liquid") |
| 176 | start profiler_daemon;; |
| 177 | esac |
| 178 | case "$baseband" in |
| 179 | "msm") |
| 180 | start_battery_monitor |
| 181 | ;; |
| 182 | esac |
| 183 | start_charger_monitor |
| 184 | ;; |
| 185 | "apq8084") |
| 186 | platformvalue=`cat /sys/devices/soc0/hw_platform` |
| 187 | case "$platformvalue" in |
| 188 | "Fluid") |
| 189 | start profiler_daemon;; |
| 190 | "Liquid") |
| 191 | start profiler_daemon;; |
| 192 | esac |
| 193 | ;; |
| 194 | "msm8226") |
| 195 | start_charger_monitor |
| 196 | ;; |
| 197 | "msm8610") |
| 198 | start_charger_monitor |
| 199 | ;; |
| 200 | "msm8916") |
| 201 | start_msm_irqbalance_8939 |
| 202 | ;; |
| 203 | "msm8994") |
| 204 | start_msm_irqbalance |
| 205 | ;; |
| 206 | "msm8909") |
| 207 | ;; |
| 208 | esac |
| 209 | |
| 210 | bootmode=`getprop ro.bootmode` |
| 211 | emmc_boot=`getprop ro.boot.emmc` |
| 212 | case "$emmc_boot" |
| 213 | in "true") |
| 214 | if [ "$bootmode" != "charger" ]; then # start rmt_storage and rfs_access |
| 215 | start rmt_storage |
| 216 | start rfs_access |
| 217 | fi |
| 218 | ;; |
| 219 | esac |