From patchwork Thu Jan 8 06:32:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 1310 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n086R8YF006165 for ; Wed, 7 Jan 2009 22:27:30 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbZAHGbH (ORCPT ); Thu, 8 Jan 2009 01:31:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752029AbZAHGbH (ORCPT ); Thu, 8 Jan 2009 01:31:07 -0500 Received: from mga01.intel.com ([192.55.52.88]:32316 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbZAHGbG (ORCPT ); Thu, 8 Jan 2009 01:31:06 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 07 Jan 2009 22:21:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.37,231,1231142400"; d="scan'208";a="655466619" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.160]) ([10.239.36.160]) by fmsmga001.fm.intel.com with ESMTP; 07 Jan 2009 22:31:34 -0800 Subject: [RESEND PATCH 2/2] ACPI: update props.brightness whenever the ACPI video backlight is changed From: Zhang Rui To: Len Brown Cc: linux-acpi , rpurdie@rpsys.net, Matthew Garrett , "Zhang, Rui" Date: Thu, 08 Jan 2009 14:32:22 +0800 Message-Id: <1231396342.20746.81.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Always update the props.brightness whenever the ACPI video backlight is changed. Signed-off-by: Zhang Rui --- 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 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; }