arm: tegra: hdmi: conditionalized the source path
mohit singh [Thu, 3 Feb 2011 13:32:47 +0000 (18:32 +0530)]
This change enables support for selecting source
reg based on verion of SOC.

Bug 783375

Original-Change-Id: Ib0fd6c7a772c1b2e94e986fad5bea942a2f2f4aa
Reviewed-on: http://git-master/r/18190
Tested-by: Mohit Singh <mpsingh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Original-Change-Id: Ibf5823e84810daef6dfb6b8e553115050e84d059

Rebase-Id: R3772f0aaf696af8298d13cb2e909f8a827ce20e4

drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/dc/hdmi_reg.h

index 92b5f0f..b9e19d1 100644 (file)
@@ -816,12 +816,21 @@ static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc)
        unsigned long audio_n;
        unsigned audio_freq = 44100; /* TODO: find some way of configuring this */
 
+
+#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
+       tegra_hdmi_writel(hdmi,AUDIO_CNTRL0_SOURCE_SELECT_AUTO,
+                         HDMI_NV_PDISP_SOR_AUDIO_CNTRL0_0);
+       tegra_hdmi_writel(hdmi,
+                         AUDIO_CNTRL0_ERROR_TOLERANCE(6) |
+                         AUDIO_CNTRL0_FRAMES_PER_BLOCK(0xc0),
+                         HDMI_NV_PDISP_AUDIO_CNTRL0);
+#else
        tegra_hdmi_writel(hdmi,
                          AUDIO_CNTRL0_ERROR_TOLERANCE(6) |
                          AUDIO_CNTRL0_FRAMES_PER_BLOCK(0xc0) |
                          AUDIO_CNTRL0_SOURCE_SELECT_AUTO,
                          HDMI_NV_PDISP_AUDIO_CNTRL0);
-
+#endif
        config = tegra_hdmi_get_audio_config(audio_freq, dc->mode.pclk);
        if (!config) {
                dev_err(&dc->ndev->dev,
index 57f292a..731e9dd 100644 (file)
 #define HDMI_NV_PDISP_AUDIO_PULSE_WIDTH                                0x89
 #define HDMI_NV_PDISP_AUDIO_THRESHOLD                          0x8a
 #define HDMI_NV_PDISP_AUDIO_CNTRL0                             0x8b
+#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
+#define HDMI_NV_PDISP_SOR_AUDIO_CNTRL0_0               0xac
+#endif
 #define  AUDIO_CNTRL0_ERROR_TOLERANCE(x)       (((x) & 0xff) << 0)
 #define  AUDIO_CNTRL0_SOFT_RESET               (1 << 8)
 #define  AUDIO_CNTRL0_SOFT_RESET_ALL           (1 << 12)