* [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
@ 2010-07-29 8:42 Eric Bénard
0 siblings, 0 replies; 4+ messages in thread
From: Eric Bénard @ 2010-07-29 8:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric B?nard <eric@eukrea.com>
---
drivers/video/imxfb.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 43f0639..0c2fb4d 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -175,7 +175,9 @@ struct imxfb_info {
struct imx_fb_videomode *mode;
int num_modes;
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct backlight_device *bl;
+#endif
void (*lcd_power)(int);
void (*backlight_power)(int);
@@ -450,8 +452,7 @@ static int imxfb_set_par(struct fb_info *info)
return 0;
}
-
-
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
static int imxfb_bl_get_brightness(struct backlight_device *bl)
{
struct imxfb_info *fbi = bl_get_data(bl);
@@ -516,6 +517,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)
{
@@ -647,6 +649,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 CONFIG_BACKLIGHT_CLASS_DEVICE
+ writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
+#endif
writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
@@ -847,7 +852,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
imxfb_enable_controller(fbi);
fbi->pdev = pdev;
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
imxfb_init_backlight(fbi);
+#endif
return 0;
@@ -885,7 +892,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
imxfb_disable_controller(fbi);
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
imxfb_exit_backlight(fbi);
+#endif
unregister_framebuffer(info);
pdata = pdev->dev.platform_data;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
@ 2010-07-29 15:01 Uwe Kleine-König
2010-08-02 7:39 ` [PATCH] " Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-07-29 15:01 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Thu, Jul 29, 2010 at 04:17:34PM +0200, Eric B?nard wrote:
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> ---
> v4: fix typo in CONFIG_FB_IMX_MODULE
> v3: handle CONFIG_BACKLIGHT_CLASS_DEVICE=m & CONFIG_FB_IMX=y case as per
> suggested by Uwe
> v2: handle CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
looks ok to me now (though I didn't compile test).
(i.e. something like:
Reported-and-Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
)
Sascha, can you please take this.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
2010-07-29 15:01 [PATCH v4] " Uwe Kleine-König
@ 2010-08-02 7:39 ` Uwe Kleine-König
0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2010-08-02 7:39 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
KernelVersion: v2.6.35-rc1-118-g7a2bb23
drivers/video/imxfb.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 43f0639..5c363d0 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -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
@@ -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);
@@ -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);
@@ -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)
{
@@ -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);
@@ -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;
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] imxfb: add pwmr controlled backlight support
@ 2010-07-29 5:16 Uwe Kleine-König
2010-07-29 8:42 ` [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE Eric Bénard
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-07-29 5:16 UTC (permalink / raw)
To: linux-arm-kernel
Hello Eric,
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> ---
> v2 : updated to use backlight infrastructure
this should have a dependency on CONFIG_BACKLIGHT_CLASS_DEVICE. As
Sascha already took your patch you can just try to build mx27_defconfig
on his for-rmk branch :-|
Instead of a dependency I would prefer to have imxfb usable without
CONFIG_BACKLIGHT_CLASS_DEVICE. From a quick look there are drivers that
have that. (I checked drivers/video/sa1100fb.c +
drivers/video/backlight/locomolcd.c.)
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
2010-07-29 5:16 [PATCH 3/3] imxfb: add pwmr controlled backlight support Uwe Kleine-König
@ 2010-07-29 8:42 ` Eric Bénard
2010-07-29 9:11 ` Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Eric Bénard @ 2010-07-29 8:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Eric B?nard <eric@eukrea.com>
---
drivers/video/imxfb.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 43f0639..0c2fb4d 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -175,7 +175,9 @@ struct imxfb_info {
struct imx_fb_videomode *mode;
int num_modes;
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct backlight_device *bl;
+#endif
void (*lcd_power)(int);
void (*backlight_power)(int);
@@ -450,8 +452,7 @@ static int imxfb_set_par(struct fb_info *info)
return 0;
}
-
-
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
static int imxfb_bl_get_brightness(struct backlight_device *bl)
{
struct imxfb_info *fbi = bl_get_data(bl);
@@ -516,6 +517,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)
{
@@ -647,6 +649,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 CONFIG_BACKLIGHT_CLASS_DEVICE
+ writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
+#endif
writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
@@ -847,7 +852,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
imxfb_enable_controller(fbi);
fbi->pdev = pdev;
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
imxfb_init_backlight(fbi);
+#endif
return 0;
@@ -885,7 +892,9 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
imxfb_disable_controller(fbi);
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
imxfb_exit_backlight(fbi);
+#endif
unregister_framebuffer(info);
pdata = pdev->dev.platform_data;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE
2010-07-29 8:42 ` [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE Eric Bénard
@ 2010-07-29 9:11 ` Uwe Kleine-König
0 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2010-07-29 9:11 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jul 29, 2010 at 10:42:58AM +0200, Eric B?nard wrote:
> Signed-off-by: Eric B?nard <eric@eukrea.com>
> ---
> drivers/video/imxfb.c | 13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index 43f0639..0c2fb4d 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -175,7 +175,9 @@ struct imxfb_info {
>
> struct imx_fb_videomode *mode;
> int num_modes;
> +#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
> struct backlight_device *bl;
> +#endif
I'm always unsure about these .._MODULE symbols. If imxfb and backlight
support both are compiled modular, is backlight support picked up if
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE is used to guard it?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-02 7:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 8:42 [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE Eric Bénard
-- strict thread matches above, loose matches on Subject: below --
2010-07-29 15:01 [PATCH v4] " Uwe Kleine-König
2010-08-02 7:39 ` [PATCH] " Uwe Kleine-König
2010-07-29 5:16 [PATCH 3/3] imxfb: add pwmr controlled backlight support Uwe Kleine-König
2010-07-29 8:42 ` [PATCH] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE Eric Bénard
2010-07-29 9:11 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).