/* Given the specified pixel clock, work out the necessary divider to get close to the output frequency.  */
static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk)
/* Given the specified pixel clock, work out the necessary divider to get close to the output frequency.  */
static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk)
{
	unsigned long clk = clk_get_rate(sfb->bus_clk);
	unsigned long long tmp;
	unsigned int result;
	tmp = (unsigned long long)clk;
	tmp *= pixclk;
	do_div(tmp, 1000000000UL);
	result = (unsigned int)tmp / 1000;
	dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n",
		pixclk, clk, result, clk / result);
	return result;
}