The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [patch] fix hardcoded values in collie frontlight
@ 2006-03-05 14:28 Pavel Machek
  2006-03-05 19:46 ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2006-03-05 14:28 UTC (permalink / raw)
  To: Andrew Morton, rpurdie, lenz, kernel list, Russell King

In frontlight support, we should really use values from flash-ROM
instead of hardcoding our own.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index ada6e75..2bcff84 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -20,6 +20,7 @@
 
 #include <asm/hardware/locomo.h>
 #include <asm/irq.h>
+#include <asm/mach/sharpsl_param.h>
 
 #ifdef CONFIG_SA1100_COLLIE
 #include <asm/arch/collie.h>
@@ -27,7 +28,7 @@
 #include <asm/arch/poodle.h>
 #endif
 
-extern void (*sa1100fb_lcd_power)(int on);
+#include "../../../arch/arm/mach-sa1100/generic.h"
 
 static struct locomo_dev *locomolcd_dev;
 
@@ -82,7 +83,7 @@ static void locomolcd_off(int comadj)
 
 void locomolcd_power(int on)
 {
-	int comadj = 118;
+	int comadj = sharpsl_param.comadj;
 	unsigned long flags;
 
 	local_irq_save(flags);
@@ -93,11 +94,13 @@ void locomolcd_power(int on)
 	}
 
 	/* read comadj */
+	if (comadj == -1) {
 #ifdef CONFIG_MACH_POODLE
-	comadj = 118;
+		comadj = 118;
 #else
-	comadj = 128;
+		comadj = 128;
 #endif
+	}
 
 	if (on)
 		locomolcd_on(comadj);

-- 
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch] fix hardcoded values in collie frontlight
  2006-03-05 14:28 [patch] fix hardcoded values in collie frontlight Pavel Machek
@ 2006-03-05 19:46 ` Richard Purdie
  2006-03-06 11:56   ` Pavel Machek
  2006-03-06 11:57   ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Purdie @ 2006-03-05 19:46 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, lenz, kernel list, Russell King

On Sun, 2006-03-05 at 15:28 +0100, Pavel Machek wrote: 
> In frontlight support, we should really use values from flash-ROM
> instead of hardcoding our own.
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
> index ada6e75..2bcff84 100644
> --- a/drivers/video/backlight/locomolcd.c
> +++ b/drivers/video/backlight/locomolcd.c
> @@ -27,7 +28,7 @@
>  #include <asm/arch/poodle.h>
>  #endif
>  
> -extern void (*sa1100fb_lcd_power)(int on);
> +#include "../../../arch/arm/mach-sa1100/generic.h"

This would be neater if that was in some more accessible header in
asm/arch. I'm not sure which header that would be though. Russell?

> @@ -93,11 +94,13 @@ void locomolcd_power(int on)
>  	}
>  
>  	/* read comadj */
> +	if (comadj == -1) {
>  #ifdef CONFIG_MACH_POODLE
> -	comadj = 118;
> +		comadj = 118;
>  #else
> -	comadj = 128;
> +		comadj = 128;
>  #endif
> +	}

Perhaps use machine_is_poodle() and machine_is_collie() here?

