diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-16 20:46:00 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-16 20:53:08 +0100 |
commit | 812c3e7c48e03d0a6457adf754cb549959550f70 (patch) | |
tree | 9fca6cc67d60dce58737cf5c403170546fd71491 | |
parent | 17abb10c641703a7ab421ea17e08981720e88e90 (diff) | |
download | rockbox-812c3e7c48e03d0a6457adf754cb549959550f70.tar.gz rockbox-812c3e7c48e03d0a6457adf754cb549959550f70.zip |
imx233: add support for speaker on stmp3780
Change-Id: I990ca2bd43e12047e257f85ff06f046dfa3f94b3
-rw-r--r-- | firmware/drivers/audio/imx233-codec.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/imx233/audioout-imx233.c | 18 | ||||
-rw-r--r-- | firmware/target/arm/imx233/audioout-imx233.h | 2 |
3 files changed, 28 insertions, 0 deletions
diff --git a/firmware/drivers/audio/imx233-codec.c b/firmware/drivers/audio/imx233-codec.c index 94a1218d5e..b2dcaa3d23 100644 --- a/firmware/drivers/audio/imx233-codec.c +++ b/firmware/drivers/audio/imx233-codec.c | |||
@@ -101,3 +101,11 @@ void audiohw_set_monitor(bool enable) | |||
101 | { | 101 | { |
102 | imx233_audioout_select_hp_input(enable); | 102 | imx233_audioout_select_hp_input(enable); |
103 | } | 103 | } |
104 | |||
105 | #ifdef HAVE_SPEAKER | ||
106 | void audiohw_enable_speaker(bool en) | ||
107 | { | ||
108 | imx233_audioout_enable_spkr(en); | ||
109 | imx233_audio_enable_spkr(en); | ||
110 | } | ||
111 | #endif | ||
diff --git a/firmware/target/arm/imx233/audioout-imx233.c b/firmware/target/arm/imx233/audioout-imx233.c index c92804c2d4..3b6203ea44 100644 --- a/firmware/target/arm/imx233/audioout-imx233.c +++ b/firmware/target/arm/imx233/audioout-imx233.c | |||
@@ -261,6 +261,24 @@ void imx233_audioout_set_3d_effect(int val) | |||
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | void imx233_audioout_enable_spkr(bool en) | ||
265 | { | ||
266 | #if IMX233_SUBTARGET >= 3780 | ||
267 | if(en) | ||
268 | { | ||
269 | BF_CLR(AUDIOOUT_PWRDN, SPEAKER); | ||
270 | BF_CLR(AUDIOOUT_SPEAKERCTRL, MUTE); | ||
271 | } | ||
272 | else | ||
273 | { | ||
274 | BF_SET(AUDIOOUT_SPEAKERCTRL, MUTE); | ||
275 | BF_SET(AUDIOOUT_PWRDN, SPEAKER); | ||
276 | } | ||
277 | #else | ||
278 | (void) en; | ||
279 | #endif | ||
280 | } | ||
281 | |||
264 | struct imx233_audioout_info_t imx233_audioout_get_info(void) | 282 | struct imx233_audioout_info_t imx233_audioout_get_info(void) |
265 | { | 283 | { |
266 | struct imx233_audioout_info_t info; | 284 | struct imx233_audioout_info_t info; |
diff --git a/firmware/target/arm/imx233/audioout-imx233.h b/firmware/target/arm/imx233/audioout-imx233.h index 88163e7ad2..47bb815a08 100644 --- a/firmware/target/arm/imx233/audioout-imx233.h +++ b/firmware/target/arm/imx233/audioout-imx233.h | |||
@@ -64,6 +64,8 @@ void imx233_audioout_set_freq(int fsel); | |||
64 | void imx233_audioout_select_hp_input(bool line1); | 64 | void imx233_audioout_select_hp_input(bool line1); |
65 | /* value in 1.5dB steps, from 0dB to 6dB */ | 65 | /* value in 1.5dB steps, from 0dB to 6dB */ |
66 | void imx233_audioout_set_3d_effect(int val); | 66 | void imx233_audioout_set_3d_effect(int val); |
67 | /* enable/disable speaker amplifier */ | ||
68 | void imx233_audioout_enable_spkr(bool en); | ||
67 | 69 | ||
68 | struct imx233_audioout_info_t imx233_audioout_get_info(void); | 70 | struct imx233_audioout_info_t imx233_audioout_get_info(void); |
69 | 71 | ||