diff options
Diffstat (limited to 'common/gpio.c')
-rw-r--r-- | common/gpio.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/common/gpio.c b/common/gpio.c index 9fa8512e27..2e76116e4c 100644 --- a/common/gpio.c +++ b/common/gpio.c @@ -1,10 +1,11 @@ -/* Copyright 2013 The Chromium OS Authors. All rights reserved. +/* Copyright 2013 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* GPIO common functionality for Chrome EC */ +#include "builtin/assert.h" #include "common.h" #include "gpio.h" #include "ioexpander.h" @@ -34,9 +35,9 @@ struct gpio_alt_func { * Construct the gpio_alt_funcs array. This array is used by gpio_config_module * to enable and disable GPIO alternate functions on a module by module basis. */ -#define ALTERNATE(pinmask, function, module, flagz) \ - {GPIO_##pinmask, .func = (function), .module_id = (module), \ - .flags = (flagz)}, +#define ALTERNATE(pinmask, function, module, flagz) \ + { GPIO_##pinmask, .func = (function), .module_id = (module), \ + .flags = (flagz) }, static __const_data const struct gpio_alt_func gpio_alt_funcs[] = { #include "gpio.wrap" @@ -74,9 +75,9 @@ static int gpio_config_pins(enum module_id id, uint32_t port, uint32_t pin_mask, gpio_set_flags_by_mask( af->port, (af->mask & pin_mask), enable ? af->flags : GPIO_INPUT); - gpio_set_alternate_function(af->port, - (af->mask & pin_mask), - enable ? af->func : GPIO_ALT_FUNC_NONE); + gpio_set_alternate_function( + af->port, (af->mask & pin_mask), + enable ? af->func : GPIO_ALT_FUNC_NONE); rv = EC_SUCCESS; /* We're done here if we were just setting one port. */ if (port != GPIO_CONFIG_ALL_PORTS) @@ -222,8 +223,8 @@ int gpio_or_ioex_get_level(int signal, int *value) int signal_is_gpio(int signal) { - return ((signal >= GPIO_SIGNAL_START) - && (signal < GPIO_SIGNAL_START + GPIO_COUNT)); + return ((signal >= GPIO_SIGNAL_START) && + (signal < GPIO_SIGNAL_START + GPIO_COUNT)); } __attribute__((weak)) void gpio_set_wakepin(enum gpio_signal signal, |