Skip to content
Permalink
Browse files

drivers/gpio_intel_apl.c: fix return value for gpio_pin_read()

gpio_intel_apl_read() should set *value to 1, not 2, when the
GPIO input is a logical high.

Fixes: #15499

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
  • Loading branch information...
Charles E. Youse authored and nashif committed Apr 17, 2019
1 parent 6b4007e commit 8905b0fe219396cf7244341415837ed14f63b185
Showing with 2 additions and 2 deletions.
  1. +2 −2 drivers/gpio/gpio_intel_apl.c
@@ -345,10 +345,10 @@ static int gpio_intel_apl_read(struct device *dev, int access_op,

if (!(val & PAD_CFG0_TXDIS)) {
/* If TX is not disabled, return TX_STATE */
*value = val & PAD_CFG0_TXSTATE;
*value = (val & PAD_CFG0_TXSTATE) >> PAD_CFG0_TXSTATE_POS;
} else {
/* else just return RX_STATE */
*value = val & PAD_CFG0_RXSTATE;
*value = (val & PAD_CFG0_RXSTATE) >> PAD_CFG0_RXSTATE_POS;
}

return 0;

0 comments on commit 8905b0f

Please sign in to comment.
You can’t perform that action at this time.