Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168573
b: refs/heads/master
c: 431861c
h: refs/heads/master
i:
  168571: bca4135
v: v3
  • Loading branch information
Nicolas Ferre authored and Linus Torvalds committed Nov 12, 2009
1 parent e98032d commit 90e42dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7779d7bed950a7fb1af4f540c2f82a6b81b65901
refs/heads/master: 431861cfab0c8613f83bac0f41dae22ff74f9bc1
11 changes: 8 additions & 3 deletions trunk/drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
unsigned long value;
unsigned long clk_value_khz;
unsigned long bits_per_line;
unsigned long pix_factor = 2;

might_sleep();

Expand Down Expand Up @@ -516,20 +517,24 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
/* Now, the LCDC core... */

/* Set pixel clock */
if (cpu_is_at91sam9g45() && !cpu_is_at91sam9g45es())
pix_factor = 1;

clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;

value = DIV_ROUND_UP(clk_value_khz, PICOS2KHZ(info->var.pixclock));

if (value < 2) {
if (value < pix_factor) {
dev_notice(info->device, "Bypassing pixel clock divider\n");
lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS);
} else {
value = (value / 2) - 1;
value = (value / pix_factor) - 1;
dev_dbg(info->device, " * programming CLKVAL = 0x%08lx\n",
value);
lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1,
value << ATMEL_LCDC_CLKVAL_OFFSET);
info->var.pixclock = KHZ2PICOS(clk_value_khz / (2 * (value + 1)));
info->var.pixclock =
KHZ2PICOS(clk_value_khz / (pix_factor * (value + 1)));
dev_dbg(info->device, " updated pixclk: %lu KHz\n",
PICOS2KHZ(info->var.pixclock));
}
Expand Down

0 comments on commit 90e42dc

Please sign in to comment.