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 <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58596
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Bill Richardson
2013-06-13 15:37:56 -07:00
committed by ChromeBot
parent f2fa913320
commit 1695760e95
12 changed files with 40 additions and 40 deletions

View File

@@ -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},

View File

@@ -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},

View File

@@ -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},

View File

@@ -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 */

View File

@@ -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. */

View File

@@ -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},

View File

@@ -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. */

View File

@@ -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},

View File

@@ -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},

View File

@@ -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);

View File

@@ -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)) {

View File

@@ -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)