From 7f3ed512dbb250f946fa62dd2ee5781b170fee48 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Thu, 21 Nov 2013 15:41:39 -0800 Subject: gpio: Make GPIO_INT_BOTH explicitly RISING|FALLING For historical reasons on LM4, we defined GPIO_INT_F_BOTH separately from GPIO_INT_F_RISING and GPIO_INT_F_FALLING. This means that the code has weird checks like BOTH || (RISING && FALLING), which have propagated in error-prone ways across the other chips. Instead, explcitly define BOTH to be RISING|FALLING. Ideally, we would have called it GPIO_INT_EDGE to match GPIO_INT_LEVEL, but changing that now would be a big find-replace. Which might still be a good idea, but that is best done in its own CL. BUG=chrome-os-partner:24204 BRANCH=none TEST=build and boot pit, spring, and link; that covers STM32F, STM32L, and LM4. Change-Id: I23ba05a3f41bb14b09af61dc52a178f710f5c1bb Signed-off-by: Randall Spangler Reviewed-on: https://chromium-review.googlesource.com/177643 Reviewed-by: Jeremy Thorpe Reviewed-by: Vic Yang --- include/gpio.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/gpio.h') diff --git a/include/gpio.h b/include/gpio.h index 6b1f80fe99..ae216269fb 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -24,7 +24,6 @@ #define GPIO_HIGH (1 << 7) /* If GPIO_OUTPUT, set level high */ #define GPIO_INT_F_RISING (1 << 8) /* Interrupt on rising edge */ #define GPIO_INT_F_FALLING (1 << 9) /* Interrupt on falling edge */ -#define GPIO_INT_F_BOTH (1 << 10) /* Interrupt on both edges */ #define GPIO_INT_F_LOW (1 << 11) /* Interrupt on low level */ #define GPIO_INT_F_HIGH (1 << 12) /* Interrupt on high level */ #define GPIO_DEFAULT (1 << 13) /* Don't set up on boot */ @@ -37,12 +36,12 @@ #define GPIO_ODR_LOW (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_LOW) #define GPIO_INT_RISING (GPIO_INPUT | GPIO_INT_F_RISING) #define GPIO_INT_FALLING (GPIO_INPUT | GPIO_INT_F_FALLING) -#define GPIO_INT_BOTH (GPIO_INPUT | GPIO_INT_F_BOTH) +/* TODO(crosbug.com/p/24204): "EDGE" would have been clearer than "BOTH". */ +#define GPIO_INT_BOTH (GPIO_INT_RISING | GPIO_INT_FALLING) #define GPIO_INT_LOW (GPIO_INPUT | GPIO_INT_F_LOW) #define GPIO_INT_HIGH (GPIO_INPUT | GPIO_INT_F_HIGH) -#define GPIO_INT_EDGE (GPIO_INT_RISING | GPIO_INT_FALLING | GPIO_INT_BOTH) #define GPIO_INT_LEVEL (GPIO_INT_LOW | GPIO_INT_HIGH) -#define GPIO_INT_ANY (GPIO_INT_EDGE | GPIO_INT_LEVEL) +#define GPIO_INT_ANY (GPIO_INT_BOTH | GPIO_INT_LEVEL) #define GPIO_INT_BOTH_DSLEEP (GPIO_INT_BOTH | GPIO_INT_DSLEEP) /* GPIO signal definition structure, for use by board.c */ -- cgit v1.2.1