From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Garrett Subject: Re: [PATCH 1/2] ACPI Video: Ignore devices that aren't present in hardware Date: Fri, 4 Jul 2008 18:39:10 +0100 Message-ID: <20080704173910.GA16595@srcf.ucam.org> References: <200807031805.52883.trenn@suse.de> <20080703160822.GA29110@srcf.ucam.org> <20080704030948.GB31908@khazad-dum.debian.net> <20080704091307.GB8905@srcf.ucam.org> <20080704115519.GA7435@khazad-dum.debian.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from cavan.codon.org.uk ([93.93.128.6]:50941 "EHLO vavatch.codon.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751170AbYGDRjT (ORCPT ); Fri, 4 Jul 2008 13:39:19 -0400 Content-Disposition: inline In-Reply-To: <20080704115519.GA7435@khazad-dum.debian.net> Sender: linux-next-owner@vger.kernel.org List-ID: To: Henrique de Moraes Holschuh Cc: Thomas Renninger , ak@linux.intel.com, linux-acpi@vger.kernel.org, linux-next@vger.kernel.org, Andrew Morton , Julia Jomantaite , marcus@better.se, dannybaumann@web.de, corsac@debian.org, jesse.barnes@intel.com Got it. The reason for the delay is that BRTO sits in a loop for no obvious reason unless BRTF is cleared. The only thing that clears BRTF is the PWMS function, which isn't called anywhere in the ACPI tables. The NetBSD driver has the following code: /* Claim ownership of brightness control */ param[0].Integer.Value = 0; (void)AcpiEvaluateObject(sc->sc_node->ad_handle, "PWMS", ¶ms, NULL); and doing this in thinkpad_acpi means my brightness control works in an acceptably speedy manner with opregion. Henrique, any thoughts on this? If you're happy with it, we can get opregion support into .27 and add the patch to remove duplicate ACPI video devices and everything will work in a beautiful and harmonious manner. diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index b596929..bbc45c8 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -899,6 +899,9 @@ static int __init tpacpi_check_std_acpi_brightness_support(void) if (ACPI_SUCCESS(status) && bcl_levels > 2) { tp_features.bright_acpimode = 1; + /* Set ACPI mode */ + if (!acpi_evalf(hkey_handle, NULL, "PWMS", "vd", 0)) + printk(TPACPI_INFO "Failed to claim backlight\n"); return (bcl_levels - 2); } -- Matthew Garrett | mjg59@srcf.ucam.org