I agree with the changes in principle though.

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] fix hardcoded values in collie frontlight
  2006-03-05 19:46 ` Richard Purdie
@ 2006-03-06 11:56   ` Pavel Machek
  2006-03-06 11:57   ` Pavel Machek
  1 sibling, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2006-03-06 11:56 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Andrew Morton, lenz, kernel list, Russell King

> > @@ -93,11 +94,13 @@ void locomolcd_power(int on)
> >  	}
> >  
> >  	/* read comadj */
> > +	if (comadj == -1) {
> >  #ifdef CONFIG_MACH_POODLE
> > -	comadj = 118;
> > +		comadj = 118;
> >  #else
> > -	comadj = 128;
> > +		comadj = 128;
> >  #endif
> > +	}
> 
> Perhaps use machine_is_poodle() and machine_is_collie() here?

Yep, and unneccesssary includes can be killed. Thanks.
								Pavel

-- 
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [patch] fix hardcoded values in collie frontlight
  2006-03-05 19:46 ` Richard Purdie
  2006-03-06 11:56   ` Pavel Machek
@ 2006-03-06 11:57   ` Pavel Machek
  2006-03-06 17:10     ` Richard Purdie
  1 sibling, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2006-03-06 11:57 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Andrew Morton, lenz, kernel list, Russell King

In frontlight support, we should really use values from flash-ROM
instead of hardcoding our own. Cleanup includes.

Signed-off-by: Pavel Machek <pavel@suse.cz>

--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -20,14 +20,10 @@
 
 #include <asm/hardware/locomo.h>
 #include <asm/irq.h>
+#include <asm/mach/sharpsl_param.h>
+#include <asm/mach-types.h>
 
-#ifdef CONFIG_SA1100_COLLIE
-#include <asm/arch/collie.h>
-#else
-#include <asm/arch/poodle.h>
-#endif
-
-extern void (*sa1100fb_lcd_power)(int on);
+#include "../../../arch/arm/mach-sa1100/generic.h"
 
 static struct locomo_dev *locomolcd_dev;
 
@@ -82,7 +78,7 @@ static void locomolcd_off(int comadj)
 
 void locomolcd_power(int on)
 {
-	int comadj = 118;
+	int comadj = sharpsl_param.comadj;
 	unsigned long flags;
 
 	local_irq_save(flags);
@@ -93,11 +89,12 @@ void locomolcd_power(int on)
 	}
 
 	/* read comadj */
-#ifdef CONFIG_MACH_POODLE
-	comadj = 118;
-#else
-	comadj = 128;
-#endif
+	if (comadj == -1) {
+		if (machine_is_poodle())
+			comadj = 118;
+		if (machine_is_collie())
+			comadj = 128;
+	}
 
 	if (on)
 		locomolcd_on(comadj);


-- 
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] fix hardcoded values in collie frontlight
  2006-03-06 11:57   ` Pavel Machek
@ 2006-03-06 17:10     ` Richard Purdie
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2006-03-06 17:10 UTC (permalink / raw)
  To: Pavel Machek, Russell King; +Cc: Andrew Morton, lenz, kernel list

On Mon, 2006-03-06 at 12:57 +0100, Pavel Machek wrote:
> In frontlight support, we should really use values from flash-ROM
> instead of hardcoding our own. Cleanup includes.
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
> 
> --- a/drivers/video/backlight/locomolcd.c
> +++ b/drivers/video/backlight/locomolcd.c
> @@ -20,14 +20,10 @@
>  
>  #include <asm/hardware/locomo.h>
>  #include <asm/irq.h>
> +#include <asm/mach/sharpsl_param.h>
> +#include <asm/mach-types.h>
>  
> -#ifdef CONFIG_SA1100_COLLIE
> -#include <asm/arch/collie.h>
> -#else
> -#include <asm/arch/poodle.h>
> -#endif
> -
> -extern void (*sa1100fb_lcd_power)(int on);
> +#include "../../../arch/arm/mach-sa1100/generic.h"
>  
>  static struct locomo_dev *locomolcd_dev;
>  
> @@ -82,7 +78,7 @@ static void locomolcd_off(int comadj)
>  
>  void locomolcd_power(int on)
>  {
> -	int comadj = 118;
> +	int comadj = sharpsl_param.comadj;
>  	unsigned long flags;
>  
>  	local_irq_save(flags);
> @@ -93,11 +89,12 @@ void locomolcd_power(int on)
>  	}
>  
>  	/* read comadj */
> -#ifdef CONFIG_MACH_POODLE
> -	comadj = 118;
> -#else
> -	comadj = 128;
> -#endif
> +	if (comadj == -1) {
> +		if (machine_is_poodle())
> +			comadj = 118;
> +		if (machine_is_collie())
> +			comadj = 128;
> +	}
>  
>  	if (on)
>  		locomolcd_on(comadj);
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-06 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-05 14:28 [patch] fix hardcoded values in collie frontlight Pavel Machek
2006-03-05 19:46 ` Richard Purdie
2006-03-06 11:56   ` Pavel Machek
2006-03-06 11:57   ` Pavel Machek
2006-03-06 17:10     ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox