* [PATCH] Jornada 720: Fixes "Invalid argument" when changing backlight brightness.
@ 2012-02-23 0:36 Chris Diamand
0 siblings, 0 replies; 2+ messages in thread
From: Chris Diamand @ 2012-02-23 0:36 UTC (permalink / raw)
To: kristoffer.ericson; +Cc: linux-kernel, torvalds, Chris Diamand
On jornada 720. Running:
echo n > /sys/class/backlight/s1d13806fb/brightness
would give a "write error: Invalid argument" as the max_brightness
was not set, so any value other that 0 exceeds it. Now sets
max_brightness to 255 when the module is loaded.
Backlight can also be turned on and off using
echo 0-4 > /sys/class/backlight/s1d13806fb/bl_power
Also added some extra braces so jornada720_ssp.c.
Signed-off-by: Chris Diamand <chris.diamand@gmail.com>
---
arch/arm/mach-sa1100/jornada720_ssp.c | 3 ++-
drivers/video/backlight/jornada720_bllcd.c | 12 +++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 7ab256a..289ae0f 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -95,9 +95,10 @@ int jornada_ssp_inout(u8 byte)
ret = jornada_ssp_byte(byte);
/* Proper return to commands is TxDummy */
if (ret != TXDUMMY) {
- for (i = 0; i < 256; i++)/* flushing bus */
+ for (i = 0; i < 256; i++) { /* flushing bus */
if (jornada_ssp_byte(TXDUMMY) == -1)
break;
+ }
return -ETIMEDOUT;
}
} else /* Exchange TxDummy for data */
diff --git a/drivers/video/backlight/jornada720_bllcd.c b/drivers/video/backlight/jornada720_bllcd.c
index 645f9ba..bc30faa 100644
--- a/drivers/video/backlight/jornada720_bllcd.c
+++ b/drivers/video/backlight/jornada720_bllcd.c
@@ -71,12 +71,11 @@ static int jornada_bl_update_status(struct backlight_device *dev)
if (dev->props.power != FB_BLANK_UNBLANK ||
dev->props.fb_blank != FB_BLANK_UNBLANK) {
ret = jornada_ssp_inout(BRIGHTNESSOFF);
- if (ret == -ETIMEDOUT) {
- printk(KERN_ERR "bl : brightness off timeout\n");
+ if (ret == -ETIMEDOUT)
+ printk(KERN_ERR "bl :brightness off timeout\n");
/* backlight off */
- PPSR &= ~PPC_LDD1;
- PPDR |= PPC_LDD1;
- }
+ PPSR &= ~PPC_LDD1;
+ PPDR |= PPC_LDD1;
} else { /* backlight on */
PPSR |= PPC_LDD1;
/* send setbrightness cmd */
@@ -233,6 +232,7 @@ static int jornada_bl_probe(struct platform_device *pdev)
bllcd->bl_device->props.power = FB_BLANK_UNBLANK;
bllcd->bl_device->props.brightness = BL_DEF_BRIGHT;
+ bllcd->bl_device->props.max_brightness = BL_MAX_BRIGHT;
jornada_bl_update_status(bllcd->bl_device);
platform_set_drvdata(pdev, bllcd);
@@ -261,7 +261,6 @@ static int jornada_bl_suspend(struct platform_device *pdev, pm_message_t state)
bllcd->bl_device->props.power = FB_BLANK_POWERDOWN;
bllcd->bl_device->props.brightness = 0;
- bllcd->bl_device->props.max_brightness = 0;
jornada_bl_update_status(bllcd->bl_device);
jornada_lcd_set_power(bllcd->lcd_device, FB_BLANK_POWERDOWN);
@@ -275,7 +274,6 @@ static int jornada_bl_resume(struct platform_device *pdev)
bllcd->bl_device->props.power = FB_BLANK_UNBLANK;
bllcd->bl_device->props.brightness = BL_DEF_BRIGHT;
- bllcd->bl_device->props.max_brightness = BL_MAX_BRIGHT;
jornada_bl_update_status(bllcd->bl_device);
jornada_lcd_set_power(bllcd->lcd_device, FB_BLANK_UNBLANK);
--
1.7.9
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] Jornada 720: Fixes "Invalid argument" when changing backlight brightness.
@ 2012-02-23 0:57 Chris Diamand
0 siblings, 0 replies; 2+ messages in thread
From: Chris Diamand @ 2012-02-23 0:57 UTC (permalink / raw)
To: kristoffer.ericson; +Cc: linux-kernel, torvalds, Chris Diamand
Sorry - this patch I just sent is for kernels 2.6.24/2.6.26.
(I think it's actually been fixed on versions >3.0 but they versions don't
seem to work on the jornada for various other reasons...)
Thanks,
Chris.
---------------------
On jornada 720. Running:
echo n > /sys/class/backlight/s1d13806fb/brightness
would give a "write error: Invalid argument" as the max_brightness
was not set, so any value other that 0 exceeds it. Now sets
max_brightness to 255 when the module is loaded.
Backlight can also be turned on and off using
echo 0-4 > /sys/class/backlight/s1d13806fb/bl_power
Also added some extra braces so jornada720_ssp.c.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-23 0:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 0:36 [PATCH] Jornada 720: Fixes "Invalid argument" when changing backlight brightness Chris Diamand
-- strict thread matches above, loose matches on Subject: below --
2012-02-23 0:57 Chris Diamand
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).