summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/speed-imx31.c
diff options
context:
space:
mode:
authorJuergen Beisert <jbe@pengutronix.de>2009-11-24 17:04:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-11-25 08:29:40 +0100
commit81b044f3b64d1b686d6957d89053f850b7c6cd32 (patch)
treead290152c914580732495295c63ab2b3bb94e06c /arch/arm/mach-imx/speed-imx31.c
parent19b98a87fc0b6ca622b8490bcf3190982d178478 (diff)
downloadbarebox-81b044f3b64d1b686d6957d89053f850b7c6cd32.tar.gz
barebox-81b044f3b64d1b686d6957d89053f850b7c6cd32.tar.xz
Adding IPU clock query functions for i.MX31 and i.MX35
Adding IPU clock query functions for i.MX31 and i.MX35 (used to generate their LCD timing). BTW: All functions are declared with the 'ulong' return type, but some are defined with 'unsigned long'. And yes, its the same, but IMHO one type should be used for all. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/speed-imx31.c')
-rw-r--r--arch/arm/mach-imx/speed-imx31.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/speed-imx31.c b/arch/arm/mach-imx/speed-imx31.c
index 630c648dbf..70b1330d96 100644
--- a/arch/arm/mach-imx/speed-imx31.c
+++ b/arch/arm/mach-imx/speed-imx31.c
@@ -41,6 +41,18 @@ ulong imx_get_mcu_main_clk(void)
return imx_get_mpl_dpdgck_clk();
}
+/**
+ * Calculate the current pixel clock speed (aka HSP or IPU)
+ * @return 0 on failure or current frequency in Hz
+ */
+ulong imx_get_lcdclk(void)
+{
+ ulong hsp_podf = (readl(IMX_CCM_BASE + CCM_PDR0) >> 11) & 0x03;
+ ulong base_clk = imx_get_mcu_main_clk();
+
+ return base_clk / (hsp_podf + 1);
+}
+
ulong imx_get_perclk1(void)
{
u32 freq = imx_get_mcu_main_clk();