Skip to contentSkip to conversation

Support powering sharp zaurus sl-5500 LCD up and down

PATCH In review Pavel Machek 4 participants 10 messages Jul 27, 2005 – Aug 1, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support powering sharp zaurus sl-5500 LCD up and down

This adds support for powering Zaurus's video up and down. PDA without screen is kind of useless, so it is quite important... I'll have to figure out how to really control the frontlight, because LCD without that is quite hard to read.

drivers/video/backlight/Makefile +1 -0
@@ -3,3 +3,4 @@
 obj-$(CONFIG_LCD_CLASS_DEVICE)     += lcd.o
 obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
 obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_bl.o
+obj-$(CONFIG_SHARP_LOCOMO)	+= locomolcd.o
drivers/video/backlight/locomolcd.c new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#1 lore raw
Quoted 2 lines · Pavel Machek

This adds support for powering Zaurus's video up and down.

I assume you have a new toy ;)

Quoted 4 lines

PDA without
screen is kind of useless, so it is quite important... I'll have to figure out how to really control the frontlight, because LCD without that is quite hard to read.

signed-off-by?

drivers/video/backlight/locomolcd.c line 5

Quoted 6 lines
drivers/video/backlight/locomolcd.c new file +5 -0
@@ -0,0 +1,156 @@
+/*
+ * Backlight control code for Sharp Zaurus SL-5500
+ *
+ * Copyright 2005 John Lenz <[email protected]>
+ * GPL v2

Who is the maintainer for this stuff?

drivers/video/backlight/locomolcd.c line 28

Quoted 1 line
drivers/video/backlight/locomolcd.c new file +1 -0
+static struct locomo_dev *locomolcd_dev = NULL;

bah.

drivers/video/backlight/locomolcd.c line 84

Quoted 6 lines
drivers/video/backlight/locomolcd.c new file +6 -0
+void locomolcd_power(int on)
+{
+	int comadj = 118;
+	unsigned long flags;
+	
+	local_irq_save(flags);

What strange locking this driver uses. It appears to be assuming uniprocessor, yes?

#2 lore raw

Hi!

Quoted 3 lines
Quoted 1 line

This adds support for powering Zaurus's video up and down.

I assume you have a new toy ;)

Actually very old toy, but I decided to make it working with 2.6 kernel (needed for bluetooth). Which is not quite an easy task.

Quoted 6 lines
Quoted 4 lines

PDA without
screen is kind of useless, so it is quite important... I'll have to figure out how to really control the frontlight, because LCD without that is quite hard to read.

signed-off-by?

Sorry, will add.

Quoted 8 lines

drivers/video/backlight/locomolcd.c line 5

Quoted 6 lines
drivers/video/backlight/locomolcd.c new file +5 -0
@@ -0,0 +1,156 @@
+/*
+ * Backlight control code for Sharp Zaurus SL-5500
+ *
+ * Copyright 2005 John Lenz <[email protected]>
+ * GPL v2

Who is the maintainer for this stuff?

I guess I'll maintain in.

Quoted 3 lines

drivers/video/backlight/locomolcd.c line 28

Quoted 1 line
drivers/video/backlight/locomolcd.c new file +1 -0
+static struct locomo_dev *locomolcd_dev = NULL;

bah.

Well, sa1100fb_lcd_power is not provide us with void * we could use, and by definition you only have one frontlight in a PDA, so that should be okay...

Quoted 9 lines

drivers/video/backlight/locomolcd.c line 84

Quoted 6 lines
drivers/video/backlight/locomolcd.c new file +6 -0
+void locomolcd_power(int on)
+{
+	int comadj = 118;
+	unsigned long flags;
+	
+	local_irq_save(flags);

What strange locking this driver uses. It appears to be assuming uniprocessor, yes?

Yes, and I guess that's okay: collie is slightly old hardware, and noone is going to retrofit second CPU to old PDA.

Pavel

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#3 lore raw
Quoted 10 lines · Pavel Machek

Hi!

Quoted 3 lines
Quoted 1 line

This adds support for powering Zaurus's video up and down.

I assume you have a new toy ;)

Actually very old toy, but I decided to make it working with 2.6 kernel (needed for bluetooth). Which is not quite an easy task.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

PDA without
screen is kind of useless, so it is quite important... I'll have to figure out how to really control the frontlight, because LCD without that is quite hard to read.

signed-off-by?

Sorry, will add.

I'll do it.

Quoted 11 lines
Quoted 8 lines

drivers/video/backlight/locomolcd.c line 5

Quoted 6 lines
drivers/video/backlight/locomolcd.c new file +5 -0
@@ -0,0 +1,156 @@
+/*
+ * Backlight control code for Sharp Zaurus SL-5500
+ *
+ * Copyright 2005 John Lenz <[email protected]>
+ * GPL v2

Who is the maintainer for this stuff?

I guess I'll maintain in.

Quoted 7 lines
Quoted 3 lines

drivers/video/backlight/locomolcd.c line 28

Quoted 1 line
drivers/video/backlight/locomolcd.c new file +1 -0
+static struct locomo_dev *locomolcd_dev = NULL;

bah.

Well, sa1100fb_lcd_power is not provide us with void * we could use, and by definition you only have one frontlight in a PDA, so that should be okay...

"bah" means "there's no need to initialise this to NULL".

#4 lore raw

Hi!

Quoted 12 lines
Quoted 12 lines
Quoted 7 lines
Quoted 5 lines

+/*
+ * Backlight control code for Sharp Zaurus SL-5500
+ *
+ * Copyright 2005 John Lenz <[email protected]>
+ * GPL v2

Who is the maintainer for this stuff?

I guess I'll maintain in.

Quoted 2 lines
Quoted 1 line

+static struct locomo_dev *locomolcd_dev = NULL;

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

bah.

Well, sa1100fb_lcd_power is not provide us with void * we could use, and by definition you only have one frontlight in a PDA, so that should be okay...

"bah" means "there's no need to initialise this to NULL".

Okay, that's kind of easier to fix ;-). Done here, it will eventually propagate.
Pavel

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#5 lore raw

PATCH 1/1 Support powering sharp zaurus sl-5500 LCD up and down

In reply to Andrew Morton

This adds support for powering Zaurus's video up and down. PDA without screen is kind of useless, so it is quite important... I'll have to figure out how to really control the frontlight, because LCD without that is quite hard to read.

drivers/video/backlight/Makefile +1 -0
@@ -3,3 +3,4 @@
 obj-$(CONFIG_LCD_CLASS_DEVICE)     += lcd.o
 obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
 obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_bl.o
+obj-$(CONFIG_SHARP_LOCOMO)	+= locomolcd.o
drivers/video/backlight/locomolcd.c new file +157 -0

157 lines not on this page · raw message

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#6 lore raw

drivers/video/backlight/locomolcd.c line 100

Quoted 6 lines · Pavel Machek
drivers/video/backlight/locomolcd.c new file +6 -0
+	/* read comadj */
+#ifdef CONFIG_MACH_POODLE
+	comadj = 118;
+#else
+	comadj = 128;
+#endif

