diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-12-18 22:14:14 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-12-18 22:14:14 +0000 |
commit | 353c344d0a94bbb019b6defcaa48d951c7a607fa (patch) | |
tree | 4addfe4a2b68005a49769c69ee15bba0628fbdc8 /sys | |
parent | d2b5de0ca7a52192665f80f4a40c4c64a8fbbfdf (diff) |
Add symbolic constants related to open source and open drain GPIOs.
ok patrick@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ofw/ofw_gpio.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/ofw/ofw_gpio.h b/sys/dev/ofw/ofw_gpio.h index e9025a2d8ac..95bcea95351 100644 --- a/sys/dev/ofw/ofw_gpio.h +++ b/sys/dev/ofw/ofw_gpio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_gpio.h,v 1.4 2020/04/27 12:15:30 kettenis Exp $ */ +/* $OpenBSD: ofw_gpio.h,v 1.5 2020/12/18 22:14:13 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -18,8 +18,15 @@ #ifndef _DEV_OFW_GPIO_H_ #define _DEV_OFW_GPIO_H_ -#define GPIO_ACTIVE_HIGH 0 -#define GPIO_ACTIVE_LOW 1 +#define GPIO_ACTIVE_HIGH (0 << 0) +#define GPIO_ACTIVE_LOW (1 << 0) +#define GPIO_PUSH_PULL (0 << 1) +#define GPIO_SINGLE_ENDED (1 << 1) +#define GPIO_LINE_OPEN_SOURCE (0 << 2) +#define GPIO_LINE_OPEN_DRAIN (1 << 2) + +#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN) +#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE) struct gpio_controller { int gc_node; |