diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-06-24 15:49:28 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-12 22:34:56 -0700 |
commit | 49312e06cdb93091b20ac3249fccb4dd711996b6 (patch) | |
tree | aad434ac48eaeda17750ae6138146f95c138bd19 /include | |
parent | 9146e44c7d14ce73061b949373b4787483c39ad8 (diff) | |
download | chrome-ec-49312e06cdb93091b20ac3249fccb4dd711996b6.tar.gz |
cr50: disable device monitoring when not in ccd
When cr50 is not trying to do ccd, we dont need to monitor the devices.
Disable device state detection interrupts and the AP and EC UARTs.
BUG=none
BRANCH=none
TEST=gru and kevin monitor devices correctly when ccd is enabled, and
dont monitor anything when it is disabled.
Change-Id: Ic3f5974320486ff6dd0147c490a1c294cc2f6a76
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/356770
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/device_state.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/device_state.h b/include/device_state.h index 1af3972bfb..d7ff0661dc 100644 --- a/include/device_state.h +++ b/include/device_state.h @@ -17,20 +17,36 @@ enum device_state { }; struct device_config { - enum device_state state; - int state_change; + const char *name; /* Device name */ + enum device_state state; /* Device status */ + /* Deferred handler to detect power off */ const struct deferred_data *deferred; - enum gpio_signal detect_on; - enum gpio_signal detect_off; + enum gpio_signal detect_on; /* GPIO detecting power on */ + enum gpio_signal detect_off; /* GPIO detecting power off */ }; enum device_type; extern struct device_config device_states[]; +/* Return the device state */ int device_get_state(enum device_type device); +/** + * Sets the device state + * + * @param device the device to update + * @param state the new device state + */ void device_set_state(enum device_type device, enum device_state state); +/* Update the device state based on the device gpios */ void board_update_device_state(enum device_type device); + +/** + * Enables or disables all device gpio interrupts + * + * @param enable enable or disable detection + */ +void device_detect_state_enable(int enable); #endif /* __CROS_DEVICE_STATE_H */ |