summaryrefslogtreecommitdiff
path: root/firmware/export/audiohw.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-03-13 02:11:45 +0000
committerSolomon Peachy <pizza@shaftnet.org>2021-03-22 13:00:11 +0000
commit55805e13a4ef0152b40e6606fce8b4603ae8cb91 (patch)
tree34171877486e5732233439ef1058007cad36ed29 /firmware/export/audiohw.h
parent3a254a92c7363aad95cfcc549732e44d9eddc42b (diff)
downloadrockbox-55805e13a4ef0152b40e6606fce8b4603ae8cb91.tar.gz
rockbox-55805e13a4ef0152b40e6606fce8b4603ae8cb91.zip
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
Diffstat (limited to 'firmware/export/audiohw.h')
-rw-r--r--firmware/export/audiohw.h15
1 files changed, 15 insertions, 0 deletions
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 @@
41#define LIN_GAIN_CAP (1 << 11) 41#define LIN_GAIN_CAP (1 << 11)
42#define MIC_GAIN_CAP (1 << 12) 42#define MIC_GAIN_CAP (1 << 12)
43#define FILTER_ROLL_OFF_CAP (1 << 13) 43#define FILTER_ROLL_OFF_CAP (1 << 13)
44#define POWER_MODE_CAP (1 << 14)
44 45
45/* Used by every driver to export its min/max/default values for its audio 46/* Used by every driver to export its min/max/default values for its audio
46 settings. */ 47 settings. */
@@ -391,6 +392,10 @@ enum AUDIOHW_EQ_SETTINGS
391#define AUDIOHW_HAVE_FILTER_ROLL_OFF 392#define AUDIOHW_HAVE_FILTER_ROLL_OFF
392#endif 393#endif
393 394
395#if (AUDIOHW_CAPS & POWER_MODE_CAP)
396#define AUDIOHW_HAVE_POWER_MODE
397#endif
398
394#endif /* AUDIOHW_CAPS */ 399#endif /* AUDIOHW_CAPS */
395 400
396#ifdef HAVE_SW_TONE_CONTROLS 401#ifdef HAVE_SW_TONE_CONTROLS
@@ -586,6 +591,16 @@ void audiohw_set_depth_3d(int val);
586void audiohw_set_filter_roll_off(int val); 591void audiohw_set_filter_roll_off(int val);
587#endif 592#endif
588 593
594#ifdef AUDIOHW_HAVE_POWER_MODE
595/**
596 * Set DAC's power saving mode.
597 * @param enable 0 - highest performance, 1 - battery saving
598 * NOTE: AUDIOHW_CAPS need to contain
599 * POWER_MODE_CAP
600 */
601void audiohw_set_power_mode(int mode);
602#endif
603
589void audiohw_set_frequency(int fsel); 604void audiohw_set_frequency(int fsel);
590 605
591#ifdef HAVE_RECORDING 606#ifdef HAVE_RECORDING