From a68336119c4e1639ebbdbb90e8030ad0522947a0 Mon Sep 17 00:00:00 2001 From: Marc Balmer Date: Sat, 17 Nov 2007 09:16:52 +0000 Subject: Support GPIO_PIN_PULLDOWN (pulldown-enable) as GPIO pin flag. --- sys/arch/i386/pci/glxpcib.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/i386/pci/glxpcib.c b/sys/arch/i386/pci/glxpcib.c index f3ee85e9eec..62e520106d8 100644 --- a/sys/arch/i386/pci/glxpcib.c +++ b/sys/arch/i386/pci/glxpcib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxpcib.c,v 1.3 2007/11/16 21:07:01 mbalmer Exp $ */ +/* $OpenBSD: glxpcib.c,v 1.4 2007/11/17 09:16:51 mbalmer Exp $ */ /* * Copyright (c) 2007 Marc Balmer @@ -108,17 +108,15 @@ /* GPIO */ #define MSR_LBAR_GPIO 0x5140000c - -#define AMD5536_GPIO_NPINS 32 - -#define AMD5536_GPIOH_OFFSET 0x80 /* high bank register offset */ - -#define AMD5536_GPIO_OUT_VAL 0x00 /* output value */ -#define AMD5536_GPIO_OUT_EN 0x04 /* output enable */ -#define AMD5536_GPIO_OD_EN 0x08 /* open-drain enable */ -#define AMD5536_GPIO_PU_EN 0x18 /* pull-up enable */ -#define AMD5536_GPIO_IN_EN 0x20 /* input enable */ -#define AMD5536_GPIO_READ_BACK 0x30 /* read back value */ +#define AMD5536_GPIO_NPINS 32 +#define AMD5536_GPIOH_OFFSET 0x80 /* high bank register offset */ +#define AMD5536_GPIO_OUT_VAL 0x00 /* output value */ +#define AMD5536_GPIO_OUT_EN 0x04 /* output enable */ +#define AMD5536_GPIO_OD_EN 0x08 /* open-drain enable */ +#define AMD5536_GPIO_PU_EN 0x18 /* pull-up enable */ +#define AMD5536_GPIO_PD_EN 0x1c /* pull-down enable */ +#define AMD5536_GPIO_IN_EN 0x20 /* input enable */ +#define AMD5536_GPIO_READ_BACK 0x30 /* read back value */ struct glxpcib_softc { struct device sc_dev; @@ -339,6 +337,9 @@ glxpcib_gpio_pin_ctl(void *arg, int pin, int flags) case GPIO_PIN_PULLUP: reg = AMD5536_GPIO_PU_EN; break; + case GPIO_PIN_PULLDOWN: + reg = AMD5536_GPIO_PD_EN; + break; default: /* flag not support by the AMD5536 GPIO */ return; -- cgit v1.2.3