summaryrefslogtreecommitdiffstats
path: root/src/southbridge/intel/lynxpoint/lp_gpio.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-06-21 13:37:23 -0500
committerRonald G. Minnich <rminnich@gmail.com>2013-12-05 20:14:01 +0100
commit550bcca6021f475d4ad7dd2c73d6bc4b5a93f94a (patch)
tree488eaa722dac090f7bc2bfda971b0e12f2ef0cdd /src/southbridge/intel/lynxpoint/lp_gpio.c
parentab365af0a05e391d1e20e39e8bfb61c023b0a678 (diff)
downloadcoreboot-550bcca6021f475d4ad7dd2c73d6bc4b5a93f94a.tar.gz
coreboot-550bcca6021f475d4ad7dd2c73d6bc4b5a93f94a.tar.bz2
coreboot-550bcca6021f475d4ad7dd2c73d6bc4b5a93f94a.zip
lynxpoint: provide gpio_is_native()
There's a need to determine if a specific gpio pin is is set up to be a native function or not. Implement this. Change-Id: I91d57a549e0f4fddc0b1849e5f74320fc839642c Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/59589 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/4324 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/southbridge/intel/lynxpoint/lp_gpio.c')
-rw-r--r--src/southbridge/intel/lynxpoint/lp_gpio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/southbridge/intel/lynxpoint/lp_gpio.c b/src/southbridge/intel/lynxpoint/lp_gpio.c
index 7d1a28d73cf5..cb052b22c39d 100644
--- a/src/southbridge/intel/lynxpoint/lp_gpio.c
+++ b/src/southbridge/intel/lynxpoint/lp_gpio.c
@@ -159,3 +159,10 @@ void set_gpio(int gpio_num, int value)
conf0 |= value << GPO_LEVEL_SHIFT;
outl(conf0, gpio_base + GPIO_CONFIG0(gpio_num));
}
+
+int gpio_is_native(int gpio_num)
+{
+ u16 gpio_base = get_gpio_base();
+
+ return !(inl(gpio_base + GPIO_CONFIG0(gpio_num)) & 1);
+}