From 2ed3f63d329250343bdfd28060bbbf805902db9f Mon Sep 17 00:00:00 2001 From: pjgowtham Date: Sun, 22 Nov 2026 18:49:53 +0530 Subject: [PATCH] ferrari: Use synthesized vibrator effects Generate the effects and composition primitives of libqtivibratoreffect.oplus for this LRA. The response constants are starting points to tune by feel. Assisted-by: LLM Change-Id: I3ddaaeb797be1f4240dea315868adc67e84a20d7 --- device.mk | 3 +++ vibrator/LraConfig.h | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 vibrator/LraConfig.h 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;