Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208569
b: refs/heads/master
c: 81ef806
h: refs/heads/master
i:
  208567: f66cff4
v: v3
  • Loading branch information
Eric Bénard authored and Russell King committed Aug 10, 2010
1 parent c40c812 commit e016691
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 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: 868003ca7ad17ac6c1606dc36101f10a7825b399
refs/heads/master: 81ef806163ebfd4775fc3154e031aad6feaaa192
19 changes: 17 additions & 2 deletions trunk/drivers/video/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
*/
#define DEBUG_VAR 1

#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
(defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) && \
defined(CONFIG_FB_IMX_MODULE))
#define PWMR_BACKLIGHT_AVAILABLE
#endif

#define DRIVER_NAME "imx-fb"

#define LCDC_SSA 0x00
Expand Down Expand Up @@ -175,7 +181,9 @@ struct imxfb_info {

struct imx_fb_videomode *mode;
int num_modes;
#ifdef PWMR_BACKLIGHT_AVAILABLE
struct backlight_device *bl;
#endif

void (*lcd_power)(int);
void (*backlight_power)(int);
Expand Down Expand Up @@ -450,8 +458,7 @@ static int imxfb_set_par(struct fb_info *info)
return 0;
}



#ifdef PWMR_BACKLIGHT_AVAILABLE
static int imxfb_bl_get_brightness(struct backlight_device *bl)
{
struct imxfb_info *fbi = bl_get_data(bl);
Expand Down Expand Up @@ -516,6 +523,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)
if (fbi->bl)
backlight_device_unregister(fbi->bl);
}
#endif

static void imxfb_enable_controller(struct imxfb_info *fbi)
{
Expand Down Expand Up @@ -647,6 +655,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
fbi->regs + LCDC_SIZE);

writel(fbi->pcr, fbi->regs + LCDC_PCR);
#ifndef PWMR_BACKLIGHT_AVAILABLE
writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
#endif
writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
writel(fbi->dmacr, fbi->regs + LCDC_DMACR);

Expand Down Expand Up @@ -847,7 +858,9 @@ static int __init imxfb_probe(struct platform_device *pdev)

imxfb_enable_controller(fbi);
fbi->pdev = pdev;
#ifdef PWMR_BACKLIGHT_AVAILABLE
imxfb_init_backlight(fbi);
#endif

return 0;

Expand Down Expand Up @@ -885,7 +898,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)

imxfb_disable_controller(fbi);

#ifdef PWMR_BACKLIGHT_AVAILABLE
imxfb_exit_backlight(fbi);
#endif
unregister_framebuffer(info);

pdata = pdev->dev.platform_data;
Expand Down

0 comments on commit e016691

Please sign in to comment.