Can you go back to the Sharp source and confirm that these values should be hardcoded in both the poodle and collie cases please? I know the sharpsl_param code can provide them but I can't remember exactly which models use which fields. I want to make sure this isn't a quick hack John made before sharpsl_param was written :).

Thanks,

Richard

#7 lore raw

Hi!

Quoted 4 lines
Quoted 4 lines
(quoted diff) +4 -0
+	/* read comadj */
+#ifdef CONFIG_MACH_POODLE
+	comadj = 118;
+#else
Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	comadj = 128;
+#endif

Can you go back to the Sharp source and confirm that these values should be hardcoded in both the poodle and collie cases please? I know the sharpsl_param code can provide them but I can't remember exactly which models use which fields. I want to make sure this isn't a quick hack John made before sharpsl_param was written :).

Sharp sources are a big mess (as usual), but reading it from sharpsl_param seems to be okay for at least poodle. I'll read it for collie, too, and see what happens... seems to work.

[Not for andrew, yet.]
Pavel

drivers/video/backlight/locomolcd.c +7 -4
@@ -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>
@@ -29,7 +30,7 @@
 
 extern void (*sa1100fb_lcd_power)(int on);
 
-static struct locomo_dev *locomolcd_dev = NULL;
+static struct locomo_dev *locomolcd_dev;
 
 static void locomolcd_on(int comadj)
 {
@@ -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);
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
#8 lore raw
In reply to Richard Purdie
Quoted 13 lines · Richard Purdie

drivers/video/backlight/locomolcd.c line 100

Quoted 6 lines · Pavel Machek
drivers/video/backlight/locomolcd.c new file +6 -0
+	/* read comadj */
+#ifdef CONFIG_MACH_POODLE
+	comadj = 118;
+#else
+	comadj = 128;
+#endif

Can you go back to the Sharp source and confirm that these values should be hardcoded in both the poodle and collie cases please? I know the sharpsl_param code can provide them but I can't remember exactly which models use which fields. I want to make sure this isn't a quick hack John made before sharpsl_param was written :).

No, those values were from the original sharp code... at some point I was going to investigate what values the sharpsl param stuff returned and see if those worked. If the sharpsl stuff works, then by all means use it.

John

#9 lore raw

Hi!

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
drivers/video/backlight/locomolcd.c new file +4 -0
+	/* read comadj */
+#ifdef CONFIG_MACH_POODLE
+	comadj = 118;
+#else
Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	comadj = 128;
+#endif

Can you go back to the Sharp source and confirm that these values should be hardcoded in both the poodle and collie cases please? I know the sharpsl_param code can provide them but I can't remember exactly which models use which fields. I want to make sure this isn't a quick hack John made before sharpsl_param was written :).

Quoted 3 lines

No, those values were from the original sharp code... at some point I was going to investigate what values the sharpsl param stuff returned and see if those worked. If the sharpsl stuff works, then by all means use it.

I added code to read it from sharpsl, if it is not there, I use defaults above. It seems to work on my collie.
Pavel

Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.