on property:vendor.all.modules.ready=1
    wait /sys/bus/i2c/devices/i2c-cs40l26a/calibration/redc_cal_time_ms

    mkdir /mnt/vendor/persist/haptics 0770 system system
    chmod 770 /mnt/vendor/persist/haptics
    chmod 440 /mnt/vendor/persist/haptics/cs40l26.cal
    chmod 440 /mnt/vendor/persist/haptics/cs40l26_dual.cal
    chown system system /mnt/vendor/persist/haptics
    chown system system /mnt/vendor/persist/haptics/cs40l26.cal
    chown system system /mnt/vendor/persist/haptics/cs40l26_dual.cal

    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/f0_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/f0_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/q_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/q_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/calibration/redc_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/calibration/redc_stored
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/vibe_state
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/vibe_state
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/num_waves
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/num_waves
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_offset
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_offset
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/owt_free_space
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/owt_free_space
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/f0_comp_enable
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/f0_comp_enable
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/redc_comp_enable
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/redc_comp_enable
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a/default/delay_before_stop_playback_us
    chown system system /sys/bus/i2c/devices/i2c-cs40l26a-dual/default/delay_before_stop_playback_us
    chown system system /dev/gpiochip44

    enable vendor.vibrator.cs40l26

service vendor.vibrator.cs40l26 /vendor/bin/hw/android.hardware.vibrator-service.cs40l26-private
    class hal
    user system
    group system input

    setenv HAPTIC_NAME Haptics
    setenv INPUT_EVENT_NAME cs40l26_input
    setenv INPUT_EVENT_NAME_DUAL cs40l26_dual_input
    setenv INPUT_EVENT_PATH /dev/input/event*
    setenv PROPERTY_PREFIX ro.vendor.vibrator.hal.
    setenv CALIBRATION_FILEPATH /mnt/vendor/persist/haptics/cs40l26.cal
    setenv CALIBRATION_FILEPATH_DUAL /mnt/vendor/persist/haptics/cs40l26_dual.cal

    setenv HWAPI_PATH_PREFIX /sys/bus/i2c/devices/i2c-cs40l26a/
    setenv HWAPI_PATH_PREFIX_DUAL /sys/bus/i2c/devices/i2c-cs40l26a-dual/
    setenv HWAPI_DEBUG_PATHS "
        calibration/f0_stored
        calibration/redc_stored
        calibration/q_stored
        default/vibe_state
        default/num_waves
        default/f0_offset
        default/owt_free_space
        default/f0_comp_enable
        default/redc_comp_enable
        default/delay_before_stop_playback_us
        "

    disabled

