Revert "Revert "Add power logging""

This reverts commit de00dac618f215d4a5c31c414e3a9fd1eb5c20c2.

Test: dumpsys, offloaded, non-offloaded playback
Bug: 30572472
Change-Id: I225baf24896f30ad87b80c9925fb2946338ac6ca
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index b0a6282..836f171 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -25,6 +25,7 @@
 #include <tinycompress/tinycompress.h>
 
 #include <audio_route/audio_route.h>
+#include <audio_utils/PowerLog.h>
 #include "voice.h"
 
 // dlopen() does not go through default library path search if there is a "/" in the library name.
@@ -53,6 +54,11 @@
 
 #define ERROR_LOG_ENTRIES 16
 
+#define POWER_LOG_LINES 40
+#define POWER_LOG_SAMPLING_INTERVAL_MS 50
+#define POWER_LOG_ENTRIES (1 /* minutes */ * 60 /* seconds */ * 1000 /* msec */ \
+                           / POWER_LOG_SAMPLING_INTERVAL_MS)
+
 typedef enum card_status_t {
     CARD_STATUS_OFFLINE,
     CARD_STATUS_ONLINE
@@ -212,6 +218,7 @@
     card_status_t card_status;
 
     struct error_log error_log;
+    power_log_t *power_log;
 };
 
 struct stream_in {