ARM: 6281/1: video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
From: Eric Bénard <eric@eukrea.com>
This fixes the following build failure:
drivers/built-in.o: In function `imxfb_probe': mxcmmc.c:(.init.text+0xd04): undefined reference to `backlight_device_register'
drivers/built-in.o: In function `imxfb_remove': mxcmmc.c:(.devexit.text+0x44): undefined reference to `backlight_device_unregister'
that was introduced by
7a2bb23 (imxfb: add pwmr controlled backlight support)
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
committed by
Russell King
parent
868003ca7a
commit
81ef806163
+17
-2
@@ -40,6 +40,12 @@
|
|||||||
*/
|
*/
|
||||||
#define DEBUG_VAR 1
|
#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 DRIVER_NAME "imx-fb"
|
||||||
|
|
||||||
#define LCDC_SSA 0x00
|
#define LCDC_SSA 0x00
|
||||||
@@ -175,7 +181,9 @@ struct imxfb_info {
|
|||||||
|
|
||||||
struct imx_fb_videomode *mode;
|
struct imx_fb_videomode *mode;
|
||||||
int num_modes;
|
int num_modes;
|
||||||
|
#ifdef PWMR_BACKLIGHT_AVAILABLE
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
|
#endif
|
||||||
|
|
||||||
void (*lcd_power)(int);
|
void (*lcd_power)(int);
|
||||||
void (*backlight_power)(int);
|
void (*backlight_power)(int);
|
||||||
@@ -450,8 +458,7 @@ static int imxfb_set_par(struct fb_info *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PWMR_BACKLIGHT_AVAILABLE
|
||||||
|
|
||||||
static int imxfb_bl_get_brightness(struct backlight_device *bl)
|
static int imxfb_bl_get_brightness(struct backlight_device *bl)
|
||||||
{
|
{
|
||||||
struct imxfb_info *fbi = bl_get_data(bl);
|
struct imxfb_info *fbi = bl_get_data(bl);
|
||||||
@@ -516,6 +523,7 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)
|
|||||||
if (fbi->bl)
|
if (fbi->bl)
|
||||||
backlight_device_unregister(fbi->bl);
|
backlight_device_unregister(fbi->bl);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void imxfb_enable_controller(struct imxfb_info *fbi)
|
static void imxfb_enable_controller(struct imxfb_info *fbi)
|
||||||
{
|
{
|
||||||
@@ -647,6 +655,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
|
|||||||
fbi->regs + LCDC_SIZE);
|
fbi->regs + LCDC_SIZE);
|
||||||
|
|
||||||
writel(fbi->pcr, fbi->regs + LCDC_PCR);
|
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->lscr1, fbi->regs + LCDC_LSCR1);
|
||||||
writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
|
writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
|
||||||
|
|
||||||
@@ -847,7 +858,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
imxfb_enable_controller(fbi);
|
imxfb_enable_controller(fbi);
|
||||||
fbi->pdev = pdev;
|
fbi->pdev = pdev;
|
||||||
|
#ifdef PWMR_BACKLIGHT_AVAILABLE
|
||||||
imxfb_init_backlight(fbi);
|
imxfb_init_backlight(fbi);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -885,7 +898,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
|
|||||||
|
|
||||||
imxfb_disable_controller(fbi);
|
imxfb_disable_controller(fbi);
|
||||||
|
|
||||||
|
#ifdef PWMR_BACKLIGHT_AVAILABLE
|
||||||
imxfb_exit_backlight(fbi);
|
imxfb_exit_backlight(fbi);
|
||||||
|
#endif
|
||||||
unregister_framebuffer(info);
|
unregister_framebuffer(info);
|
||||||
|
|
||||||
pdata = pdev->dev.platform_data;
|
pdata = pdev->dev.platform_data;
|
||||||
|
|||||||
Reference in New Issue
Block a user