summaryrefslogtreecommitdiffstats
path: root/firmware/target
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/target
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/target')
-rw-r--r--firmware/target/mips/ingenic_x1000/fiiom3k/audiohw-fiiom3k.c2
-rw-r--r--firmware/target/mips/ingenic_x1000/shanlingq1/audiohw-shanlingq1.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/audiohw-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/audiohw-fiiom3k.c
index 8528b803f7..f7dced8f54 100644
--- a/firmware/target/mips/ingenic_x1000/fiiom3k/audiohw-fiiom3k.c
+++ b/firmware/target/mips/ingenic_x1000/fiiom3k/audiohw-fiiom3k.c
@@ -28,7 +28,7 @@
#include "logf.h"
static int cur_fsel = HW_FREQ_48;
-static int cur_power_mode = 0;
+static int cur_power_mode = SOUND_HIGH_POWER;
static void set_ak_freqmode(void)
{
diff --git a/firmware/target/mips/ingenic_x1000/shanlingq1/audiohw-shanlingq1.c b/firmware/target/mips/ingenic_x1000/shanlingq1/audiohw-shanlingq1.c
index 7314f20412..3b49262f20 100644
--- a/firmware/target/mips/ingenic_x1000/shanlingq1/audiohw-shanlingq1.c
+++ b/firmware/target/mips/ingenic_x1000/shanlingq1/audiohw-shanlingq1.c
@@ -154,7 +154,7 @@ void audiohw_set_filter_roll_off(int value)
void audiohw_set_power_mode(int mode)
{
enum es9218_amp_mode new_amp_mode;
- if(mode == 0)
+ if(mode == SOUND_HIGH_POWER)
new_amp_mode = ES9218_AMP_MODE_2VRMS;
else
new_amp_mode = ES9218_AMP_MODE_1VRMS;