diff options
| author | Johan Hovold <jhovold@gmail.com> | 2013-02-07 10:31:57 -0500 |
|---|---|---|
| committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2013-03-13 06:05:12 -0400 |
| commit | 934a50bd089789d1ed74f0bef4988a97bd590afe (patch) | |
| tree | 2af235ab1cf16bc5cf7f9226e24de746346053d8 /drivers/video/atmel_lcdfb.c | |
| parent | 557b7d5d0787997247a798e6f46541fe9dc977fa (diff) | |
atmel_lcdfb: move lcdcon2 register access to compute_hozval
Pass atmel_lcd_info structure to compute_hozval and only do the register
access on SOCs that actually use it.
This will also simplify the removal of the cpu_is macros.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'drivers/video/atmel_lcdfb.c')
| -rw-r--r-- | drivers/video/atmel_lcdfb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index c5883cafa38a..2effd35da589 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
| @@ -193,14 +193,17 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = { | |||
| 193 | .accel = FB_ACCEL_NONE, | 193 | .accel = FB_ACCEL_NONE, |
| 194 | }; | 194 | }; |
| 195 | 195 | ||
| 196 | static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2) | 196 | static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo, |
| 197 | unsigned long xres) | ||
| 197 | { | 198 | { |
| 199 | unsigned long lcdcon2; | ||
| 198 | unsigned long value; | 200 | unsigned long value; |
| 199 | 201 | ||
| 200 | if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10() | 202 | if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10() |
| 201 | || cpu_is_at32ap7000())) | 203 | || cpu_is_at32ap7000())) |
| 202 | return xres; | 204 | return xres; |
| 203 | 205 | ||
| 206 | lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2); | ||
| 204 | value = xres; | 207 | value = xres; |
| 205 | if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) { | 208 | if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) { |
| 206 | /* STN display */ | 209 | /* STN display */ |
| @@ -591,8 +594,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) | |||
| 591 | lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value); | 594 | lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value); |
| 592 | 595 | ||
| 593 | /* Horizontal value (aka line size) */ | 596 | /* Horizontal value (aka line size) */ |
| 594 | hozval_linesz = compute_hozval(info->var.xres, | 597 | hozval_linesz = compute_hozval(sinfo, info->var.xres); |
| 595 | lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2)); | ||
| 596 | 598 | ||
| 597 | /* Display size */ | 599 | /* Display size */ |
| 598 | value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET; | 600 | value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET; |
