summaryrefslogtreecommitdiff
path: root/include/gpio.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-09-25 13:22:32 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-26 01:07:39 -0700
commit747056ec93b7d55a117be812a5d77452b0851086 (patch)
treee8bbe84cbf4b35a0c496067b890c2f7fe0435c88 /include/gpio.h
parentc121a3287c2917cf2abed497bd22371fabea6474 (diff)
downloadchrome-ec-747056ec93b7d55a117be812a5d77452b0851086.tar.gz
gpio: Merge config_module into config_pins.
gpio_config_module() and gpio_config_pins() had very similar code. This commit moves the functionality of gpio_config_module into gpio_config_pins. That is, gpio_config_pins() can now configure an entire module. This is accomplished by passing in GPIO_CONFIG_ALL_PORTS as the port parameter. BUG=chromium:533539 BRANCH=None TEST=Build and flash on samus. Verify that lightbar, charging, power button, sensors, all functional. TEST=make -j buildall tests Change-Id: I7c9122ebf7b0e2716af2d55b842c4806d8099a63 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/302479 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/gpio.h')
-rw-r--r--include/gpio.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h
index 31f68b1c4b..6b76f29d04 100644
--- a/include/gpio.h
+++ b/include/gpio.h
@@ -10,6 +10,13 @@
#include "common.h"
+/*
+ * GPIO_CONFIG_ALL_PORTS signifies a "don't care" for the GPIO port. This is
+ * used in gpio_config_pins(). When the port parameter is set to this, the
+ * pin_mask parameter is ignored.
+ */
+#define GPIO_CONFIG_ALL_PORTS 0xFFFFFFFF
+
/* Flag definitions for gpio_info and gpio_alt_func */
/* The following are valid for both gpio_info and gpio_alt_func: */
#define GPIO_OPEN_DRAIN (1 << 0) /* Output type is open-drain */
@@ -129,6 +136,9 @@ void gpio_config_module(enum module_id id, int enable);
/**
* Enable/disable alternate function for pins
*
+ * Note, you can also configure an entire module by setting the port parameter
+ * equal to GPIO_CONFIG_ALL_PORTS.
+ *
* @param id module ID of pins
* @param port Port of pins
* @param pin_mask Bit mask of pins