summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-01-10 21:50:32 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-01-16 19:35:40 -0500
commitdac3175445b6e76a29c1550da9cece13dfaf7f8c (patch)
tree2f1475163428f3c5af431b1c3dec630d13365c8f /firmware/export
parent18b3e91707e42873eab833f0f3da709062207ba7 (diff)
downloadrockbox-dac3175445b6e76a29c1550da9cece13dfaf7f8c.tar.gz
rockbox-dac3175445b6e76a29c1550da9cece13dfaf7f8c.zip
audiohw: avoid magic numbers for DAC power mode
Define proper symbolic constants for power mode. Also allow targets to define the default power mode setting. Change-Id: Ia07cf854dce47d0a6aa88e067471f1ff9fbc45fb
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/ak4376.h4
-rw-r--r--firmware/export/audiohw.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/firmware/export/ak4376.h b/firmware/export/ak4376.h
index eab0bc24f3..0ae156bc37 100644
--- a/firmware/export/ak4376.h
+++ b/firmware/export/ak4376.h
@@ -144,8 +144,8 @@ extern void ak4376_set_filter_roll_off(int val);
* and power-up / power-down sequences as a frequency switch, so both settings
* are controlled by this function.
*
- * high power mode -- use power_mode=0
- * low power mode -- use power_mode=1
+ * high power mode -- use power_mode=SOUND_HIGH_POWER
+ * low power mode -- use power_mode=SOUND_LOW_POWER
*/
extern void ak4376_set_freqmode(int fsel, int mult, int power_mode);
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index a365b97828..3f8b48d750 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -605,6 +605,12 @@ void audiohw_set_filter_roll_off(int val);
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE
+enum audiohw_power_mode
+{
+ SOUND_HIGH_POWER = 0,
+ SOUND_LOW_POWER,
+};
+
/**
* Set DAC's power saving mode.
* @param enable 0 - highest performance, 1 - battery saving