device: gs201: add speaker health stats

Add the sysfs that required by the new ATOM of VendorSpeakerStatsReported.
Copy the file sysfs from ag/15659556

Bug: 201250553
Test: Manually test with ATOM

Signed-off-by: Roger Fang <rogerfang@google.com>
Change-Id: Ic98d26ebb384e567f7016868777f951f00a0b27d
This commit is contained in:
Roger Fang 2021-09-27 15:21:37 +08:00
parent 328c3f7c98
commit 0d2cf52ae0

View file

@ -17,6 +17,9 @@
#define LOG_TAG "pixelstats" #define LOG_TAG "pixelstats"
#include <android-base/logging.h> #include <android-base/logging.h>
#include <pixelstats/SysfsCollector.h>
#include <pixelstats/UeventListener.h>
#include <thread> #include <thread>
#include <pixelstats/SysfsCollector.h> #include <pixelstats/SysfsCollector.h>
@ -38,6 +41,9 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
.F2fsStatsPath = "/sys/fs/f2fs/", .F2fsStatsPath = "/sys/fs/f2fs/",
.ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance", .ImpedancePath = "/sys/devices/platform/audiometrics/speaker_impedance",
.CodecPath = "/sys/devices/platform/audiometrics/codec_state", .CodecPath = "/sys/devices/platform/audiometrics/codec_state",
.SpeakerTemperaturePath = "/sys/devices/platform/audiometrics/speaker_temp",
.SpeakerExcursionPath = "/sys/devices/platform/audiometrics/speaker_excursion",
.SpeakerHeartBeatPath = "/sys/devices/platform/audiometrics/speaker_heartbeat",
.UFSErrStatsPath = { .UFSErrStatsPath = {
UFS_ERR_PATH(pa_err_count), UFS_ERR_PATH(pa_err_count),
UFS_ERR_PATH(dl_err_count), UFS_ERR_PATH(dl_err_count),
@ -49,12 +55,14 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = {
}, },
}; };
const char *const kAudioUevent = "/devices/virtual/amcs/amcs"; const struct UeventListener::UeventPaths ueventPaths = {
.AudioUevent = "/devices/virtual/amcs/amcs",
};
int main() { int main() {
LOG(INFO) << "starting PixelStats"; LOG(INFO) << "starting PixelStats";
UeventListener ueventListener(kAudioUevent); UeventListener ueventListener(ueventPaths);
std::thread listenThread(&UeventListener::ListenForever, &ueventListener); std::thread listenThread(&UeventListener::ListenForever, &ueventListener);
listenThread.detach(); listenThread.detach();