mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
imx233: add the possibility to choose audio output coupling mode
via target-defined option Change-Id: I1bffbc7f17a11cf690a771057c2e4a7ba6a5faaa Reviewed-on: http://gerrit.rockbox.org/678 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
This commit is contained in:
parent
85578cdc4d
commit
75c791dabf
7 changed files with 31 additions and 0 deletions
|
|
@ -23,6 +23,15 @@
|
||||||
#include "rtc-imx233.h"
|
#include "rtc-imx233.h"
|
||||||
#include "pcm_sampr.h"
|
#include "pcm_sampr.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "audio-target.h"
|
||||||
|
|
||||||
|
#ifndef IMX233_AUDIO_COUPLING_MODE
|
||||||
|
#error You must define IMX233_AUDIO_COUPLING_MODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if IMX233_AUDIO_COUPLING_MODE != ACM_CAP && IMX233_AUDIO_COUPLING_MODE != ACM_CAPLESS
|
||||||
|
#error Invalid value for IMX233_AUDIO_COUPLING_MODE
|
||||||
|
#endif
|
||||||
|
|
||||||
static int hp_vol_l, hp_vol_r;
|
static int hp_vol_l, hp_vol_r;
|
||||||
static bool input_line1;
|
static bool input_line1;
|
||||||
|
|
@ -46,7 +55,11 @@ void imx233_audioout_preinit(void)
|
||||||
/* Enable DAC */
|
/* Enable DAC */
|
||||||
BF_CLR(AUDIOOUT_ANACLKCTRL, CLKGATE);
|
BF_CLR(AUDIOOUT_ANACLKCTRL, CLKGATE);
|
||||||
/* Set capless mode */
|
/* Set capless mode */
|
||||||
|
#if IMX233_AUDIO_COUPLING_MODE == ACM_CAP
|
||||||
|
BF_SET(AUDIOOUT_PWRDN, CAPLESS);
|
||||||
|
#else
|
||||||
BF_CLR(AUDIOOUT_PWRDN, CAPLESS);
|
BF_CLR(AUDIOOUT_PWRDN, CAPLESS);
|
||||||
|
#endif
|
||||||
/* Set word-length to 16-bit */
|
/* Set word-length to 16-bit */
|
||||||
BF_SET(AUDIOOUT_CTRL, WORD_LENGTH);
|
BF_SET(AUDIOOUT_CTRL, WORD_LENGTH);
|
||||||
/* Power up DAC */
|
/* Power up DAC */
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,14 @@
|
||||||
|
|
||||||
#include "regs/regs-audioout.h"
|
#include "regs/regs-audioout.h"
|
||||||
|
|
||||||
|
/* target-defined output stage coupling method
|
||||||
|
* its setting is IMX233_AUDIO_COUPLING_MODE and must be set for every target
|
||||||
|
* Use ACM_CAP if output stage (i.e. headphones) have output capacitors,
|
||||||
|
* ACM_CAPLESS (DC-coupled) otherwise.
|
||||||
|
*/
|
||||||
|
#define ACM_CAPLESS 0
|
||||||
|
#define ACM_CAP 1
|
||||||
|
|
||||||
struct imx233_audioout_info_t
|
struct imx233_audioout_info_t
|
||||||
{
|
{
|
||||||
// NOTE there is a convention here: dac -> dacvol -> dacmute
|
// NOTE there is a convention here: dac -> dacvol -> dacmute
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,7 @@
|
||||||
#ifndef __audio_target__
|
#ifndef __audio_target__
|
||||||
#define __audio_target__
|
#define __audio_target__
|
||||||
|
|
||||||
|
#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
|
||||||
|
|
||||||
#endif /* __audio_target__ */
|
#endif /* __audio_target__ */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,6 @@
|
||||||
#ifndef __audio_target__
|
#ifndef __audio_target__
|
||||||
#define __audio_target__
|
#define __audio_target__
|
||||||
|
|
||||||
|
#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
|
||||||
|
|
||||||
#endif /* __audio_target__ */
|
#endif /* __audio_target__ */
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,6 @@
|
||||||
#define IMX233_AUDIO_SPKR_GATE_BANK 1
|
#define IMX233_AUDIO_SPKR_GATE_BANK 1
|
||||||
#define IMX233_AUDIO_SPKR_GATE_PIN 22
|
#define IMX233_AUDIO_SPKR_GATE_PIN 22
|
||||||
|
|
||||||
|
#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
|
||||||
|
|
||||||
#endif /* __audio_target__ */
|
#endif /* __audio_target__ */
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,6 @@
|
||||||
#ifndef __audio_target__
|
#ifndef __audio_target__
|
||||||
#define __audio_target__
|
#define __audio_target__
|
||||||
|
|
||||||
|
#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
|
||||||
|
|
||||||
#endif /* __audio_target__ */
|
#endif /* __audio_target__ */
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,6 @@
|
||||||
#ifndef __audio_target__
|
#ifndef __audio_target__
|
||||||
#define __audio_target__
|
#define __audio_target__
|
||||||
|
|
||||||
|
#define IMX233_AUDIO_COUPLING_MODE ACM_CAPLESS
|
||||||
|
|
||||||
#endif /* __audio_target__ */
|
#endif /* __audio_target__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue