init: qcom: set permission/ownership of secure-touch sysfs

The sysfs path of input device corresponding to the touchscreen
can not be hard-coded. Determine the path dynamically at
run-time and set the permission/ownership of secure-touch sysfs
correctly.

Change-Id: I203c7a21ce8f1669fce8eab17f646d4d29795c6e
This commit is contained in:
Himanshu Aggarwal 2015-10-13 16:44:28 +05:30
parent 333fd37971
commit d4c42275cb
1 changed files with 21 additions and 0 deletions

View File

@ -224,6 +224,27 @@ case "$target" in
"msm8994" | "msm8992") "msm8994" | "msm8992")
start_msm_irqbalance start_msm_irqbalance
;; ;;
"msm8996")
if [ -f /sys/devices/soc0/hw_platform ]; then
hw_platform=`cat /sys/devices/soc0/hw_platform`
fi
case "$hw_platform" in
"MTP" | "CDP")
#Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership.
for count in 0 1 2 3 4 5 6 7 8 9 10
do
dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count
if [ -d "$dir" ]; then
chmod 0660 $dir/secure_touch_enable
chmod 0440 $dir/secure_touch
chown system.drmrpc $dir/secure_touch_enable
chown system.drmrpc $dir/secure_touch
break
fi
done
;;
esac
;;
"msm8909") "msm8909")
start_vm_bms start_vm_bms
;; ;;