diff options
author | CHLin <CHLIN56@nuvoton.com> | 2018-10-31 17:54:10 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-05 04:55:03 -0800 |
commit | d607e8e1ac8e44222ce14b23bfc05bf0cba473bf (patch) | |
tree | 90564fb156f65a031b4ee3229e2f22809519a277 /common/gpio_commands.c | |
parent | efa0cb94e8cb111bb296523402bfa689e97dc92e (diff) | |
download | chrome-ec-d607e8e1ac8e44222ce14b23bfc05bf0cba473bf.tar.gz |
npcx: gpio: implement the gpio_get_flags_by_mask function
This CL adds the gpio_get_flags_by_mask function which is used to get
the flag information of a GPIO when CONFIG_CMD_GPIO_EXTENDED is enabled.
BRANCH=none
BUG=b:118390658
TEST=No build error for make buildall.
TEST=Enable CONFIG_CMD_GPIO_EXTENDED in npcx7_evb/board.h; modify flags
of GPIOs in gpio.inc to cover all the flags required to be shown in
print_gpio_info(); check the result of "gpioget" is consistent with
what is set in the gpio.inc.
Change-Id: Icb17e59f959c0d15e95023f27187972f690d88ce
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/1312515
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/gpio_commands.c')
-rw-r--r-- | common/gpio_commands.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/gpio_commands.c b/common/gpio_commands.c index 32bd896c0c..aafc376e79 100644 --- a/common/gpio_commands.c +++ b/common/gpio_commands.c @@ -92,7 +92,8 @@ static void print_gpio_info(int gpio) #endif changed = last_val_changed(gpio, v); - ccprintf(" %d%c %s%s%s%s%s%s%s%s%s%s\n", v, (changed ? '*' : ' '), + ccprintf(" %d%c %s%s%s%s%s%s%s%s%s%s%s%s\n", v, + (changed ? '*' : ' '), (flags & GPIO_INPUT ? "I " : ""), (flags & GPIO_OUTPUT ? "O " : ""), (flags & GPIO_LOW ? "L " : ""), @@ -102,6 +103,8 @@ static void print_gpio_info(int gpio) (flags & GPIO_PULL_UP ? "PU " : ""), (flags & GPIO_PULL_DOWN ? "PD " : ""), (flags & GPIO_ALTERNATE ? "ALT " : ""), + (flags & GPIO_SEL_1P8V ? "1P8 " : ""), + (flags & GPIO_LOCKED ? "LCK " : ""), gpio_get_name(gpio)); /* Flush console to avoid truncating output */ |