Hello Marco Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/34190
to review the following change.
Change subject: soc/intel/gpio: add support to the function - gpio_get_output(). ......................................................................
soc/intel/gpio: add support to the function - gpio_get_output().
BUG=b:137033609 BRANCH=octopus TEST=build image and verify on the DUT to check returned value.
Change-Id: I85bfd66c32528dc1191dc8896322c5894f5cfc02 Signed-off-by: Marco Chen marcochen@google.com --- M src/soc/intel/common/block/gpio/gpio.c 1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/34190/1
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c index 7ebf05a..a53e16a 100644 --- a/src/soc/intel/common/block/gpio/gpio.c +++ b/src/soc/intel/common/block/gpio/gpio.c @@ -402,6 +402,18 @@ return !!(reg & PAD_CFG0_RX_STATE); }
+int gpio_get_output(gpio_t gpio_num) +{ + const struct pad_community *comm = gpio_get_community(gpio_num); + uint16_t config_offset; + uint32_t reg; + + config_offset = pad_config_offset(comm, gpio_num); + reg = pcr_read32(comm->port, config_offset); + + return !!(reg & PAD_CFG0_TX_STATE); +} + void gpio_set(gpio_t gpio_num, int value) { const struct pad_community *comm = gpio_get_community(gpio_num);
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34190?usp=email )
Change subject: soc/intel/gpio: add support to the function - gpio_get_output(). ......................................................................
Abandoned