From patchwork Mon Oct 1 05:39:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1529521 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 03F1A3FE80 for ; Mon, 1 Oct 2012 05:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750822Ab2JAFjy (ORCPT ); Mon, 1 Oct 2012 01:39:54 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34434 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194Ab2JAFjy (ORCPT ); Mon, 1 Oct 2012 01:39:54 -0400 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TIYjP-0005Jo-9p; Mon, 01 Oct 2012 05:39:51 +0000 From: Alex Hung To: alex.hung@canonical.com, rui.zhang@intel.com, linux-acpi@vger.kernel.org Subject: [PATCH] acpi: fix brightness level is initialized to zero when BIOS does not restore the brightness value to _BQC. Date: Mon, 1 Oct 2012 13:39:47 +0800 Message-Id: <1349069987-23992-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Signed-off-by: Alex Hung --- drivers/acpi/video.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 42b226e..eaa9573 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -724,6 +724,10 @@ acpi_video_init_brightness(struct acpi_video_device *device) if (level_old == br->levels[i]) level = level_old; } + + if (level == 0) + level = br->levels[(br->count) / 2 + 1]; + goto set_level; }