diff --git a/device.mk b/device.mk index 54b86da..02ddf43 100644 --- a/device.mk +++ b/device.mk @@ -74,6 +74,9 @@ PRODUCT_PACKAGES += \ PRODUCT_SOONG_NAMESPACES += \ $(LOCAL_PATH) +# Vibrator +$(call soong_config_set,OPLUS_LINEAGE_VIBRATOR_EFFECT,INCLUDE_DIR,$(LOCAL_PATH)/vibrator) + # Inherit from the common OEM chipset makefile. $(call inherit-product, device/oneplus/sm8450-common/common.mk) diff --git a/vibrator/LraConfig.h b/vibrator/LraConfig.h new file mode 100644 index 0000000..ac5ec2b --- /dev/null +++ b/vibrator/LraConfig.h @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: The LineageOS Project + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +// Measured CL_TLRA 5706 us; the DT's qcom,lra-period-us = <5882> is nominal. +constexpr float kF0 = 175.0f; +// Loaded quality factor, and the steady drive at resonance for 1 G +// (2000 mV of qcom,fifo-vmax-mv = <8900>). +constexpr float kQ = 8.0f; +constexpr float kLevelPerG = 0.225f; +// Drive limit for the long chirps (5000 mV); taps may use the full scale. +constexpr float kSustainMaxLevel = 0.562f;