summaryrefslogtreecommitdiff
path: root/src/soc/nvidia/tegra/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/nvidia/tegra/gpio.h')
-rw-r--r--src/soc/nvidia/tegra/gpio.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/soc/nvidia/tegra/gpio.h b/src/soc/nvidia/tegra/gpio.h
index 546ea05030..70c1026f44 100644
--- a/src/soc/nvidia/tegra/gpio.h
+++ b/src/soc/nvidia/tegra/gpio.h
@@ -31,10 +31,20 @@ typedef u32 gpio_t;
#define GPIO(name) ((gpio_t)(GPIO_##name##_INDEX | \
(PINMUX_GPIO_##name << GPIO_PINMUX_SHIFT)))
+void __gpio_output(gpio_t gpio, int value, u32 open_drain);
+void __gpio_input(gpio_t gpio, u32 pull);
+
/* Higher level function wrappers for common GPIO configurations. */
-void gpio_output(gpio_t gpio, int value);
-void __gpio_input(gpio_t gpio, u32 pull);
+static inline void gpio_output(gpio_t gpio, int value)
+{
+ __gpio_output(gpio, value, 0);
+}
+
+static inline void gpio_output_open_drain(gpio_t gpio, int value)
+{
+ __gpio_output(gpio, value, PINMUX_OPEN_DRAIN);
+}
static inline void gpio_input(gpio_t gpio)
{