arm: tegra: hdmi:audio freq and source selection
mohit singh [Tue, 1 Mar 2011 05:49:35 +0000 (10:49 +0530)]
- moving the new API to a new file under mach tegra
  include.

Original-Change-Id: I0e898883bbf5ab0f24573bb334ff355564118f2f
Reviewed-on: http://git-master/r/21206
Tested-by: Mohit Singh <mpsingh@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Original-Change-Id: I232974ba41e9b3589aebf6aa25a9ab17d4dd12dd

Rebase-Id: R09f335e4905579ca334a1f8132a3d6f96ada0555

arch/arm/mach-tegra/include/mach/hdmi-audio.h [new file with mode: 0644]
drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/dc/hdmi.h

diff --git a/arch/arm/mach-tegra/include/mach/hdmi-audio.h b/arch/arm/mach-tegra/include/mach/hdmi-audio.h
new file mode 100644 (file)
index 0000000..261ff07
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * arch/arm/mach-tegra/include/mach/hdmi-audio.h
+ *
+ * Copyright (c) 2008-2011, NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __MACH_TEGRA_HDMI_AUDIO_H
+#define __MACH_TEGRA_HDMI_AUDIO_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+enum {
+       AUDIO_FREQ_32K = 32000,
+       AUDIO_FREQ_44_1K = 44100,
+       AUDIO_FREQ_48K = 48000,
+       AUDIO_FREQ_88_2K = 88200,
+       AUDIO_FREQ_96K = 96000,
+       AUDIO_FREQ_176_4K = 176400,
+       AUDIO_FREQ_192K = 192000,
+};
+
+enum {
+       AUTO = 0,
+       SPDIF,
+       HDA,
+};
+
+int tegra_hdmi_setup_audio_freq_source(unsigned audio_freq, unsigned audio_source);
+
+#endif /* __MACH_TEGRA_HDMI_AUDIO_H */
index 398ca9a..f491b1c 100644 (file)
@@ -30,6 +30,7 @@
 #include <mach/dc.h>
 #include <mach/fb.h>
 #include <mach/nvhost.h>
+#include <mach/hdmi-audio.h>
 
 #include <video/tegrafb.h>
 
@@ -798,7 +799,6 @@ static int tegra_dc_hdmi_init(struct tegra_dc *dc)
        tegra_dc_set_outdata(dc, hdmi);
 
        dc_hdmi = hdmi;
-
        /* boards can select default content protection policy */
        if (dc->out->flags & TEGRA_DC_OUT_NVHDCP_POLICY_ON_DEMAND) {
                tegra_nvhdcp_set_policy(hdmi->nvhdcp,
@@ -1038,7 +1038,7 @@ static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc, unsigned audio_freq,
                break;
        }
 
-       _tegra_hdmi_writel(hdmi, config->aval, reg_addr);
+       tegra_hdmi_writel(hdmi, config->aval, reg_addr);
 #endif
        tegra_dc_hdmi_setup_audio_fs_tables(dc);
 
@@ -1327,10 +1327,11 @@ static void tegra_dc_hdmi_enable(struct tegra_dc *dc)
                          SOR_REFCLK_DIV_FRAC(dispclk_div_8_2),
                          HDMI_NV_PDISP_SOR_REFCLK);
 
-
        hdmi->clk_enabled = true;
+
        if (!hdmi->dvi) {
-               err = tegra_dc_hdmi_setup_audio(dc);
+               err = tegra_dc_hdmi_setup_audio(dc, hdmi->audio_freq,
+                       hdmi->audio_source);
 
                if (err < 0)
                        hdmi->dvi = true;
index 8757ad8..f726f41 100644 (file)
@@ -212,26 +212,9 @@ struct hdmi_stereo_infoframe {
 
 struct tegra_dc_hdmi_data;
 
-enum {
-       AUDIO_FREQ_32K = 32000,
-       AUDIO_FREQ_44_1K = 44100,
-       AUDIO_FREQ_48K = 48000,
-       AUDIO_FREQ_88_2K = 88200,
-       AUDIO_FREQ_96K = 96000,
-       AUDIO_FREQ_176_4K = 176400,
-       AUDIO_FREQ_192K = 192000,
-};
-
-enum {
-       AUTO = 0,
-       SPDIF,
-       HDA,
-};
-
 unsigned long tegra_hdmi_readl(struct tegra_dc_hdmi_data *hdmi,
                                unsigned long reg);
 void tegra_hdmi_writel(struct tegra_dc_hdmi_data *hdmi,
                                unsigned long val, unsigned long reg);
-int tegra_hdmi_setup_audio_freq_source(unsigned audio_freq, unsigned audio_source);
 
 #endif