/* The code in this function is based on the code from  */
unsigned long lcd_clk_get_rate(struct clk *clk)
/* The code in this function is based on the code from  */
unsigned long lcd_clk_get_rate(struct clk *clk)
{
	u32 tmp, div, rate;
	tmp = __raw_readl(LPC178X_LCD_BASE + CLCD_TIM2);
	rate = lpc178x_clock_get(CLOCK_CCLK);
	if (!(tmp & TIM2_BCD)) {
		div = (tmp & 0x1F) | ((tmp & 0xF8) >> 22);
		rate /= (2 + div);
	}
	return rate;
}