Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2774)

Unified Diff: drivers/video/tegra/dc/hdmi.c

Issue 6632011: CHROMIUM: video: tegra: Implement tegra_dc_hdmi_set_audio_sample_rate (Closed)
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « arch/arm/mach-tegra/include/mach/dc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drivers/video/tegra/dc/hdmi.c
diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c
index 662427428f7394750f385125480a4f0a1c30fe70..5eafeab1c15f115065c355ce00bd89eb2148a0d0 100644
--- a/drivers/video/tegra/dc/hdmi.c
+++ b/drivers/video/tegra/dc/hdmi.c
@@ -685,12 +685,11 @@ static void tegra_dc_hdmi_setup_audio_fs_tables(struct tegra_dc *dc)
}
}
-static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc)
+static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc, unsigned audio_freq)
{
struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc);
const struct tegra_hdmi_audio_config *config;
unsigned long audio_n;
- unsigned audio_freq = 44100; /* TODO: find some way of configuring this */
tegra_hdmi_writel(hdmi,
AUDIO_CNTRL0_ERROR_TOLERANCE(6) |
@@ -730,6 +729,28 @@ static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc)
return 0;
}
+int tegra_dc_hdmi_set_audio_sample_rate(unsigned audio_freq)
+{
+ int i, ret;
+ struct tegra_dc *dc;
+ struct tegra_dc_hdmi_data *hdmi;
+
+ for (i = 0; i < TEGRA_MAX_DC; i++) {
+ dc = tegra_dc_get_dc(i);
+ if (!dc)
+ continue;
+ hdmi = tegra_dc_get_outdata(dc);
+ if (!hdmi)
+ continue;
+ ret = tegra_dc_hdmi_setup_audio(dc, audio_freq);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(tegra_dc_hdmi_set_audio_sample_rate);
+
static void tegra_dc_hdmi_write_infopack(struct tegra_dc *dc, int header_reg,
u8 type, u8 version, void *data, int len)
{
@@ -937,7 +958,7 @@ static void tegra_dc_hdmi_enable(struct tegra_dc *dc)
SOR_REFCLK_DIV_FRAC(dispclk_div_8_2),
HDMI_NV_PDISP_SOR_REFCLK);
- err = tegra_dc_hdmi_setup_audio(dc);
+ err = tegra_dc_hdmi_setup_audio(dc, 44100);
if (err < 0)
dvi = true;
« no previous file with comments | « arch/arm/mach-tegra/include/mach/dc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698