imx233: add support for speaker on stmp3780

Change-Id: I990ca2bd43e12047e257f85ff06f046dfa3f94b3
This commit is contained in:
Amaury Pouly 2014-02-16 20:46:00 +01:00
parent 17abb10c64
commit 812c3e7c48
3 changed files with 28 additions and 0 deletions

View file

@ -101,3 +101,11 @@ void audiohw_set_monitor(bool enable)
{
imx233_audioout_select_hp_input(enable);
}
#ifdef HAVE_SPEAKER
void audiohw_enable_speaker(bool en)
{
imx233_audioout_enable_spkr(en);
imx233_audio_enable_spkr(en);
}
#endif

View file

@ -261,6 +261,24 @@ void imx233_audioout_set_3d_effect(int val)
}
}
void imx233_audioout_enable_spkr(bool en)
{
#if IMX233_SUBTARGET >= 3780
if(en)
{
BF_CLR(AUDIOOUT_PWRDN, SPEAKER);
BF_CLR(AUDIOOUT_SPEAKERCTRL, MUTE);
}
else
{
BF_SET(AUDIOOUT_SPEAKERCTRL, MUTE);
BF_SET(AUDIOOUT_PWRDN, SPEAKER);
}
#else
(void) en;
#endif
}
struct imx233_audioout_info_t imx233_audioout_get_info(void)
{
struct imx233_audioout_info_t info;

View file

@ -64,6 +64,8 @@ void imx233_audioout_set_freq(int fsel);
void imx233_audioout_select_hp_input(bool line1);
/* value in 1.5dB steps, from 0dB to 6dB */
void imx233_audioout_set_3d_effect(int val);
/* enable/disable speaker amplifier */
void imx233_audioout_enable_spkr(bool en);
struct imx233_audioout_info_t imx233_audioout_get_info(void);