summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/g/gpio.c6
-rw-r--r--chip/g/registers.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/chip/g/gpio.c b/chip/g/gpio.c
index 95b2a79385..ff2e05890c 100644
--- a/chip/g/gpio.c
+++ b/chip/g/gpio.c
@@ -87,7 +87,11 @@ void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func)
static void connect_pinmux(uint32_t signal, uint32_t dio, uint16_t flags)
{
- if (FIELD_IS_FUNC(signal)) {
+ if (flags & DIO_ENABLE_DIRECT_INPUT) {
+ /* enable digital input for direct wired peripheral */
+ REG_WRITE_MLV(DIO_CTL_REG(dio), DIO_CTL_IE_MASK,
+ DIO_CTL_IE_LSB, 1);
+ } else if (FIELD_IS_FUNC(signal)) {
/* Connect peripheral function to DIO */
if (flags & DIO_OUTPUT) {
/* drive DIO from peripheral */
diff --git a/chip/g/registers.h b/chip/g/registers.h
index a7ab14e67c..566bf063b3 100644
--- a/chip/g/registers.h
+++ b/chip/g/registers.h
@@ -185,6 +185,7 @@ static inline int x_uart_addr(int ch, int offset)
/* Flags to indicate the direction of the signal-to-pin connection */
#define DIO_INPUT 0x0001
#define DIO_OUTPUT 0x0002
+#define DIO_ENABLE_DIRECT_INPUT 0x0004
/*
* To store a pinmux DIO in the struct gpio_alt_func's mask field, we use: