1# Caiman specific init.rc
2import /vendor/etc/init/hw/init.${ro.board.platform}.board.rc
3
4on init && property:ro.vendor.factory=1
5    import /vendor/etc/init/hw/init.factory.rc
6
7on init && property:ro.boot.hardware.platform=zuma
8    setprop vendor.powerhal.config powerhint-proto.json
9
10on init
11    # eSE  streset tool name
12    setprop persist.vendor.se.streset libstreset24
13    setprop persist.vendor.nfc.streset libstreset24
14# No se_chip_en for P1.0
15on late-init && property:ro.boot.hardware.revision=PROTO1.0
16    setprop persist.vendor.se.reset.chip_en false
17
18on early-boot
19    # Wait for insmod_sh to finish all common modules
20    wait_for_prop vendor.common.modules.ready 1
21    start insmod_sh_caiman
22
23service insmod_sh_caiman /vendor/bin/insmod.sh /vendor_dlkm/etc/init.insmod.${ro.hardware}.cfg
24    class main
25    user root
26    group root system
27    disabled
28    oneshot
29
30on property:vendor.mfgapi.touchpanel.permission=1
31    chmod 0600 /sys/devices/virtual/sec/tsp/cmd
32    chown system system /sys/devices/virtual/sec/tsp/cmd
33
34# Permissions for display
35on fs
36    chown system system /sys/class/backlight/panel0-backlight/acl_mode
37
38# WiFi
39on post-fs-data
40    setprop wifi.direct.interface p2p-dev-wlan0
41    setprop wifi.aware.interface aware_nmi0
42
43    # Speaker amp permission
44    chmod 644 /mnt/vendor/persist/audio/speaker.cal
45
46# Bluetooth
47on post-fs-data
48    chown bluetooth system /proc/bluetooth/timesync
49
50# Thermal
51on late-init && property:ro.boot.hardware.revision=PROTO1.0
52    setprop vendor.thermal.config "thermal_info_config_proto.json"
53
54on late-init && property:ro.boot.hardware.revision=PROTO1.1
55    setprop vendor.thermal.config "thermal_info_config_proto.json"
56
57# Toggle high_sensitivity according to touch_sensitivity_mode
58on property:persist.vendor.touch_sensitivity_mode=0 && property:sys.boot_completed=1
59    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 0
60
61on property:persist.vendor.touch_sensitivity_mode=1 && property:sys.boot_completed=1
62    write /sys/devices/virtual/goog_touch_interface/gti.0/screen_protector_mode_enabled 1
63
64# ODPM
65on early-boot && property:ro.boot.hardware.sku=GEC77
66    write /sys/bus/iio/devices/iio:device0/enabled_rails "CH11=BUCK12S"
67    write /sys/bus/iio/devices/iio:device1/enabled_rails "CH11=BUCK12S"
68on early-boot && property:ro.boot.hardware.sku=GWVK6
69    write /sys/bus/iio/devices/iio:device0/enabled_rails "CH11=BUCK12S"
70    write /sys/bus/iio/devices/iio:device1/enabled_rails "CH11=BUCK12S"
71
72# Start the twoshay touch service
73on property:sys.boot_completed=1
74    chown system input /dev/touch_offload
75    chmod 660 /dev/touch_offload
76    start twoshay
77
78# For Japan sku, always enforce camera shutter sound
79# Since this property is read by the audio server in system service,
80# it should be written by the system init.
81on property:ro.boot.hardware.sku=GWVK6
82    setprop audio.camerasound.force true
83
84# Check serial no. from specific CM4 devices for audio.
85on property:ro.boot.serialno=*
86    setprop vendor.audio_hal.device.serialno ${ro.boot.serialno}
87