diff options
Diffstat (limited to 'firmware/drivers/audio/eros_qn_codec.c')
-rw-r--r-- | firmware/drivers/audio/eros_qn_codec.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/firmware/drivers/audio/eros_qn_codec.c b/firmware/drivers/audio/eros_qn_codec.c index 21347f5fca..095b3b5305 100644 --- a/firmware/drivers/audio/eros_qn_codec.c +++ b/firmware/drivers/audio/eros_qn_codec.c @@ -27,39 +27,36 @@ #include "settings.h" #include "pcm_sw_volume.h" -static long int vol_l_hw = 0; -static long int vol_r_hw = 0; +#include "gpio-x1000.h" -void pcm5102_set_outputs(void) +static long int vol_l_hw = PCM5102A_VOLUME_MIN; +static long int vol_r_hw = PCM5102A_VOLUME_MIN; +int es9018k2m_present_flag = 0; + +void eros_qn_set_outputs(void) { audiohw_set_volume(vol_l_hw, vol_r_hw); } -/* this makes less sense here than it does in the audiohw-*.c file, - * but we need access to settings.h */ -void audiohw_set_volume(int vol_l, int vol_r) +void eros_qn_set_last_vol(long int vol_l, long int vol_r) { - int l, r; - vol_l_hw = vol_l; vol_r_hw = vol_r; +} - l = vol_l; - r = vol_r; +int eros_qn_get_volume_limit(void) +{ + return (global_settings.volume_limit * 10); +} -#if (defined(HAVE_HEADPHONE_DETECTION) && defined(HAVE_LINEOUT_DETECTION)) - /* make sure headphones aren't present - don't want to - * blow out our eardrums cranking it to full */ - if (lineout_inserted() && !headphones_inserted()) +void eros_qn_switch_output(int select) +{ + if (select == 0) { - l = r = global_settings.volume_limit * 10; + gpio_set_level(GPIO_STEREOSW_SEL, 0); } else { - l = vol_l; - r = vol_r; + gpio_set_level(GPIO_STEREOSW_SEL, 1); } -#endif - - pcm_set_master_volume(l, r); -} +}
\ No newline at end of file |