From patchwork Thu Mar 7 19:39:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 2233521 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 00264DFE75 for ; Thu, 7 Mar 2013 19:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724Ab3CGTjq (ORCPT ); Thu, 7 Mar 2013 14:39:46 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:49277 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932336Ab3CGTjp (ORCPT ); Thu, 7 Mar 2013 14:39:45 -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 1UDgfI-00051N-G7; Thu, 07 Mar 2013 19:39:45 +0000 From: Seth Forshee To: linux-acpi@vger.kernel.org Cc: Matthew Garrett , Len Brown , "Rafael J. Wysocki" , Ben Jencks , joeyli , Seth Forshee Subject: [PATCH 1/5] ACPICA: Add interface for getting latest Windows version requested via _OSI Date: Thu, 7 Mar 2013 13:39:36 -0600 Message-Id: <1362685180-7768-1-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20130307193812.GD24233@thinkpad-t410> References: <20130307193812.GD24233@thinkpad-t410> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The acpi_video driver needs to know the latest Windows version requested by the BIOS to work around a buggy backlight implementation which is specific to Windows 8. Add a new interface named acpi_osi_windows_version() for retrieving this information. Signed-off-by: Seth Forshee --- drivers/acpi/acpica/aclocal.h | 13 ------------- drivers/acpi/acpica/utxface.c | 19 +++++++++++++++++++ include/acpi/acpixf.h | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index ff8bd00..932c3d8 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h @@ -926,19 +926,6 @@ struct acpi_bit_register_info { /* Structs and definitions for _OSI support and I/O port validation */ -#define ACPI_OSI_WIN_2000 0x01 -#define ACPI_OSI_WIN_XP 0x02 -#define ACPI_OSI_WIN_XP_SP1 0x03 -#define ACPI_OSI_WINSRV_2003 0x04 -#define ACPI_OSI_WIN_XP_SP2 0x05 -#define ACPI_OSI_WINSRV_2003_SP1 0x06 -#define ACPI_OSI_WIN_VISTA 0x07 -#define ACPI_OSI_WINSRV_2008 0x08 -#define ACPI_OSI_WIN_VISTA_SP1 0x09 -#define ACPI_OSI_WIN_VISTA_SP2 0x0A -#define ACPI_OSI_WIN_7 0x0B -#define ACPI_OSI_WIN_8 0x0C - #define ACPI_ALWAYS_ILLEGAL 0x00 struct acpi_interface_info { diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index 390db0c..1531984 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c @@ -384,6 +384,25 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) /***************************************************************************** * + * FUNCTION: acpi_osi_windows_version + * + * PARAMETERS: None + * + * RETURN: Latest Windows version Windows requested via _OSI + * + * DESCRIPTION: Returns the latest version of Windows that has been requested + * by the BIOS via _OSI. + * + ****************************************************************************/ +u8 acpi_osi_windows_version(void) +{ + return acpi_gbl_osi_data; +} + +ACPI_EXPORT_SYMBOL(acpi_osi_windows_version) + +/***************************************************************************** + * * FUNCTION: acpi_check_address_range * * PARAMETERS: space_id - Address space ID diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 3d88395..29a9429 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -73,6 +73,22 @@ extern u8 acpi_gbl_truncate_io_addresses; extern u8 acpi_gbl_disable_auto_repair; /* + * Values returned by acpi_osi_windows_version() + */ +#define ACPI_OSI_WIN_2000 0x01 +#define ACPI_OSI_WIN_XP 0x02 +#define ACPI_OSI_WIN_XP_SP1 0x03 +#define ACPI_OSI_WINSRV_2003 0x04 +#define ACPI_OSI_WIN_XP_SP2 0x05 +#define ACPI_OSI_WINSRV_2003_SP1 0x06 +#define ACPI_OSI_WIN_VISTA 0x07 +#define ACPI_OSI_WINSRV_2008 0x08 +#define ACPI_OSI_WIN_VISTA_SP1 0x09 +#define ACPI_OSI_WIN_VISTA_SP2 0x0A +#define ACPI_OSI_WIN_7 0x0B +#define ACPI_OSI_WIN_8 0x0C + +/* * Hardware-reduced prototypes. All interfaces that use these macros will * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag * is set to TRUE. @@ -301,6 +317,8 @@ acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, acpi_notify_handler handler, void *context); +u8 acpi_osi_windows_version(void); + acpi_status acpi_remove_notify_handler(acpi_handle device, u32 handler_type, acpi_notify_handler handler);