From patchwork Thu Dec 6 18:46:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E5AA54C15B0 for ; Thu, 6 Dec 2012 18:47:29 +0000 (UTC) Received: from mail-ia0-f173.google.com (mail-ia0-f173.google.com [209.85.210.173]) by fiordland.canonical.com (Postfix) with ESMTP id 79EA1A18688 for ; Thu, 6 Dec 2012 18:47:29 +0000 (UTC) Received: by mail-ia0-f173.google.com with SMTP id w21so5078302iac.4 for ; Thu, 06 Dec 2012 10:47:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=7XrOOl+jdUkyYC9zeGG+Hh6d4Sm1GQiwHdzQ01fzUTQ=; b=bZmVpAMM3WzZ2qOg9WvAbSIFpaMAJ8L6XQryLdphLrvCrRLH6mV/n2rWsMkRKwKf6P 9OjF+J7mH3b4pJDZrtRsdPzoUtSJsJE6EzsT1nk1w3inJR7MLmJ6sTVNwMrPuHkrAh7C OwsBdPaO+tbHKN3IVCvP0mvVCCv89LVGAvb4E/8Ho2VV8x7O+l9vjLpV5Tom2cgAXlFD 0c8dWgfq6zQX0DMXfJ1skq62HT2j+wIFwJmTEH1ZLWdOFBrSiXWlwcifjK2lmD9V9G4E f+EM+Y4I+PxhU4t8zINsIQYUAieYGvPgULdIh50XmAqeDkcnGkTgm1GopO+Psi5beHkz C4Xw== Received: by 10.50.152.137 with SMTP id uy9mr2460019igb.62.1354819648943; Thu, 06 Dec 2012 10:47:28 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp427818igt; Thu, 6 Dec 2012 10:47:28 -0800 (PST) Received: by 10.14.215.197 with SMTP id e45mr8543205eep.0.1354819646451; Thu, 06 Dec 2012 10:47:26 -0800 (PST) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id m3si18300841een.140.2012.12.06.10.47.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Dec 2012 10:47:26 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUMDoMRGti4QLpxI5QNR3Q7jwviYjusrM@postini.com; Thu, 06 Dec 2012 18:47:26 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 79A14C9; Thu, 6 Dec 2012 18:46:48 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BEFDA5273; Thu, 6 Dec 2012 18:46:47 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 30B3324C2AB; Thu, 6 Dec 2012 19:46:38 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 6 Dec 2012 19:46:46 +0100 From: Linus Walleij To: , Greg Kroah-Hartman , Len Brown , "Rafael J. Wysocki" Cc: Alan Cox , Rickard Andersson , , Linus Walleij Subject: [PATCH 1/2] ACPI: break out the states from the ACPI types Date: Thu, 6 Dec 2012 19:46:36 +0100 Message-ID: <1354819596-2355-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlAwF/SWrWq60jYTBe8YbkvI/h+HjSdWBX8pKLid9xqDHDkQZtSxvQG/eNOi8xPceveBWQ/ From: Linus Walleij The ACPI states are used by the serial core by way of magic numbers in the code, it's pretty confusing, so we need to reference the definitions from the actual ACPI includes. This breaks out the state definitons. The entire include can not be used since that file will not compile for a machine that is not using ACPI due to things like this: #ifndef ACPI_MACHINE_WIDTH #error ACPI_MACHINE_WIDTH not defined #endif So just break it out, include it back into the original file and be done with it. After this the serial core can piggyback the actual state definitions from the ACPI subsystem. Signed-off-by: Linus Walleij --- include/acpi/acstates.h | 32 ++++++++++++++++++++++++++++++++ include/acpi/actypes.h | 32 ++------------------------------ 2 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 include/acpi/acstates.h diff --git a/include/acpi/acstates.h b/include/acpi/acstates.h new file mode 100644 index 0000000..fe73f6c --- /dev/null +++ b/include/acpi/acstates.h @@ -0,0 +1,32 @@ +/* + * Power state values + * + * These defines are used by subsystems that are not necessarily + * tied in to using ACPI. + */ +#define ACPI_STATE_UNKNOWN (u8) 0xFF + +#define ACPI_STATE_S0 (u8) 0 +#define ACPI_STATE_S1 (u8) 1 +#define ACPI_STATE_S2 (u8) 2 +#define ACPI_STATE_S3 (u8) 3 +#define ACPI_STATE_S4 (u8) 4 +#define ACPI_STATE_S5 (u8) 5 +#define ACPI_S_STATES_MAX ACPI_STATE_S5 +#define ACPI_S_STATE_COUNT 6 + +#define ACPI_STATE_D0 (u8) 0 +#define ACPI_STATE_D1 (u8) 1 +#define ACPI_STATE_D2 (u8) 2 +#define ACPI_STATE_D3_HOT (u8) 3 +#define ACPI_STATE_D3 (u8) 4 +#define ACPI_STATE_D3_COLD ACPI_STATE_D3 +#define ACPI_D_STATES_MAX ACPI_STATE_D3 +#define ACPI_D_STATE_COUNT 5 + +#define ACPI_STATE_C0 (u8) 0 +#define ACPI_STATE_C1 (u8) 1 +#define ACPI_STATE_C2 (u8) 2 +#define ACPI_STATE_C3 (u8) 3 +#define ACPI_C_STATES_MAX ACPI_STATE_C3 +#define ACPI_C_STATE_COUNT 4 diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 4f43f1f..29d6c46 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -44,6 +44,8 @@ #ifndef __ACTYPES_H__ #define __ACTYPES_H__ +#include "acstates.h" + /* acpisrc:struct_defs -- for acpisrc conversion */ /* @@ -487,36 +489,6 @@ typedef u64 acpi_integer; #define ACPI_INITIALIZED_OK 0x02 /* - * Power state values - */ -#define ACPI_STATE_UNKNOWN (u8) 0xFF - -#define ACPI_STATE_S0 (u8) 0 -#define ACPI_STATE_S1 (u8) 1 -#define ACPI_STATE_S2 (u8) 2 -#define ACPI_STATE_S3 (u8) 3 -#define ACPI_STATE_S4 (u8) 4 -#define ACPI_STATE_S5 (u8) 5 -#define ACPI_S_STATES_MAX ACPI_STATE_S5 -#define ACPI_S_STATE_COUNT 6 - -#define ACPI_STATE_D0 (u8) 0 -#define ACPI_STATE_D1 (u8) 1 -#define ACPI_STATE_D2 (u8) 2 -#define ACPI_STATE_D3_HOT (u8) 3 -#define ACPI_STATE_D3 (u8) 4 -#define ACPI_STATE_D3_COLD ACPI_STATE_D3 -#define ACPI_D_STATES_MAX ACPI_STATE_D3 -#define ACPI_D_STATE_COUNT 5 - -#define ACPI_STATE_C0 (u8) 0 -#define ACPI_STATE_C1 (u8) 1 -#define ACPI_STATE_C2 (u8) 2 -#define ACPI_STATE_C3 (u8) 3 -#define ACPI_C_STATES_MAX ACPI_STATE_C3 -#define ACPI_C_STATE_COUNT 4 - -/* * Sleep type invalid value */ #define ACPI_SLEEP_TYPE_MAX 0x7