mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
mec1322: Allow GPIO hibernate state to be specified at board-level
Add a new board-level function board_get_gpio_hibernate_state which can optionally be defined to set the desired state of a GPIO during hibernate. BUG=chrome-os-partner:43807 TEST=Manual on Glados with subsequent commit. Run 'hibernate' on console, verify that LED remains off. Press power button, verify that board wakes. BRANCH=None Change-Id: Ica11554e231e88773c3e139fea4622377ebe1e42 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/292471 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
fba4f335a9
commit
5b93f04c19
@@ -49,6 +49,11 @@
|
||||
/* Convert GPIO mask to GPIO number / index. */
|
||||
#define GPIO_MASK_TO_NUM(mask) (31 - __builtin_clz(mask))
|
||||
|
||||
/* Convert a GPIO to a port + mask pair */
|
||||
#define GPIO_TO_PORT_MASK_PAIR(gpio) \
|
||||
{ gpio_list[(gpio)].port, \
|
||||
GPIO_MASK_TO_NUM(gpio_list[(gpio)].mask) }
|
||||
|
||||
/* NOTE: This is normally included from board.h, thru config.h and common.h But,
|
||||
* some boards and unit tests don't have a gpio_signal enum defined, so we
|
||||
* define an emtpy one here.*/
|
||||
|
||||
Reference in New Issue
Block a user