From 42bfa2f5d47a0dc19bca289571c7215b71c34d2d Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 5 Mar 2012 09:56:20 -0800 Subject: Add platform-neutral chipset interface ...since x86_power_in_S0() is a terrible function to have implemented for gaia chipsets, and I need to add more detectable states for lid switch handling anyway. Signed-off-by: Randall Spangler BUG=none TEST=none Change-Id: I0c90c6875b27d1bf23f093e88e34eabf2a8c86e4 --- include/chipset.h | 32 ++++++++++++++++++++++++++++++++ include/x86_power.h | 3 --- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 include/chipset.h (limited to 'include') diff --git a/include/chipset.h b/include/chipset.h new file mode 100644 index 0000000000..8e126ccddc --- /dev/null +++ b/include/chipset.h @@ -0,0 +1,32 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Chipset module for Chrome EC. + * + * This is intended to be a platform/chipset-neutral interface, implemented by + * all main chipsets (x86, gaia, etc.). */ + +#ifndef __CROS_EC_CHIPSET_H +#define __CROS_EC_CHIPSET_H + +#include "common.h" + +/* Chipset state. + * + * Note that this is a non-exhaustive list of states which the main chipset can + * be in, and is potentially one-to-many for real, underlying chipset states. + * That's why chipset_in_state() asks "Is the chipset in something + * approximating this state?" and not "Tell me what state the chipset is in and + * I'll compare it myself with the state(s) I want." */ +enum chipset_state { + CHIPSET_STATE_SOFT_OFF, /* Soft off (S5) */ + CHIPSET_STATE_SUSPEND, /* Suspend (S3) */ + CHIPSET_STATE_ON, /* On (S0) */ +}; + +/* Returns non-zero if the chipset is in the specified state. */ +int chipset_in_state(enum chipset_state in_state); + +#endif /* __CROS_EC_CHIPSET_H */ diff --git a/include/x86_power.h b/include/x86_power.h index fc0d812413..41191b4d3f 100644 --- a/include/x86_power.h +++ b/include/x86_power.h @@ -17,9 +17,6 @@ int x86_power_init(void); /* Interrupt handler for input GPIOs */ void x86_power_interrupt(enum gpio_signal signal); -/* Returns true if the system is in S0. */ -int x86_power_in_S0(void); - /* Informs the power module that the CPU has overheated (too_hot=1) or is * no longer too hot (too_hot=0). */ void x86_power_cpu_overheated(int too_hot); -- cgit v1.2.1