diff options
Diffstat (limited to 'firmware/drivers/audio/eros_qn_codec.c')
-rw-r--r-- | firmware/drivers/audio/eros_qn_codec.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/firmware/drivers/audio/eros_qn_codec.c b/firmware/drivers/audio/eros_qn_codec.c index da50d62fe5..39a421ee92 100644 --- a/firmware/drivers/audio/eros_qn_codec.c +++ b/firmware/drivers/audio/eros_qn_codec.c | |||
@@ -31,10 +31,10 @@ | |||
31 | static long int vol_l_hw = 0; | 31 | static long int vol_l_hw = 0; |
32 | static long int vol_r_hw = 0; | 32 | static long int vol_r_hw = 0; |
33 | 33 | ||
34 | /* internal: mute the headphone amp. 0 - unmuted, 1 - muted */ | 34 | /* internal: Switch the output sink. 0 - headphones, 1 - line out */ |
35 | void audiohw_mute_hp(int mute); | 35 | void audiohw_switch_output(int select); |
36 | 36 | ||
37 | void pcm5102_set_outputs(void) | 37 | void dac_set_outputs(void) |
38 | { | 38 | { |
39 | audiohw_set_volume(vol_l_hw, vol_r_hw); | 39 | audiohw_set_volume(vol_l_hw, vol_r_hw); |
40 | } | 40 | } |
@@ -56,15 +56,14 @@ void audiohw_set_volume(int vol_l, int vol_r) | |||
56 | * blow out our eardrums cranking it to full */ | 56 | * blow out our eardrums cranking it to full */ |
57 | if (lineout_inserted() && !headphones_inserted()) | 57 | if (lineout_inserted() && !headphones_inserted()) |
58 | { | 58 | { |
59 | l = r = global_settings.volume_limit * 10; | 59 | audiohw_switch_output(1); |
60 | 60 | ||
61 | /* mute the headphone amp if not plugged in */ | 61 | l = r = global_settings.volume_limit * 10; |
62 | audiohw_mute_hp(1); | ||
63 | } | 62 | } |
64 | else | 63 | else |
65 | { | 64 | { |
66 | /* unmute the headphone amp when plugged in */ | 65 | audiohw_switch_output(0); |
67 | audiohw_mute_hp(0); | 66 | |
68 | l = vol_l; | 67 | l = vol_l; |
69 | r = vol_r; | 68 | r = vol_r; |
70 | } | 69 | } |
@@ -76,14 +75,14 @@ void audiohw_set_volume(int vol_l, int vol_r) | |||
76 | pcm_set_master_volume(l, r); | 75 | pcm_set_master_volume(l, r); |
77 | } | 76 | } |
78 | 77 | ||
79 | void audiohw_mute_hp(int mute) | 78 | void audiohw_switch_output(int select) |
80 | { | 79 | { |
81 | if (mute == 0) | 80 | if (select == 0) |
82 | { | 81 | { |
83 | gpio_set_level(GPIO_MAX97220_SHDN, 1); | 82 | gpio_set_level(GPIO_STEREOSW_SEL, 0); |
84 | } | 83 | } |
85 | else | 84 | else |
86 | { | 85 | { |
87 | gpio_set_level(GPIO_MAX97220_SHDN, 0); | 86 | gpio_set_level(GPIO_STEREOSW_SEL, 1); |
88 | } | 87 | } |
89 | } | 88 | } |