From: smj <smj@rock-chips.com>
Date: Sat, 25 Apr 2015 02:11:44 +0000 (+0800)
Subject: rk3368: add the hdmi nlpcm and hbr mode for direct output
X-Git-Tag: firefly_0821_release~4158^2~163
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=544790e030e66a54a8d0551f7d7079de841bc623;p=firefly-linux-kernel-4.4.55.git

rk3368: add the hdmi nlpcm and hbr mode for direct output

Signed-off-by: smj <smj@rock-chips.com>
---

diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c
index 24b7934607f9..afa3b3974ed3 100755
--- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c
+++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c
@@ -1505,7 +1505,20 @@ static int hdmi_dev_config_audio(struct hdmi *hdmi, struct hdmi_audio *audio)
 		hdmi_msk_reg(hdmi_dev, AUD_CONF0,
 			     m_SW_AUD_FIFO_RST, v_SW_AUD_FIFO_RST(1));
 		hdmi_writel(hdmi_dev, MC_SWRSTZREQ, 0xF7);
+		hdmi_writel(hdmi_dev, AUD_CONF2, 0x0);
 		usleep_range(90, 100);
+		if (I2S_CHANNEL_7_8 == channel) {
+			HDMIDBG("hbr mode.\n");
+			hdmi_writel(hdmi_dev, AUD_CONF2, 0x1);
+			word_length = I2S_24BIT_SAMPLE;
+		} else if ((HDMI_AUDIO_FS_48000 == audio->rate)
+			   || (HDMI_AUDIO_FS_192000 == audio->rate)) {
+			HDMIDBG("nlpcm mode.\n");
+			hdmi_writel(hdmi_dev, AUD_CONF2, 0x2);
+			word_length = I2S_24BIT_SAMPLE;
+		} else {
+			hdmi_writel(hdmi_dev, AUD_CONF2, 0x0);
+		}
 		hdmi_msk_reg(hdmi_dev, AUD_CONF0,
 			     m_I2S_SEL | m_I2S_IN_EN,
 			     v_I2S_SEL(AUDIO_I2S) | v_I2S_IN_EN(channel));
diff --git a/sound/soc/rockchip/rk30_i2s.c b/sound/soc/rockchip/rk30_i2s.c
index d66d5ffd9ec1..4f8b1c9eaf93 100755
--- a/sound/soc/rockchip/rk30_i2s.c
+++ b/sound/soc/rockchip/rk30_i2s.c
@@ -77,7 +77,7 @@ struct rk30_i2s_info {
 #define I2S_CLR_ERROR_COUNT 10// check I2S_CLR reg 
 static struct rk30_i2s_info *rk30_i2s;
 
-#if defined (CONFIG_RK_HDMI) && defined (CONFIG_SND_RK_SOC_HDMI_I2S)
+#if 0 /*defined (CONFIG_RK_HDMI) && defined (CONFIG_SND_RK_SOC_HDMI_I2S)*/
 extern int hdmi_get_hotplug(void);
 #else
 #define hdmi_get_hotplug() 0
@@ -693,11 +693,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
 
 	i2s->playback_dma_data.addr = regs_base + I2S_TXR_BUFF;
 	i2s->playback_dma_data.addr_width = 4;
-	i2s->playback_dma_data.maxburst = 1;
+	i2s->playback_dma_data.maxburst = 16;
 
 	i2s->capture_dma_data.addr = regs_base + I2S_RXR_BUFF;
 	i2s->capture_dma_data.addr_width = 4;
-	i2s->capture_dma_data.maxburst = 1;
+	i2s->capture_dma_data.maxburst = 16;
 
 	i2s->i2s_tx_status = false;
 	i2s->i2s_rx_status = false;