Skip to content

Commit

Permalink
Merge pull request #4 from anssih/cubox-hdmi-hbr
Browse files Browse the repository at this point in the history
ASoC: imx-hdmi: Add support for HBR/HD bitstreaming
  • Loading branch information
rabeeh committed Jun 11, 2014
2 parents 70b8d7d + ceca50e commit 46ad014
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/video/mxc_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@ enum {
/* AHB_DMA_CONF0 field values */
HDMI_AHB_DMA_CONF0_SW_FIFO_RST_OFFSET = 7,
HDMI_AHB_DMA_CONF0_SW_FIFO_RST_MASK = 0x80,
HDMI_AHB_DMA_CONF0_HBR = 0x10,
HDMI_AHB_DMA_CONF0_HBR_OFFSET = 4,
HDMI_AHB_DMA_CONF0_HBR_MASK = 0x10,
HDMI_AHB_DMA_CONF0_EN_HLOCK_OFFSET = 3,
HDMI_AHB_DMA_CONF0_EN_HLOCK_MASK = 0x08,
HDMI_AHB_DMA_CONF0_INCR_TYPE_OFFSET = 1,
Expand Down
11 changes: 10 additions & 1 deletion sound/soc/fsl/imx-hdmi-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ static void hdmi_dma_init_iec_header(void)
iec_header.U = 0;

iec_header.B.consumer = 0; /* Consumer use */
iec_header.B.linear_pcm = 0; /* linear pcm audio */
iec_header.B.non_pcm = 0; /* linear pcm audio */
iec_header.B.copyright = 1; /* no copyright */
iec_header.B.pre_emphasis = 0; /* 2 channels without pre-emphasis */
iec_header.B.mode = 0; /* Mode 0 */
Expand Down Expand Up @@ -785,6 +785,15 @@ static void hdmi_dma_trigger_init(struct snd_pcm_substream *substream,
struct hdmi_dma_priv *priv)
{
unsigned long status;
bool hbr;

/*
* Set HBR mode (>192kHz IEC-61937 HD audio bitstreaming).
* This is done this late because userspace may alter the AESx
* parameters until the stream is finally prepared.
*/
hbr = (iec_header.B.non_pcm && priv->channels == 8);
hdmi_audio_writeb(AHB_DMA_CONF0, HBR, !!hbr);

priv->frame_idx = 0;

Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/imx-hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ union hdmi_audio_header_t {
uint64_t U;
struct {
unsigned consumer:1;
unsigned linear_pcm:1;
unsigned non_pcm:1;
unsigned copyright:1;
unsigned pre_emphasis:3;
unsigned mode:2;
Expand Down

0 comments on commit 46ad014

Please sign in to comment.