X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Fchipsfb.c;fp=drivers%2Fvideo%2Fchipsfb.c;h=73cb426bf2d7db5428ecb348da4b3fc112d2704c;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=72ff6bf75e5ed8cbabc87d83f882b77702fafa7a;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c index 72ff6bf75..73cb426bf 100644 --- a/drivers/video/chipsfb.c +++ b/drivers/video/chipsfb.c @@ -14,13 +14,11 @@ * more details. */ -#include #include #include #include #include #include -#include #include #include #include @@ -148,9 +146,23 @@ static int chipsfb_set_par(struct fb_info *info) static int chipsfb_blank(int blank, struct fb_info *info) { #ifdef CONFIG_PMAC_BACKLIGHT - // used to disable backlight only for blank > 1, but it seems - // useful at blank = 1 too (saves battery, extends backlight life) - set_backlight_enable(!blank); + mutex_lock(&pmac_backlight_mutex); + + if (pmac_backlight) { + /* used to disable backlight only for blank > 1, but it seems + * useful at blank = 1 too (saves battery, extends backlight + * life) + */ + down(&pmac_backlight->sem); + if (blank) + pmac_backlight->props->power = FB_BLANK_POWERDOWN; + else + pmac_backlight->props->power = FB_BLANK_UNBLANK; + pmac_backlight->props->update_status(pmac_backlight); + up(&pmac_backlight->sem); + } + + mutex_unlock(&pmac_backlight_mutex); #endif /* CONFIG_PMAC_BACKLIGHT */ return 1; /* get fb_blank to set the colormap to all black */ @@ -401,7 +413,14 @@ chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) #ifdef CONFIG_PMAC_BACKLIGHT /* turn on the backlight */ - set_backlight_enable(1); + mutex_lock(&pmac_backlight_mutex); + if (pmac_backlight) { + down(&pmac_backlight->sem); + pmac_backlight->props->power = FB_BLANK_UNBLANK; + pmac_backlight->props->update_status(pmac_backlight); + up(&pmac_backlight->sem); + } + mutex_unlock(&pmac_backlight_mutex); #endif /* CONFIG_PMAC_BACKLIGHT */ #ifdef CONFIG_PPC