summaryrefslogtreecommitdiff
path: root/include/espi.h
diff options
context:
space:
mode:
authorScott Worley <scott.worley@microchip.corp-partner.google.com>2017-12-20 12:23:59 -0500
committerchrome-bot <chrome-bot@chromium.org>2018-01-02 15:48:20 -0800
commitd813935b827b55f4650365a5e9e8096e47122f07 (patch)
tree32d0ef28e42c9b540770a5e4572e163e80f62b52 /include/espi.h
parentb74f6a576a822f43872f07aebb6909a457a84afa (diff)
downloadchrome-ec-d813935b827b55f4650365a5e9e8096e47122f07.tar.gz
espi: Add API to test if signal is eSPI virtual wire
Add espi_signal_is_vw in new file common/espi.c for testing if a signal is an eSPI virtual wire. API used in power common and intel_x86. Fix CONFIG_BRINGUP support for eSPI (off by default). Add espi_vw_get_wire_name returning a pointer to constant string. Chip modules do not need to maintain names of eSPI signals. BRANCH=none BUG= TEST=Build poppy and other eSPI enabled boards. Test power state machine. Change-Id: I13319e79d208c69092a02ec3ac655477d3043d61 Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/836818 Commit-Ready: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/espi.h')
-rw-r--r--include/espi.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/espi.h b/include/espi.h
index d96f79c9c8..2795f9aacb 100644
--- a/include/espi.h
+++ b/include/espi.h
@@ -40,6 +40,8 @@ enum espi_vw_signal {
VW_SIGNAL_BASE_END,
};
+#define VW_SIGNAL_COUNT (VW_SIGNAL_BASE_END - VW_SIGNAL_BASE - 1)
+
/**
* Set eSPI Virtual-Wire signal to Host
*
@@ -73,4 +75,20 @@ int espi_vw_enable_wire_int(enum espi_vw_signal signal);
*/
int espi_vw_disable_wire_int(enum espi_vw_signal signal);
+/**
+ * Return pointer to constant eSPI virtual wire signal name
+ *
+ * @param signal virtual wire enum
+ * @return pointer to string or NULL if signal out of range
+ */
+const char *espi_vw_get_wire_name(enum espi_vw_signal signal);
+
+/**
+ * Check if signal is an eSPI virtual wire
+ * @param signal is gpio_signal or espi_vw_signal enum casted to int
+ * @return 1 if signal is virtual wire else returns 0.
+ */
+int espi_signal_is_vw(int signal);
+
+
#endif /* __CROS_EC_ESPI_H */