summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/superio/winbond/common/early_serial.c13
-rw-r--r--src/superio/winbond/common/winbond.h3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/superio/winbond/common/early_serial.c b/src/superio/winbond/common/early_serial.c
index 6482a94838..aebbd38b46 100644
--- a/src/superio/winbond/common/early_serial.c
+++ b/src/superio/winbond/common/early_serial.c
@@ -66,3 +66,16 @@ void winbond_enable_serial(pnp_devfn_t dev, u16 iobase)
pnp_set_enable(dev, 1);
pnp_exit_conf_state(dev);
}
+
+void winbond_set_pinmux(pnp_devfn_t dev, uint8_t offset, uint8_t mask, uint8_t state)
+{
+ uint8_t byte;
+
+ /* Configure pin mux */
+ pnp_enter_conf_state(dev);
+ byte = pnp_read_config(dev, offset);
+ byte &= ~mask;
+ byte |= state;
+ pnp_write_config(dev, offset, byte);
+ pnp_exit_conf_state(dev);
+}
diff --git a/src/superio/winbond/common/winbond.h b/src/superio/winbond/common/winbond.h
index 1f7e7b1794..6e67eeb83d 100644
--- a/src/superio/winbond/common/winbond.h
+++ b/src/superio/winbond/common/winbond.h
@@ -20,7 +20,8 @@
#include <arch/io.h>
#include <stdint.h>
-void winbond_enable_serial(pnp_devfn_t dev, u16 iobase);
+void winbond_enable_serial(pnp_devfn_t dev, uint16_t iobase);
+void winbond_set_pinmux(pnp_devfn_t dev, uint8_t offset, uint8_t mask, uint8_t state);
void pnp_enter_conf_state(pnp_devfn_t dev);
void pnp_exit_conf_state(pnp_devfn_t dev);