diff mbox

[RESEND,2/2] ACPI: update props.brightness whenever the ACPI video backlight is changed

Message ID 1231396342.20746.81.camel@rzhang-dt (mailing list archive)
State Accepted
Headers show

Commit Message

Zhang, Rui Jan. 8, 2009, 6:32 a.m. UTC
Always update the props.brightness
whenever the ACPI video backlight is changed.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/video.c |    5 +++++
 1 file changed, 5 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Len Brown Jan. 9, 2009, 6:39 a.m. UTC | #1
this one was already applied on 12/30

it was titled video: always update the brightness when poking "brightness"
--
Len Brown, Intel Open Source Technology Center

On Thu, 8 Jan 2009, Zhang Rui wrote:

> Always update the props.brightness
> whenever the ACPI video backlight is changed.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/video.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> Index: linux-2.6/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/video.c
> +++ linux-2.6/drivers/acpi/video.c
> @@ -481,6 +481,7 @@ acpi_video_device_lcd_set_level(struct a
>  	int status = AE_OK;
>  	union acpi_object arg0 = { ACPI_TYPE_INTEGER };
>  	struct acpi_object_list args = { 1, &arg0 };
> +	int state;
>  
>  
>  	arg0.integer.value = level;
> @@ -489,6 +490,10 @@ acpi_video_device_lcd_set_level(struct a
>  		status = acpi_evaluate_object(device->dev->handle, "_BCM",
>  					      &args, NULL);
>  	device->brightness->curr = level;
> +	for (state = 2; state < device->brightness->count; state++)
> +		if (level == device->brightness->levels[state])
> +			device->backlight->props.brightness = state - 2;
> +
>  	return status;
>  }
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-2.6/drivers/acpi/video.c
===================================================================
--- linux-2.6.orig/drivers/acpi/video.c
+++ linux-2.6/drivers/acpi/video.c
@@ -481,6 +481,7 @@  acpi_video_device_lcd_set_level(struct a
 	int status = AE_OK;
 	union acpi_object arg0 = { ACPI_TYPE_INTEGER };
 	struct acpi_object_list args = { 1, &arg0 };
+	int state;
 
 
 	arg0.integer.value = level;
@@ -489,6 +490,10 @@  acpi_video_device_lcd_set_level(struct a
 		status = acpi_evaluate_object(device->dev->handle, "_BCM",
 					      &args, NULL);
 	device->brightness->curr = level;
+	for (state = 2; state < device->brightness->count; state++)
+		if (level == device->brightness->levels[state])
+			device->backlight->props.brightness = state - 2;
+
 	return status;
 }