mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 18:11:05 +00:00
Now pingpong and mutex tests compile. Still need some more work to handle the i8042-specific KEYPROTO task for keyboard tests. BUG=chrome-os-partner:18598 TEST=Build tests for link BRANCH=None Change-Id: I9ee35d4edb811f17b9a81beb799484a07c0bef14 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47981
94 lines
2.4 KiB
C
94 lines
2.4 KiB
C
/* 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 mask
|
|
*
|
|
* 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_mask {
|
|
CHIPSET_STATE_HARD_OFF = 0x01, /* Hard off (G3) */
|
|
CHIPSET_STATE_SOFT_OFF = 0x02, /* Soft off (S5) */
|
|
CHIPSET_STATE_SUSPEND = 0x04, /* Suspend (S3) */
|
|
CHIPSET_STATE_ON = 0x08, /* On (S0) */
|
|
/* Common combinations */
|
|
CHIPSET_STATE_ANY_OFF = (CHIPSET_STATE_HARD_OFF |
|
|
CHIPSET_STATE_SOFT_OFF), /* Any off state */
|
|
};
|
|
|
|
#ifdef CONFIG_TASK_CHIPSET
|
|
/**
|
|
* Check if chipset is in a given state.
|
|
*
|
|
* @param state_mask Combination of one or more CHIPSET_STATE_* flags.
|
|
*
|
|
* @return non-zero if the chipset is in one of the states specified in the
|
|
* mask.
|
|
*/
|
|
int chipset_in_state(int state_mask);
|
|
#else
|
|
static inline int chipset_in_state(int state_mask)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_TASK_CHIPSET
|
|
/**
|
|
* Ask the chipset to exit the hard off state.
|
|
*
|
|
* Does nothing if the chipset has already left the state, or was not in the
|
|
* state to begin with.
|
|
*/
|
|
void chipset_exit_hard_off(void);
|
|
#else
|
|
static inline void chipset_exit_hard_off(void) { }
|
|
#endif
|
|
|
|
/**
|
|
* Enable/disable CPU throttling.
|
|
*
|
|
* @param throttle Enable (!=0) or disable(0) throttling
|
|
*/
|
|
void chipset_throttle_cpu(int throttle);
|
|
|
|
#ifdef CONFIG_TASK_CHIPSET
|
|
/**
|
|
* Immedaitely shut off power to main processor and chipset.
|
|
*
|
|
* This is intended for use when the system is too hot or battery power is
|
|
* critical.
|
|
*/
|
|
void chipset_force_shutdown(void);
|
|
#else
|
|
static inline void chipset_force_shutdown(void) { }
|
|
#endif
|
|
|
|
/**
|
|
* Reset the CPU and/or chipset.
|
|
*
|
|
* @param cold_reset If !=0, force a cold reset of the CPU and chipset;
|
|
* if 0, just pulse the reset line to the CPU.
|
|
*/
|
|
void chipset_reset(int cold_reset);
|
|
|
|
#endif /* __CROS_EC_CHIPSET_H */
|