From 746dc76b99e44128025d9f18f7a154e2382ed134 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 5 Jun 2015 14:39:36 -0600 Subject: tegra: clock: Support enabling external clocks Add a simple function to enable external clocks. Signed-off-by: Simon Glass Signed-off-by: Tom Warren --- arch/arm/mach-tegra/clock.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/arm/mach-tegra/clock.c') diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c index cdd5438..5908260 100644 --- a/arch/arm/mach-tegra/clock.c +++ b/arch/arm/mach-tegra/clock.c @@ -17,11 +17,13 @@ /* Tegra SoC common clock control functions */ #include +#include #include #include #include #include #include +#include #include #include #include @@ -702,3 +704,18 @@ void tegra30_set_up_pllp(void) set_avp_clock_source(SCLK_SOURCE_PLLP_OUT4); } + +int clock_external_output(int clk_id) +{ + struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; + + if (clk_id >= 1 && clk_id <= 3) { + setbits_le32(&pmc->pmc_clk_out_cntrl, + 1 << (2 + (clk_id - 1) * 8)); + } else { + printf("%s: Unknown output clock id %d\n", __func__, clk_id); + return -EINVAL; + } + + return 0; +} -- cgit v1.1