add touch auto detect setup script

picked from tama devices twrp by MartinX3 as available here
https://github.com/MartinX3-AndroidDevelopment/TWRP_android_device_sony_akari_old
android-9.0

and from twrp builds available at https://www.dhsfileserver.de/ftp/martinx3/

explicit set of permissive mode seems to be needed during restore of twrp backup
for some reason (it might be depending on used rom) so picking that too
This commit is contained in:
j4nn 2025-10-05 12:57:19 +02:00
commit 5bf734cda3
3 changed files with 73 additions and 0 deletions

View file

@ -45,3 +45,21 @@ on fs
on late-init
start boot-hal-1-0
start health-hal-2-0
start set_permissive
on post-fs-data
start preptouch
service set_permissive /system/bin/permissive.sh
disabled
user root
group root
oneshot
seclabel u:r:recovery:s0
service preptouch /system/bin/preptouch.sh
disabled
user root
group root
oneshot
seclabel u:r:recovery:s0

View file

@ -0,0 +1,8 @@
#!/sbin/sh
# We use this shell script because the script will follow symlinks and
# different trees will use different binaries to supply the setenforce
# tool. Before M we use toolbox, M and beyond will use toybox. The init
# binary and init.rc will not follow symlinks.
setenforce 0

View file

@ -0,0 +1,47 @@
#!/sbin/sh
#
# Copyright (c) 2019-2020 Martin Dünkelmann
# All rights reserved.
#
# We use this shell script because the script will follow symlinks and
# different trees will use different binaries to supply the setenforce
# tool. Before M we use toolbox, M and beyond will use toybox. The init
# binary and init.rc will not follow symlinks.
touch_id=`cat /sys/devices/dsi_panel_driver/panel_id`
#XZ2 "3" XZ2C "4" Clearpad
if [[ "$touch_id" == "3" ]] || [[ "$touch_id" == "4" ]]; then
insmod /sbin/clearpad_rmi_dev.ko
insmod /sbin/clearpad_core.ko
insmod /sbin/clearpad_i2c.ko
echo 1 > /sys/devices/virtual/input/clearpad/post_probe_start
fi
#XZ2 "7" XZ2C "8" TCM
if [[ "$touch_id" == "7" ]] || [[ "$touch_id" == "8" ]]; then
insmod /sbin/synaptics_tcm_i2c.ko
insmod /sbin/synaptics_tcm_core.ko
insmod /sbin/synaptics_tcm_touch.ko
insmod /sbin/synaptics_tcm_device.ko
insmod /sbin/synaptics_tcm_testing.ko
insmod /sbin/synaptics_tcm_reflash.ko
insmod /sbin/synaptics_tcm_recovery.ko
insmod /sbin/synaptics_tcm_diagnostics.ko
fi
#XZ2P SSW
if [[ "$touch_id" == "9" ]]; then
insmod /sbin/ssw49501.ko
insmod /sbin/ssw_mon.ko
echo 1 > /sys/devices/virtual/input/siw_touch_input/init_late_session
fi
#XZ3 ATMEL
if [[ "$touch_id" == "5" ]]; then
insmod /sbin/atmel_mxt640u.ko
echo 1 > /sys/devices/virtual/input/lge_touch/charge_out
fi