kernel-ark/arch
Uwe Kleine-König f61b9fc27e ARM: mxs/clock-mx28: fix up name##_set_rate
For the lcdif clock get_rate looks as follows:

	read div from HW_CLKCTRL_DIS_LCDIF.DIV
	return clk_get_rate(clk->parent) / div

with clk->parent being ref_pix_clk on my system.

ref_pix_clk's rate depends on HW_CLKCTRL_FRAC1.PIXFRAC.

The set_rate function for lcdif does:

	parent_rate = clk_get_rate(clk->parent);
	based on that calculate frac and div such that
	  parent_rate * 18 / frac / div is near the requested rate.
	HW_CLKCTRL_FRAC1.PIXFRAC is updated with frac
	HW_CLKCTRL_DIS_LCDIF.DIV is updated with div

For this calculation to be correct parent_rate needs to be
initialized not with the clock rate of lcdif's parent (i.e. ref_pix) but
that of its grandparent (i.e. ref_pix' parent == pll0_clk).

The obvious downside of this patch is that now set_rate(lcdif) changes
its parent's rate, too.  Still this is better than a wrong rate.

Acked-by: Shawn Guo <shawn.guo@freescale.com>
LAKML-Reference: 20110225084950.GA13684@S2101-09.ap.freescale.net
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:48:02 +02:00
..
alpha genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
arm ARM: mxs/clock-mx28: fix up name##_set_rate 2011-04-12 09:48:02 +02:00
avr32 avr32: Fix missing irq namespace conversion 2011-03-30 15:38:03 +02:00
blackfin Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-03-30 09:35:52 -07:00
cris genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
frv genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
h8300 genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
ia64 [IA64] fix build warning: argument 1 of 'irqd_irq_disabled' 2011-04-01 10:56:03 -07:00
m32r genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
m68k genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2011-04-04 17:54:46 -07:00
mips mips: vr41xx: Use irdq_irq_disabled() 2011-03-29 14:48:07 +02:00
mn10300 genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
parisc genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
powerpc powerpc/pseries: Fix build without CONFIG_HOTPLUG_CPU 2011-04-05 16:22:11 +10:00
s390 Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2011-03-25 17:47:04 -07:00
score genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
sh genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2011-04-01 08:54:14 -07:00
tile genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
um genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
unicore32 Merge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32 2011-04-04 08:33:21 -07:00
x86 Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-04-04 08:37:45 -07:00
xtensa genirq: Remove the now obsolete config options and select statements 2011-03-30 14:13:23 +02:00
.gitignore
Kconfig oprofile, s390: Cleanups 2011-03-16 14:30:40 +01:00