lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 23 Feb 2012 00:36:01 +0000
From:	Chris Diamand <chris.diamand@...il.com>
To:	kristoffer.ericson@...il.com
Cc:	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	Chris Diamand <chris.diamand@...il.com>
Subject: [PATCH] Jornada 720: Fixes "Invalid argument" when changing backlight brightness.

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@...il.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