From 55805e13a4ef0152b40e6606fce8b4603ae8cb91 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 13 Mar 2021 02:11:45 +0000 Subject: Add new audiohw capability: POWER_MODE_CAP This allows the user to make use of the DAC's power-saving abilities. The two modes are "high performance" and "battery saver". This feature is supported by the AK4376 DAC in the upcoming FiiO M3K port. The setting is only a manual toggle right now, but in the future it could be hooked up to the battery level (via another setting) so it can be toggled automatically when the battery gets too low. Change-Id: I482af6e2f969fcbdeb3411bd3ff91f866b12d027 --- firmware/export/audiohw.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'firmware/export/audiohw.h') diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 8a46cbea78..d862c977db 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -41,6 +41,7 @@ #define LIN_GAIN_CAP (1 << 11) #define MIC_GAIN_CAP (1 << 12) #define FILTER_ROLL_OFF_CAP (1 << 13) +#define POWER_MODE_CAP (1 << 14) /* Used by every driver to export its min/max/default values for its audio settings. */ @@ -391,6 +392,10 @@ enum AUDIOHW_EQ_SETTINGS #define AUDIOHW_HAVE_FILTER_ROLL_OFF #endif +#if (AUDIOHW_CAPS & POWER_MODE_CAP) +#define AUDIOHW_HAVE_POWER_MODE +#endif + #endif /* AUDIOHW_CAPS */ #ifdef HAVE_SW_TONE_CONTROLS @@ -586,6 +591,16 @@ void audiohw_set_depth_3d(int val); void audiohw_set_filter_roll_off(int val); #endif +#ifdef AUDIOHW_HAVE_POWER_MODE +/** + * Set DAC's power saving mode. + * @param enable 0 - highest performance, 1 - battery saving + * NOTE: AUDIOHW_CAPS need to contain + * POWER_MODE_CAP + */ +void audiohw_set_power_mode(int mode); +#endif + void audiohw_set_frequency(int fsel); #ifdef HAVE_RECORDING -- cgit v1.2.3