* Hook collie frontlight into sysfs
@ 2006-03-30 11:46 Pavel Machek
2006-03-30 22:59 ` Richard Purdie
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2006-03-30 11:46 UTC (permalink / raw)
To: rpurdie, lenz, kernel list, patches
Hook backlight handling into backlight subsystem, so that backlight is
controllable using /sys . I had to shuffle code around a bit in order
to avoid prototypes.
Signed-off-by: Pavel Machek <pavel@suse.cz>
PATCH FOLLOWS
KernelVersion: 2.6.16-git
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index a7dc137..8c53ebc 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -507,7 +507,7 @@ locomo_init_one_child(struct locomo *lch
goto out;
}
- strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id));
+ strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
/*
* If the parent device has a DMA mask associated with it,
* propagate it down to the children.
@@ -629,21 +629,6 @@ static int locomo_resume(struct platform
#endif
-#define LCM_ALC_EN 0x8000
-
-void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&lchip->lock, flags);
- locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
- udelay(100);
- locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
- locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
- spin_unlock_irqrestore(&lchip->lock, flags);
-}
-
-
/**
* locomo_probe - probe for a single LoCoMo chip.
* @phys_addr: physical address of device.
@@ -698,14 +683,10 @@ __locomo_probe(struct device *me, struct
, lchip->base + LOCOMO_GPD);
locomo_writel(0, lchip->base + LOCOMO_GIE);
- /* FrontLight */
+ /* Frontlight */
locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
- /* Same constants can be used for collie and poodle
- (depending on CONFIG options in original sharp code)? */
- frontlight_set(lchip, 163, 0, 148);
-
/* Longtime timer */
locomo_writel(0, lchip->base + LOCOMO_LTINT);
/* SPI */
@@ -749,7 +730,6 @@ __locomo_probe(struct device *me, struct
for (i = 0; i < ARRAY_SIZE(locomo_devices); i++)
locomo_init_one_child(lchip, &locomo_devices[i]);
-
return 0;
out:
@@ -1063,6 +1043,25 @@ void locomo_m62332_senddata(struct locom
}
/*
+ * Frontlight control
+ */
+
+static struct locomo *locomo_chip_driver(struct locomo_dev *ldev);
+
+void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf)
+{
+ unsigned long flags;
+ struct locomo *lchip = locomo_chip_driver(dev);
+
+ spin_lock_irqsave(&lchip->lock, flags);
+ locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
+ udelay(100);
+ locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+ locomo_writel(bpwf | LOCOMO_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
+ spin_unlock_irqrestore(&lchip->lock, flags);
+}
+
+/*
* LoCoMo "Register Access Bus."
*
* We model this as a regular bus type, and hang devices directly
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index 60831bb..a95cd25 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/interrupt.h>
+#include <linux/backlight.h>
#include <asm/hardware/locomo.h>
#include <asm/irq.h>
@@ -105,6 +106,38 @@ void locomolcd_power(int on)
}
EXPORT_SYMBOL(locomolcd_power);
+
+static int current_intensity;
+
+static int set_intensity(struct backlight_device *bd, int intensity)
+{
+ switch (intensity) {
+ /* AC and non-AC are handled differently, but produce same results in sharp code? */
+ case 0: locomo_frontlight_set(locomolcd_dev, 0, 0, 161); break;
+ case 1: locomo_frontlight_set(locomolcd_dev, 117, 0, 161); break;
+ case 2: locomo_frontlight_set(locomolcd_dev, 163, 0, 148); break;
+ case 3: locomo_frontlight_set(locomolcd_dev, 194, 0, 161); break;
+ case 4: locomo_frontlight_set(locomolcd_dev, 194, 1, 161); break;
+
+ default:
+ locomo_frontlight_set(locomolcd_dev, intensity, 0, 148); break;
+ }
+ current_intensity = intensity;
+ return 0;
+}
+
+static int get_intensity(struct backlight_device *bd)
+{
+ return current_intensity;
+}
+
+static struct backlight_properties locomobl_data = {
+ .owner = THIS_MODULE,
+ .get_brightness = get_intensity,
+ .set_brightness = set_intensity,
+ .max_brightness = 5,
+};
+
static int poodle_lcd_probe(struct locomo_dev *dev)
{
unsigned long flags;
@@ -112,6 +145,9 @@ static int poodle_lcd_probe(struct locom
local_irq_save(flags);
locomolcd_dev = dev;
+ /* Set up frontlight so that screen is readable */
+ set_intensity(NULL, 2);
+
/* the poodle_lcd_power function is called for the first time
* from fs_initcall, which is before locomo is activated.
* We need to recall poodle_lcd_power here*/
@@ -147,8 +183,13 @@ static int __init poodle_lcd_init(void)
#ifdef CONFIG_SA1100_COLLIE
sa1100fb_lcd_power = locomolcd_power;
+
+ backlight_device_register("collie-bl", NULL, &locomobl_data);
#endif
return 0;
}
device_initcall(poodle_lcd_init);
+MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>, Pavel Machek <pavel@suse.cz>");
+MODULE_DESCRIPTION("Collie LCD driver");
+MODULE_LICENSE("GPL");
--- a/include/asm-arm/hardware/locomo.h
+++ b/include/asm-arm/hardware/locomo.h
@@ -203,4 +203,7 @@ void locomo_gpio_write(struct locomo_dev
/* M62332 control function */
void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
+/* Frontlight control */
+void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
+
#endif
--
Picture of sleeping (Linux) penguin wanted...
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: Hook collie frontlight into sysfs
2006-03-30 11:46 Hook collie frontlight into sysfs Pavel Machek
@ 2006-03-30 22:59 ` Richard Purdie
2006-03-30 23:30 ` Pavel Machek
0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2006-03-30 22:59 UTC (permalink / raw)
To: Pavel Machek; +Cc: lenz, kernel list, patches, Bompart Cedric
On Thu, 2006-03-30 at 13:46 +0200, Pavel Machek wrote:
> Hook backlight handling into backlight subsystem, so that backlight is
> controllable using /sys . I had to shuffle code around a bit in order
> to avoid prototypes.
Hi Pavel,
There are a few issues with this. Firstly,
CC arch/arm/common/locomo.o
arch/arm/common/locomo.c: In function `locomo_frontlight_set':
arch/arm/common/locomo.c:1061: error: `LOCOMO_ALC_EN' undeclared (first use in this function)
arch/arm/common/locomo.c:1061: error: (Each undeclared identifier is reported only once
arch/arm/common/locomo.c:1061: error: for each function it appears in.)
make[1]: *** [arch/arm/common/locomo.o] Error 1
> diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
> index 60831bb..a95cd25 100644
> --- a/drivers/video/backlight/locomolcd.c
> +++ b/drivers/video/backlight/locomolcd.c
> @@ -105,6 +106,38 @@ void locomolcd_power(int on)
> }
> EXPORT_SYMBOL(locomolcd_power);
>
> +
> +static int current_intensity;
> +
> +static int set_intensity(struct backlight_device *bd, int intensity)
> +{
> + switch (intensity) {
> + /* AC and non-AC are handled differently, but produce same results in sharp code? */
> + case 0: locomo_frontlight_set(locomolcd_dev, 0, 0, 161); break;
> + case 1: locomo_frontlight_set(locomolcd_dev, 117, 0, 161); break;
> + case 2: locomo_frontlight_set(locomolcd_dev, 163, 0, 148); break;
> + case 3: locomo_frontlight_set(locomolcd_dev, 194, 0, 161); break;
> + case 4: locomo_frontlight_set(locomolcd_dev, 194, 1, 161); break;
> +
> + default:
> + locomo_frontlight_set(locomolcd_dev, intensity, 0, 148); break;
> + }
> + current_intensity = intensity;
> + return 0;
> +}
That default statement gives cause for concern. Should it not return
-EINVAL for intensities outside of 0-4?
> +static int get_intensity(struct backlight_device *bd)
> +{
> + return current_intensity;
> +}
> +
> +static struct backlight_properties locomobl_data = {
> + .owner = THIS_MODULE,
> + .get_brightness = get_intensity,
> + .set_brightness = set_intensity,
> + .max_brightness = 5,
Maximum brightness is 4 above?
> +};
> +
> static int poodle_lcd_probe(struct locomo_dev *dev)
> {
> unsigned long flags;
> @@ -147,8 +183,13 @@ static int __init poodle_lcd_init(void)
>
> #ifdef CONFIG_SA1100_COLLIE
> sa1100fb_lcd_power = locomolcd_power;
> +
> + backlight_device_register("collie-bl", NULL, &locomobl_data);
> #endif
> return 0;
> }
Could this be changed to:
#ifdef CONFIG_SA1100_COLLIE
sa1100fb_lcd_power = locomolcd_power;
#endif
backlight_device_register("locomo-bl", NULL, &locomobl_data);
return 0;
This means that it will also present a backlight interface on poodle. In
fact I've already helped a poodle user test this and it works!
Also note that there are some backlight interface changes sitting in -mm
(see the linux-fbdev-devel mailing list) which this patch isn't covered
by. If this patch gets merged first, I'll make sure it gets adapted to
the new interface though (which actually brings some benefits like power
attribute implementation for free).
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Hook collie frontlight into sysfs
2006-03-30 22:59 ` Richard Purdie
@ 2006-03-30 23:30 ` Pavel Machek
0 siblings, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2006-03-30 23:30 UTC (permalink / raw)
To: Richard Purdie; +Cc: lenz, kernel list, patches, Bompart Cedric
Hi!
> > Hook backlight handling into backlight subsystem, so that backlight is
> > controllable using /sys . I had to shuffle code around a bit in order
> > to avoid prototypes.
>
> Hi Pavel,
>
> There are a few issues with this. Firstly,
> CC arch/arm/common/locomo.o
> arch/arm/common/locomo.c: In function `locomo_frontlight_set':
> arch/arm/common/locomo.c:1061: error: `LOCOMO_ALC_EN' undeclared (first use in this function)
> arch/arm/common/locomo.c:1061: error: (Each undeclared identifier is reported only once
> arch/arm/common/locomo.c:1061: error: for each function it appears in.)
> make[1]: *** [arch/arm/common/locomo.o] Error 1
Oops, too much hand editing, probably.
> > +static int set_intensity(struct backlight_device *bd, int intensity)
> > +{
> > + switch (intensity) {
> > + /* AC and non-AC are handled differently, but produce same results in sharp code? */
> > + case 0: locomo_frontlight_set(locomolcd_dev, 0, 0, 161); break;
> > + case 1: locomo_frontlight_set(locomolcd_dev, 117, 0, 161); break;
> > + case 2: locomo_frontlight_set(locomolcd_dev, 163, 0, 148); break;
> > + case 3: locomo_frontlight_set(locomolcd_dev, 194, 0, 161); break;
> > + case 4: locomo_frontlight_set(locomolcd_dev, 194, 1, 161); break;
> > +
> > + default:
> > + locomo_frontlight_set(locomolcd_dev, intensity, 0, 148); break;
> > + }
> > + current_intensity = intensity;
> > + return 0;
> > +}
>
> That default statement gives cause for concern. Should it not return
> -EINVAL for intensities outside of 0-4?
Well.. I noticed that values 80..194 actually provide continuous
selection of backlights, so this was my little hack to play with.
I am not sure if it is okay to leave backlight at some state like that
for long ammount of time, nor how is third parameter related...
I guess I'll simply return -EINVAL.
> > +static int get_intensity(struct backlight_device *bd)
> > +{
> > + return current_intensity;
> > +}
> > +
> > +static struct backlight_properties locomobl_data = {
> > + .owner = THIS_MODULE,
> > + .get_brightness = get_intensity,
> > + .set_brightness = set_intensity,
> > + .max_brightness = 5,
>
> Maximum brightness is 4 above?
It seems to be ignored, anyway, but will fix.
> > @@ -147,8 +183,13 @@ static int __init poodle_lcd_init(void)
> >
> > #ifdef CONFIG_SA1100_COLLIE
> > sa1100fb_lcd_power = locomolcd_power;
> > +
> > + backlight_device_register("collie-bl", NULL, &locomobl_data);
> > #endif
> > return 0;
> > }
>
> Could this be changed to:
>
> #ifdef CONFIG_SA1100_COLLIE
> sa1100fb_lcd_power = locomolcd_power;
> #endif
> backlight_device_register("locomo-bl", NULL, &locomobl_data);
>
> return 0;
>
> This means that it will also present a backlight interface on poodle. In
> fact I've already helped a poodle user test this and it works!
Good -- I had no idea if it would work. Changed.
> Also note that there are some backlight interface changes sitting in -mm
> (see the linux-fbdev-devel mailing list) which this patch isn't covered
> by. If this patch gets merged first, I'll make sure it gets adapted to
> the new interface though (which actually brings some benefits like power
> attribute implementation for free).
Perhaps I can merge it into your tree (instead of rmk's?).
Pavel
This incremental diff should fix these issues...
Signed-off-by: Pavel Machek <pavel@suse.cz>
PATCH FOLLOWS
KernelVersion: 2.6.16-git-previouspatch
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index bcce028..84b0226 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -1090,6 +1090,7 @@ void locomo_frontlight_set(struct locomo
locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
udelay(100);
locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+#define LOCOMO_ALC_EN 0x8000
locomo_writel(bpwf | LOCOMO_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
spin_unlock_irqrestore(&lchip->lock, flags);
}
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index a95cd25..d033471 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -120,7 +120,9 @@ static int set_intensity(struct backligh
case 4: locomo_frontlight_set(locomolcd_dev, 194, 1, 161); break;
default:
- locomo_frontlight_set(locomolcd_dev, intensity, 0, 148); break;
+ return -EINVAL;
+ /* Actually, other values are possible, too. Everything between 80..194
+ seems to work as duty parameter */
}
current_intensity = intensity;
return 0;
@@ -135,7 +137,7 @@ static struct backlight_properties locom
.owner = THIS_MODULE,
.get_brightness = get_intensity,
.set_brightness = set_intensity,
- .max_brightness = 5,
+ .max_brightness = 4,
};
static int poodle_lcd_probe(struct locomo_dev *dev)
@@ -183,9 +185,9 @@ static int __init poodle_lcd_init(void)
#ifdef CONFIG_SA1100_COLLIE
sa1100fb_lcd_power = locomolcd_power;
-
- backlight_device_register("collie-bl", NULL, &locomobl_data);
#endif
+ backlight_device_register("collie-bl", NULL, &locomobl_data);
+
return 0;
}
device_initcall(poodle_lcd_init);
--
Picture of sleeping (Linux) penguin wanted...
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: Hook collie frontlight into sysfs
@ 2006-03-31 7:29 Bompart Cedric
2006-03-31 8:23 ` Pavel Machek
0 siblings, 1 reply; 6+ messages in thread
From: Bompart Cedric @ 2006-03-31 7:29 UTC (permalink / raw)
To: Richard Purdie, Pavel Machek; +Cc: lenz, kernel list, patches
Hi Pavel,
During our test with Richard, we've been thinking can you implement the
full range of brightness intensity values? For example for the others
Zaurus, I think the range is between 0 and 63. So the userspace can
adjust a wider range of levels for the backlight. Another thing, I
didn't see anything different visually between the value 3 and 4.
Regards,
Ced.
-----Original Message-----
From: Richard Purdie [mailto:rpurdie@rpsys.net]
Sent: 31 March 2006 00:59
To: Pavel Machek
Cc: lenz@cs.wisc.edu; kernel list; patches@arm.linux.org.uk; Bompart
Cedric
Subject: Re: Hook collie frontlight into sysfs
On Thu, 2006-03-30 at 13:46 +0200, Pavel Machek wrote:
> Hook backlight handling into backlight subsystem, so that backlight is
> controllable using /sys . I had to shuffle code around a bit in order
> to avoid prototypes.
Hi Pavel,
There are a few issues with this. Firstly,
CC arch/arm/common/locomo.o
arch/arm/common/locomo.c: In function `locomo_frontlight_set':
arch/arm/common/locomo.c:1061: error: `LOCOMO_ALC_EN' undeclared (first
use in this function)
arch/arm/common/locomo.c:1061: error: (Each undeclared identifier is
reported only once
arch/arm/common/locomo.c:1061: error: for each function it appears in.)
make[1]: *** [arch/arm/common/locomo.o] Error 1
> diff --git a/drivers/video/backlight/locomolcd.c
b/drivers/video/backlight/locomolcd.c
> index 60831bb..a95cd25 100644
> --- a/drivers/video/backlight/locomolcd.c
> +++ b/drivers/video/backlight/locomolcd.c
> @@ -105,6 +106,38 @@ void locomolcd_power(int on)
> }
> EXPORT_SYMBOL(locomolcd_power);
>
> +
> +static int current_intensity;
> +
> +static int set_intensity(struct backlight_device *bd, int intensity)
> +{
> + switch (intensity) {
> + /* AC and non-AC are handled differently, but produce same
results in sharp code? */
> + case 0: locomo_frontlight_set(locomolcd_dev, 0, 0, 161); break;
> + case 1: locomo_frontlight_set(locomolcd_dev, 117, 0, 161);
break;
> + case 2: locomo_frontlight_set(locomolcd_dev, 163, 0, 148);
break;
> + case 3: locomo_frontlight_set(locomolcd_dev, 194, 0, 161);
break;
> + case 4: locomo_frontlight_set(locomolcd_dev, 194, 1, 161);
break;
> +
> + default:
> + locomo_frontlight_set(locomolcd_dev, intensity, 0, 148);
break;
> + }
> + current_intensity = intensity;
> + return 0;
> +}
That default statement gives cause for concern. Should it not return
-EINVAL for intensities outside of 0-4?
> +static int get_intensity(struct backlight_device *bd)
> +{
> + return current_intensity;
> +}
> +
> +static struct backlight_properties locomobl_data = {
> + .owner = THIS_MODULE,
> + .get_brightness = get_intensity,
> + .set_brightness = set_intensity,
> + .max_brightness = 5,
Maximum brightness is 4 above?
> +};
> +
> static int poodle_lcd_probe(struct locomo_dev *dev)
> {
> unsigned long flags;
> @@ -147,8 +183,13 @@ static int __init poodle_lcd_init(void)
>
> #ifdef CONFIG_SA1100_COLLIE
> sa1100fb_lcd_power = locomolcd_power;
> +
> + backlight_device_register("collie-bl", NULL, &locomobl_data);
> #endif
> return 0;
> }
Could this be changed to:
#ifdef CONFIG_SA1100_COLLIE
sa1100fb_lcd_power = locomolcd_power;
#endif
backlight_device_register("locomo-bl", NULL, &locomobl_data);
return 0;
This means that it will also present a backlight interface on poodle. In
fact I've already helped a poodle user test this and it works!
Also note that there are some backlight interface changes sitting in -mm
(see the linux-fbdev-devel mailing list) which this patch isn't covered
by. If this patch gets merged first, I'll make sure it gets adapted to
the new interface though (which actually brings some benefits like power
attribute implementation for free).
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Hook collie frontlight into sysfs
2006-03-31 7:29 Bompart Cedric
@ 2006-03-31 8:23 ` Pavel Machek
2006-03-31 10:13 ` Richard Purdie
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Machek @ 2006-03-31 8:23 UTC (permalink / raw)
To: Bompart Cedric; +Cc: Richard Purdie, lenz, kernel list
Hi!
> During our test with Richard, we've been thinking can you implement the
> full range of brightness intensity values? For example for the others
> Zaurus, I think the range is between 0 and 63. So the userspace can
Well, I'm not sure if other values are "legal". They could damage
frontlight long-term or just eat too much power...
> adjust a wider range of levels for the backlight. Another thing, I
> didn't see anything different visually between the value 3 and 4.
You are right, the code to go brightness 4 is attached. It probably
needs to be converted to writel/readl...
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 8c53ebc..bcce028 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -1046,13 +1046,46 @@ void locomo_m62332_senddata(struct locom
* Frontlight control
*/
+#define LOCOMO_GPIO9 (1<<9)
+
+#ifdef DONE
+/* Should be same for collie and poodle */
+static int poodlefl_enable_accel(void)
+{
+ if (!(LOCOMO_GPO & LOCOMO_GPIO9)) {
+ LOCOMO_GPD &= ~LOCOMO_GPIO9;
+ LOCOMO_GPE &= ~LOCOMO_GPIO9;
+ LOCOMO_GPO |= LOCOMO_GPIO9;
+ }
+ return 0;
+}
+
+/* Should be same for collie and poodle */
+static int poodlefl_disable_accel(void)
+{
+ if (LOCOMO_GPO & LOCOMO_GPIO9) {
+ LOCOMO_GPD &= ~LOCOMO_GPIO9;
+ LOCOMO_GPE &= ~LOCOMO_GPIO9;
+ LOCOMO_GPO &= ~LOCOMO_GPIO9;
+ }
+ return 0;
+}
+#endif
+
static struct locomo *locomo_chip_driver(struct locomo_dev *ldev);
+#define LOCOMO_ALC_EN 0x8000
+
void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf)
{
unsigned long flags;
struct locomo *lchip = locomo_chip_driver(dev);
+#ifdef DONE
+ if (vr) poodlefl_enable_accel();
+ else poodlefl_disable_accel();
+#endif
+
spin_lock_irqsave(&lchip->lock, flags);
locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
udelay(100);
Pavel
--
Picture of sleeping (Linux) penguin wanted...
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: Hook collie frontlight into sysfs
2006-03-31 8:23 ` Pavel Machek
@ 2006-03-31 10:13 ` Richard Purdie
0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2006-03-31 10:13 UTC (permalink / raw)
To: Pavel Machek; +Cc: lenz, Bompart Cedric, kernel list
On Fri, 2006-03-31 at 10:23 +0200, Pavel Machek wrote:
> Hi!
>
> > During our test with Richard, we've been thinking can you implement the
> > full range of brightness intensity values? For example for the others
> > Zaurus, I think the range is between 0 and 63. So the userspace can
>
> Well, I'm not sure if other values are "legal". They could damage
> frontlight long-term or just eat too much power...
For what its worth, these back/frontlight controllers are normally PWM
driven so the LED is always at full brightness and just the percentage
of time its turned on varies. These numbers in the driver control the
duty cycle of the PWM.
The original code for corgi/spitz only had a limited number of values
and I exposed the whole range into userspace. I doubt you can damage the
hardware with the different values. There are probably optimal points
for power consumption which is perhaps why Sharp limited the values
exposed. My view is that its up to userspace to limit the values for
optimal power consumption :).
> > adjust a wider range of levels for the backlight. Another thing, I
> > didn't see anything different visually between the value 3 and 4.
>
> You are right, the code to go brightness 4 is attached. It probably
> needs to be converted to writel/readl...
This makes sense as on corgi/spitz there is also this magic bit to set
for the second level of brightness settings...
I'll have a look at these patches and perhaps combine/convert them to
the replacement backlight interface, then we can submit them to Antonino
Daplas/Andrew so all the backlight patches are in one place (currently
-mm).
Given what I've said above, would you be happy to expose the full range
of values to userspace?
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-03-31 10:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-30 11:46 Hook collie frontlight into sysfs Pavel Machek
2006-03-30 22:59 ` Richard Purdie
2006-03-30 23:30 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2006-03-31 7:29 Bompart Cedric
2006-03-31 8:23 ` Pavel Machek
2006-03-31 10:13 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox