summaryrefslogtreecommitdiff
path: root/include/chipset.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-09-20 14:00:45 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-09-23 21:26:29 +0000
commit29ee9c6d48910c8ce327ac1ccee18eaca9036eb1 (patch)
tree4cf80eba8c079749ac138d4caf58bebf7897ee26 /include/chipset.h
parent6277f7e336f0dc96b676905a4c420f9d53951603 (diff)
downloadchrome-ec-29ee9c6d48910c8ce327ac1ccee18eaca9036eb1.tar.gz
Support compiling with chipset task disabled
For bringup, we need to be able to compile a binary with the chipset task disabled. Chipset functions should be stubbed to do nothing in that case. BUG=chrome-os-partner:22820 BRANCH=none TEST=compile falco, pit, link with chipset task commented out in ec.tasklist Change-Id: I73a4e09effb049f19b1a128e643b267d6469037b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170221
Diffstat (limited to 'include/chipset.h')
-rw-r--r--include/chipset.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/include/chipset.h b/include/chipset.h
index 932f1aec3e..ddf4eb3db0 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -35,6 +35,7 @@ enum chipset_state_mask {
};
#ifdef HAS_TASK_CHIPSET
+
/**
* Check if chipset is in a given state.
*
@@ -44,14 +45,7 @@ enum chipset_state_mask {
* mask.
*/
int chipset_in_state(int state_mask);
-#else
-static inline int chipset_in_state(int state_mask)
-{
- return 0;
-}
-#endif
-#ifdef HAS_TASK_CHIPSET
/**
* Ask the chipset to exit the hard off state.
*
@@ -59,9 +53,6 @@ static inline int chipset_in_state(int state_mask)
* state to begin with.
*/
void chipset_exit_hard_off(void);
-#else
-static inline void chipset_exit_hard_off(void) { }
-#endif
/* This is a private chipset-specific implementation for use only by
* throttle_ap() . Don't call this directly!
@@ -84,4 +75,22 @@ void chipset_force_shutdown(void);
*/
void chipset_reset(int cold_reset);
+#else /* !HAS_TASK_CHIPSET */
+/*
+ * Allow other modules to compile if the chipset module is disabled. This is
+ * commonly done during early stages of board bringup.
+ */
+
+static inline int chipset_in_state(int state_mask)
+{
+ return 0;
+}
+
+static inline void chipset_exit_hard_off(void) { }
+static inline void chipset_throttle_cpu(int throttle) { }
+static inline void chipset_force_shutdown(void) { }
+static inline void chipset_reset(int cold_reset) { }
+
+#endif /* !HAS_TASK_CHIPSET */
+
#endif /* __CROS_EC_CHIPSET_H */