summaryrefslogtreecommitdiffstats
path: root/firmware/drivers
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-11-03 20:14:01 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-11-06 21:37:06 +0100
commit0fe7b8becf26816eb303626addc8d34821e361f3 (patch)
treecb8fcd990d5aa3a55212b60e2a3d2282f8f92bff /firmware/drivers
parentee2eb13b7407841e9c0dbc76d18878b241d3e9f2 (diff)
downloadrockbox-0fe7b8becf26816eb303626addc8d34821e361f3.tar.gz
rockbox-0fe7b8becf26816eb303626addc8d34821e361f3.tar.bz2
rockbox-0fe7b8becf26816eb303626addc8d34821e361f3.zip
nwzlinux: add support for radio
None of the Sony up to A15 seem to support RDS (they use either Si4702 or Si4708), thus I did not add any code to support RDS. Change-Id: I64838993b9705b36b94665f8470c7a89c772c961
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/audio/nwzlinux-codec.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/drivers/audio/nwzlinux-codec.c b/firmware/drivers/audio/nwzlinux-codec.c
index 7d730ce68b..33059d2aec 100644
--- a/firmware/drivers/audio/nwzlinux-codec.c
+++ b/firmware/drivers/audio/nwzlinux-codec.c
@@ -300,6 +300,17 @@ void audiohw_enable_cuerev(bool en)
alsa_controls_set_bool("CODEC Cue/Rev Switch", en);
}
+void audiohw_set_playback_src(enum nwz_src_t src)
+{
+ switch(src)
+ {
+ case NWZ_RADIO: alsa_controls_set_enum("Playback Src Switch", "Fm"); break;
+ case NWZ_MIC: alsa_controls_set_enum("Playback Src Switch", "Mic"); break;
+ case NWZ_PLAYBACK:
+ default: alsa_controls_set_enum("Playback Src Switch", "Music"); break;
+ }
+}
+
void audiohw_preinit(void)
{
alsa_controls_init();
@@ -312,8 +323,8 @@ void audiohw_preinit(void)
* them by default */
audiohw_enable_acoustic(false);
audiohw_enable_cuerev(false);
- /* not sure exactly what it means */
- alsa_controls_set_enum("Playback Src Switch", "Music");
+ /* select playback source */
+ audiohw_set_playback_src(NWZ_PLAYBACK);
/* use headphone output */
alsa_controls_set_enum("Output Switch", "Headphone");
/* unmute */