From 1695760e95a9d86eb11ca239da28cfe48a142af8 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 13 Jun 2013 15:37:56 -0700 Subject: Rename GPIO_HI_Z macros to more descriptive GPIO_ODR_HIGH/LOW GPIO_HI_Z was a bit misleading (it's high impedance by default, but it's actually an output not an input), but when we added GPIO_HI_Z_OPEN to mean "open-drain output, pulled low by default", it got too confusing. This renames those macros to: #define GPIO_ODR_HIGH (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_HIGH) #define GPIO_ODR_LOW (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_LOW) BUG=chrome-os-partner:18788 BRANCH=none TEST=none No functional change, just renaming some macros. If it compiles, it should be unchanged in behavior. Change-Id: Ic84d7be8531f2b240a8eca4f6cfe5291ebd2d5ef Signed-off-by: Bill Richardson Reviewed-on: https://gerrit.chromium.org/gerrit/58596 Reviewed-by: Aaron Durbin --- board/daisy/board.c | 4 ++-- board/falco/board.c | 6 +++--- board/link/board.c | 8 ++++---- board/mccroskey/board.c | 4 ++-- board/peppy/board.c | 14 +++++++------- board/pit/board.c | 14 +++++++------- board/slippy/board.c | 10 +++++----- board/snow/board.c | 6 +++--- board/spring/board.c | 4 ++-- chip/lm4/spi.c | 2 +- chip/stm32/i2c-stm32f100.c | 4 ++-- include/gpio.h | 4 ++-- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/board/daisy/board.c b/board/daisy/board.c index 777073cb77..dbd27ed0ef 100644 --- a/board/daisy/board.c +++ b/board/daisy/board.c @@ -79,8 +79,8 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"ENTERING_RW", GPIO_H, (1<<0), GPIO_OUT_LOW, NULL}, {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, {"POWER_LED_L", GPIO_B, (1<<3), GPIO_OUT_HIGH, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_HI_Z, NULL}, - {"CODEC_INT", GPIO_H, (1<<1), GPIO_HI_Z, NULL}, + {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, + {"CODEC_INT", GPIO_H, (1<<1), GPIO_ODR_HIGH, NULL}, {"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL}, {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, {"KB_OUT02", GPIO_B, (1<<12), GPIO_KB_OUTPUT, NULL}, diff --git a/board/falco/board.c b/board/falco/board.c index 95c47f3d80..0bca002f49 100644 --- a/board/falco/board.c +++ b/board/falco/board.c @@ -98,7 +98,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_NMI_L", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL}, {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_OUT_HIGH, NULL}, {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_HI_Z_OPEN, NULL}, + {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_ODR_LOW, NULL}, {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_OUT_HIGH, NULL}, {"TOUCHSCREEN_RESET_L", LM4_GPIO_N, (1<<7), GPIO_OUT_LOW, NULL}, @@ -109,8 +109,8 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"USB2_ENABLE", LM4_GPIO_D, (1<<5), GPIO_OUT_LOW, NULL}, {"PCH_SUSACK_L", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, - {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_HI_Z, NULL}, - {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_HI_Z, NULL}, + {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_ODR_HIGH, NULL}, + {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_ODR_HIGH, NULL}, {"PWR_LED_L", LM4_GPIO_N, (1<<6), GPIO_OUT_HIGH, NULL}, {"KB_LED_EN", LM4_GPIO_D, (1<<4), GPIO_OUT_LOW, NULL}, diff --git a/board/link/board.c b/board/link/board.c index 4a5e3ea999..1fa2bdfed2 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -99,15 +99,15 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_NMI_L", LM4_GPIO_M, (1<<2), GPIO_OUT_HIGH, NULL}, {"PCH_PWRBTN_L", LM4_GPIO_G, (1<<7), GPIO_OUT_HIGH, NULL}, {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - {"PCH_RCIN_L", LM4_GPIO_Q, (1<<7), GPIO_HI_Z, NULL}, + {"PCH_RCIN_L", LM4_GPIO_Q, (1<<7), GPIO_ODR_HIGH, NULL}, {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, - {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_HI_Z, NULL}, + {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_ODR_HIGH, NULL}, {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_OUT_HIGH, NULL}, - {"PCH_SRTCRST_L", LM4_GPIO_C, (1<<7), GPIO_HI_Z, NULL}, + {"PCH_SRTCRST_L", LM4_GPIO_C, (1<<7), GPIO_ODR_HIGH, NULL}, {"PCH_SUSACK_L", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, {"RADIO_ENABLE_WLAN", LM4_GPIO_D, (1<<0), GPIO_OUT_LOW, NULL}, {"RADIO_ENABLE_BT", LM4_GPIO_D, (1<<1), GPIO_OUT_LOW, NULL}, - {"SPI_CS_L", LM4_GPIO_A, (1<<3), GPIO_HI_Z, NULL}, + {"SPI_CS_L", LM4_GPIO_A, (1<<3), GPIO_ODR_HIGH, NULL}, {"TOUCHSCREEN_RESET_L", LM4_GPIO_B, (1<<0), GPIO_OUT_LOW, NULL}, {"USB1_CTL1", LM4_GPIO_E, (1<<2), GPIO_OUT_LOW, NULL}, {"USB1_CTL2", LM4_GPIO_E, (1<<3), GPIO_OUT_LOW, NULL}, diff --git a/board/mccroskey/board.c b/board/mccroskey/board.c index 2faff701dc..f751ce4ae3 100644 --- a/board/mccroskey/board.c +++ b/board/mccroskey/board.c @@ -46,7 +46,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KBD_PWR_BUTTON", GPIO_B, (1<<2), GPIO_INPUT, kbd_power_on}, {"OMZO_RDY_L", GPIO_A, (1<<0), GPIO_INPUT, NULL}, /* PA0_WKUP */ - {"OZMO_RST_L", GPIO_A, (1<<2), GPIO_HI_Z, NULL}, + {"OZMO_RST_L", GPIO_A, (1<<2), GPIO_ODR_HIGH, NULL}, {"VBUS_UP_DET", GPIO_A, (1<<3), GPIO_INPUT, NULL}, {"OZMO_REQ_L", GPIO_A, (1<<8), GPIO_INPUT, NULL}, {"CHARGE_ZERO", GPIO_B, (1<<0), GPIO_INPUT, NULL}, @@ -74,7 +74,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"KB_OUT11", GPIO_C, (1<<11), GPIO_KB_OUTPUT, NULL}, {"KB_OUT12", GPIO_C, (1<<12), GPIO_KB_OUTPUT, NULL}, {"USB_VBUS_CTRL", GPIO_C, (1<<13), GPIO_OUT_LOW, NULL}, - {"HUB_RESET", GPIO_C, (1<<14), GPIO_HI_Z, NULL}, + {"HUB_RESET", GPIO_C, (1<<14), GPIO_ODR_HIGH, NULL}, {"WP_L", GPIO_D, (1<<2), GPIO_INPUT, NULL}, /* FIXME: make this alt. function */ diff --git a/board/peppy/board.c b/board/peppy/board.c index 9eaf17f718..fccb3aab8c 100644 --- a/board/peppy/board.c +++ b/board/peppy/board.c @@ -98,7 +98,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_NMI_L", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL}, {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_OUT_HIGH, NULL}, {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_HI_Z_OPEN, NULL}, + {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_ODR_LOW, NULL}, {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_OUT_HIGH, NULL}, {"TOUCHSCREEN_RESET_L", LM4_GPIO_N, (1<<7), GPIO_OUT_LOW, NULL}, @@ -109,14 +109,14 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"USB2_ENABLE", LM4_GPIO_D, (1<<5), GPIO_OUT_LOW, NULL}, {"PCH_SUSACK_L", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, - {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_HI_Z, NULL}, - {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_HI_Z, NULL}, + {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_ODR_HIGH, NULL}, + {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_ODR_HIGH, NULL}, /* HEY: LED GPIOs need to sync up to 9mA. Leave off for now. */ - {"BAT_LED0", LM4_GPIO_D, (1<<0), GPIO_HI_Z, NULL}, - {"BAT_LED1", LM4_GPIO_N, (1<<4), GPIO_HI_Z, NULL}, - {"PWR_LED0", LM4_GPIO_D, (1<<1), GPIO_HI_Z, NULL}, - {"PWR_LED1", LM4_GPIO_N, (1<<6), GPIO_HI_Z, NULL}, + {"BAT_LED0", LM4_GPIO_D, (1<<0), GPIO_ODR_HIGH, NULL}, + {"BAT_LED1", LM4_GPIO_N, (1<<4), GPIO_ODR_HIGH, NULL}, + {"PWR_LED0", LM4_GPIO_D, (1<<1), GPIO_ODR_HIGH, NULL}, + {"PWR_LED1", LM4_GPIO_N, (1<<6), GPIO_ODR_HIGH, NULL}, }; /* ADC channels. Must be in the exactly same order as in enum adc_channel. */ diff --git a/board/pit/board.c b/board/pit/board.c index 8e3608b5c6..5ba14e3439 100644 --- a/board/pit/board.c +++ b/board/pit/board.c @@ -18,7 +18,7 @@ #include "util.h" #define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_HI_Z +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH /* GPIO signal list. Must match order from enum gpio_signal. */ const struct gpio_info gpio_list[GPIO_COUNT] = { @@ -51,17 +51,17 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { /* Other inputs */ {"WP_L", GPIO_B, (1<<4), GPIO_INPUT, NULL}, /* Outputs */ - {"AP_RESET_L", GPIO_B, (1<<3), GPIO_HI_Z, NULL}, + {"AP_RESET_L", GPIO_B, (1<<3), GPIO_ODR_HIGH, NULL}, {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_HI_Z, NULL}, + {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, {"EN_PP1350", GPIO_H, (1<<1), GPIO_OUT_LOW, NULL}, {"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL}, {"EN_PP5000", GPIO_A, (1<<11), GPIO_OUT_LOW, NULL}, {"ENTERING_RW", GPIO_H, (1<<0), GPIO_OUT_LOW, NULL}, - {"I2C1_SCL", GPIO_B, (1<<6), GPIO_HI_Z, NULL}, - {"I2C1_SDA", GPIO_B, (1<<7), GPIO_HI_Z, NULL}, - {"I2C2_SCL", GPIO_B, (1<<10), GPIO_HI_Z, NULL}, - {"I2C2_SDA", GPIO_B, (1<<11), GPIO_HI_Z, NULL}, + {"I2C1_SCL", GPIO_B, (1<<6), GPIO_ODR_HIGH, NULL}, + {"I2C1_SDA", GPIO_B, (1<<7), GPIO_ODR_HIGH, NULL}, + {"I2C2_SCL", GPIO_B, (1<<10), GPIO_ODR_HIGH, NULL}, + {"I2C2_SDA", GPIO_B, (1<<11), GPIO_ODR_HIGH, NULL}, {"LED_POWER_L", GPIO_A, (1<<2), GPIO_OUT_HIGH, NULL}, {"PMIC_PWRON", GPIO_A, (1<<12), GPIO_OUT_LOW, NULL}, {"PMIC_RESET", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, diff --git a/board/slippy/board.c b/board/slippy/board.c index ff37bc82f1..56b499ad31 100644 --- a/board/slippy/board.c +++ b/board/slippy/board.c @@ -98,7 +98,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PCH_NMI_L", LM4_GPIO_F, (1<<2), GPIO_OUT_HIGH, NULL}, {"PCH_PWRBTN_L", LM4_GPIO_H, (1<<0), GPIO_OUT_HIGH, NULL}, {"PCH_PWROK", LM4_GPIO_F, (1<<5), GPIO_OUT_LOW, NULL}, - {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_HI_Z_OPEN, NULL}, + {"PCH_RCIN_L", LM4_GPIO_L, (1<<6), GPIO_ODR_LOW, NULL}, {"PCH_RSMRST_L", LM4_GPIO_F, (1<<1), GPIO_OUT_LOW, NULL}, {"PCH_SMI_L", LM4_GPIO_F, (1<<4), GPIO_OUT_HIGH, NULL}, {"TOUCHSCREEN_RESET_L", LM4_GPIO_N, (1<<7), GPIO_OUT_LOW, NULL}, @@ -109,11 +109,11 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"USB2_ENABLE", LM4_GPIO_D, (1<<5), GPIO_OUT_LOW, NULL}, {"PCH_SUSACK_L", LM4_GPIO_F, (1<<3), GPIO_OUT_HIGH, NULL}, - {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_HI_Z, NULL}, - {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_HI_Z, NULL}, + {"PCH_RTCRST_L", LM4_GPIO_F, (1<<6), GPIO_ODR_HIGH, NULL}, + {"PCH_SRTCRST_L", LM4_GPIO_F, (1<<7), GPIO_ODR_HIGH, NULL}, - {"BAT_LED0_L", LM4_GPIO_N, (1<<6), GPIO_HI_Z, NULL}, - {"BAT_LED1_L", LM4_GPIO_N, (1<<4), GPIO_HI_Z, NULL}, + {"BAT_LED0_L", LM4_GPIO_N, (1<<6), GPIO_ODR_HIGH, NULL}, + {"BAT_LED1_L", LM4_GPIO_N, (1<<4), GPIO_ODR_HIGH, NULL}, }; /* ADC channels. Must be in the exactly same order as in enum adc_channel. */ diff --git a/board/snow/board.c b/board/snow/board.c index 0f911e03fd..4b9c0cdcc8 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -23,7 +23,7 @@ #include "util.h" #define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_HI_Z +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH #define INT_BOTH_FLOATING (GPIO_INPUT | GPIO_INT_BOTH) #define INT_BOTH_PULL_UP (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) @@ -75,8 +75,8 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PMIC_RESET", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, {"ENTERING_RW", GPIO_D, (1<<0), GPIO_OUT_LOW, NULL}, {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_HI_Z, NULL}, - {"CODEC_INT", GPIO_D, (1<<1), GPIO_HI_Z, NULL}, + {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, + {"CODEC_INT", GPIO_D, (1<<1), GPIO_ODR_HIGH, NULL}, {"LED_POWER_L", GPIO_B, (1<<3), GPIO_INPUT, NULL}, {"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL}, {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, diff --git a/board/spring/board.c b/board/spring/board.c index 40118cc309..46b8180fcb 100644 --- a/board/spring/board.c +++ b/board/spring/board.c @@ -24,7 +24,7 @@ #include "util.h" #define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) -#define GPIO_KB_OUTPUT GPIO_HI_Z +#define GPIO_KB_OUTPUT GPIO_ODR_HIGH #define INT_BOTH_FLOATING (GPIO_INPUT | GPIO_INT_BOTH) #define INT_BOTH_PULL_UP (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH) @@ -74,7 +74,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"PMIC_RESET", GPIO_A, (1<<15), GPIO_OUT_LOW, NULL}, {"ENTERING_RW", GPIO_D, (1<<0), GPIO_OUT_LOW, NULL}, {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, - {"EC_INT", GPIO_B, (1<<9), GPIO_HI_Z, NULL}, + {"EC_INT", GPIO_B, (1<<9), GPIO_ODR_HIGH, NULL}, {"ID_MUX", GPIO_D, (1<<1), GPIO_OUT_LOW, NULL}, {"KB_OUT00", GPIO_B, (1<<0), GPIO_KB_OUTPUT, NULL}, {"KB_OUT01", GPIO_B, (1<<8), GPIO_KB_OUTPUT, NULL}, diff --git a/chip/lm4/spi.c b/chip/lm4/spi.c index 4607f7460c..c35a834f8b 100644 --- a/chip/lm4/spi.c +++ b/chip/lm4/spi.c @@ -38,7 +38,7 @@ int spi_enable(int enable) /* Make sure CS# is deselected */ gpio_set_level(GPIO_SPI_CSn, 1); - gpio_set_flags(GPIO_SPI_CSn, GPIO_HI_Z); + gpio_set_flags(GPIO_SPI_CSn, GPIO_ODR_HIGH); /* PA2,4,5 normal function (high-Z GPIOs) */ gpio_set_alternate_function(LM4_GPIO_A, 0x34, -1); diff --git a/chip/stm32/i2c-stm32f100.c b/chip/stm32/i2c-stm32f100.c index 8680f59521..7952d4a5f5 100644 --- a/chip/stm32/i2c-stm32f100.c +++ b/chip/stm32/i2c-stm32f100.c @@ -378,8 +378,8 @@ static void unwedge_i2c_bus(int port) * Reconfigure ports as general purpose open-drain outputs, initted * to high. */ - gpio_set_flags(scl, GPIO_HI_Z); - gpio_set_flags(sda, GPIO_HI_Z); + gpio_set_flags(scl, GPIO_ODR_HIGH); + gpio_set_flags(sda, GPIO_ODR_HIGH); /* Try to send out pseudo-stop bit. See function description */ if (gpio_get_level(scl) && gpio_get_level(sda)) { diff --git a/include/gpio.h b/include/gpio.h index 20ab664864..b66b4be794 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -28,8 +28,8 @@ /* Common flag combinations */ #define GPIO_OUT_LOW (GPIO_OUTPUT | GPIO_LOW) #define GPIO_OUT_HIGH (GPIO_OUTPUT | GPIO_HIGH) -#define GPIO_HI_Z (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_HIGH) -#define GPIO_HI_Z_OPEN (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_LOW) +#define GPIO_ODR_HIGH (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_HIGH) +#define GPIO_ODR_LOW (GPIO_OUTPUT | GPIO_OPEN_DRAIN | GPIO_LOW) #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) -- cgit v1.2.1