diff options
Diffstat (limited to 'drivers/video/imxfb.c')
-rw-r--r-- | drivers/video/imxfb.c | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 5c363d026f64..f135dbead07d 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -53,11 +53,8 @@ | |||
53 | #define LCDC_SIZE 0x04 | 53 | #define LCDC_SIZE 0x04 |
54 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) | 54 | #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) |
55 | 55 | ||
56 | #ifdef CONFIG_ARCH_MX1 | 56 | #define YMAX_MASK (cpu_is_mx1() ? 0x1ff : 0x3ff) |
57 | #define SIZE_YMAX(y) ((y) & 0x1ff) | 57 | #define SIZE_YMAX(y) ((y) & YMAX_MASK) |
58 | #else | ||
59 | #define SIZE_YMAX(y) ((y) & 0x3ff) | ||
60 | #endif | ||
61 | 58 | ||
62 | #define LCDC_VPW 0x08 | 59 | #define LCDC_VPW 0x08 |
63 | #define VPW_VPW(x) ((x) & 0x3ff) | 60 | #define VPW_VPW(x) ((x) & 0x3ff) |
@@ -68,12 +65,6 @@ | |||
68 | #define CPOS_OP (1<<28) | 65 | #define CPOS_OP (1<<28) |
69 | #define CPOS_CXP(x) (((x) & 3ff) << 16) | 66 | #define CPOS_CXP(x) (((x) & 3ff) << 16) |
70 | 67 | ||
71 | #ifdef CONFIG_ARCH_MX1 | ||
72 | #define CPOS_CYP(y) ((y) & 0x1ff) | ||
73 | #else | ||
74 | #define CPOS_CYP(y) ((y) & 0x3ff) | ||
75 | #endif | ||
76 | |||
77 | #define LCDC_LCWHB 0x10 | 68 | #define LCDC_LCWHB 0x10 |
78 | #define LCWHB_BK_EN (1<<31) | 69 | #define LCWHB_BK_EN (1<<31) |
79 | #define LCWHB_CW(w) (((w) & 0x1f) << 24) | 70 | #define LCWHB_CW(w) (((w) & 0x1f) << 24) |
@@ -82,16 +73,6 @@ | |||
82 | 73 | ||
83 | #define LCDC_LCHCC 0x14 | 74 | #define LCDC_LCHCC 0x14 |
84 | 75 | ||
85 | #ifdef CONFIG_ARCH_MX1 | ||
86 | #define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11) | ||
87 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5) | ||
88 | #define LCHCC_CUR_COL_B(b) ((b) & 0x1f) | ||
89 | #else | ||
90 | #define LCHCC_CUR_COL_R(r) (((r) & 0x3f) << 12) | ||
91 | #define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 6) | ||
92 | #define LCHCC_CUR_COL_B(b) ((b) & 0x3f) | ||
93 | #endif | ||
94 | |||
95 | #define LCDC_PCR 0x18 | 76 | #define LCDC_PCR 0x18 |
96 | 77 | ||
97 | #define LCDC_HCR 0x1C | 78 | #define LCDC_HCR 0x1C |
@@ -118,11 +99,7 @@ | |||
118 | 99 | ||
119 | #define LCDC_RMCR 0x34 | 100 | #define LCDC_RMCR 0x34 |
120 | 101 | ||
121 | #ifdef CONFIG_ARCH_MX1 | 102 | #define RMCR_LCDC_EN_MX1 (1<<1) |
122 | #define RMCR_LCDC_EN (1<<1) | ||
123 | #else | ||
124 | #define RMCR_LCDC_EN 0 | ||
125 | #endif | ||
126 | 103 | ||
127 | #define RMCR_SELF_REF (1<<0) | 104 | #define RMCR_SELF_REF (1<<0) |
128 | 105 | ||
@@ -502,6 +479,7 @@ static void imxfb_init_backlight(struct imxfb_info *fbi) | |||
502 | 479 | ||
503 | memset(&props, 0, sizeof(struct backlight_properties)); | 480 | memset(&props, 0, sizeof(struct backlight_properties)); |
504 | props.max_brightness = 0xff; | 481 | props.max_brightness = 0xff; |
482 | props.type = BACKLIGHT_RAW; | ||
505 | writel(fbi->pwmr, fbi->regs + LCDC_PWMR); | 483 | writel(fbi->pwmr, fbi->regs + LCDC_PWMR); |
506 | 484 | ||
507 | bl = backlight_device_register("imxfb-bl", &fbi->pdev->dev, fbi, | 485 | bl = backlight_device_register("imxfb-bl", &fbi->pdev->dev, fbi, |
@@ -538,7 +516,11 @@ static void imxfb_enable_controller(struct imxfb_info *fbi) | |||
538 | writel(readl(fbi->regs + LCDC_CPOS) & ~(CPOS_CC0 | CPOS_CC1), | 516 | writel(readl(fbi->regs + LCDC_CPOS) & ~(CPOS_CC0 | CPOS_CC1), |
539 | fbi->regs + LCDC_CPOS); | 517 | fbi->regs + LCDC_CPOS); |
540 | 518 | ||
541 | writel(RMCR_LCDC_EN, fbi->regs + LCDC_RMCR); | 519 | /* |
520 | * RMCR_LCDC_EN_MX1 is present on i.MX1 only, but doesn't hurt | ||
521 | * on other SoCs | ||
522 | */ | ||
523 | writel(RMCR_LCDC_EN_MX1, fbi->regs + LCDC_RMCR); | ||
542 | 524 | ||
543 | clk_enable(fbi->clk); | 525 | clk_enable(fbi->clk); |
544 | 526 | ||
@@ -623,7 +605,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf | |||
623 | if (var->right_margin > 255) | 605 | if (var->right_margin > 255) |
624 | printk(KERN_ERR "%s: invalid right_margin %d\n", | 606 | printk(KERN_ERR "%s: invalid right_margin %d\n", |
625 | info->fix.id, var->right_margin); | 607 | info->fix.id, var->right_margin); |
626 | if (var->yres < 1 || var->yres > 511) | 608 | if (var->yres < 1 || var->yres > YMAX_MASK) |
627 | printk(KERN_ERR "%s: invalid yres %d\n", | 609 | printk(KERN_ERR "%s: invalid yres %d\n", |
628 | info->fix.id, var->yres); | 610 | info->fix.id, var->yres); |
629 | if (var->vsync_len > 100) | 611 | if (var->vsync_len > 100) |
@@ -874,10 +856,10 @@ failed_platform_init: | |||
874 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, | 856 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, |
875 | fbi->map_dma); | 857 | fbi->map_dma); |
876 | failed_map: | 858 | failed_map: |
877 | clk_put(fbi->clk); | ||
878 | failed_getclock: | ||
879 | iounmap(fbi->regs); | 859 | iounmap(fbi->regs); |
880 | failed_ioremap: | 860 | failed_ioremap: |
861 | clk_put(fbi->clk); | ||
862 | failed_getclock: | ||
881 | release_mem_region(res->start, resource_size(res)); | 863 | release_mem_region(res->start, resource_size(res)); |
882 | failed_req: | 864 | failed_req: |
883 | kfree(info->pseudo_palette); | 865 | kfree(info->pseudo_palette); |
@@ -977,6 +959,6 @@ static void __exit imxfb_cleanup(void) | |||
977 | module_init(imxfb_init); | 959 | module_init(imxfb_init); |
978 | module_exit(imxfb_cleanup); | 960 | module_exit(imxfb_cleanup); |
979 | 961 | ||
980 | MODULE_DESCRIPTION("Motorola i.MX framebuffer driver"); | 962 | MODULE_DESCRIPTION("Freescale i.MX framebuffer driver"); |
981 | MODULE_AUTHOR("Sascha Hauer, Pengutronix"); | 963 | MODULE_AUTHOR("Sascha Hauer, Pengutronix"); |
982 | MODULE_LICENSE("GPL"); | 964 | MODULE_LICENSE("GPL"); |