# Charge only mode configuration
import /vendor/etc/init/hw/init.mmi.charge_only.rc

on post-fs
    # MOT_LED_CALIBRATION
    chown camera camera /mnt/vendor/persist/camera/mot_ledcal

on early-init
    exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules exfat

on property:ro.boot.default_usb_mode=device && property:vendor.usb.controller=*
    setprop sys.usb.controller ${vendor.usb.controller}
    write /sys/class/udc/${vendor.usb.controller}/device/../mode peripheral

on early-boot
    # Permission for Health Storage HAL
    chown system system /sys/devices/platform/soc/1d84000.ufshc/manual_gc
    chown system system /sys/devices/platform/soc/1d84000.ufshc/ufshid/trigger
    #sync power supply with healthd
    wait /sys/class/power_supply/battery
    wait /sys/class/power_supply/usb

on early-boot && property:ro.boot.bm_ulog_enabled=1
    write /sys/module/bm_adsp_ulog/parameters/debug_enabled 1

on charger && property:ro.boot.bm_ulog_enabled=1
    write /sys/module/bm_adsp_ulog/parameters/debug_enabled 1

on property:sys.boot_completed=1
    write /sys/devices/platform/soc/soc:mmi,charger/state_sync 1

