Snap for 12462067 from 583f46ea0a
to mainline-tzdata6-release
Change-Id: I94b9d66f8b862d7feb7c1d2b5ceb625dcc9b8da6
This commit is contained in:
commit
e35aab62b7
16 changed files with 203 additions and 54 deletions
|
@ -11,6 +11,7 @@
|
|||
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
|
||||
</mixPort>
|
||||
<!-- Le Audio Audio Ports -->
|
||||
<mixPort name="le audio broadcast output" role="source" />
|
||||
<mixPort name="le audio output" role="source" flags="AUDIO_OUTPUT_FLAG_SPATIALIZER">
|
||||
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
|
||||
samplingRates="44100 48000"
|
||||
|
@ -51,6 +52,7 @@
|
|||
<devicePort tagName="BLE Headset Out" type="AUDIO_DEVICE_OUT_BLE_HEADSET" role="sink"/>
|
||||
<devicePort tagName="BLE Speaker Out" type="AUDIO_DEVICE_OUT_BLE_SPEAKER" role="sink"/>
|
||||
<devicePort tagName="BLE Headset In" type="AUDIO_DEVICE_IN_BLE_HEADSET" role="source"/>
|
||||
<devicePort tagName="BLE Broadcast Out" type="AUDIO_DEVICE_OUT_BLE_BROADCAST" role="sink"/>
|
||||
</devicePorts>
|
||||
<routes>
|
||||
<route type="mix" sink="BT A2DP Out"
|
||||
|
@ -66,6 +68,8 @@
|
|||
<route type="mix" sink="le audio input"
|
||||
sources="BLE Headset In"/>
|
||||
<route type="mix" sink="BLE Speaker Out"
|
||||
sources="le audio output"/>
|
||||
sources="le audio output"/>
|
||||
<route type="mix" sink="BLE Broadcast Out"
|
||||
sources="le audio broadcast output"/>
|
||||
</routes>
|
||||
</module>
|
|
@ -41,8 +41,8 @@ $(call soong_config_set,fp_hal_feature,pixel_product, product_a)
|
|||
include device/google/felix/vibrator/cs40l26/device.mk
|
||||
include device/google/gs-common/bcmbt/bluetooth.mk
|
||||
include device/google/gs-common/display/dump_second_display.mk
|
||||
include device/google/gs-common/touch/gti/gti.mk
|
||||
include device/google/gs-common/touch/stm/stm6.mk
|
||||
include device/google/gs-common/touch/gti/predump_gti_dual.mk
|
||||
include device/google/gs-common/touch/stm/predump_stm6.mk
|
||||
ifeq ($(filter factory_felix, $(TARGET_PRODUCT)),)
|
||||
include device/google/felix/uwb/uwb_calibration.mk
|
||||
endif
|
||||
|
@ -447,5 +447,6 @@ PRODUCT_PACKAGES += \
|
|||
AvoidAppsInCutoutOverlay
|
||||
|
||||
# Bluetooth device id
|
||||
# Felix: 0x410C
|
||||
PRODUCT_PRODUCT_PROPERTIES += \
|
||||
bluetooth.device_id.product_id=20494
|
||||
bluetooth.device_id.product_id=16652
|
||||
|
|
|
@ -39,6 +39,7 @@ USES_IDISPLAY_INTF_SEC := true
|
|||
|
||||
include device/google/gs201/BoardConfig-common.mk
|
||||
-include vendor/google_devices/gs201/prebuilts/BoardConfigVendor.mk
|
||||
include device/google/gs-common/check_current_prebuilt/check_current_prebuilt.mk
|
||||
-include vendor/google_devices/felix/proprietary/BoardConfigVendor.mk
|
||||
include device/google/felix-sepolicy/felix-sepolicy.mk
|
||||
include device/google/felix/wifi/BoardConfig-wifi.mk
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
SuplLogFullName="/data/vendor/gps/suplflow.txt"
|
||||
tlsEnable="true"
|
||||
|
||||
SuplSslMethod="SSLv23_NO_TLSv1_2"
|
||||
SuplSslMethod="SSLv23"
|
||||
SuplEnable="true"
|
||||
SuplUseApn="false"
|
||||
SuplUseApnNI="true"
|
||||
|
@ -49,6 +49,7 @@
|
|||
LtoSyncThresholdDays="1"
|
||||
|
||||
GnssYearOfHardware="2020"
|
||||
CpEarlyFixGuardTimeSec="1"
|
||||
CpGuardTimeSec="1"
|
||||
CpLppGuardTimeSec="1"
|
||||
IgnoreInjectedSystemTime="true"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
SuplLogFullName="/data/vendor/gps/suplflow.txt"
|
||||
tlsEnable="true"
|
||||
|
||||
SuplSslMethod="SSLv23_NO_TLSv1_2"
|
||||
SuplSslMethod="SSLv23"
|
||||
SuplEnable="true"
|
||||
SuplUseApn="false"
|
||||
SuplUseApnNI="true"
|
||||
|
@ -49,6 +49,7 @@
|
|||
LtoSyncThresholdDays="1"
|
||||
|
||||
GnssYearOfHardware="2020"
|
||||
CpEarlyFixGuardTimeSec="1"
|
||||
CpGuardTimeSec="1"
|
||||
CpLppGuardTimeSec="1"
|
||||
IgnoreInjectedSystemTime="true"
|
||||
|
@ -100,6 +101,7 @@
|
|||
<gll_features
|
||||
EnableNicAutoSwitch="true"
|
||||
EnableNavic="true"
|
||||
ConstellationAutoSwitchOffNavOnly="true"
|
||||
/>
|
||||
|
||||
</glgps>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
SuplLogFullName="/data/vendor/gps/suplflow.txt"
|
||||
tlsEnable="true"
|
||||
|
||||
SuplSslMethod="SSLv23_NO_TLSv1_2"
|
||||
SuplSslMethod="SSLv23"
|
||||
SuplEnable="true"
|
||||
SuplUseApn="false"
|
||||
SuplUseApnNI="true"
|
||||
|
@ -48,6 +48,7 @@
|
|||
LtoSyncThresholdDays="1"
|
||||
|
||||
GnssYearOfHardware="2020"
|
||||
CpEarlyFixGuardTimeSec="1"
|
||||
CpGuardTimeSec="1"
|
||||
CpLppGuardTimeSec="1"
|
||||
IgnoreInjectedSystemTime="true"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
SuplLogFullName="/data/vendor/gps/suplflow.txt"
|
||||
tlsEnable="true"
|
||||
|
||||
SuplSslMethod="SSLv23_NO_TLSv1_2"
|
||||
SuplSslMethod="SSLv23"
|
||||
SuplEnable="true"
|
||||
SuplUseApn="false"
|
||||
SuplUseApnNI="true"
|
||||
|
@ -48,6 +48,7 @@
|
|||
LtoSyncThresholdDays="1"
|
||||
|
||||
GnssYearOfHardware="2020"
|
||||
CpEarlyFixGuardTimeSec="1"
|
||||
CpGuardTimeSec="1"
|
||||
CpLppGuardTimeSec="1"
|
||||
IgnoreInjectedSystemTime="true"
|
||||
|
@ -99,6 +100,7 @@
|
|||
<gll_features
|
||||
EnableNicAutoSwitch="true"
|
||||
EnableNavic="true"
|
||||
ConstellationAutoSwitchOffNavOnly="true"
|
||||
/>
|
||||
|
||||
</glgps>
|
||||
|
|
|
@ -48,15 +48,6 @@
|
|||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.mapper</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>4.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.composer</name>
|
||||
<transport>hwbinder</transport>
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
"1539000",
|
||||
"1352000",
|
||||
"1014000",
|
||||
"421000"
|
||||
"421000",
|
||||
"546000"
|
||||
],
|
||||
"ResetOnInit": true
|
||||
},
|
||||
|
@ -884,6 +885,12 @@
|
|||
"Duration": 50,
|
||||
"Value": "302000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "DISPLAY_INACTIVE",
|
||||
"Node": "MemFreq",
|
||||
"Duration": 0,
|
||||
"Value": "421000"
|
||||
},
|
||||
{
|
||||
"PowerHint": "CPU_LOAD_RESET",
|
||||
"Node": "MemFreq",
|
||||
|
|
|
@ -3,20 +3,17 @@
|
|||
{
|
||||
"Name":"neutral_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"quiet_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"skin_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -24,14 +21,12 @@
|
|||
{
|
||||
"Name":"usb_pwr_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"usb_pwr_therm2",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -39,19 +34,16 @@
|
|||
{
|
||||
"Name":"inner_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"outer_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"gnss_tcxo_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,20 +9,17 @@
|
|||
{
|
||||
"Name":"neutral_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"quiet_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"skin_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -30,14 +27,12 @@
|
|||
{
|
||||
"Name":"usb_pwr_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"usb_pwr_therm2",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -45,19 +40,16 @@
|
|||
{
|
||||
"Name":"inner_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"outer_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"gnss_tcxo_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,20 +9,17 @@
|
|||
{
|
||||
"Name":"neutral_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/neutral_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"quiet_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/quiet_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"skin_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 32.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/skin_therm/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -30,14 +27,12 @@
|
|||
{
|
||||
"Name":"usb_pwr_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"usb_pwr_therm2",
|
||||
"Type":"UNKNOWN",
|
||||
"HotThreshold":["NAN", 40.0, "NAN", "NAN", "NAN", "NAN", "NAN"],
|
||||
"TempPath":"/dev/thermal/tz-by-name/usb_pwr_therm2/tz_temp",
|
||||
"Multiplier":0.001,
|
||||
"PollingDelay":300000,
|
||||
"PassiveDelay":7000
|
||||
|
@ -45,19 +40,16 @@
|
|||
{
|
||||
"Name":"inner_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/inner_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"outer_disp_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/outer_disp_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
"Name":"gnss_tcxo_therm",
|
||||
"Type":"UNKNOWN",
|
||||
"TempPath":"/dev/thermal/tz-by-name/gnss_tcxo_therm/tz_temp",
|
||||
"Multiplier":0.001
|
||||
},
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <sys/epoll.h>
|
||||
#include <utils/Trace.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
|
@ -48,17 +49,19 @@ class HwApiBase {
|
|||
class Record : public RecordInterface {
|
||||
public:
|
||||
Record(const char *func, const T &value, const std::ios *stream)
|
||||
: mFunc(func), mValue(value), mStream(stream) {}
|
||||
: mFunc(func), mValue(value), mStream(stream),
|
||||
mTp(std::chrono::system_clock::system_clock::now()) {}
|
||||
std::string toString(const NamesMap &names) override;
|
||||
|
||||
private:
|
||||
const char *mFunc;
|
||||
const T mValue;
|
||||
const std::ios *mStream;
|
||||
const std::chrono::system_clock::time_point mTp;
|
||||
};
|
||||
using Records = std::list<std::unique_ptr<RecordInterface>>;
|
||||
|
||||
static constexpr uint32_t RECORDS_SIZE = 32;
|
||||
static constexpr uint32_t RECORDS_SIZE = 2048;
|
||||
|
||||
public:
|
||||
HwApiBase();
|
||||
|
@ -181,9 +184,14 @@ template <typename T>
|
|||
std::string HwApiBase::Record<T>::toString(const NamesMap &names) {
|
||||
using utils::operator<<;
|
||||
std::stringstream ret;
|
||||
auto lTp = std::chrono::system_clock::to_time_t(mTp);
|
||||
struct tm buf;
|
||||
auto lTime = localtime_r(&lTp, &buf);
|
||||
|
||||
ret << mFunc << " '" << names.at(mStream) << "' = '" << mValue << "'";
|
||||
|
||||
ret << std::put_time(lTime, "%Y-%m-%d %H:%M:%S.") << std::setfill('0') << std::setw(3)
|
||||
<< (std::chrono::duration_cast<std::chrono::milliseconds>(mTp.time_since_epoch()) % 1000)
|
||||
.count()
|
||||
<< " " << mFunc << " '" << names.at(mStream) << "' = '" << mValue << "'";
|
||||
return ret.str();
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ cc_library {
|
|||
srcs: [
|
||||
"Vibrator.cpp",
|
||||
],
|
||||
shared_libs: ["//hardware/google/pixel:PixelVibratorFlagsL26"],
|
||||
shared_libs: ["//device/google/gs-common:PixelVibratorFlagsL26"],
|
||||
export_include_dirs: ["."],
|
||||
vendor_available: true,
|
||||
visibility: [":__subpackages__"],
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <glob.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/vibrator.h>
|
||||
#include <linux/version.h>
|
||||
#include <log/log.h>
|
||||
#include <stdio.h>
|
||||
#include <utils/Trace.h>
|
||||
|
@ -71,6 +72,14 @@ static constexpr int32_t COMPOSE_PWLE_SIZE_MAX_DEFAULT = 127;
|
|||
// See the LRA Calibration Support documentation for more details.
|
||||
static constexpr int32_t Q14_BIT_SHIFT = 14;
|
||||
|
||||
// Measured ReDC. The LRA series resistance (ReDC), expressed as follows
|
||||
// redc(ohms) = redc_measured / 2^Q15_BIT_SHIFT.
|
||||
// This value represents the unit-specific ReDC input to the click compensation
|
||||
// algorithm. It can be overwritten at a later time by writing to the redc_stored
|
||||
// sysfs control.
|
||||
// See the LRA Calibration Support documentation for more details.
|
||||
static constexpr int32_t Q15_BIT_SHIFT = 15;
|
||||
|
||||
// Measured Q factor, q_measured, is represented by Q8.16 fixed
|
||||
// point format on cs40l26 devices. The expression to calculate q is:
|
||||
// q = q_measured / 2^Q16_BIT_SHIFT
|
||||
|
@ -84,6 +93,30 @@ static constexpr uint8_t PWLE_CHIRP_BIT = 0x8; // Dynamic/static frequency and
|
|||
static constexpr uint8_t PWLE_BRAKE_BIT = 0x4;
|
||||
static constexpr uint8_t PWLE_AMP_REG_BIT = 0x2;
|
||||
|
||||
static constexpr uint8_t PWLE_WT_TYPE = 12;
|
||||
static constexpr uint8_t PWLE_HEADER_WORD_COUNT = 3;
|
||||
static constexpr uint8_t PWLE_HEADER_FTR_SHIFT = 8;
|
||||
static constexpr uint8_t PWLE_SVC_METADATA_WORD_COUNT = 3;
|
||||
static constexpr uint32_t PWLE_SVC_METADATA_TERMINATOR = 0xFFFFFF;
|
||||
static constexpr uint8_t PWLE_SEGMENT_WORD_COUNT = 2;
|
||||
static constexpr uint8_t PWLE_HEADER_WCOUNT_WORD_OFFSET = 2;
|
||||
static constexpr uint8_t PWLE_WORD_SIZE = sizeof(uint32_t);
|
||||
|
||||
static constexpr uint8_t PWLE_SVC_NO_BRAKING = -1;
|
||||
static constexpr uint8_t PWLE_SVC_CAT_BRAKING = 0;
|
||||
static constexpr uint8_t PWLE_SVC_OPEN_BRAKING = 1;
|
||||
static constexpr uint8_t PWLE_SVC_CLOSED_BRAKING = 2;
|
||||
static constexpr uint8_t PWLE_SVC_MIXED_BRAKING = 3;
|
||||
|
||||
static constexpr uint32_t PWLE_SVC_MAX_BRAKING_TIME_MS = 1000;
|
||||
|
||||
static constexpr uint8_t PWLE_FTR_BUZZ_BIT = 0x80;
|
||||
static constexpr uint8_t PWLE_FTR_CLICK_BIT = 0x00;
|
||||
static constexpr uint8_t PWLE_FTR_DYNAMIC_F0_BIT = 0x10;
|
||||
static constexpr uint8_t PWLE_FTR_SVC_METADATA_BIT = 0x04;
|
||||
static constexpr uint8_t PWLE_FTR_DVL_BIT = 0x02;
|
||||
static constexpr uint8_t PWLE_FTR_LF0T_BIT = 0x01;
|
||||
|
||||
static constexpr float PWLE_LEVEL_MIN = 0.0;
|
||||
static constexpr float PWLE_LEVEL_MAX = 1.0;
|
||||
static constexpr float CS40L26_PWLE_LEVEL_MIN = -1.0;
|
||||
|
@ -115,6 +148,10 @@ static uint16_t amplitudeToScale(float amplitude, float maximum) {
|
|||
return std::round(ratio);
|
||||
}
|
||||
|
||||
static float redcToFloat(std::string *caldata) {
|
||||
return static_cast<float>(std::stoul(*caldata, nullptr, 16)) / (1 << Q15_BIT_SHIFT);
|
||||
}
|
||||
|
||||
enum WaveformBankID : uint8_t {
|
||||
RAM_WVFRM_BANK,
|
||||
ROM_WVFRM_BANK,
|
||||
|
@ -233,10 +270,18 @@ class DspMemChunk {
|
|||
write(8, 0); /* nsections placeholder */
|
||||
write(8, 0); /* repeat */
|
||||
} else if (waveformType == WAVEFORM_PWLE) {
|
||||
write(16, (PWLE_FTR_BUZZ_BIT | PWLE_FTR_DVL_BIT)
|
||||
<< PWLE_HEADER_FTR_SHIFT); /* Feature flag */
|
||||
write(8, PWLE_WT_TYPE); /* type12 */
|
||||
write(24, PWLE_HEADER_WORD_COUNT); /* Header word count */
|
||||
write(24, 0); /* Body word count placeholder */
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
|
||||
write(24, 0); /* Waveform length placeholder */
|
||||
write(8, 0); /* Repeat */
|
||||
write(12, 0); /* Wait time between repeats */
|
||||
write(8, 0); /* nsections placeholder */
|
||||
#endif
|
||||
} else {
|
||||
ALOGE("%s: Invalid type: %u", __func__, waveformType);
|
||||
}
|
||||
|
@ -324,6 +369,9 @@ class DspMemChunk {
|
|||
ALOGE("%s: Invalid argument: %u", __func__, totalDuration);
|
||||
return -EINVAL;
|
||||
}
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
|
||||
f += PWLE_HEADER_WORD_COUNT * PWLE_WORD_SIZE;
|
||||
#endif
|
||||
totalDuration *= 8; /* Unit: 0.125 ms (since wlength played @ 8kHz). */
|
||||
totalDuration |=
|
||||
WT_LEN_CALCD; /* Bit 23 is for WT_LEN_CALCD; Bit 22 is for WT_INDEFINITE. */
|
||||
|
@ -352,6 +400,9 @@ class DspMemChunk {
|
|||
ALOGE("%s: Invalid argument: %d", __func__, segmentIdx);
|
||||
return -EINVAL;
|
||||
}
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
|
||||
f += PWLE_HEADER_WORD_COUNT * PWLE_WORD_SIZE;
|
||||
#endif
|
||||
*(f + 7) |= (0xF0 & segmentIdx) >> 4; /* Bit 4 to 7 */
|
||||
*(f + 9) |= (0x0F & segmentIdx) << 4; /* Bit 3 to 0 */
|
||||
} else {
|
||||
|
@ -361,6 +412,34 @@ class DspMemChunk {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int updateWCount(int segmentCount) {
|
||||
uint8_t *f = front();
|
||||
|
||||
if (segmentCount > COMPOSE_SIZE_MAX + 1 /*1st effect may have a delay*/) {
|
||||
ALOGE("%s: Invalid argument: %d", __func__, segmentCount);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (f == nullptr) {
|
||||
ALOGE("%s: head does not exist!", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (waveformType != WAVEFORM_PWLE) {
|
||||
ALOGE("%s: Invalid type: %d", __func__, waveformType);
|
||||
return -EDOM;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
|
||||
f += PWLE_HEADER_WORD_COUNT * PWLE_WORD_SIZE;
|
||||
#endif
|
||||
uint32_t dataSize = segmentCount * PWLE_SEGMENT_WORD_COUNT + PWLE_HEADER_WORD_COUNT;
|
||||
*(f + 0) = (dataSize >> 24) & 0xFF;
|
||||
*(f + 1) = (dataSize >> 16) & 0xFF;
|
||||
*(f + 2) = (dataSize >> 8) & 0xFF;
|
||||
*(f + 3) = dataSize & 0xFF;
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> hwCalDefault,
|
||||
|
@ -598,9 +677,12 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwApiDefault, std::unique_ptr<HwCal> h
|
|||
|
||||
if (mHwCalDef->getF0(&caldata)) {
|
||||
mHwApiDef->setF0(caldata);
|
||||
mResonantFrequency =
|
||||
static_cast<float>(std::stoul(caldata, nullptr, 16)) / (1 << Q14_BIT_SHIFT);
|
||||
}
|
||||
if (mHwCalDef->getRedc(&caldata)) {
|
||||
mHwApiDef->setRedc(caldata);
|
||||
mRedc = redcToFloat(&caldata);
|
||||
}
|
||||
if (mHwCalDef->getQ(&caldata)) {
|
||||
mHwApiDef->setQ(caldata);
|
||||
|
@ -1138,12 +1220,7 @@ ndk::ScopedAStatus Vibrator::alwaysOnDisable(int32_t /*id*/) {
|
|||
}
|
||||
|
||||
ndk::ScopedAStatus Vibrator::getResonantFrequency(float *resonantFreqHz) {
|
||||
std::string caldata{8, '0'};
|
||||
if (!mHwCalDef->getF0(&caldata)) {
|
||||
ALOGE("Failed to get resonant frequency (%d): %s", errno, strerror(errno));
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
||||
}
|
||||
*resonantFreqHz = static_cast<float>(std::stoul(caldata, nullptr, 16)) / (1 << Q14_BIT_SHIFT);
|
||||
*resonantFreqHz = mResonantFrequency;
|
||||
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
@ -1360,6 +1437,13 @@ ndk::ScopedAStatus Vibrator::composePwle(const std::vector<PrimitivePwle> &compo
|
|||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
|
||||
/* Update word count */
|
||||
if (ch.updateWCount(segmentIdx) < 0) {
|
||||
ALOGE("%s: Failed to update the waveform word count", __func__);
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
|
||||
/* Update waveform length */
|
||||
if (ch.updateWLength(totalDuration) < 0) {
|
||||
ALOGE("%s: Failed to update the waveform length length", __func__);
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
|
||||
|
@ -1392,7 +1476,10 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) {
|
|||
|
||||
dprintf(fd, "AIDL:\n");
|
||||
|
||||
dprintf(fd, " Active Effect ID: %" PRId32 "\n", mActiveId);
|
||||
dprintf(fd, " F0: %.02f\n", mResonantFrequency);
|
||||
dprintf(fd, " F0 Offset: base: %" PRIu32 " flip: %" PRIu32 "\n", mF0Offset, mF0OffsetDual);
|
||||
dprintf(fd, " Redc: %.02f\n", mRedc);
|
||||
|
||||
dprintf(fd, " Voltage Levels:\n");
|
||||
dprintf(fd, " Tick Effect Min: %" PRIu32 " Max: %" PRIu32 "\n", mTickEffectVol[0],
|
||||
|
@ -1464,7 +1551,73 @@ binder_status_t Vibrator::dump(int fd, const char **args, uint32_t numArgs) {
|
|||
}
|
||||
}
|
||||
dprintf(fd, "\n");
|
||||
dprintf(fd, "\n");
|
||||
|
||||
dprintf(fd, "Versions:\n");
|
||||
std::ifstream verFile;
|
||||
const auto verBinFileMode = std::ifstream::in | std::ifstream::binary;
|
||||
std::string ver;
|
||||
verFile.open("/sys/module/cs40l26_core/version");
|
||||
if (verFile.is_open()) {
|
||||
getline(verFile, ver);
|
||||
dprintf(fd, " Haptics Driver: %s\n", ver.c_str());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/sys/module/cl_dsp_core/version");
|
||||
if (verFile.is_open()) {
|
||||
getline(verFile, ver);
|
||||
dprintf(fd, " DSP Driver: %s\n", ver.c_str());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26.wmfw", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
verFile.seekg(113);
|
||||
dprintf(fd, " cs40l26.wmfw: %d.%d.%d\n", verFile.get(), verFile.get(), verFile.get());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26-calib.wmfw", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
verFile.seekg(113);
|
||||
dprintf(fd, " cs40l26-calib.wmfw: %d.%d.%d\n", verFile.get(), verFile.get(),
|
||||
verFile.get());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26.bin", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
while (getline(verFile, ver)) {
|
||||
auto pos = ver.find("Date: ");
|
||||
if (pos != std::string::npos) {
|
||||
ver = ver.substr(pos + 6, pos + 15);
|
||||
dprintf(fd, " cs40l26.bin: %s\n", ver.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26-svc.bin", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
verFile.seekg(36);
|
||||
getline(verFile, ver);
|
||||
ver = ver.substr(ver.rfind('\\') + 1);
|
||||
dprintf(fd, " cs40l26-svc.bin: %s\n", ver.c_str());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26-calib.bin", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
verFile.seekg(36);
|
||||
getline(verFile, ver);
|
||||
ver = ver.substr(ver.rfind('\\') + 1);
|
||||
dprintf(fd, " cs40l26-calib.bin: %s\n", ver.c_str());
|
||||
verFile.close();
|
||||
}
|
||||
verFile.open("/vendor/firmware/cs40l26-dvl.bin", verBinFileMode);
|
||||
if (verFile.is_open()) {
|
||||
verFile.seekg(36);
|
||||
getline(verFile, ver);
|
||||
ver = ver.substr(0, ver.find('\0') + 1);
|
||||
ver = ver.substr(ver.rfind('\\') + 1);
|
||||
dprintf(fd, " cs40l26-dvl.bin: %s\n", ver.c_str());
|
||||
verFile.close();
|
||||
}
|
||||
|
||||
mHwApiDef->debug(fd);
|
||||
|
||||
|
|
|
@ -242,6 +242,8 @@ class Vibrator : public BnVibrator {
|
|||
float mLongEffectScale{1.0};
|
||||
bool mIsChirpEnabled;
|
||||
uint32_t mSupportedPrimitivesBits = 0x0;
|
||||
float mRedc{0.0f};
|
||||
float mResonantFrequency{0.0f};
|
||||
std::vector<CompositePrimitive> mSupportedPrimitives;
|
||||
std::vector<uint32_t> mPrimitiveMaxScale;
|
||||
std::vector<uint32_t> mPrimitiveMinScale;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue