diff options
author | David Hendricks <dhendrix@chromium.org> | 2012-08-28 14:14:06 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-28 15:38:58 -0700 |
commit | a90949661214a14a5f299181267db45a67b6b81e (patch) | |
tree | 3402b1b550aab2be3e943a2749e06e0aaff4951a | |
parent | ac26b57735e57647544f2838d0548c1b7263c284 (diff) | |
download | chrome-ec-a90949661214a14a5f299181267db45a67b6b81e.tar.gz |
stm32f: remove gpio_set_alternate_function()
gpio_set_alternate_function() for STM32F is not used, and even if
it were it would be incorrect. So for now it just takes up space.
Unlike STM32L, alternate functions rely on toggling bits in AFIO
remapping registers rather than setting a simple AF number. This
would make writing a working version of this function trickier,
and it may not be worth the effort.
Signed-off-by: David Hendricks <dhendrix@chromum.org>
BRANCH=snow
BUG=none
TEST=locally compiled for snow
Change-Id: I2ce1e7aba2760a94819500af4e322812f3346ad3
Reviewed-on: https://gerrit.chromium.org/gerrit/31630
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r-- | chip/stm32/gpio-stm32f100.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/chip/stm32/gpio-stm32f100.c b/chip/stm32/gpio-stm32f100.c index 0cc79a0856..2641db612c 100644 --- a/chip/stm32/gpio-stm32f100.c +++ b/chip/stm32/gpio-stm32f100.c @@ -153,43 +153,6 @@ int gpio_init(void) DECLARE_HOOK(HOOK_INIT, gpio_init, HOOK_PRIO_DEFAULT); -void gpio_set_alternate_function(int port, int mask, int func) -{ - int i; - const struct gpio_info *g = gpio_list; - uint32_t addr, cnf, mode, val = 0; - - /* - * TODO(dhendrix): STM32 GPIO registers do not have free-form - * alternate function setup like the STM32, where each pin can - * be configured for any alternate function (though not necessarily - * in a valid fashion). Instead, pre-determined sets of pins for a - * a given alternate function are chosen via a remapping register. - * - * Consequently, this function becomes very simple and can (should?) - * be merged into gpio_pre_init. - */ - for (i = 0; i < GPIO_COUNT; i++, g++) { - if ((g->port != port) || (g->mask != mask)) - continue; - - gpio_config_info(g, &addr, &mode, &cnf); - val = REG32(addr) & ~cnf; - - /* switch from general output to alternate output mode */ - if (g->flags & GPIO_OUTPUT) { - if (g->flags & GPIO_OPEN_DRAIN) - val |= 0xcccccccc & cnf; - else - val |= 0x88888888 & cnf; - } - - REG32(addr) = val ; - break; - } -} - - uint16_t *gpio_get_level_reg(enum gpio_signal signal, uint32_t *mask) { *mask = gpio_list[signal].mask; |