From afbae177a16fafbd898925e874fc56d395756d3a Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sat, 7 Oct 2017 21:59:21 +0200 Subject: sonynwz: add api and debug entries for "acoustic" and "cue/rev" mode We don't really know what those are supposed to do. They seem to change the volume curve but it is not very clear what is the intended purpose. Change-Id: I65f5d18aba139844c23df092277ba17ee8518f96 --- firmware/drivers/audio/nwzlinux-codec.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'firmware/drivers/audio') diff --git a/firmware/drivers/audio/nwzlinux-codec.c b/firmware/drivers/audio/nwzlinux-codec.c index 36ebaa8b79..7d730ce68b 100644 --- a/firmware/drivers/audio/nwzlinux-codec.c +++ b/firmware/drivers/audio/nwzlinux-codec.c @@ -277,6 +277,29 @@ static void hw_close(void) close(fd_hw); } +/* Acoustic and Cue/Rev control how the volume curve, but it is not clear + * what the intention of these modes are and the OF does not seem to use + * them by default */ +bool audiohw_acoustic_enabled(void) +{ + return alsa_controls_get_bool("CODEC Acoustic Switch"); +} + +void audiohw_enable_acoustic(bool en) +{ + alsa_controls_set_bool("CODEC Acoustic Switch", en); +} + +bool audiohw_cuerev_enabled(void) +{ + return alsa_controls_get_bool("CODEC Cue/Rev Switch"); +} + +void audiohw_enable_cuerev(bool en) +{ + alsa_controls_set_bool("CODEC Cue/Rev Switch", en); +} + void audiohw_preinit(void) { alsa_controls_init(); @@ -287,8 +310,8 @@ void audiohw_preinit(void) /* Acoustic and Cue/Rev control how the volume curve, but it is not clear * what the intention of these modes are and the OF does not seem to use * them by default */ - alsa_controls_set_bool("CODEC Acoustic Switch", false); - alsa_controls_set_bool("CODEC Cue/Rev Switch", false); + audiohw_enable_acoustic(false); + audiohw_enable_cuerev(false); /* not sure exactly what it means */ alsa_controls_set_enum("Playback Src Switch", "Music"); /* use headphone output */ -- cgit v1.2.3