From patchwork Mon Feb 11 16:21:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 2124861 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C7EB8DF23E for ; Mon, 11 Feb 2013 16:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757858Ab3BKQVe (ORCPT ); Mon, 11 Feb 2013 11:21:34 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:44879 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757725Ab3BKQVd (ORCPT ); Mon, 11 Feb 2013 11:21:33 -0500 Received: from 64-126-113-177.dyn.everestkc.net ([64.126.113.177] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1U4w8G-0006Ll-7C; Mon, 11 Feb 2013 16:21:28 +0000 From: Seth Forshee To: Len Brown , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Ben Jencks , joeyli , Seth Forshee Subject: [PATCH] ACPI: Disable Windows 8 compatibility for some Lenovo ThinkPads Date: Mon, 11 Feb 2013 10:21:21 -0600 Message-Id: <1360599681-24781-1-git-send-email-seth.forshee@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 The AML implementation for brightness control on several ThinkPads contains a workaround to meet a Windows 8 requirement of 101 brightness levels [1]. The implementation is flawed, as only 16 of the brighness values reported by _BCL affect a change in brightness. _BCM silently discards the rest of the values. Disabling Windows 8 compatibility on these machines reverts them to the old behavior, making _BCL only report the 16 brightness levels which actually work. Add a quirk to do this along with a dmi callback to disable Win8 compatibility. [1] http://msdn.microsoft.com/en-us/library/windows/hardware/jj128256.aspx Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51231 BugLink: http://bugs.launchpad.net/bugs/1098216 Signed-off-by: Seth Forshee --- This has been discussed previously at [2], however the description of the problem there is incorrect. _BCM simply discards any value written that isn't one of the brightness levels returned by _BCL for non-Win8 systems; it does not do any rounding. This patch quirks six machines that have been confirmed to have this problem, but there may be others. I looked for some way to do this other than quirking for individual models, but unfortunately I couldn't find any other criteria which worked. Thanks, Seth [2] http://comments.gmane.org/gmane.linux.acpi.devel/58398 drivers/acpi/blacklist.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index cb96296..6c242ed 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c @@ -193,6 +193,13 @@ static int __init dmi_disable_osi_win7(const struct dmi_system_id *d) return 0; } +static int __init dmi_disable_osi_win8(const struct dmi_system_id *d) +{ + printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); + acpi_osi_setup("!Windows 2012"); + return 0; +} + static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { { .callback = dmi_disable_osi_vista, @@ -269,6 +276,61 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { }, /* + * The following Lenovo models have a broken workaround in the + * acpi_video backlight implementation to meet the Windows 8 + * requirement of 101 backlight levels. Reverting to pre-Win8 + * behavior fixes the problem. + */ + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad L430", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L430"), + }, + }, + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad T430s", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T430s"), + }, + }, + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad T530", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T530"), + }, + }, + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad W530", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W530"), + }, + }, + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad X1 Carbon", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon"), + }, + }, + { + .callback = dmi_disable_osi_win8, + .ident = "Lenovo ThinkPad X230", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X230"), + }, + }, + + /* * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. * Linux ignores it, except for the machines enumerated below. */