diff options
61 files changed, 1746 insertions, 1690 deletions
diff --git a/board/auron/gpio.inc b/board/auron/gpio.inc index 3e275ec397..0ce95b1f43 100644 --- a/board/auron/gpio.inc +++ b/board/auron/gpio.inc @@ -6,87 +6,87 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ -GPIO(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ -GPIO(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ -GPIO(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ -GPIO(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, power_interrupt) /* PCH wants EDP enabled */ -GPIO(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ +GPIO_INT(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ +GPIO_INT(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ +GPIO_INT(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, power_interrupt) /* PCH wants EDP enabled */ +GPIO_INT(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ /* Other inputs */ -GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT, NULL) /* From thermal sensor */ -GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, NULL) /* SUSWARN# signal from PCH */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ -GPIO(CPU_PGOOD, C, 4, GPIO_INPUT, NULL) /* Power good to the CPU */ -GPIO(BAT_PRESENT_L, B, 4, GPIO_INPUT, NULL) /* Battery present. Repurposed BAT_TEMP */ +GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT) /* From thermal sensor */ +GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH) /* SUSWARN# signal from PCH */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT) /* Board version stuffing resistor 3 */ +GPIO(CPU_PGOOD, C, 4, GPIO_INPUT) /* Power good to the CPU */ +GPIO(BAT_PRESENT_L, B, 4, GPIO_INPUT) /* Battery present. Repurposed BAT_TEMP */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW, NULL) /* Stuffing option - not connected */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PP5000_FAN_EN, J, 3, GPIO_OUT_LOW, NULL) /* Enable fan power rail */ -GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW, NULL) /* Allow battery to charge when on AC */ +GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW) /* Stuffing option - not connected */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PP5000_FAN_EN, J, 3, GPIO_OUT_LOW) /* Enable fan power rail */ +GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW) /* Allow battery to charge when on AC */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW, NULL) /* Indicate when VccDSW is good */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW) /* Indicate when VccDSW is good */ /* * HDA_SDO is technically an output, but we need to leave it as an * input until we drive it high. So can't use open-drain (HI_Z). */ -GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT, NULL) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH, NULL) /* Non-maskable interrupt pin to PCH */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* PWROK / APWROK signals to PCH */ +GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH) /* Wake signal from EC to PCH */ +GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH) /* Non-maskable interrupt pin to PCH */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW) /* PWROK / APWROK signals to PCH */ /* * PL6 is one of 4 pins on the EC which can't be used in open-drain * mode. To work around this PCH_RCIN_L is set to an input. It will * only be set to an output when it needs to be driven to 0. */ -GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT, NULL) /* RCIN# line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW, NULL) /* Enable EDP (passthru from PCH) */ +GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT) /* RCIN# line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW) /* Enable EDP (passthru from PCH) */ -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Dunno. Probably important, though. */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Dunno. Probably important, though. */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW) /* USB port 2 output power enable */ -GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH, NULL) /* Acknowledge PCH SUSWARN# signal */ -GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ -GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ +GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH) /* Acknowledge PCH SUSWARN# signal */ +GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH) /* Not supposed to be here */ +GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH) /* Not supposed to be here */ -GPIO(BAT_LED0_L, D, 0, GPIO_ODR_HIGH, NULL) /* Battery charging LED - blue */ -GPIO(BAT_LED1_L, N, 4, GPIO_ODR_HIGH, NULL) /* Battery charging LED - orange */ -GPIO(PWR_LED0_L, D, 1, GPIO_ODR_HIGH, NULL) /* Power LED - blue */ -GPIO(PWR_LED1_L, N, 6, GPIO_ODR_HIGH, NULL) /* Power LED - orange */ +GPIO(BAT_LED0_L, D, 0, GPIO_ODR_HIGH) /* Battery charging LED - blue */ +GPIO(BAT_LED1_L, N, 4, GPIO_ODR_HIGH) /* Battery charging LED - orange */ +GPIO(PWR_LED0_L, D, 1, GPIO_ODR_HIGH) /* Power LED - blue */ +GPIO(PWR_LED1_L, N, 6, GPIO_ODR_HIGH) /* Power LED - orange */ ALTERNATE(A, 0x03, 1, MODULE_UART, GPIO_PULL_UP) /* UART0 */ ALTERNATE(B, 0x04, 3, MODULE_I2C, 0) /* I2C0 SCL */ diff --git a/board/bds/gpio.inc b/board/bds/gpio.inc index 06f290e53c..b1b13057aa 100644 --- a/board/bds/gpio.inc +++ b/board/bds/gpio.inc @@ -6,8 +6,8 @@ */ /* Recovery signal from DOWN button */ -GPIO(RECOVERY_L, D, 1, GPIO_PULL_UP, NULL) -GPIO(DEBUG_LED, A, 7, GPIO_OUT_LOW, NULL) +GPIO(RECOVERY_L, D, 1, GPIO_PULL_UP) +GPIO(DEBUG_LED, A, 7, GPIO_OUT_LOW) /* * Signals which aren't implemented on BDS but we'll emulate anyway, to diff --git a/board/big/gpio.inc b/board/big/gpio.inc index e35673e5fe..54e541f55b 100644 --- a/board/big/gpio.inc +++ b/board/big/gpio.inc @@ -6,56 +6,56 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_KB_INPUT, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) -GPIO(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_KB_INPUT, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) +GPIO_INT(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH, NULL) -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) -GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(LED_POWER_L, A, 2, GPIO_OUT_HIGH, NULL) /* PWR_LED1 */ -GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH, NULL) -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(PWR_LED0, B, 10, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED1, A, 8, GPIO_OUT_LOW, NULL) -GPIO(CHARGING, A, 11, GPIO_OUT_LOW, NULL) -GPIO(EC_BL_OVERRIDE, H, 1, GPIO_ODR_HIGH, NULL) -GPIO(PMIC_THERM_L, A, 1, GPIO_ODR_HIGH, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH) +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) +GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(LED_POWER_L, A, 2, GPIO_OUT_HIGH) /* PWR_LED1 */ +GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH) +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(PWR_LED0, B, 10, GPIO_OUT_LOW) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) +GPIO(BAT_LED1, A, 8, GPIO_OUT_LOW) +GPIO(CHARGING, A, 11, GPIO_OUT_LOW) +GPIO(EC_BL_OVERRIDE, H, 1, GPIO_ODR_HIGH) +GPIO(PMIC_THERM_L, A, 1, GPIO_ODR_HIGH) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI, GPIO_DEFAULT) ALTERNATE(A, 0x0600, GPIO_ALT_USART, MODULE_UART, GPIO_DEFAULT) diff --git a/board/cr50/gpio.inc b/board/cr50/gpio.inc index 8c518b8cf7..d5cf447cb1 100644 --- a/board/cr50/gpio.inc +++ b/board/cr50/gpio.inc @@ -1,4 +1,4 @@ -/* +/* -*- mode:c -*- * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. @@ -7,25 +7,25 @@ /* Inputs with interrupt handlers are first for efficiency */ /* User Push buttons */ -GPIO(SW_N, 0, 0, GPIO_INT_RISING, button_event) -GPIO(SW_S, 0, 1, GPIO_INT_RISING, button_event) -GPIO(SW_W, 0, 2, GPIO_INT_RISING, button_event) -GPIO(SW_E, 0, 3, GPIO_INT_RISING, button_event) +GPIO_INT(SW_N, 0, 0, GPIO_INT_RISING, button_event) +GPIO_INT(SW_S, 0, 1, GPIO_INT_RISING, button_event) +GPIO_INT(SW_W, 0, 2, GPIO_INT_RISING, button_event) +GPIO_INT(SW_E, 0, 3, GPIO_INT_RISING, button_event) /* We can't trigger on both rising and falling edge, so attach each button * to two input GPIOs. */ -GPIO(SW_N_, 1, 0, GPIO_INT_FALLING, button_event) -GPIO(SW_S_, 1, 1, GPIO_INT_FALLING, button_event) -GPIO(SW_W_, 1, 2, GPIO_INT_FALLING, button_event) -GPIO(SW_E_, 1, 3, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_N_, 1, 0, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_S_, 1, 1, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_W_, 1, 2, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_E_, 1, 3, GPIO_INT_FALLING, button_event) /* User GPIO LEDs */ -GPIO(LED_2, 0, 4, GPIO_OUT_LOW, NULL) -GPIO(LED_3, 0, 5, GPIO_OUT_LOW, NULL) -GPIO(LED_4, 0, 6, GPIO_OUT_LOW, NULL) -GPIO(LED_5, 0, 7, GPIO_OUT_LOW, NULL) -GPIO(LED_6, 0, 8, GPIO_OUT_LOW, NULL) -GPIO(LED_7, 0, 9, GPIO_OUT_LOW, NULL) +GPIO(LED_2, 0, 4, GPIO_OUT_LOW) +GPIO(LED_3, 0, 5, GPIO_OUT_LOW) +GPIO(LED_4, 0, 6, GPIO_OUT_LOW) +GPIO(LED_5, 0, 7, GPIO_OUT_LOW) +GPIO(LED_6, 0, 8, GPIO_OUT_LOW) +GPIO(LED_7, 0, 9, GPIO_OUT_LOW) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/cr50_a1/gpio.inc b/board/cr50_a1/gpio.inc index 8c518b8cf7..d5cf447cb1 100644 --- a/board/cr50_a1/gpio.inc +++ b/board/cr50_a1/gpio.inc @@ -1,4 +1,4 @@ -/* +/* -*- mode:c -*- * Copyright (c) 2014 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. @@ -7,25 +7,25 @@ /* Inputs with interrupt handlers are first for efficiency */ /* User Push buttons */ -GPIO(SW_N, 0, 0, GPIO_INT_RISING, button_event) -GPIO(SW_S, 0, 1, GPIO_INT_RISING, button_event) -GPIO(SW_W, 0, 2, GPIO_INT_RISING, button_event) -GPIO(SW_E, 0, 3, GPIO_INT_RISING, button_event) +GPIO_INT(SW_N, 0, 0, GPIO_INT_RISING, button_event) +GPIO_INT(SW_S, 0, 1, GPIO_INT_RISING, button_event) +GPIO_INT(SW_W, 0, 2, GPIO_INT_RISING, button_event) +GPIO_INT(SW_E, 0, 3, GPIO_INT_RISING, button_event) /* We can't trigger on both rising and falling edge, so attach each button * to two input GPIOs. */ -GPIO(SW_N_, 1, 0, GPIO_INT_FALLING, button_event) -GPIO(SW_S_, 1, 1, GPIO_INT_FALLING, button_event) -GPIO(SW_W_, 1, 2, GPIO_INT_FALLING, button_event) -GPIO(SW_E_, 1, 3, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_N_, 1, 0, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_S_, 1, 1, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_W_, 1, 2, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_E_, 1, 3, GPIO_INT_FALLING, button_event) /* User GPIO LEDs */ -GPIO(LED_2, 0, 4, GPIO_OUT_LOW, NULL) -GPIO(LED_3, 0, 5, GPIO_OUT_LOW, NULL) -GPIO(LED_4, 0, 6, GPIO_OUT_LOW, NULL) -GPIO(LED_5, 0, 7, GPIO_OUT_LOW, NULL) -GPIO(LED_6, 0, 8, GPIO_OUT_LOW, NULL) -GPIO(LED_7, 0, 9, GPIO_OUT_LOW, NULL) +GPIO(LED_2, 0, 4, GPIO_OUT_LOW) +GPIO(LED_3, 0, 5, GPIO_OUT_LOW) +GPIO(LED_4, 0, 6, GPIO_OUT_LOW) +GPIO(LED_5, 0, 7, GPIO_OUT_LOW) +GPIO(LED_6, 0, 8, GPIO_OUT_LOW) +GPIO(LED_7, 0, 9, GPIO_OUT_LOW) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/cyan/gpio.inc b/board/cyan/gpio.inc index 06dbf46cd9..44aee47534 100644 --- a/board/cyan/gpio.inc +++ b/board/cyan/gpio.inc @@ -5,91 +5,91 @@ * found in the LICENSE file. */ -GPIO(LID_OPEN, PORT(2), 7, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, PORT(3), 0, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* BC_ACOK / EC_ACIN - to know if battery or AC connected */ -GPIO(WP_L, PORT(3), 3, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(POWER_BUTTON_L, PORT(3), 5, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(RSMRST_L_PGOOD, PORT(6), 3, GPIO_INT_BOTH, power_signal_interrupt) /* RSMRST_N_PWRGD from power logic */ -GPIO(ALL_SYS_PGOOD, PORT(13), 0, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* ALL_SYS_PWRGD from power logic */ -GPIO(PCH_SLP_S4_L, PORT(20), 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PCH_SLP_S3_L, PORT(20), 6, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ - -GPIO(NC_012, PORT(1), 2, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ -GPIO(USB_ILIM_SEL, PORT(1), 3, GPIO_OUT_HIGH, NULL) /* USB current control */ -GPIO(I2C_PORT0_SCL, PORT(1), 5, GPIO_ODR_HIGH, NULL) -GPIO(I2C_PORT0_SDA, PORT(1), 6, GPIO_ODR_HIGH, NULL) - -GPIO(I2C_PORT1_SCL, PORT(2), 2, GPIO_ODR_HIGH, NULL) -GPIO(I2C_PORT1_SDA, PORT(2), 3, GPIO_ODR_HIGH, NULL) -GPIO(PCH_SCI_L, PORT(2), 6, GPIO_ODR_HIGH, NULL) /* SCI output */ - -GPIO(VOLUME_UP, PORT(3), 1, GPIO_INT_FALLING, NULL) /* Volume up button */ -GPIO(VOLUME_DOWN, PORT(3), 4, GPIO_INT_FALLING, NULL) /* Volume down button */ -GPIO(USB2_PWR_EN, PORT(3), 6, GPIO_OUT_HIGH, NULL) /* Enable power for USB2 Port */ - -GPIO(ENTERING_RW, PORT(4), 1, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH, NULL) /* SMI output */ -GPIO(USB_OC1_L, PORT(4), 5, GPIO_INT_FALLING, NULL) /* DB2 BC1.2 over current signal to EC */ -GPIO(DP_USB_C_HPD_Q, PORT(4), 6, GPIO_OUT_HIGH, NULL) /* DP hot plug detect from EC to SOC */ -GPIO(VBATA_VR_HOT_N, PORT(4), 7, GPIO_INT_FALLING, NULL) /* PROCHOT signal of VBATA VR connected to EC */ - -GPIO(VNN_I2C3_ALERT_N, PORT(5), 0, GPIO_INT_FALLING, NULL) /* Alert signal from VNN VR to EC */ -GPIO(PCH_SUS_STAT_L, PORT(5), 1, GPIO_INT_FALLING, NULL) /* Signal to inform EC that SOC is entering low power state */ -GPIO(TOUCHPANEL_PWREN, PORT(5), 2, GPIO_OUT_HIGH, NULL) /* Enable power for Touch Panel */ -GPIO(TRACKPAD_PWREN, PORT(5), 3, GPIO_OUT_HIGH, NULL) /* Enable power for Track Pad */ -GPIO(USB_OC0_L, PORT(5), 5, GPIO_INT_FALLING, NULL) /* Over current signal of the BC1.2 charger to EC */ -GPIO(EC_ADC0, PORT(5), 6, GPIO_ANALOG, NULL) /* EC_ADC0 */ -GPIO(EC_ADC1, PORT(5), 7, GPIO_ANALOG, NULL) /* EC_ADC1 */ - -GPIO(CHGR_PMON, PORT(6), 0, GPIO_ANALOG, NULL) -GPIO(WIFI_PWREN, PORT(6), 1, GPIO_OUT_HIGH, NULL) /* Enable power for WiFi */ -GPIO(BATT_EN_L, PORT(6), 2, GPIO_INPUT, NULL) /* Will be NC */ -GPIO(SW_OPEN_EC, PORT(6), 4, GPIO_INT_BOTH, NULL) /* Signal from USB Charger to EC to indicate if the isolation switch is open or close */ -GPIO(PCH_SYS_PWROK, PORT(6), 5, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready (DELAY_ALL_SYS_PWRGD) */ -GPIO(PCH_WAKE_L, PORT(6), 6, GPIO_ODR_HIGH, NULL) /* PCH wake pin */ -GPIO(USB3_PWR_EN, PORT(6), 7, GPIO_OUT_HIGH, NULL) /* Enable power for USB3 Port */ - -GPIO(USB_CTL1, PORT(10), 5, GPIO_OUT_HIGH, NULL) /* USB charging mode control */ - -GPIO(PCH_RCIN_L, PORT(11), 0, GPIO_ODR_HIGH, NULL) /* Reset line to PCH (for 8042 emulation) */ -GPIO(NC_115, PORT(11), 5, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ - -GPIO(USB_PD_EC_INT, PORT(12), 2, GPIO_INT_BOTH, NULL) /* Interrupt from USB PD Controller to EC */ -GPIO(EC_WAKE_L, PORT(12), 3, GPIO_INT_BOTH_DSLEEP, NULL) -GPIO(USB_CHG_DET_EC, PORT(12), 4, GPIO_INT_BOTH, NULL) /* Signal from USB Charger to EC to indicate charger has been detected */ -GPIO(GYRO_INT2, PORT(12), 7, GPIO_INT_FALLING, NULL) /* Gyro sensor interrupt 2 to EC */ - -GPIO(EC_PLUG_DETECT, PORT(13), 2, GPIO_INT_BOTH, NULL) -GPIO(BAT_LED0_L, PORT(13), 3, GPIO_ODR_HIGH, NULL) /* Battery charging LED - blue */ -GPIO(WWAN_PWREN, PORT(13), 5, GPIO_OUT_HIGH, NULL) /* Enable power for WWAN - PROBE_DETECT_L */ -GPIO(BAT_LED1_L, PORT(13), 6, GPIO_ODR_HIGH, NULL) /* Battery charging LED - orange */ - -GPIO(THERMAL_PROBE_EN_L,PORT(14), 0, GPIO_OUT_HIGH, NULL) -GPIO(PWR_LED0_L, PORT(14), 1, GPIO_ODR_HIGH, NULL) /* Power LED - blue */ -GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW, NULL) /* RSMRST_N to PCH */ -GPIO(PWR_LED1_L, PORT(14), 5, GPIO_ODR_HIGH, NULL) /* Power LED - orange */ -GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH, NULL) /* SPI PVT Chip select */ -GPIO(ALS_INT, PORT(14), 7, GPIO_INT_FALLING, NULL) /* ALS sensor interrupt to EC */ - -GPIO(WLAN_OFF_L, PORT(15), 0, GPIO_ODR_HIGH, NULL) /* Wireless LAN */ -GPIO(CPU_PROCHOT, PORT(15), 1, GPIO_OUT_LOW, NULL) -GPIO(KBD_IRQ_L, PORT(15), 2, GPIO_ODR_HIGH, NULL) /* Negative edge triggered irq. */ -GPIO(NC_154, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ -GPIO(CORE_PWROK, PORT(15), 5, GPIO_ODR_HIGH, NULL) /* CORE_PWR_OK_R */ -GPIO(LID_OPEN2, PORT(15), 6, GPIO_INT_BOTH_DSLEEP, NULL) /* LID_OPEN_OUT2_R */ -GPIO(PCH_SUSPWRDNACK, PORT(15), 7, GPIO_INT_FALLING, NULL) /* PMC SUSPWRDNACK signal from SOC to EC */ - -GPIO(PCH_PWRBTN_L, PORT(16), 0, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(GYRO_INT1, PORT(16), 1, GPIO_INT_FALLING, NULL) /* Gyro sensor interrupt 1 to EC */ -GPIO(MUX_CROSS_BAR_EN, PORT(16), 3, GPIO_OUT_LOW, NULL) /* Enable signal of the USB Type C Mux */ - -GPIO(MUX_CROSS_BAR_POL, PORT(20), 1, GPIO_OUT_LOW, NULL) /* Output from EC to POL signal of USB Type C Mux */ -GPIO(EC_BL_DISABLE_L, PORT(20), 2, GPIO_OUT_HIGH, NULL) /* EDP backligh disable signal from EC */ -GPIO(SMC_SHUTDOWN, PORT(20), 3, GPIO_OUT_LOW, NULL) /* Shutdown signal from EC to power sequencing PLD */ -GPIO(MUX_CROSS_BAR_MODE,PORT(20), 4, GPIO_OUT_LOW, NULL) /* Output from EC - Type C Mux mode select */ - -GPIO(SUSPWRDNACK_SOC_EC,PORT(21), 0, GPIO_OUT_LOW, NULL) /* SUSPWRDNACK signal from EC to MOIC device */ -GPIO(PCH_SLP_SX_L, PORT(21), 1, GPIO_INT_BOTH_DSLEEP, NULL) /* Sleep SOIX signal from SOC to EC */ +GPIO_INT(LID_OPEN, PORT(2), 7, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, PORT(3), 0, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* BC_ACOK / EC_ACIN - to know if battery or AC connected */ +GPIO_INT(WP_L, PORT(3), 3, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(POWER_BUTTON_L, PORT(3), 5, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(RSMRST_L_PGOOD, PORT(6), 3, GPIO_INT_BOTH, power_signal_interrupt) /* RSMRST_N_PWRGD from power logic */ +GPIO_INT(ALL_SYS_PGOOD, PORT(13), 0, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* ALL_SYS_PWRGD from power logic */ +GPIO_INT(PCH_SLP_S4_L, PORT(20), 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, PORT(20), 6, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ + +GPIO(NC_012, PORT(1), 2, GPIO_INPUT | GPIO_PULL_UP) /* NC */ +GPIO(USB_ILIM_SEL, PORT(1), 3, GPIO_OUT_HIGH) /* USB current control */ +GPIO(I2C_PORT0_SCL, PORT(1), 5, GPIO_ODR_HIGH) +GPIO(I2C_PORT0_SDA, PORT(1), 6, GPIO_ODR_HIGH) + +GPIO(I2C_PORT1_SCL, PORT(2), 2, GPIO_ODR_HIGH) +GPIO(I2C_PORT1_SDA, PORT(2), 3, GPIO_ODR_HIGH) +GPIO(PCH_SCI_L, PORT(2), 6, GPIO_ODR_HIGH) /* SCI output */ + +GPIO(VOLUME_UP, PORT(3), 1, GPIO_INT_FALLING) /* Volume up button */ +GPIO(VOLUME_DOWN, PORT(3), 4, GPIO_INT_FALLING) /* Volume down button */ +GPIO(USB2_PWR_EN, PORT(3), 6, GPIO_OUT_HIGH) /* Enable power for USB2 Port */ + +GPIO(ENTERING_RW, PORT(4), 1, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH) /* SMI output */ +GPIO(USB_OC1_L, PORT(4), 5, GPIO_INT_FALLING) /* DB2 BC1.2 over current signal to EC */ +GPIO(DP_USB_C_HPD_Q, PORT(4), 6, GPIO_OUT_HIGH) /* DP hot plug detect from EC to SOC */ +GPIO(VBATA_VR_HOT_N, PORT(4), 7, GPIO_INT_FALLING) /* PROCHOT signal of VBATA VR connected to EC */ + +GPIO(VNN_I2C3_ALERT_N, PORT(5), 0, GPIO_INT_FALLING) /* Alert signal from VNN VR to EC */ +GPIO(PCH_SUS_STAT_L, PORT(5), 1, GPIO_INT_FALLING) /* Signal to inform EC that SOC is entering low power state */ +GPIO(TOUCHPANEL_PWREN, PORT(5), 2, GPIO_OUT_HIGH) /* Enable power for Touch Panel */ +GPIO(TRACKPAD_PWREN, PORT(5), 3, GPIO_OUT_HIGH) /* Enable power for Track Pad */ +GPIO(USB_OC0_L, PORT(5), 5, GPIO_INT_FALLING) /* Over current signal of the BC1.2 charger to EC */ +GPIO(EC_ADC0, PORT(5), 6, GPIO_ANALOG) /* EC_ADC0 */ +GPIO(EC_ADC1, PORT(5), 7, GPIO_ANALOG) /* EC_ADC1 */ + +GPIO(CHGR_PMON, PORT(6), 0, GPIO_ANALOG) +GPIO(WIFI_PWREN, PORT(6), 1, GPIO_OUT_HIGH) /* Enable power for WiFi */ +GPIO(BATT_EN_L, PORT(6), 2, GPIO_INPUT) /* Will be NC */ +GPIO(SW_OPEN_EC, PORT(6), 4, GPIO_INT_BOTH) /* Signal from USB Charger to EC to indicate if the isolation switch is open or close */ +GPIO(PCH_SYS_PWROK, PORT(6), 5, GPIO_OUT_LOW) /* EC thinks everything is up and ready (DELAY_ALL_SYS_PWRGD) */ +GPIO(PCH_WAKE_L, PORT(6), 6, GPIO_ODR_HIGH) /* PCH wake pin */ +GPIO(USB3_PWR_EN, PORT(6), 7, GPIO_OUT_HIGH) /* Enable power for USB3 Port */ + +GPIO(USB_CTL1, PORT(10), 5, GPIO_OUT_HIGH) /* USB charging mode control */ + +GPIO(PCH_RCIN_L, PORT(11), 0, GPIO_ODR_HIGH) /* Reset line to PCH (for 8042 emulation) */ +GPIO(NC_115, PORT(11), 5, GPIO_INPUT | GPIO_PULL_UP) /* NC */ + +GPIO(USB_PD_EC_INT, PORT(12), 2, GPIO_INT_BOTH) /* Interrupt from USB PD Controller to EC */ +GPIO(EC_WAKE_L, PORT(12), 3, GPIO_INT_BOTH_DSLEEP) +GPIO(USB_CHG_DET_EC, PORT(12), 4, GPIO_INT_BOTH) /* Signal from USB Charger to EC to indicate charger has been detected */ +GPIO(GYRO_INT2, PORT(12), 7, GPIO_INT_FALLING) /* Gyro sensor interrupt 2 to EC */ + +GPIO(EC_PLUG_DETECT, PORT(13), 2, GPIO_INT_BOTH) +GPIO(BAT_LED0_L, PORT(13), 3, GPIO_ODR_HIGH) /* Battery charging LED - blue */ +GPIO(WWAN_PWREN, PORT(13), 5, GPIO_OUT_HIGH) /* Enable power for WWAN - PROBE_DETECT_L */ +GPIO(BAT_LED1_L, PORT(13), 6, GPIO_ODR_HIGH) /* Battery charging LED - orange */ + +GPIO(THERMAL_PROBE_EN_L,PORT(14), 0, GPIO_OUT_HIGH) +GPIO(PWR_LED0_L, PORT(14), 1, GPIO_ODR_HIGH) /* Power LED - blue */ +GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW) /* RSMRST_N to PCH */ +GPIO(PWR_LED1_L, PORT(14), 5, GPIO_ODR_HIGH) /* Power LED - orange */ +GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH) /* SPI PVT Chip select */ +GPIO(ALS_INT, PORT(14), 7, GPIO_INT_FALLING) /* ALS sensor interrupt to EC */ + +GPIO(WLAN_OFF_L, PORT(15), 0, GPIO_ODR_HIGH) /* Wireless LAN */ +GPIO(CPU_PROCHOT, PORT(15), 1, GPIO_OUT_LOW) +GPIO(KBD_IRQ_L, PORT(15), 2, GPIO_ODR_HIGH) /* Negative edge triggered irq. */ +GPIO(NC_154, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP) /* NC */ +GPIO(CORE_PWROK, PORT(15), 5, GPIO_ODR_HIGH) /* CORE_PWR_OK_R */ +GPIO(LID_OPEN2, PORT(15), 6, GPIO_INT_BOTH_DSLEEP) /* LID_OPEN_OUT2_R */ +GPIO(PCH_SUSPWRDNACK, PORT(15), 7, GPIO_INT_FALLING) /* PMC SUSPWRDNACK signal from SOC to EC */ + +GPIO(PCH_PWRBTN_L, PORT(16), 0, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(GYRO_INT1, PORT(16), 1, GPIO_INT_FALLING) /* Gyro sensor interrupt 1 to EC */ +GPIO(MUX_CROSS_BAR_EN, PORT(16), 3, GPIO_OUT_LOW) /* Enable signal of the USB Type C Mux */ + +GPIO(MUX_CROSS_BAR_POL, PORT(20), 1, GPIO_OUT_LOW) /* Output from EC to POL signal of USB Type C Mux */ +GPIO(EC_BL_DISABLE_L, PORT(20), 2, GPIO_OUT_HIGH) /* EDP backligh disable signal from EC */ +GPIO(SMC_SHUTDOWN, PORT(20), 3, GPIO_OUT_LOW) /* Shutdown signal from EC to power sequencing PLD */ +GPIO(MUX_CROSS_BAR_MODE,PORT(20), 4, GPIO_OUT_LOW) /* Output from EC - Type C Mux mode select */ + +GPIO(SUSPWRDNACK_SOC_EC,PORT(21), 0, GPIO_OUT_LOW) /* SUSPWRDNACK signal from EC to MOIC device */ +GPIO(PCH_SLP_SX_L, PORT(21), 1, GPIO_INT_BOTH_DSLEEP) /* Sleep SOIX signal from SOC to EC */ /* Alternate functions GPIO definition */ ALTERNATE(PORT(16), 0x24, 1, MODULE_UART, 0) /* UART0 */ @@ -104,7 +104,7 @@ ALTERNATE(PORT(0), 0xfc, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) ALTERNATE(PORT(1), 0x03, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) ALTERNATE(PORT(10) , 0xd8, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT) #ifdef CONFIG_KEYBOARD_COL2_INVERTED - GPIO(KBD_KSO2, PORT(0),1, GPIO_KB_OUTPUT_COL2, NULL) /* Negative edge triggered irq. */ + GPIO(KBD_KSO2, PORT(0),1, GPIO_KB_OUTPUT_COL2) /* Negative edge triggered irq. */ #else ALTERNATE(PORT(0), 0x02, 3, MODULE_KEYBOARD_SCAN, GPIO_KB_OUTPUT_COL2) #endif diff --git a/board/dingdong/gpio.inc b/board/dingdong/gpio.inc index 95a75b88b1..9dc31bea66 100644 --- a/board/dingdong/gpio.inc +++ b/board/dingdong/gpio.inc @@ -4,20 +4,22 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -GPIO(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event) -GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG, NULL) -GPIO(STM_READY, A, 2, GPIO_OUT_LOW, NULL) /* factory test only */ -GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG, NULL) -GPIO(DP_AUX_N, A, 5, GPIO_INPUT, NULL) -GPIO(DP_AUX_P, A, 6, GPIO_INPUT, NULL) -GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW, NULL) -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW, NULL) +GPIO_INT(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event) -GPIO(PD_DPSINK_PRESENT, B, 0, GPIO_INPUT, NULL) -GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW, NULL) +GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG) +GPIO(STM_READY, A, 2, GPIO_OUT_LOW) /* factory test only */ +GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG) +GPIO(DP_AUX_N, A, 5, GPIO_INPUT) +GPIO(DP_AUX_P, A, 6, GPIO_INPUT) + +GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW) + +GPIO(PD_DPSINK_PRESENT, B, 0, GPIO_INPUT) +GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/discovery-stm32f072/gpio.inc b/board/discovery-stm32f072/gpio.inc index 8c368c20b1..63735399f6 100644 --- a/board/discovery-stm32f072/gpio.inc +++ b/board/discovery-stm32f072/gpio.inc @@ -6,18 +6,18 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(USER_BUTTON, A, 0, GPIO_INT_FALLING, button_event) +GPIO_INT(USER_BUTTON, A, 0, GPIO_INT_FALLING, button_event) /* Outputs */ -GPIO(LED_U, C, 6, GPIO_OUT_LOW, NULL) -GPIO(LED_D, C, 7, GPIO_OUT_LOW, NULL) -GPIO(LED_L, C, 8, GPIO_OUT_LOW, NULL) -GPIO(LED_R, C, 9, GPIO_OUT_LOW, NULL) +GPIO(LED_U, C, 6, GPIO_OUT_LOW) +GPIO(LED_D, C, 7, GPIO_OUT_LOW) +GPIO(LED_L, C, 8, GPIO_OUT_LOW) +GPIO(LED_R, C, 9, GPIO_OUT_LOW) /* Flash SPI interface */ -GPIO(SPI_WP, C, 3, GPIO_OUT_HIGH, NULL) -GPIO(SPI_HOLD, C, 4, GPIO_OUT_HIGH, NULL) -GPIO(SPI_CS, B, 12, GPIO_OUT_HIGH, NULL) +GPIO(SPI_WP, C, 3, GPIO_OUT_HIGH) +GPIO(SPI_HOLD, C, 4, GPIO_OUT_HIGH) +GPIO(SPI_CS, B, 12, GPIO_OUT_HIGH) ALTERNATE(B, 0xE000, 0, MODULE_SPI_MASTER, 0) diff --git a/board/discovery/gpio.inc b/board/discovery/gpio.inc index 91e4d9587b..bce256bef8 100644 --- a/board/discovery/gpio.inc +++ b/board/discovery/gpio.inc @@ -6,11 +6,11 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(USER_BUTTON, A, 0, GPIO_INT_BOTH, button_event) +GPIO_INT(USER_BUTTON, A, 0, GPIO_INT_BOTH, button_event) /* Outputs */ -GPIO(LED_BLUE, B, 6, GPIO_OUT_LOW, NULL) -GPIO(LED_GREEN, B, 7, GPIO_OUT_LOW, NULL) +GPIO(LED_BLUE, B, 6, GPIO_OUT_LOW) +GPIO(LED_GREEN, B, 7, GPIO_OUT_LOW) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/falco/gpio.inc b/board/falco/gpio.inc index 3356c2ae83..ffb69242fb 100644 --- a/board/falco/gpio.inc +++ b/board/falco/gpio.inc @@ -6,86 +6,86 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ -GPIO(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ -GPIO(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ -GPIO(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ -GPIO(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, lcdvcc_interrupt) /* PCH wants EDP enabled */ -GPIO(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ +GPIO_INT(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ +GPIO_INT(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ +GPIO_INT(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, lcdvcc_interrupt) /* PCH wants EDP enabled */ +GPIO_INT(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ /* Other inputs */ -GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT, NULL) /* From thermal sensor */ -GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, NULL) /* SUSWARN# signal from PCH */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ -GPIO(CPU_PGOOD, C, 4, GPIO_INPUT, NULL) /* Power good to the CPU */ +GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT) /* From thermal sensor */ +GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH) /* SUSWARN# signal from PCH */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT) /* Board version stuffing resistor 3 */ +GPIO(CPU_PGOOD, C, 4, GPIO_INPUT) /* Power good to the CPU */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DSW_GATED_EN, J, 3, GPIO_OUT_LOW, NULL) /* Enable DSW rails */ -GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW, NULL) /* Stuffing option - not connected */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW, NULL) /* Allow battery to charge when on AC */ +GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DSW_GATED_EN, J, 3, GPIO_OUT_LOW) /* Enable DSW rails */ +GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW) /* Stuffing option - not connected */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW) /* Allow battery to charge when on AC */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW, NULL) /* Indicate when VccDSW is good */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW) /* Indicate when VccDSW is good */ /* * HDA_SDO is technically an output, but we need to leave it as an * input until we drive it high. So can't use open-drain (HI_Z). */ -GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT, NULL) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH, NULL) /* Non-maskable interrupt pin to PCH */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* PWROK / APWROK signals to PCH */ +GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH) /* Wake signal from EC to PCH */ +GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH) /* Non-maskable interrupt pin to PCH */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW) /* PWROK / APWROK signals to PCH */ /* * PL6 is one of 4 pins on the EC which can't be used in open-drain * mode. To work around this PCH_RCIN_L is set to an input. It will * only be set to an output when it needs to be driven to 0. */ -GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT, NULL) /* RCIN# line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW, NULL) /* Enable EDP (passthru from PCH) */ +GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT) /* RCIN# line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW) /* Enable EDP (passthru from PCH) */ -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Dunno. Probably important, though. */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Dunno. Probably important, though. */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW) /* USB port 2 output power enable */ -GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH, NULL) /* Acknowledge PCH SUSWARN# signal */ -GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ -GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ +GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH) /* Acknowledge PCH SUSWARN# signal */ +GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH) /* Not supposed to be here */ +GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH) /* Not supposed to be here */ -GPIO(PWR_LED_L, N, 6, GPIO_OUT_HIGH, NULL) /* Power LED */ -GPIO(KB_LED_EN, D, 4, GPIO_OUT_LOW, NULL) /* Keyboard LED */ -GPIO(BAT_LED0, D, 0, GPIO_OUT_LOW, NULL) /* Battery charger status */ -GPIO(BAT_LED1, D, 1, GPIO_OUT_LOW, NULL) /* Battery charger status */ +GPIO(PWR_LED_L, N, 6, GPIO_OUT_HIGH) /* Power LED */ +GPIO(KB_LED_EN, D, 4, GPIO_OUT_LOW) /* Keyboard LED */ +GPIO(BAT_LED0, D, 0, GPIO_OUT_LOW) /* Battery charger status */ +GPIO(BAT_LED1, D, 1, GPIO_OUT_LOW) /* Battery charger status */ ALTERNATE(A, 0x03, 1, MODULE_UART, GPIO_PULL_UP) /* UART0 */ ALTERNATE(A, 0x40, 3, MODULE_I2C, 0) /* I2C1 SCL */ diff --git a/board/firefly/gpio.inc b/board/firefly/gpio.inc index 49863406c0..f408933962 100644 --- a/board/firefly/gpio.inc +++ b/board/firefly/gpio.inc @@ -6,55 +6,55 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(VBUS_WAKE, C, 13, GPIO_INT_BOTH, vbus_event) +GPIO_INT(VBUS_WAKE, C, 13, GPIO_INT_BOTH, vbus_event) /* Buttons */ -GPIO(SW_PP20000, B, 10, GPIO_INT_FALLING, button_event) -GPIO(SW_PP12000, B, 11, GPIO_INT_FALLING, button_event) -GPIO(SW_PP5000, B, 12, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_PP20000, B, 10, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_PP12000, B, 11, GPIO_INT_FALLING, button_event) +GPIO_INT(SW_PP5000, B, 12, GPIO_INT_FALLING, button_event) /* PD RX/TX */ -GPIO(USB_CC1_PD, A, 0, GPIO_ANALOG, NULL) -GPIO(PD_REF1, A, 1, GPIO_ANALOG, NULL) -GPIO(USB_CC2_PD, A, 2, GPIO_ANALOG, NULL) -GPIO(PD_REF2, A, 3, GPIO_ANALOG, NULL) -GPIO(PD_CC1_TX_EN, A, 4, GPIO_ODR_HIGH, NULL) -GPIO(PD_CC2_TX_EN, A, 15, GPIO_ODR_HIGH, NULL) -GPIO(PD_CLK_OUT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(PD_CC1_TX_DATA, A, 6, GPIO_INPUT, NULL) -GPIO(PD_CC2_TX_DATA, B, 4, GPIO_INPUT, NULL) -GPIO(PD_CLK_IN, B, 3, GPIO_INPUT, NULL) +GPIO(USB_CC1_PD, A, 0, GPIO_ANALOG) +GPIO(PD_REF1, A, 1, GPIO_ANALOG) +GPIO(USB_CC2_PD, A, 2, GPIO_ANALOG) +GPIO(PD_REF2, A, 3, GPIO_ANALOG) +GPIO(PD_CC1_TX_EN, A, 4, GPIO_ODR_HIGH) +GPIO(PD_CC2_TX_EN, A, 15, GPIO_ODR_HIGH) +GPIO(PD_CLK_OUT, B, 9, GPIO_OUT_LOW) +GPIO(PD_CC1_TX_DATA, A, 6, GPIO_INPUT) +GPIO(PD_CC2_TX_DATA, B, 4, GPIO_INPUT) +GPIO(PD_CLK_IN, B, 3, GPIO_INPUT) /* CCx device pull-downs */ -GPIO(PD_CC1_DEVICE, B, 13, GPIO_ODR_LOW, NULL) -GPIO(PD_CC2_DEVICE, B, 14, GPIO_ODR_LOW, NULL) +GPIO(PD_CC1_DEVICE, B, 13, GPIO_ODR_LOW) +GPIO(PD_CC2_DEVICE, B, 14, GPIO_ODR_LOW) /* ADC */ -GPIO(VBUS_SENSE, A, 5, GPIO_ANALOG, NULL) +GPIO(VBUS_SENSE, A, 5, GPIO_ANALOG) /* LEDs control */ -GPIO(LED_PP20000, B, 0, GPIO_OUT_LOW, NULL) -GPIO(LED_PP12000, B, 1, GPIO_OUT_LOW, NULL) -GPIO(LED_PP5000, B, 2, GPIO_OUT_LOW, NULL) +GPIO(LED_PP20000, B, 0, GPIO_OUT_LOW) +GPIO(LED_PP12000, B, 1, GPIO_OUT_LOW) +GPIO(LED_PP5000, B, 2, GPIO_OUT_LOW) /* Slave I2C port */ -GPIO(I2C_INT_L, B, 8, GPIO_ODR_HIGH, NULL) +GPIO(I2C_INT_L, B, 8, GPIO_ODR_HIGH) /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C_SDA, B, 7, GPIO_INPUT, NULL) +GPIO(I2C_SCL, B, 6, GPIO_INPUT) +GPIO(I2C_SDA, B, 7, GPIO_INPUT) /* Test points */ -GPIO(TP_A8, A, 8, GPIO_ODR_HIGH, NULL) -GPIO(TP_A13, A, 13, GPIO_ODR_HIGH, NULL) -GPIO(TP_A14, A, 14, GPIO_ODR_HIGH, NULL) -GPIO(TP_B15, B, 15, GPIO_ODR_HIGH, NULL) -GPIO(TP_C14, C, 14, GPIO_ODR_HIGH, NULL) -GPIO(TP_C15, C, 15, GPIO_ODR_HIGH, NULL) -GPIO(TP_F0, F, 0, GPIO_ODR_HIGH, NULL) -GPIO(TP_F1, F, 1, GPIO_ODR_HIGH, NULL) +GPIO(TP_A8, A, 8, GPIO_ODR_HIGH) +GPIO(TP_A13, A, 13, GPIO_ODR_HIGH) +GPIO(TP_A14, A, 14, GPIO_ODR_HIGH) +GPIO(TP_B15, B, 15, GPIO_ODR_HIGH) +GPIO(TP_C14, C, 14, GPIO_ODR_HIGH) +GPIO(TP_C15, C, 15, GPIO_ODR_HIGH) +GPIO(TP_F0, F, 0, GPIO_ODR_HIGH) +GPIO(TP_F1, F, 1, GPIO_ODR_HIGH) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/fruitpie/gpio.inc b/board/fruitpie/gpio.inc index a3bd4dca38..bdbefc70ae 100644 --- a/board/fruitpie/gpio.inc +++ b/board/fruitpie/gpio.inc @@ -5,63 +5,63 @@ * found in the LICENSE file. */ -GPIO(VBUS_WAKE, B, 5, GPIO_INT_BOTH, vbus_event) -GPIO(MASTER_I2C_INT_L, C, 13, GPIO_INT_FALLING, tsu_event) -GPIO(ALERT_L, A, 2, GPIO_INT_FALLING, rohm_event) +GPIO_INT(VBUS_WAKE, B, 5, GPIO_INT_BOTH, vbus_event) +GPIO_INT(MASTER_I2C_INT_L, C, 13, GPIO_INT_FALLING, tsu_event) +GPIO_INT(ALERT_L, A, 2, GPIO_INT_FALLING, rohm_event) /* PD RX/TX */ -GPIO(USB_CC1_PD, A, 0, GPIO_ANALOG, NULL) -GPIO(PD_REF1, A, 1, GPIO_ANALOG, NULL) -GPIO(PD_REF2, A, 3, GPIO_ANALOG, NULL) -GPIO(USB_CC2_PD, A, 4, GPIO_ANALOG, NULL) -GPIO(PD_CLK_OUT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(PD_TX_EN, B, 12, GPIO_OUT_LOW, NULL) -GPIO(PD_TX_DATA, B, 14, GPIO_OUT_LOW, NULL) +GPIO(USB_CC1_PD, A, 0, GPIO_ANALOG) +GPIO(PD_REF1, A, 1, GPIO_ANALOG) +GPIO(PD_REF2, A, 3, GPIO_ANALOG) +GPIO(USB_CC2_PD, A, 4, GPIO_ANALOG) +GPIO(PD_CLK_OUT, B, 9, GPIO_OUT_LOW) +GPIO(PD_TX_EN, B, 12, GPIO_OUT_LOW) +GPIO(PD_TX_DATA, B, 14, GPIO_OUT_LOW) #if 0 -GPIO(PD_CLK_IN, B, 13, GPIO_OUT_LOW, NULL) +GPIO(PD_CLK_IN, B, 13, GPIO_OUT_LOW) #endif /* Power and muxes control */ -GPIO(PP5000_EN, A, 5, GPIO_OUT_HIGH, NULL) -GPIO(CC_HOST, A, 6, GPIO_OUT_LOW, NULL) -GPIO(CHARGE_EN_L, A, 8, GPIO_OUT_LOW, NULL) -GPIO(USB_C_5V_EN, A, 10, GPIO_OUT_LOW, NULL) -GPIO(VCONN1_EN, B, 15, GPIO_OUT_LOW, NULL) -GPIO(VCONN2_EN, C, 14, GPIO_OUT_LOW, NULL) -GPIO(SS1_EN_L, A, 9, GPIO_OUT_HIGH, NULL) -GPIO(SS2_EN_L, B, 4, GPIO_OUT_HIGH, NULL) -GPIO(SS2_USB_MODE_L, B, 3, GPIO_OUT_HIGH, NULL) -GPIO(SS1_USB_MODE_L, B, 8, GPIO_OUT_HIGH, NULL) -GPIO(DP_MODE, C, 15, GPIO_OUT_LOW, NULL) -GPIO(DP_POLARITY_L, A, 7, GPIO_OUT_HIGH, NULL) +GPIO(PP5000_EN, A, 5, GPIO_OUT_HIGH) +GPIO(CC_HOST, A, 6, GPIO_OUT_LOW) +GPIO(CHARGE_EN_L, A, 8, GPIO_OUT_LOW) +GPIO(USB_C_5V_EN, A, 10, GPIO_OUT_LOW) +GPIO(VCONN1_EN, B, 15, GPIO_OUT_LOW) +GPIO(VCONN2_EN, C, 14, GPIO_OUT_LOW) +GPIO(SS1_EN_L, A, 9, GPIO_OUT_HIGH) +GPIO(SS2_EN_L, B, 4, GPIO_OUT_HIGH) +GPIO(SS2_USB_MODE_L, B, 3, GPIO_OUT_HIGH) +GPIO(SS1_USB_MODE_L, B, 8, GPIO_OUT_HIGH) +GPIO(DP_MODE, C, 15, GPIO_OUT_LOW) +GPIO(DP_POLARITY_L, A, 7, GPIO_OUT_HIGH) /* Not used : no host on that bus */ -GPIO(SLAVE_I2C_INT_L, B, 2, GPIO_ODR_HIGH, NULL) +GPIO(SLAVE_I2C_INT_L, B, 2, GPIO_ODR_HIGH) /* Alternate functions */ #if 0 -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(UART_TX, A, 14, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, A, 15, GPIO_OUT_LOW, NULL) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(UART_TX, A, 14, GPIO_OUT_LOW) +GPIO(UART_RX, A, 15, GPIO_OUT_LOW) #endif /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT) +GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT) /* Rohm BD92104 connections */ -GPIO(USBPD_RST, B, 0, GPIO_OUT_LOW, NULL) -GPIO(USBPD_FORCE_OTG, B, 1, GPIO_OUT_LOW, NULL) -GPIO(USBPD_VIN_EN_L, F, 0, GPIO_OUT_HIGH, NULL) +GPIO(USBPD_RST, B, 0, GPIO_OUT_LOW) +GPIO(USBPD_FORCE_OTG, B, 1, GPIO_OUT_LOW) +GPIO(USBPD_VIN_EN_L, F, 0, GPIO_OUT_HIGH) /* Test points */ -GPIO(TP9, A, 13, GPIO_ODR_HIGH, NULL) -GPIO(TP11, F, 1, GPIO_ODR_HIGH, NULL) +GPIO(TP9, A, 13, GPIO_ODR_HIGH) +GPIO(TP11, F, 1, GPIO_ODR_HIGH) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/glower/gpio.inc b/board/glower/gpio.inc index 6c57bdb776..5da064b9de 100644 --- a/board/glower/gpio.inc +++ b/board/glower/gpio.inc @@ -6,73 +6,73 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, PORT(20), 3, GPIO_INT_BOTH, power_button_interrupt) -GPIO(LID_OPEN, PORT(16), 0, GPIO_INT_BOTH, lid_interrupt) -GPIO(AC_PRESENT, PORT(16), 3, GPIO_INT_BOTH, extpower_interrupt) -GPIO(PCH_SLP_S3_L, PORT(20), 4, GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S4_L, PORT(21), 0, GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PP1050_PGOOD, PORT(13), 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP3300_PCH_PGOOD, PORT(4), 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ -GPIO(PP5000_PGOOD, PORT(3), 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(S5_PGOOD, PORT(6), 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ -GPIO(VCORE_PGOOD, PORT(5), 7, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(WP_L, PORT(1), 2, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(POWER_BUTTON_L, PORT(20), 3, GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(LID_OPEN, PORT(16), 0, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(AC_PRESENT, PORT(16), 3, GPIO_INT_BOTH, extpower_interrupt) +GPIO_INT(PCH_SLP_S3_L, PORT(20), 4, GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S4_L, PORT(21), 0, GPIO_INT_BOTH | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PP1050_PGOOD, PORT(13), 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP3300_PCH_PGOOD, PORT(4), 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ +GPIO_INT(PP5000_PGOOD, PORT(3), 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(S5_PGOOD, PORT(6), 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ +GPIO_INT(VCORE_PGOOD, PORT(5), 7, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(WP_L, PORT(1), 2, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ /* Other inputs */ -GPIO(BOARD_VERSION1, PORT(0), 6, GPIO_INPUT, NULL) -GPIO(BOARD_VERSION2, PORT(12), 3, GPIO_INPUT, NULL) -GPIO(BOARD_VERSION3, PORT(12), 7, GPIO_INPUT, NULL) +GPIO(BOARD_VERSION1, PORT(0), 6, GPIO_INPUT) +GPIO(BOARD_VERSION2, PORT(12), 3, GPIO_INPUT) +GPIO(BOARD_VERSION3, PORT(12), 7, GPIO_INPUT) #ifdef CONFIG_CHIPSET_DEBUG -GPIO(PCH_SLP_SX_L, PORT(21), 1, GPIO_INPUT | GPIO_PULL_UP, NULL) -GPIO(PCH_SUS_STAT_L, PORT(20), 1, GPIO_INPUT | GPIO_PULL_UP, NULL) -GPIO(PCH_SUSPWRDNACK, PORT(4), 6, GPIO_INPUT | GPIO_PULL_UP, NULL) +GPIO(PCH_SLP_SX_L, PORT(21), 1, GPIO_INPUT | GPIO_PULL_UP) +GPIO(PCH_SUS_STAT_L, PORT(20), 1, GPIO_INPUT | GPIO_PULL_UP) +GPIO(PCH_SUSPWRDNACK, PORT(4), 6, GPIO_INPUT | GPIO_PULL_UP) #endif -GPIO(PP1000_S0IX_PGOOD, PORT(3), 5, GPIO_INPUT, NULL) -GPIO(USB1_OC_L, PORT(13), 4, GPIO_INPUT, NULL) -GPIO(USB2_OC_L, PORT(1), 6, GPIO_INPUT, NULL) +GPIO(PP1000_S0IX_PGOOD, PORT(3), 5, GPIO_INPUT) +GPIO(USB1_OC_L, PORT(13), 4, GPIO_INPUT) +GPIO(USB2_OC_L, PORT(1), 6, GPIO_INPUT) /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, PORT(14), 5, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(ENABLE_BACKLIGHT, PORT(20), 0, GPIO_ODR_HIGH, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, PORT(6), 4, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, PORT(3), 3, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(LPC_CLKRUN_L, PORT(1), 4, GPIO_ODR_HIGH, NULL) /* Request that PCH drive LPC clock */ -GPIO(PCH_CORE_PWROK, PORT(12), 2, GPIO_OUT_LOW, NULL) /* Indicate core well power is stable */ -GPIO(PCH_PWRBTN_L, PORT(13), 0, GPIO_ODR_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_RCIN_L, PORT(14), 0, GPIO_ODR_HIGH, NULL) /* Reset line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, PORT(5), 5, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(PCH_SOC_OVERRIDE_L, PORT(6), 5, GPIO_OUT_LOW, NULL) /* SOC override signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_SYS_PWROK, PORT(12), 4, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(PCH_WAKE_L, PORT(20), 2, GPIO_ODR_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PP1350_EN, PORT(14), 7, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DX_EN, PORT(5), 0, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, PORT(1), 1, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, PORT(4), 7, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(PP5000_EN, PORT(2), 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PPSX_EN, PORT(5), 3, GPIO_INPUT, NULL) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ -GPIO(SUSP_VR_EN, PORT(6), 6, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(TOUCHSCREEN_RESET_L, PORT(16), 1, GPIO_OUT_HIGH, NULL) /* Reset touch screen */ -GPIO(USB_CTL1, PORT(15), 7, GPIO_OUT_LOW, NULL) /* USB control signal 1 to both ports */ -GPIO(USB_ILIM_SEL, PORT(3), 6, GPIO_OUT_LOW, NULL) /* USB current limit to both ports */ -GPIO(USB1_ENABLE, PORT(1), 5, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, PORT(1), 7, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ -GPIO(VCORE_EN, PORT(15), 0, GPIO_OUT_LOW, NULL) /* Enable core power supplies */ -GPIO(WLAN_OFF_L, PORT(5), 2, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(KBD_IRQ_L, PORT(6), 7, GPIO_ODR_HIGH, NULL) /* Negative edge triggered irq. */ -GPIO(BAT_LED0, PORT(15), 4, GPIO_ODR_HIGH, NULL) -GPIO(BAT_LED1, PORT(15), 5, GPIO_ODR_HIGH, NULL) -GPIO(KBD_KSO2, PORT(10), 1, GPIO_OUT_LOW, NULL) +GPIO(CPU_PROCHOT, PORT(14), 5, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(ENABLE_BACKLIGHT, PORT(20), 0, GPIO_ODR_HIGH) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, PORT(6), 4, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, PORT(3), 3, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(LPC_CLKRUN_L, PORT(1), 4, GPIO_ODR_HIGH) /* Request that PCH drive LPC clock */ +GPIO(PCH_CORE_PWROK, PORT(12), 2, GPIO_OUT_LOW) /* Indicate core well power is stable */ +GPIO(PCH_PWRBTN_L, PORT(13), 0, GPIO_ODR_HIGH) /* Power button output to PCH */ +GPIO(PCH_RCIN_L, PORT(14), 0, GPIO_ODR_HIGH) /* Reset line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, PORT(5), 5, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(PCH_SOC_OVERRIDE_L, PORT(6), 5, GPIO_OUT_LOW) /* SOC override signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_SYS_PWROK, PORT(12), 4, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(PCH_WAKE_L, PORT(20), 2, GPIO_ODR_HIGH) /* Wake signal from EC to PCH */ +GPIO(PP1350_EN, PORT(14), 7, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DX_EN, PORT(5), 0, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, PORT(1), 1, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, PORT(4), 7, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(PP5000_EN, PORT(2), 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PPSX_EN, PORT(5), 3, GPIO_INPUT) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ +GPIO(SUSP_VR_EN, PORT(6), 6, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(TOUCHSCREEN_RESET_L, PORT(16), 1, GPIO_OUT_HIGH) /* Reset touch screen */ +GPIO(USB_CTL1, PORT(15), 7, GPIO_OUT_LOW) /* USB control signal 1 to both ports */ +GPIO(USB_ILIM_SEL, PORT(3), 6, GPIO_OUT_LOW) /* USB current limit to both ports */ +GPIO(USB1_ENABLE, PORT(1), 5, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, PORT(1), 7, GPIO_OUT_LOW) /* USB port 2 output power enable */ +GPIO(VCORE_EN, PORT(15), 0, GPIO_OUT_LOW) /* Enable core power supplies */ +GPIO(WLAN_OFF_L, PORT(5), 2, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(KBD_IRQ_L, PORT(6), 7, GPIO_ODR_HIGH) /* Negative edge triggered irq. */ +GPIO(BAT_LED0, PORT(15), 4, GPIO_ODR_HIGH) +GPIO(BAT_LED1, PORT(15), 5, GPIO_ODR_HIGH) +GPIO(KBD_KSO2, PORT(10), 1, GPIO_OUT_LOW) -GPIO(SYS_RST_L, PORT(12), 1, GPIO_INPUT, NULL) -GPIO(EC_HIB, PORT(3), 4, GPIO_INPUT, NULL) -GPIO(ICMNT, PORT(6), 1, GPIO_INPUT, NULL) -GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH, NULL) +GPIO(SYS_RST_L, PORT(12), 1, GPIO_INPUT) +GPIO(EC_HIB, PORT(3), 4, GPIO_INPUT) +GPIO(ICMNT, PORT(6), 1, GPIO_INPUT) +GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH) /* Configure VCC_PWRGD as GPIO so that it's internally gated high */ -GPIO(TP78, PORT(6), 3, GPIO_OUT_HIGH, NULL) +GPIO(TP78, PORT(6), 3, GPIO_OUT_HIGH) ALTERNATE(PORT(16), 0x24, 1, MODULE_UART, 0) /* UART0 */ diff --git a/board/hadoken/gpio.inc b/board/hadoken/gpio.inc index 009953bf93..26e8a0fd76 100644 --- a/board/hadoken/gpio.inc +++ b/board/hadoken/gpio.inc @@ -14,44 +14,44 @@ /* * TODO(yjlou): call keyboard_raw_gpio_interrupt() in chip/nrf51/keyboard_raw.c */ -GPIO(KB_IN00, 0, 6, GPIO_KB_INPUT, NULL) -GPIO(KB_IN01, 0, 24, GPIO_KB_INPUT, NULL) -GPIO(KB_IN02, 0, 1, GPIO_KB_INPUT, NULL) -GPIO(KB_IN03, 0, 4, GPIO_KB_INPUT, NULL) -GPIO(KB_IN04, 0, 0, GPIO_KB_INPUT, NULL) -GPIO(KB_IN05, 0, 30, GPIO_KB_INPUT, NULL) -GPIO(KB_IN06, 0, 27, GPIO_KB_INPUT, NULL) -GPIO(KB_IN07, 0, 26, GPIO_KB_INPUT, NULL) +GPIO(KB_IN00, 0, 6, GPIO_KB_INPUT) +GPIO(KB_IN01, 0, 24, GPIO_KB_INPUT) +GPIO(KB_IN02, 0, 1, GPIO_KB_INPUT) +GPIO(KB_IN03, 0, 4, GPIO_KB_INPUT) +GPIO(KB_IN04, 0, 0, GPIO_KB_INPUT) +GPIO(KB_IN05, 0, 30, GPIO_KB_INPUT) +GPIO(KB_IN06, 0, 27, GPIO_KB_INPUT) +GPIO(KB_IN07, 0, 26, GPIO_KB_INPUT) /* Other inputs */ -GPIO(MCU_GPIO_13, 0, 13, GPIO_INPUT, NULL) /* PAIR on the debug board */ -GPIO(MCU_GPIO_14, 0, 14, GPIO_INPUT, NULL) /* TP 4 */ -GPIO(MCU_GPIO_17, 0, 17, GPIO_INPUT, NULL) /* TP 5 */ -GPIO(MCU_GPIO_19, 0, 19, GPIO_INPUT, NULL) /* TP 6 */ -GPIO(BQ27621_GPOUT, 0, 20, GPIO_INPUT, NULL) /* Fuel Gauge */ -GPIO(LID_PRESENT_L, 0, 31, GPIO_INPUT, NULL) /* Hall sensor */ +GPIO(MCU_GPIO_13, 0, 13, GPIO_INPUT) /* PAIR on the debug board */ +GPIO(MCU_GPIO_14, 0, 14, GPIO_INPUT) /* TP 4 */ +GPIO(MCU_GPIO_17, 0, 17, GPIO_INPUT) /* TP 5 */ +GPIO(MCU_GPIO_19, 0, 19, GPIO_INPUT) /* TP 6 */ +GPIO(BQ27621_GPOUT, 0, 20, GPIO_INPUT) /* Fuel Gauge */ +GPIO(LID_PRESENT_L, 0, 31, GPIO_INPUT) /* Hall sensor */ /* Will be an output at some point */ -GPIO(IND_CHRG_DISABLE, 0, 21, GPIO_INPUT, NULL) /* Control for charging */ +GPIO(IND_CHRG_DISABLE, 0, 21, GPIO_INPUT) /* Control for charging */ /* Outputs */ -GPIO(KB_OUT00, 0, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, 0, 10, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, 0, 7, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, 0, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, 0, 3, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, 0, 9, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, 0, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, 0, 28, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, 0, 18, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, 0, 16, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, 0, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, 0, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, 0, 11, GPIO_KB_OUTPUT, NULL) +GPIO(KB_OUT00, 0, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, 0, 10, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, 0, 7, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, 0, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, 0, 3, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, 0, 9, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, 0, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, 0, 28, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, 0, 18, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, 0, 16, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, 0, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, 0, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, 0, 11, GPIO_KB_OUTPUT) /* Configure the TWI (I2C) interface in the init function. */ -GPIO(MCU_SCL, 0, 23, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL) -GPIO(MCU_SDA, 0, 22, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN, NULL) +GPIO(MCU_SCL, 0, 23, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN) +GPIO(MCU_SDA, 0, 22, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN) /* Use port 0 for I2C (TWI0), Pins 22 & 23 */ ALTERNATE(0, 0x800000, NRF51_TWI0_ALT_FUNC_SCL, MODULE_I2C, GPIO_INPUT | GPIO_PULL_UP | GPIO_OPEN_DRAIN) diff --git a/board/hoho/gpio.inc b/board/hoho/gpio.inc index 4bd01192a3..72c8b93b22 100644 --- a/board/hoho/gpio.inc +++ b/board/hoho/gpio.inc @@ -4,23 +4,25 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -GPIO(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event) -GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG, NULL) -GPIO(STM_READY, A, 2, GPIO_OUT_LOW, NULL) /* factory test only */ -GPIO(MCDP_RESET_L, A, 3, GPIO_OUT_HIGH, NULL) -GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG, NULL) -GPIO(MCDP_READY, A, 7, GPIO_OUT_LOW, NULL) /* factory test only */ -GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW, NULL) -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW, NULL) +GPIO_INT(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event) -GPIO(MCDP_GPIO1, B, 0, GPIO_INPUT, NULL) -GPIO(MCDP_CONFIG1, B, 1, GPIO_INPUT, NULL) -GPIO(PD_MCDP_SPI_WP_L, B, 2, GPIO_OUT_LOW, NULL) -GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW, NULL) -GPIO(PD_MCDP_SPI_CS_L, B, 12, GPIO_INPUT, NULL) +GPIO(USB_C_CC1_PD, A, 1, GPIO_ANALOG) +GPIO(STM_READY, A, 2, GPIO_OUT_LOW) /* factory test only */ +GPIO(MCDP_RESET_L, A, 3, GPIO_OUT_HIGH) +GPIO(PD_DAC_REF, A, 4, GPIO_ANALOG) + +GPIO(MCDP_READY, A, 7, GPIO_OUT_LOW) /* factory test only */ +GPIO(PD_SBU_ENABLE, A, 8, GPIO_OUT_LOW) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(PD_CC1_TX_EN, A, 15, GPIO_OUT_LOW) + +GPIO(MCDP_GPIO1, B, 0, GPIO_INPUT) +GPIO(MCDP_CONFIG1, B, 1, GPIO_INPUT) +GPIO(PD_MCDP_SPI_WP_L, B, 2, GPIO_OUT_LOW) +GPIO(PD_CC1_TX_DATA, B, 4, GPIO_OUT_LOW) +GPIO(PD_MCDP_SPI_CS_L, B, 12, GPIO_INPUT) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/honeybuns/gpio.inc b/board/honeybuns/gpio.inc index e61972a6a3..553ab618fc 100644 --- a/board/honeybuns/gpio.inc +++ b/board/honeybuns/gpio.inc @@ -5,42 +5,42 @@ * found in the LICENSE file. */ -/*GPIO(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event)*/ -GPIO(DP_HPD, A, 0, GPIO_INPUT, NULL) +/*GPIO_INT(DP_HPD, A, 0, GPIO_INT_BOTH, hpd_event)*/ +GPIO(DP_HPD, A, 0, GPIO_INPUT) /* PD RX/TX */ -GPIO(USB_CC1_PD, A, 1, GPIO_ANALOG, NULL) -GPIO(PD_VBUS_P, A, 5, GPIO_ANALOG, NULL) -GPIO(PD_VBUS_N, A, 6, GPIO_ANALOG, NULL) -GPIO(PD_TX_EN, A, 15, GPIO_OUT_LOW, NULL) -GPIO(PD_TX_DATA, B, 4, GPIO_OUT_LOW, NULL) +GPIO(USB_CC1_PD, A, 1, GPIO_ANALOG) +GPIO(PD_VBUS_P, A, 5, GPIO_ANALOG) +GPIO(PD_VBUS_N, A, 6, GPIO_ANALOG) +GPIO(PD_TX_EN, A, 15, GPIO_OUT_LOW) +GPIO(PD_TX_DATA, B, 4, GPIO_OUT_LOW) /* Power and muxes control */ -GPIO(PP20000_EN, A, 8, GPIO_OUT_LOW, NULL) -GPIO(PPVAR_VBUS_EN, B, 12, GPIO_OUT_LOW, NULL) -GPIO(SS_MUX_OE_L, B, 13, GPIO_OUT_HIGH, NULL) -GPIO(SS_MUX_SEL, B, 14, GPIO_OUT_LOW, NULL) +GPIO(PP20000_EN, A, 8, GPIO_OUT_LOW) +GPIO(PPVAR_VBUS_EN, B, 12, GPIO_OUT_LOW) +GPIO(SS_MUX_OE_L, B, 13, GPIO_OUT_HIGH) +GPIO(SS_MUX_SEL, B, 14, GPIO_OUT_LOW) /* Display Port/HDMI */ -GPIO(PD_SBU_ENABLE, A, 7, GPIO_OUT_LOW, NULL) +GPIO(PD_SBU_ENABLE, A, 7, GPIO_OUT_LOW) /* Chip Resets */ -GPIO(BRIDGE_RESET_L, B, 0, GPIO_OUT_HIGH, NULL) -GPIO(SPLITTER_RESET_L, B, 1, GPIO_OUT_HIGH, NULL) -GPIO(HUB_RESET_L, B, 15, GPIO_OUT_HIGH, NULL) +GPIO(BRIDGE_RESET_L, B, 0, GPIO_OUT_HIGH) +GPIO(SPLITTER_RESET_L, B, 1, GPIO_OUT_HIGH) +GPIO(HUB_RESET_L, B, 15, GPIO_OUT_HIGH) /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(MASTER_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 7, GPIO_INPUT, NULL) +GPIO(MASTER_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 7, GPIO_INPUT) /* Test points */ -GPIO(TP6, A, 13, GPIO_OUT_HIGH /*GPIO_ODR_HIGH*/, NULL) -GPIO(TP7, A, 14, GPIO_OUT_LOW /*GPIO_ODR_HIGH*/, NULL) +GPIO(TP6, A, 13, GPIO_OUT_HIGH /*GPIO_ODR_HIGH*/) +GPIO(TP7, A, 14, GPIO_OUT_LOW /*GPIO_ODR_HIGH*/) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) @@ -52,4 +52,3 @@ ALTERNATE(A, 0x0600, 1, MODULE_UART, GPIO_PULL_UP) /* USART1: PA9/PA10 */ ALTERNATE(A, 0x000C, 1, MODULE_UART, GPIO_PULL_UP) /* USART2: PA2/PA3 */ ALTERNATE(B, 0x0C00, 4, MODULE_UART, GPIO_PULL_UP) /* USART3: PB10/PB11 */ ALTERNATE(B, 0x00C0, 1, MODULE_I2C, 0) /* I2C MASTER: PB6/PB7 */ - diff --git a/board/host/gpio.inc b/board/host/gpio.inc index bb01c129e4..5a69bb5848 100644 --- a/board/host/gpio.inc +++ b/board/host/gpio.inc @@ -5,18 +5,19 @@ * found in the LICENSE file. */ -GPIO(LID_OPEN, 0, 0, GPIO_INT_BOTH, lid_interrupt) -GPIO(POWER_BUTTON_L, 0, 0, GPIO_INT_BOTH, power_button_interrupt) -GPIO(AC_PRESENT, 0, 0, GPIO_INT_BOTH, extpower_interrupt) -GPIO(BUTTON_VOLUME_DOWN_L, 0, 0, GPIO_INT_BOTH, button_interrupt) -GPIO(BUTTON_VOLUME_UP, 0, 0, GPIO_INT_BOTH, button_interrupt) -GPIO(CHARGE_DONE, 0, 0, GPIO_INT_BOTH, inductive_charging_interrupt) -GPIO(EC_INT, 0, 0, 0, NULL) -GPIO(WP, 0, 0, 0, NULL) -GPIO(ENTERING_RW, 0, 0, 0, NULL) -GPIO(PCH_BKLTEN, 0, 0, 0, NULL) -GPIO(ENABLE_BACKLIGHT, 0, 0, 0, NULL) +GPIO_INT(LID_OPEN, 0, 0, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(POWER_BUTTON_L, 0, 0, GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(AC_PRESENT, 0, 0, GPIO_INT_BOTH, extpower_interrupt) +GPIO_INT(BUTTON_VOLUME_DOWN_L, 0, 0, GPIO_INT_BOTH, button_interrupt) +GPIO_INT(BUTTON_VOLUME_UP, 0, 0, GPIO_INT_BOTH, button_interrupt) +GPIO_INT(CHARGE_DONE, 0, 0, GPIO_INT_BOTH, inductive_charging_interrupt) + +GPIO(EC_INT, 0, 0, 0) +GPIO(WP, 0, 0, 0) +GPIO(ENTERING_RW, 0, 0, 0) +GPIO(PCH_BKLTEN, 0, 0, 0) +GPIO(ENABLE_BACKLIGHT, 0, 0, 0) /* Inductive charging */ -GPIO(CHARGE_EN, 0, 0, 0, NULL) -GPIO(BASE_CHG_VDD_EN, 0, 0, 0, NULL) +GPIO(CHARGE_EN, 0, 0, 0) +GPIO(BASE_CHG_VDD_EN, 0, 0, 0) diff --git a/board/it8380dev/gpio.inc b/board/it8380dev/gpio.inc index e609967d26..d94ea6cd45 100644 --- a/board/it8380dev/gpio.inc +++ b/board/it8380dev/gpio.inc @@ -5,31 +5,32 @@ * found in the LICENSE file. */ -GPIO(POWER_BUTTON_L, E, 4, GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt) -GPIO(LID_OPEN, E, 2, GPIO_INT_BOTH | GPIO_PULL_DOWN, lid_interrupt) -GPIO(H_LED0, A, 0, GPIO_ODR_HIGH, NULL) -GPIO(H_LED1, A, 1, GPIO_ODR_HIGH, NULL) -GPIO(H_LED2, A, 2, GPIO_ODR_HIGH, NULL) -GPIO(H_LED3, A, 3, GPIO_ODR_HIGH, NULL) -GPIO(H_LED4, A, 4, GPIO_ODR_HIGH, NULL) -GPIO(H_LED5, A, 5, GPIO_ODR_HIGH, NULL) -GPIO(H_LED6, A, 6, GPIO_ODR_HIGH, NULL) -GPIO(L_LED0, I, 0, GPIO_ODR_HIGH, NULL) -GPIO(L_LED1, I, 1, GPIO_ODR_HIGH, NULL) -GPIO(L_LED2, I, 2, GPIO_ODR_HIGH, NULL) -GPIO(L_LED3, I, 3, GPIO_ODR_HIGH, NULL) -GPIO(L_LED4, I, 4, GPIO_ODR_HIGH, NULL) -GPIO(L_LED5, I, 5, GPIO_ODR_HIGH, NULL) -GPIO(L_LED6, I, 6, GPIO_ODR_HIGH, NULL) -GPIO(BUSY_LED, J, 0, GPIO_OUT_LOW, NULL) -GPIO(GOOD_LED, J, 1, GPIO_OUT_HIGH, NULL) -GPIO(FAIL_LED, J, 2, GPIO_OUT_LOW, NULL) -GPIO(PCH_PLTRST_L, E, 3, GPIO_INPUT, NULL) -GPIO(PCH_SMI_L, D, 3, GPIO_OUT_HIGH, NULL) -GPIO(PCH_SCI_L, D, 4, GPIO_OUT_HIGH, NULL) -GPIO(GATE_A20_H, B, 5, GPIO_OUT_HIGH, NULL) -GPIO(PCH_RCIN_L, B, 6, GPIO_OUT_HIGH, NULL) -GPIO(LPC_CLKRUN_L, H, 0, GPIO_OUT_LOW, NULL) +GPIO_INT(POWER_BUTTON_L, E, 4, GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt) +GPIO_INT(LID_OPEN, E, 2, GPIO_INT_BOTH | GPIO_PULL_DOWN, lid_interrupt) + +GPIO(H_LED0, A, 0, GPIO_ODR_HIGH) +GPIO(H_LED1, A, 1, GPIO_ODR_HIGH) +GPIO(H_LED2, A, 2, GPIO_ODR_HIGH) +GPIO(H_LED3, A, 3, GPIO_ODR_HIGH) +GPIO(H_LED4, A, 4, GPIO_ODR_HIGH) +GPIO(H_LED5, A, 5, GPIO_ODR_HIGH) +GPIO(H_LED6, A, 6, GPIO_ODR_HIGH) +GPIO(L_LED0, I, 0, GPIO_ODR_HIGH) +GPIO(L_LED1, I, 1, GPIO_ODR_HIGH) +GPIO(L_LED2, I, 2, GPIO_ODR_HIGH) +GPIO(L_LED3, I, 3, GPIO_ODR_HIGH) +GPIO(L_LED4, I, 4, GPIO_ODR_HIGH) +GPIO(L_LED5, I, 5, GPIO_ODR_HIGH) +GPIO(L_LED6, I, 6, GPIO_ODR_HIGH) +GPIO(BUSY_LED, J, 0, GPIO_OUT_LOW) +GPIO(GOOD_LED, J, 1, GPIO_OUT_HIGH) +GPIO(FAIL_LED, J, 2, GPIO_OUT_LOW) +GPIO(PCH_PLTRST_L, E, 3, GPIO_INPUT) +GPIO(PCH_SMI_L, D, 3, GPIO_OUT_HIGH) +GPIO(PCH_SCI_L, D, 4, GPIO_OUT_HIGH) +GPIO(GATE_A20_H, B, 5, GPIO_OUT_HIGH) +GPIO(PCH_RCIN_L, B, 6, GPIO_OUT_HIGH) +GPIO(LPC_CLKRUN_L, H, 0, GPIO_OUT_LOW) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/board/jerry/gpio.inc b/board/jerry/gpio.inc index 30800f347c..56be639729 100644 --- a/board/jerry/gpio.inc +++ b/board/jerry/gpio.inc @@ -6,53 +6,53 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ -GPIO(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) -GPIO(AC_PRESENT, C, 6, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ +GPIO_INT(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) +GPIO_INT(AC_PRESENT, C, 6, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN, NULL) /* wk1 */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN) /* wk1 */ +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(BAT_LED_RED, B, 11, GPIO_OUT_HIGH, NULL) -GPIO(BAT_LED_GREEN, A, 11, GPIO_OUT_HIGH, NULL) -GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW, NULL) /* Inverted from silegro */ -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(POWER_LED, A, 2, GPIO_OUT_HIGH, NULL) -GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW, NULL) -GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(BAT_LED_RED, B, 11, GPIO_OUT_HIGH) +GPIO(BAT_LED_GREEN, A, 11, GPIO_OUT_HIGH) +GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_OUT_LOW) +GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW) /* Inverted from silegro */ +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(POWER_LED, A, 2, GPIO_OUT_HIGH) +GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW) +GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, 0, MODULE_SPI, 0) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) diff --git a/board/link/gpio.inc b/board/link/gpio.inc index 027b9190ce..f4330035d7 100644 --- a/board/link/gpio.inc +++ b/board/link/gpio.inc @@ -6,80 +6,79 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, K, 7, GPIO_INT_BOTH, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, K, 5, GPIO_INT_BOTH, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH, extpower_interrupt) /* AC power present */ -GPIO(PCH_BKLTEN, J, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ -GPIO(PCH_SLP_A_L, G, 5, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_A# signal from PCH */ -GPIO(PCH_SLP_ME_CSW_DEV_L, G, 4, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_ME_CSW_DEV# signal from PCH */ -GPIO(PCH_SLP_S3_L, J, 0, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S4_L, J, 1, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PCH_SLP_S5_L, J, 2, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S5# signal from PCH */ -GPIO(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ -GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, power_interrupt) /* SUSWARN# signal from PCH */ -GPIO(PGOOD_1_5V_DDR, K, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.5V_DDR */ -GPIO(PGOOD_1_5V_PCH, K, 1, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.5V_PCH */ -GPIO(PGOOD_1_8VS, K, 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.8VS */ -GPIO(PGOOD_5VALW, H, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +5VALW */ -GPIO(PGOOD_CPU_CORE, M, 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +CPU_CORE */ -GPIO(PGOOD_VCCP, K, 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VCCP */ -GPIO(PGOOD_VCCSA, H, 1, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VCCSA */ -GPIO(PGOOD_VGFX_CORE, D, 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VGFX_CORE */ -GPIO(RECOVERY_L, H, 7, GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ -GPIO(WP, J, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(POWER_BUTTON_L, K, 7, GPIO_INT_BOTH, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, K, 5, GPIO_INT_BOTH, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_BKLTEN, J, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ +GPIO_INT(PCH_SLP_A_L, G, 5, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_A# signal from PCH */ +GPIO_INT(PCH_SLP_ME_CSW_DEV_L, G, 4, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_ME_CSW_DEV# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, J, 0, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S4_L, J, 1, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PCH_SLP_S5_L, J, 2, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S5# signal from PCH */ +GPIO_INT(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ +GPIO_INT(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, power_interrupt) /* SUSWARN# signal from PCH */ +GPIO_INT(PGOOD_1_5V_DDR, K, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.5V_DDR */ +GPIO_INT(PGOOD_1_5V_PCH, K, 1, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.5V_PCH */ +GPIO_INT(PGOOD_1_8VS, K, 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +1.8VS */ +GPIO_INT(PGOOD_5VALW, H, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +5VALW */ +GPIO_INT(PGOOD_CPU_CORE, M, 3, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +CPU_CORE */ +GPIO_INT(PGOOD_VCCP, K, 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VCCP */ +GPIO_INT(PGOOD_VCCSA, H, 1, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VCCSA */ +GPIO_INT(PGOOD_VGFX_CORE, D, 2, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on +VGFX_CORE */ +GPIO_INT(RECOVERY_L, H, 7, GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ +GPIO_INT(WP, J, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ /* Other inputs */ -GPIO(THERMAL_DATA_READY_L, B, 4, GPIO_INPUT, NULL) /* Data ready from I2C thermal sensor */ -GPIO(BOARD_VERSION1, H, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, L, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, L, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ -GPIO(ONEWIRE, H, 2, GPIO_INPUT, NULL) /* One-wire bus to adapter LED */ -GPIO(USB1_STATUS_L, E, 7, GPIO_INPUT, NULL) /* USB charger port 1 status output */ -GPIO(USB2_STATUS_L, E, 1, GPIO_INPUT, NULL) /* USB charger port 2 status output */ - +GPIO(THERMAL_DATA_READY_L, B, 4, GPIO_INPUT) /* Data ready from I2C thermal sensor */ +GPIO(BOARD_VERSION1, H, 6, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, L, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, L, 7, GPIO_INPUT) /* Board version stuffing resistor 3 */ +GPIO(ONEWIRE, H, 2, GPIO_INPUT) /* One-wire bus to adapter LED */ +GPIO(USB1_STATUS_L, E, 7, GPIO_INPUT) /* USB charger port 1 status output */ +GPIO(USB2_STATUS_L, E, 1, GPIO_INPUT) /* USB charger port 2 status output */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, F, 2, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(ENABLE_1_5V_DDR, H, 5, GPIO_OUT_LOW, NULL) /* Enable +1.5V_DDR supply */ -GPIO(ENABLE_5VALW, K, 4, GPIO_OUT_HIGH, NULL) /* Enable +5V always on rail */ -GPIO(ENABLE_BACKLIGHT, H, 4, GPIO_OUT_LOW, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, C, 6, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENABLE_VCORE, F, 7, GPIO_OUT_LOW, NULL) /* Enable +CPU_CORE and +VGFX_CORE */ -GPIO(ENABLE_VS, G, 6, GPIO_OUT_LOW, NULL) /* Enable VS power supplies */ -GPIO(ENABLE_WLAN, Q, 5, GPIO_OUT_LOW, NULL) /* Enable WLAN module power (+3VS_WLAN) */ -GPIO(ENTERING_RW, J, 5, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(LIGHTBAR_RESET_L, B, 1, GPIO_OUT_LOW, NULL) /* Reset lightbar controllers */ -GPIO(PCH_A20GATE, Q, 6, GPIO_OUT_LOW, NULL) /* A20GATE signal to PCH */ -GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW, NULL) /* DPWROK signal to PCH */ +GPIO(CPU_PROCHOT, F, 2, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(ENABLE_1_5V_DDR, H, 5, GPIO_OUT_LOW) /* Enable +1.5V_DDR supply */ +GPIO(ENABLE_5VALW, K, 4, GPIO_OUT_HIGH) /* Enable +5V always on rail */ +GPIO(ENABLE_BACKLIGHT, H, 4, GPIO_OUT_LOW) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, C, 6, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENABLE_VCORE, F, 7, GPIO_OUT_LOW) /* Enable +CPU_CORE and +VGFX_CORE */ +GPIO(ENABLE_VS, G, 6, GPIO_OUT_LOW) /* Enable VS power supplies */ +GPIO(ENABLE_WLAN, Q, 5, GPIO_OUT_LOW) /* Enable WLAN module power (+3VS_WLAN) */ +GPIO(ENTERING_RW, J, 5, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(LIGHTBAR_RESET_L, B, 1, GPIO_OUT_LOW) /* Reset lightbar controllers */ +GPIO(PCH_A20GATE, Q, 6, GPIO_OUT_LOW) /* A20GATE signal to PCH */ +GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW) /* DPWROK signal to PCH */ /* * HDA_SDO is technically an output, but we need to leave it as an * input until we drive it high. So can't use open-drain (HI_Z). */ -GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT, NULL) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH, NULL) /* Wake signal output to PCH */ -GPIO(PCH_NMI_L, M, 2, GPIO_OUT_HIGH, NULL) /* Non-maskable interrupt pin to PCH */ -GPIO(PCH_PWRBTN_L, G, 7, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* PWROK / APWROK signals to PCH */ -GPIO(PCH_RCIN_L, Q, 7, GPIO_ODR_HIGH, NULL) /* RCIN# signal to PCH */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH, NULL) /* Reset PCH RTC well */ -GPIO(PCH_SMI_L, F, 4, GPIO_OUT_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(PCH_SRTCRST_L, C, 7, GPIO_ODR_HIGH, NULL) /* Reset PCH ME RTC well */ -GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH, NULL) /* Acknowledge PCH SUSWARN# signal */ -GPIO(RADIO_ENABLE_WLAN, D, 0, GPIO_OUT_LOW, NULL) /* Enable WLAN radio */ -GPIO(RADIO_ENABLE_BT, D, 1, GPIO_OUT_LOW, NULL) /* Enable bluetooth radio */ -GPIO(SPI_CS_L, A, 3, GPIO_ODR_HIGH, NULL) /* SPI chip select */ -GPIO(TOUCHSCREEN_RESET_L, B, 0, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(USB1_CTL1, E, 2, GPIO_OUT_LOW, NULL) /* USB charger port 1 CTL1 output */ -GPIO(USB1_CTL2, E, 3, GPIO_OUT_LOW, NULL) /* USB charger port 1 CTL2 output */ -GPIO(USB1_CTL3, E, 4, GPIO_OUT_LOW, NULL) /* USB charger port 1 CTL3 output */ -GPIO(USB1_ENABLE, E, 5, GPIO_OUT_LOW, NULL) /* USB charger port 1 enable */ -GPIO(USB1_ILIM_SEL, E, 6, GPIO_OUT_LOW, NULL) /* USB charger port 1 ILIM_SEL output */ -GPIO(USB2_CTL1, D, 4, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL1 output */ -GPIO(USB2_CTL2, D, 5, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL2 output */ -GPIO(USB2_CTL3, D, 6, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL3 output */ -GPIO(USB2_ENABLE, D, 7, GPIO_OUT_LOW, NULL) /* USB charger port 2 enable */ -GPIO(USB2_ILIM_SEL, E, 0, GPIO_OUT_LOW, NULL) /* USB charger port 2 ILIM_SEL output */ +GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH) /* Wake signal output to PCH */ +GPIO(PCH_NMI_L, M, 2, GPIO_OUT_HIGH) /* Non-maskable interrupt pin to PCH */ +GPIO(PCH_PWRBTN_L, G, 7, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW) /* PWROK / APWROK signals to PCH */ +GPIO(PCH_RCIN_L, Q, 7, GPIO_ODR_HIGH) /* RCIN# signal to PCH */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH) /* Reset PCH RTC well */ +GPIO(PCH_SMI_L, F, 4, GPIO_OUT_HIGH) /* System management interrupt to PCH */ +GPIO(PCH_SRTCRST_L, C, 7, GPIO_ODR_HIGH) /* Reset PCH ME RTC well */ +GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH) /* Acknowledge PCH SUSWARN# signal */ +GPIO(RADIO_ENABLE_WLAN, D, 0, GPIO_OUT_LOW) /* Enable WLAN radio */ +GPIO(RADIO_ENABLE_BT, D, 1, GPIO_OUT_LOW) /* Enable bluetooth radio */ +GPIO(SPI_CS_L, A, 3, GPIO_ODR_HIGH) /* SPI chip select */ +GPIO(TOUCHSCREEN_RESET_L, B, 0, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(USB1_CTL1, E, 2, GPIO_OUT_LOW) /* USB charger port 1 CTL1 output */ +GPIO(USB1_CTL2, E, 3, GPIO_OUT_LOW) /* USB charger port 1 CTL2 output */ +GPIO(USB1_CTL3, E, 4, GPIO_OUT_LOW) /* USB charger port 1 CTL3 output */ +GPIO(USB1_ENABLE, E, 5, GPIO_OUT_LOW) /* USB charger port 1 enable */ +GPIO(USB1_ILIM_SEL, E, 6, GPIO_OUT_LOW) /* USB charger port 1 ILIM_SEL output */ +GPIO(USB2_CTL1, D, 4, GPIO_OUT_LOW) /* USB charger port 2 CTL1 output */ +GPIO(USB2_CTL2, D, 5, GPIO_OUT_LOW) /* USB charger port 2 CTL2 output */ +GPIO(USB2_CTL3, D, 6, GPIO_OUT_LOW) /* USB charger port 2 CTL3 output */ +GPIO(USB2_ENABLE, D, 7, GPIO_OUT_LOW) /* USB charger port 2 enable */ +GPIO(USB2_ILIM_SEL, E, 0, GPIO_OUT_LOW) /* USB charger port 2 ILIM_SEL output */ ALTERNATE(A, 0x03, 1, MODULE_UART, 0) /* UART0 */ ALTERNATE(A, 0x40, 3, MODULE_I2C, 0) /* I2C1 SCL */ diff --git a/board/llama/gpio.inc b/board/llama/gpio.inc index 0ad76346c7..a13246ecca 100644 --- a/board/llama/gpio.inc +++ b/board/llama/gpio.inc @@ -6,58 +6,59 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) /* AC power present: PA 0 */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt) /* Keyboard power button: PB 5 */ -GPIO(SOC_POWER_GOOD_L, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) /* AP suspend/resume state */ -GPIO(5V_GOOD_L, A, 1, GPIO_INT_BOTH, NULL) -GPIO(AP_RESET_H, B, 3, GPIO_OUT_LOW, NULL) -GPIO(BOARD_VERSION1, C, 6, GPIO_INPUT|GPIO_PULL_UP, NULL) /* Board version stuffing resistor 1 */ +GPIO_INT(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) /* AC power present: PA 0 */ +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt) /* Keyboard power button: PB 5 */ +GPIO_INT(SOC_POWER_GOOD_L, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) /* AP suspend/resume state */ + +/* Keyboard inputs */ +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* SPI Chip Select */ -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) -/* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO(5V_GOOD_L, A, 1, GPIO_INT_BOTH) +GPIO(AP_RESET_H, B, 3, GPIO_OUT_LOW) +GPIO(BOARD_VERSION1, C, 6, GPIO_INPUT|GPIO_PULL_UP) /* Board version stuffing resistor 1 */ /* Outputs */ -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) /* LED_GREEN */ -GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) /* LED_ORANGE */ -GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_OUT_HIGH, NULL) -GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW, NULL) /* KSO2 is inverted */ -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 14, GPIO_KB_OUTPUT, NULL) -GPIO(SYSTEM_POWER_H, B, 10, GPIO_OUT_LOW, NULL) -GPIO(PMIC_PWRON_H, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_WARM_RESET_H, C, 3, GPIO_ODR_LOW, NULL) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) /* LED_GREEN */ +GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW) /* LED_ORANGE */ +GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_OUT_HIGH) +GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW) /* KSO2 is inverted */ +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 14, GPIO_KB_OUTPUT) +GPIO(SYSTEM_POWER_H, B, 10, GPIO_OUT_LOW) +GPIO(PMIC_PWRON_H, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_WARM_RESET_H, C, 3, GPIO_ODR_LOW) /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(MASTER_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 7, GPIO_INPUT, NULL) +GPIO(MASTER_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 7, GPIO_INPUT) /* Unimplemented signals which we need to emulate for now */ /* UNIMPLEMENTED(ENTERING_RW) */ diff --git a/board/mccroskey/gpio.inc b/board/mccroskey/gpio.inc index e885176c08..61a02c05ff 100644 --- a/board/mccroskey/gpio.inc +++ b/board/mccroskey/gpio.inc @@ -6,55 +6,55 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(KB_IN00, B, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, B, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, B, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, B, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, B, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, B, 13, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, B, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, B, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, B, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, B, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, B, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, B, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, B, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, B, 13, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, B, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, B, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* TODO(crosbug.com/p/23494): interrupt handler for power button */ -GPIO(KBD_PWR_BUTTON, B, 2, GPIO_INPUT, NULL) +GPIO(KBD_PWR_BUTTON, B, 2, GPIO_INPUT) -GPIO(OMZO_RDY_L, A, 0, GPIO_INPUT, NULL) /* PA0_WKUP */ -GPIO(OZMO_RST_L, A, 2, GPIO_ODR_HIGH, NULL) -GPIO(VBUS_UP_DET, A, 3, GPIO_INPUT, NULL) -GPIO(OZMO_REQ_L, A, 8, GPIO_INPUT, NULL) -GPIO(CHARGE_ZERO, B, 0, GPIO_INPUT, NULL) -GPIO(CHARGE_SHUNT, B, 1, GPIO_INPUT, NULL) -GPIO(PMIC_INT_L, B, 5, GPIO_INPUT, NULL) +GPIO(OMZO_RDY_L, A, 0, GPIO_INPUT) /* PA0_WKUP */ +GPIO(OZMO_RST_L, A, 2, GPIO_ODR_HIGH) +GPIO(VBUS_UP_DET, A, 3, GPIO_INPUT) +GPIO(OZMO_REQ_L, A, 8, GPIO_INPUT) +GPIO(CHARGE_ZERO, B, 0, GPIO_INPUT) +GPIO(CHARGE_SHUNT, B, 1, GPIO_INPUT) +GPIO(PMIC_INT_L, B, 5, GPIO_INPUT) /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(I2C1_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_INPUT, NULL) +GPIO(I2C1_SCL, B, 6, GPIO_INPUT) +GPIO(I2C1_SDA, B, 7, GPIO_INPUT) -GPIO(KB_OUT00, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, C, 3, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 6, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 7, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, C, 9, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 10, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 11, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, C, 12, GPIO_KB_OUTPUT, NULL) -GPIO(USB_VBUS_CTRL, C, 13, GPIO_OUT_LOW, NULL) -GPIO(HUB_RESET, C, 14, GPIO_ODR_HIGH, NULL) -GPIO(WP_L, D, 2, GPIO_INPUT, NULL) +GPIO(KB_OUT00, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, C, 3, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 6, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 7, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, C, 9, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 10, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 11, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, C, 12, GPIO_KB_OUTPUT) +GPIO(USB_VBUS_CTRL, C, 13, GPIO_OUT_LOW) +GPIO(HUB_RESET, C, 14, GPIO_ODR_HIGH) +GPIO(WP_L, D, 2, GPIO_INPUT) /* * TODO(crosbug.com/p/23494): This will be an alternate function GPIO, * so remove it from here. */ -GPIO(BL_PWM, A, 1, GPIO_OUTPUT, NULL) +GPIO(BL_PWM, A, 1, GPIO_OUTPUT) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(EC_INT) @@ -62,12 +62,12 @@ UNIMPLEMENTED(ENTERING_RW) #if 0 /* Other GPIOs (probably need to be set up below as alt. function) */ -GPIO(STM_USBDM, A, 11, GPIO_DEFAULT, NULL) -GPIO(STM_USBDP, A, 12, GPIO_DEFAULT, NULL) -GPIO(JTMS_SWDIO, A, 13, GPIO_DEFAULT, NULL) -GPIO(JTCK_SWCLK, A, 14, GPIO_DEFAULT, NULL) -GPIO(JTDI, A, 15, GPIO_DEFAULT, NULL) -GPIO(JTDO, B, 3, GPIO_DEFAULT, NULL) -GPIO(JNTRST, B, 4, GPIO_DEFAULT, NULL) -GPIO(OSC32_OUT, C, 15, GPIO_DEFAULT, NULL) +GPIO(STM_USBDM, A, 11, GPIO_DEFAULT) +GPIO(STM_USBDP, A, 12, GPIO_DEFAULT) +GPIO(JTMS_SWDIO, A, 13, GPIO_DEFAULT) +GPIO(JTCK_SWCLK, A, 14, GPIO_DEFAULT) +GPIO(JTDI, A, 15, GPIO_DEFAULT) +GPIO(JTDO, B, 3, GPIO_DEFAULT) +GPIO(JNTRST, B, 4, GPIO_DEFAULT) +GPIO(OSC32_OUT, C, 15, GPIO_DEFAULT) #endif diff --git a/board/mec1322_evb/gpio.inc b/board/mec1322_evb/gpio.inc index 64e4024ef9..511fcd8c68 100644 --- a/board/mec1322_evb/gpio.inc +++ b/board/mec1322_evb/gpio.inc @@ -5,17 +5,17 @@ * found in the LICENSE file. */ -GPIO(LED1, PORT(15), 4, GPIO_ODR_LOW, NULL) -GPIO(LED2, PORT(15), 5, GPIO_ODR_HIGH, NULL) -GPIO(LED3, PORT(15), 6, GPIO_ODR_LOW, NULL) -GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH, NULL) /* SMI output */ -GPIO(PCH_WAKE_L, PORT(20), 0, GPIO_ODR_HIGH, NULL) /* PCH wake pin */ +GPIO(LED1, PORT(15), 4, GPIO_ODR_LOW) +GPIO(LED2, PORT(15), 5, GPIO_ODR_HIGH) +GPIO(LED3, PORT(15), 6, GPIO_ODR_LOW) +GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH) /* SMI output */ +GPIO(PCH_WAKE_L, PORT(20), 0, GPIO_ODR_HIGH) /* PCH wake pin */ /* Switch S1 */ -GPIO(S1, PORT(6), 3, GPIO_INT_FALLING | GPIO_PULL_UP, NULL) +GPIO(S1, PORT(6), 3, GPIO_INT_FALLING | GPIO_PULL_UP) /* Shared SPI CS */ -GPIO(SHD_CS0, PORT(15), 0, GPIO_ODR_HIGH, NULL) +GPIO(SHD_CS0, PORT(15), 0, GPIO_ODR_HIGH) /* * Signals which aren't implemented on MEC1322 eval board but we'll diff --git a/board/mighty/gpio.inc b/board/mighty/gpio.inc index 29efb848d1..294b097766 100644 --- a/board/mighty/gpio.inc +++ b/board/mighty/gpio.inc @@ -6,53 +6,53 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ -GPIO(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) -GPIO(AC_PRESENT, A, 8, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ +GPIO_INT(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) +GPIO_INT(AC_PRESENT, A, 8, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN, NULL) /* wk1 */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN) /* wk1 */ +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) -GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW, NULL) /* Inverted from silegro */ -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(POWER_LED, A, 2, GPIO_OUT_LOW, NULL) -GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW, NULL) -GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) +GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW) +GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_OUT_LOW) +GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW) /* Inverted from silegro */ +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(POWER_LED, A, 2, GPIO_OUT_LOW) +GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW) +GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, 0, MODULE_SPI, 0) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) diff --git a/board/npcx_evb/gpio.inc b/board/npcx_evb/gpio.inc index 8457aff4ae..77dbd801c5 100644 --- a/board/npcx_evb/gpio.inc +++ b/board/npcx_evb/gpio.inc @@ -6,33 +6,34 @@ */ /* TODO: Redefine debug 2 inputs */ -GPIO(RECOVERY_L, 0, 0, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ -GPIO(WP_L, 9, 3, GPIO_PULL_DOWN | GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(RECOVERY_L, 0, 0, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ +GPIO_INT(WP_L, 9, 3, GPIO_PULL_DOWN | GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ /* For testing 8042 commands, we need the following GPIOs */ /* TODO: Redefine 4 inputs */ -GPIO(POWER_BUTTON_L, 0, 2, GPIO_PULL_UP | GPIO_INT_BOTH, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, 3, 3, GPIO_PULL_DOWN | GPIO_INT_BOTH, lid_interrupt) /* Lid switch */ -GPIO(ENTERING_RW, 3, 6, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_WAKE_L, 5, 0, GPIO_OUT_HIGH, NULL) /* Wake signal output to PCH */ +GPIO_INT(POWER_BUTTON_L, 0, 2, GPIO_PULL_UP | GPIO_INT_BOTH, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, 3, 3, GPIO_PULL_DOWN | GPIO_INT_BOTH, lid_interrupt) /* Lid switch */ + +GPIO(ENTERING_RW, 3, 6, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_WAKE_L, 5, 0, GPIO_OUT_HIGH) /* Wake signal output to PCH */ /* Used for module testing */ -GPIO(PGOOD_FAN, C, 7, GPIO_PULL_UP | GPIO_INPUT, NULL) /* Power Good for FAN test */ -GPIO(SPI_CS_L, A, 5, GPIO_OUT_HIGH, NULL) /* SPI_CS Ready, Low Active. */ +GPIO(PGOOD_FAN, C, 7, GPIO_PULL_UP | GPIO_INPUT) /* Power Good for FAN test */ +GPIO(SPI_CS_L, A, 5, GPIO_OUT_HIGH) /* SPI_CS Ready, Low Active. */ /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(MASTER_I2C_SCL, B, 5, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 4, GPIO_INPUT, NULL) +GPIO(MASTER_I2C_SCL, B, 5, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 4, GPIO_INPUT) /* Used for board version command */ -GPIO(BOARD_VERSION1, 6, 4, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, 6, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, 6, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ +GPIO(BOARD_VERSION1, 6, 4, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, 6, 5, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, 6, 6, GPIO_INPUT) /* Board version stuffing resistor 3 */ #ifdef CONFIG_KEYBOARD_COL2_INVERTED -GPIO(KBD_KSO2, 1, 7, GPIO_OUT_LOW, NULL) /* Negative edge triggered keyboard irq. */ +GPIO(KBD_KSO2, 1, 7, GPIO_OUT_LOW) /* Negative edge triggered keyboard irq. */ #endif /* Alternate pins for UART/I2C/ADC/SPI/PWM/MFT */ ALTERNATE(1, 0x03, 1, MODULE_UART, 0) /* CR_SIN/SOUT GPIO10/11 */ diff --git a/board/nyan/gpio.inc b/board/nyan/gpio.inc index e35673e5fe..54e541f55b 100644 --- a/board/nyan/gpio.inc +++ b/board/nyan/gpio.inc @@ -6,56 +6,56 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_KB_INPUT, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) -GPIO(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_KB_INPUT, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) +GPIO_INT(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH, NULL) -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) -GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(LED_POWER_L, A, 2, GPIO_OUT_HIGH, NULL) /* PWR_LED1 */ -GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH, NULL) -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(PWR_LED0, B, 10, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED1, A, 8, GPIO_OUT_LOW, NULL) -GPIO(CHARGING, A, 11, GPIO_OUT_LOW, NULL) -GPIO(EC_BL_OVERRIDE, H, 1, GPIO_ODR_HIGH, NULL) -GPIO(PMIC_THERM_L, A, 1, GPIO_ODR_HIGH, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH) +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) +GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(LED_POWER_L, A, 2, GPIO_OUT_HIGH) /* PWR_LED1 */ +GPIO(PMIC_PWRON_L, A, 12, GPIO_OUT_HIGH) +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(PWR_LED0, B, 10, GPIO_OUT_LOW) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) +GPIO(BAT_LED1, A, 8, GPIO_OUT_LOW) +GPIO(CHARGING, A, 11, GPIO_OUT_LOW) +GPIO(EC_BL_OVERRIDE, H, 1, GPIO_ODR_HIGH) +GPIO(PMIC_THERM_L, A, 1, GPIO_ODR_HIGH) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI, GPIO_DEFAULT) ALTERNATE(A, 0x0600, GPIO_ALT_USART, MODULE_UART, GPIO_DEFAULT) diff --git a/board/peppy/gpio.inc b/board/peppy/gpio.inc index 3e275ec397..0ce95b1f43 100644 --- a/board/peppy/gpio.inc +++ b/board/peppy/gpio.inc @@ -6,87 +6,87 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ -GPIO(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ -GPIO(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ -GPIO(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ -GPIO(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, power_interrupt) /* PCH wants EDP enabled */ -GPIO(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_BKLTEN, M, 3, GPIO_INT_BOTH, backlight_interrupt) /* Backlight enable signal from PCH */ +GPIO_INT(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ +GPIO_INT(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP1350_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.35V (DRAM) */ +GPIO_INT(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(PCH_EDP_VDD_EN, J, 1, GPIO_INT_BOTH, power_interrupt) /* PCH wants EDP enabled */ +GPIO_INT(RECOVERY_L, A, 5, GPIO_PULL_UP | GPIO_INT_BOTH, switch_interrupt) /* Recovery signal from servo */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ /* Other inputs */ -GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT, NULL) /* From thermal sensor */ -GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, NULL) /* SUSWARN# signal from PCH */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ -GPIO(CPU_PGOOD, C, 4, GPIO_INPUT, NULL) /* Power good to the CPU */ -GPIO(BAT_PRESENT_L, B, 4, GPIO_INPUT, NULL) /* Battery present. Repurposed BAT_TEMP */ +GPIO(FAN_ALERT_L, B, 0, GPIO_INPUT) /* From thermal sensor */ +GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH) /* SUSWARN# signal from PCH */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT) /* Board version stuffing resistor 3 */ +GPIO(CPU_PGOOD, C, 4, GPIO_INPUT) /* Power good to the CPU */ +GPIO(BAT_PRESENT_L, B, 4, GPIO_INPUT) /* Battery present. Repurposed BAT_TEMP */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW, NULL) /* Stuffing option - not connected */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PP5000_FAN_EN, J, 3, GPIO_OUT_LOW, NULL) /* Enable fan power rail */ -GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW, NULL) /* Allow battery to charge when on AC */ +GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW) /* Stuffing option - not connected */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PP5000_FAN_EN, J, 3, GPIO_OUT_LOW) /* Enable fan power rail */ +GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(CHARGE_L, E, 6, GPIO_OUT_LOW) /* Allow battery to charge when on AC */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW, NULL) /* Indicate when VccDSW is good */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW) /* Indicate when VccDSW is good */ /* * HDA_SDO is technically an output, but we need to leave it as an * input until we drive it high. So can't use open-drain (HI_Z). */ -GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT, NULL) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH, NULL) /* Non-maskable interrupt pin to PCH */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* PWROK / APWROK signals to PCH */ +GPIO(PCH_HDA_SDO, G, 1, GPIO_INPUT) /* HDA_SDO signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_WAKE_L, F, 0, GPIO_OUT_HIGH) /* Wake signal from EC to PCH */ +GPIO(PCH_NMI_L, F, 2, GPIO_OUT_HIGH) /* Non-maskable interrupt pin to PCH */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW) /* PWROK / APWROK signals to PCH */ /* * PL6 is one of 4 pins on the EC which can't be used in open-drain * mode. To work around this PCH_RCIN_L is set to an input. It will * only be set to an output when it needs to be driven to 0. */ -GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT, NULL) /* RCIN# line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW, NULL) /* Enable EDP (passthru from PCH) */ +GPIO(PCH_RCIN_L, L, 6, GPIO_INPUT) /* RCIN# line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(EC_EDP_VDD_EN, J, 5, GPIO_OUT_LOW) /* Enable EDP (passthru from PCH) */ -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Dunno. Probably important, though. */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Dunno. Probably important, though. */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW) /* USB port 2 output power enable */ -GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH, NULL) /* Acknowledge PCH SUSWARN# signal */ -GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ -GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH, NULL) /* Not supposed to be here */ +GPIO(PCH_SUSACK_L, F, 3, GPIO_OUT_HIGH) /* Acknowledge PCH SUSWARN# signal */ +GPIO(PCH_RTCRST_L, F, 6, GPIO_ODR_HIGH) /* Not supposed to be here */ +GPIO(PCH_SRTCRST_L, F, 7, GPIO_ODR_HIGH) /* Not supposed to be here */ -GPIO(BAT_LED0_L, D, 0, GPIO_ODR_HIGH, NULL) /* Battery charging LED - blue */ -GPIO(BAT_LED1_L, N, 4, GPIO_ODR_HIGH, NULL) /* Battery charging LED - orange */ -GPIO(PWR_LED0_L, D, 1, GPIO_ODR_HIGH, NULL) /* Power LED - blue */ -GPIO(PWR_LED1_L, N, 6, GPIO_ODR_HIGH, NULL) /* Power LED - orange */ +GPIO(BAT_LED0_L, D, 0, GPIO_ODR_HIGH) /* Battery charging LED - blue */ +GPIO(BAT_LED1_L, N, 4, GPIO_ODR_HIGH) /* Battery charging LED - orange */ +GPIO(PWR_LED0_L, D, 1, GPIO_ODR_HIGH) /* Power LED - blue */ +GPIO(PWR_LED1_L, N, 6, GPIO_ODR_HIGH) /* Power LED - orange */ ALTERNATE(A, 0x03, 1, MODULE_UART, GPIO_PULL_UP) /* UART0 */ ALTERNATE(B, 0x04, 3, MODULE_I2C, 0) /* I2C0 SCL */ diff --git a/board/pinky/gpio.inc b/board/pinky/gpio.inc index a0909168c2..e4dca2ba78 100644 --- a/board/pinky/gpio.inc +++ b/board/pinky/gpio.inc @@ -6,52 +6,52 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) -GPIO(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) -GPIO(AC_PRESENT, A, 0, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) +GPIO_INT(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) +GPIO_INT(AC_PRESENT, A, 0, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(5V_DRV, A, 8, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) -GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW, NULL) /* Inverted from silegro */ -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW, NULL) -GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(5V_DRV, A, 8, GPIO_OUT_LOW) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) +GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW) +GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_OUT_LOW) +GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW) /* Inverted from silegro */ +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW) +GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, 0, MODULE_SPI, 0) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) diff --git a/board/pit/gpio.inc b/board/pit/gpio.inc index 8c00cab0bd..7717295d62 100644 --- a/board/pit/gpio.inc +++ b/board/pit/gpio.inc @@ -6,56 +6,56 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_RISING, power_signal_interrupt) -GPIO(CHARGER_INT_L, C, 6, GPIO_INT_FALLING, pmu_irq_handler) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) -GPIO(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) +GPIO_INT(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_RISING, power_signal_interrupt) +GPIO_INT(CHARGER_INT_L, C, 6, GPIO_INT_FALLING, pmu_irq_handler) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) +GPIO_INT(AC_PRESENT, A, 0, GPIO_INT_BOTH, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH, NULL) -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) -GPIO(EN_PP1350, H, 1, GPIO_OUT_LOW, NULL) -GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW, NULL) -GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW, NULL) -GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(I2C2_SCL, B, 10, GPIO_ODR_HIGH, NULL) -GPIO(I2C2_SDA, B, 11, GPIO_ODR_HIGH, NULL) -GPIO(CHARGING_LED,A, 2, GPIO_OUT_LOW, NULL) -GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) +GPIO(AP_RESET_L, B, 3, GPIO_ODR_HIGH) +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) +GPIO(EN_PP1350, H, 1, GPIO_OUT_LOW) +GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW) +GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW) +GPIO(ENTERING_RW, H, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(I2C2_SCL, B, 10, GPIO_ODR_HIGH) +GPIO(I2C2_SDA, B, 11, GPIO_ODR_HIGH) +GPIO(CHARGING_LED,A, 2, GPIO_OUT_LOW) +GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) ALTERNATE(A, 0x00f0, GPIO_ALT_SPI, MODULE_SPI, 0) ALTERNATE(A, 0x0600, GPIO_ALT_USART, MODULE_UART, 0) diff --git a/board/plankton/gpio.inc b/board/plankton/gpio.inc index 13a6507848..dce01b2d9e 100644 --- a/board/plankton/gpio.inc +++ b/board/plankton/gpio.inc @@ -6,65 +6,65 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(VBUS_WAKE, B, 5, GPIO_INT_BOTH, vbus_event) -GPIO(DBG_20V_TO_DUT_L, C, 13, GPIO_INT_FALLING, button_event) -GPIO(DBG_12V_TO_DUT_L, B, 14, GPIO_INT_FALLING, button_event) -GPIO(DBG_5V_TO_DUT_L, B, 8, GPIO_INT_FALLING, button_event) -GPIO(DBG_CHG_TO_DEV_L, F, 1, GPIO_INT_FALLING, button_event) -GPIO(DBG_USB_TOGGLE_L, F, 0, GPIO_INT_FALLING, button_event) -GPIO(DBG_CASE_CLOSE_EN_L, B, 12, GPIO_INT_FALLING, button_event) -GPIO(DBG_MUX_FLIP_L, B, 15, GPIO_INT_FALLING, button_event) +GPIO_INT(VBUS_WAKE, B, 5, GPIO_INT_BOTH, vbus_event) +GPIO_INT(DBG_20V_TO_DUT_L, C, 13, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_12V_TO_DUT_L, B, 14, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_5V_TO_DUT_L, B, 8, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_CHG_TO_DEV_L, F, 1, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_USB_TOGGLE_L, F, 0, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_CASE_CLOSE_EN_L, B, 12, GPIO_INT_FALLING, button_event) +GPIO_INT(DBG_MUX_FLIP_L, B, 15, GPIO_INT_FALLING, button_event) /* PD RX/TX */ -GPIO(USBC_PD_REF, A, 1, GPIO_ANALOG, NULL) -GPIO(USBC_CC1_PD, A, 0, GPIO_ANALOG, NULL) -GPIO(USBC_CC1_TX_EN, A, 3, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC2_PD, A, 4, GPIO_ANALOG, NULL) -GPIO(USBC_CC2_TX_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC_TX_DATA, A, 6, GPIO_OUT_LOW, NULL) +GPIO(USBC_PD_REF, A, 1, GPIO_ANALOG) +GPIO(USBC_CC1_PD, A, 0, GPIO_ANALOG) +GPIO(USBC_CC1_TX_EN, A, 3, GPIO_OUT_LOW) +GPIO(USBC_CC2_PD, A, 4, GPIO_ANALOG) +GPIO(USBC_CC2_TX_EN, B, 2, GPIO_OUT_LOW) +GPIO(USBC_CC_TX_DATA, A, 6, GPIO_OUT_LOW) #if 0 /* Alternate functions */ -GPIO(USBC_TX_CLKOUT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(USBC_TX_CLKIN, A, 5, GPIO_OUT_LOW, NULL) +GPIO(USBC_TX_CLKOUT, B, 9, GPIO_OUT_LOW) +GPIO(USBC_TX_CLKIN, A, 5, GPIO_OUT_LOW) #endif /* USB-C Power and muxes control */ -GPIO(USBC_CHARGE_EN, A, 8, GPIO_OUT_HIGH, NULL) -GPIO(USBC_CC1_DEVICE_ODL, A, 9, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC1_HOST, A, 2, GPIO_INPUT, NULL) -GPIO(USBC_CC2_DEVICE_ODL, B, 7, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC2_HOST, B, 6, GPIO_INPUT, NULL) -GPIO(USBC_POLARITY, B, 1, GPIO_OUT_HIGH, NULL) -GPIO(USBC_SS_USB_MODE, B, 3, GPIO_OUT_LOW, NULL) -GPIO(USB_CC1_VCONN_EN_L, A, 11, GPIO_OUT_HIGH, NULL) -GPIO(USB_CC2_VCONN_EN_L, A, 12, GPIO_OUT_HIGH, NULL) +GPIO(USBC_CHARGE_EN, A, 8, GPIO_OUT_HIGH) +GPIO(USBC_CC1_DEVICE_ODL, A, 9, GPIO_OUT_LOW) +GPIO(USBC_CC1_HOST, A, 2, GPIO_INPUT) +GPIO(USBC_CC2_DEVICE_ODL, B, 7, GPIO_OUT_LOW) +GPIO(USBC_CC2_HOST, B, 6, GPIO_INPUT) +GPIO(USBC_POLARITY, B, 1, GPIO_OUT_HIGH) +GPIO(USBC_SS_USB_MODE, B, 3, GPIO_OUT_LOW) +GPIO(USB_CC1_VCONN_EN_L, A, 11, GPIO_OUT_HIGH) +GPIO(USB_CC2_VCONN_EN_L, A, 12, GPIO_OUT_HIGH) -GPIO(VBUS_CHARGER_EN, B, 0, GPIO_OUT_LOW, NULL) +GPIO(VBUS_CHARGER_EN, B, 0, GPIO_OUT_LOW) /* VSEL_0/1: 0/0 = 5V, 1/0 = 12V, 1/1 = 20V */ -GPIO(USBC_VSEL_1, A, 10, GPIO_OUT_LOW, NULL) -GPIO(USBC_VSEL_0, C, 14, GPIO_OUT_LOW, NULL) +GPIO(USBC_VSEL_1, A, 10, GPIO_OUT_LOW) +GPIO(USBC_VSEL_0, C, 14, GPIO_OUT_LOW) /* Case closed debugging */ -GPIO(CASE_CLOSE_EN, A, 7, GPIO_OUT_LOW, NULL) -GPIO(CASE_CLOSE_DFU_L, A, 13, GPIO_OUT_HIGH, NULL) -GPIO(DEBUG_TOGGLE, B, 4, GPIO_OUT_LOW, NULL) +GPIO(CASE_CLOSE_EN, A, 7, GPIO_OUT_LOW) +GPIO(CASE_CLOSE_DFU_L, A, 13, GPIO_OUT_HIGH) +GPIO(DEBUG_TOGGLE, B, 4, GPIO_OUT_LOW) /* Display port */ -GPIO(DPSRC_HPD, B, 13, GPIO_INPUT, NULL) +GPIO(DPSRC_HPD, B, 13, GPIO_INPUT) /* Alternate functions */ #if 0 -GPIO(UART_TX, A, 14, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, A, 15, GPIO_OUT_LOW, NULL) +GPIO(UART_TX, A, 14, GPIO_OUT_LOW) +GPIO(UART_RX, A, 15, GPIO_OUT_LOW) #endif /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) @@ -74,4 +74,3 @@ ALTERNATE(A, 0x0020, 0, MODULE_USB_PD, 0) /* SPI1: SCK(PA5) */ ALTERNATE(B, 0x0200, 2, MODULE_USB_PD, 0) /* TIM17_CH1: (PB9) */ ALTERNATE(A, 0xC000, 1, MODULE_UART, 0) /* USART2: PA14/PA15 */ ALTERNATE(B, 0x0C00, 1, MODULE_I2C, 0) /* I2C MASTER:PB10/11 */ - diff --git a/board/rambi/gpio.inc b/board/rambi/gpio.inc index 43a87ae928..c4f52acbd1 100644 --- a/board/rambi/gpio.inc +++ b/board/rambi/gpio.inc @@ -6,65 +6,65 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S4_L, H, 1, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP3300_PCH_PGOOD, C, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ -GPIO(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(S5_PGOOD, G, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S4_L, H, 1, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP3300_PCH_PGOOD, C, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ +GPIO_INT(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(S5_PGOOD, G, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, uart_deepsleep_interrupt) /* UART0 RX input */ /* Other inputs */ -GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT, NULL) -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) -GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT, NULL) +GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT) +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) +GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT) #ifdef CONFIG_CHIPSET_DEBUG -GPIO(PCH_SLP_SX_L, G, 3, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SLP_S0IX# signal from PCH */ -GPIO(PCH_SUS_STAT_L, G, 6, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SUS_STAT# signal from PCH */ -GPIO(PCH_SUSPWRDNACK, G, 2, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SUSPWRDNACK signal from PCH */ +GPIO(PCH_SLP_SX_L, G, 3, GPIO_INPUT | GPIO_PULL_UP) /* SLP_S0IX# signal from PCH */ +GPIO(PCH_SUS_STAT_L, G, 6, GPIO_INPUT | GPIO_PULL_UP) /* SUS_STAT# signal from PCH */ +GPIO(PCH_SUSPWRDNACK, G, 2, GPIO_INPUT | GPIO_PULL_UP) /* SUSPWRDNACK signal from PCH */ #endif -GPIO(PP1000_S0IX_PGOOD, H, 6, GPIO_INPUT, NULL) /* Power good on 1.00V (S0iX supplies) */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ +GPIO(PP1000_S0IX_PGOOD, H, 6, GPIO_INPUT) /* Power good on 1.00V (S0iX supplies) */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 5, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_ODR_HIGH, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 6, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Request that PCH drive LPC clock */ -GPIO(PCH_CORE_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* Indicate core well power is stable */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH, NULL) /* Reset line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(PCH_SOC_OVERRIDE, G, 1, GPIO_OUT_LOW, NULL) /* SOC override signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_SYS_PWROK, J, 1, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, D, 4, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PPSX_EN, L, 6, GPIO_OUT_LOW, NULL) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ -GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(USB_CTL1, E, 6, GPIO_OUT_LOW, NULL) /* USB control signal 1 to both ports */ -GPIO(USB_ILIM_SEL, E, 5, GPIO_OUT_LOW, NULL) /* USB current limit to both ports */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ -GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW, NULL) /* Enable core power supplies */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(PCH_SCI_L, M, 1, GPIO_ODR_HIGH, NULL) /* Assert SCI to PCH */ -GPIO(KBD_IRQ_L, M, 3, GPIO_ODR_HIGH, NULL) /* Negative edge triggered irq. */ +GPIO(CPU_PROCHOT, B, 5, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_ODR_HIGH) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 6, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Request that PCH drive LPC clock */ +GPIO(PCH_CORE_PWROK, F, 5, GPIO_OUT_LOW) /* Indicate core well power is stable */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH) /* Power button output to PCH */ +GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH) /* Reset line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(PCH_SOC_OVERRIDE, G, 1, GPIO_OUT_LOW) /* SOC override signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_SYS_PWROK, J, 1, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH) /* Wake signal from EC to PCH */ +GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, D, 4, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PPSX_EN, L, 6, GPIO_OUT_LOW) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ +GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(USB_CTL1, E, 6, GPIO_OUT_LOW) /* USB control signal 1 to both ports */ +GPIO(USB_ILIM_SEL, E, 5, GPIO_OUT_LOW) /* USB current limit to both ports */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW) /* USB port 2 output power enable */ +GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW) /* Enable core power supplies */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(PCH_SCI_L, M, 1, GPIO_ODR_HIGH) /* Assert SCI to PCH */ +GPIO(KBD_IRQ_L, M, 3, GPIO_ODR_HIGH) /* Negative edge triggered irq. */ ALTERNATE(A, 0x03, 1, MODULE_UART, 0) /* UART0 */ ALTERNATE(B, 0x04, 3, MODULE_I2C, 0) /* I2C0 SCL */ diff --git a/board/ryu/gpio.inc b/board/ryu/gpio.inc index 5922676fb7..816e9e3e68 100644 --- a/board/ryu/gpio.inc +++ b/board/ryu/gpio.inc @@ -6,120 +6,120 @@ */ /* Interrupts */ -GPIO(CHGR_ACOK, D, 4, GPIO_INT_BOTH | GPIO_PULL_UP, vbus_evt) -GPIO(POWER_BUTTON_L, C, 13, GPIO_INT_BOTH, power_button_interrupt) /* active high, the name is for compatibility with existing code */ -GPIO(USBC_BC12_INT_L, D, 11, GPIO_INT_FALLING | GPIO_PULL_UP, usb_evt) -GPIO(LID_OPEN, E, 1, GPIO_INT_BOTH | GPIO_PULL_UP, lid_interrupt) -GPIO(CHARGE_DONE, E, 6, GPIO_INT_BOTH, inductive_charging_interrupt) -GPIO(AP_IN_SUSPEND, F, 9, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(AP_HOLD, E, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(BC_TEMP_ALERT_L, C, 5, GPIO_INT_FALLING, NULL) -GPIO(LB_INT_L, E, 7, GPIO_INT_FALLING | GPIO_PULL_UP, NULL) -GPIO(LIGHTBAR_EN_L, E, 8, GPIO_INT_FALLING | GPIO_PULL_UP, NULL) -GPIO(BASE_PRES_L, E, 10, GPIO_INT_BOTH | GPIO_PULL_UP, NULL) +GPIO_INT(CHGR_ACOK, D, 4, GPIO_INT_BOTH | GPIO_PULL_UP, vbus_evt) +GPIO_INT(POWER_BUTTON_L, C, 13, GPIO_INT_BOTH, power_button_interrupt) /* active high, the name is for compatibility with existing code */ +GPIO_INT(USBC_BC12_INT_L, D, 11, GPIO_INT_FALLING | GPIO_PULL_UP, usb_evt) +GPIO_INT(LID_OPEN, E, 1, GPIO_INT_BOTH | GPIO_PULL_UP, lid_interrupt) +GPIO_INT(CHARGE_DONE, E, 6, GPIO_INT_BOTH, inductive_charging_interrupt) +GPIO_INT(AP_IN_SUSPEND, F, 9, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(AP_HOLD, E, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO(BC_TEMP_ALERT_L, C, 5, GPIO_INT_FALLING) +GPIO(LB_INT_L, E, 7, GPIO_INT_FALLING | GPIO_PULL_UP) +GPIO(LIGHTBAR_EN_L, E, 8, GPIO_INT_FALLING | GPIO_PULL_UP) +GPIO(BASE_PRES_L, E, 10, GPIO_INT_BOTH | GPIO_PULL_UP) /* Buttons */ -GPIO(BTN_VOLD_L, C, 0, GPIO_INPUT | GPIO_PULL_UP, NULL) -GPIO(BTN_VOLU_L, A, 2, GPIO_INPUT | GPIO_PULL_UP, NULL) +GPIO(BTN_VOLD_L, C, 0, GPIO_INPUT | GPIO_PULL_UP) +GPIO(BTN_VOLU_L, A, 2, GPIO_INPUT | GPIO_PULL_UP) /* PD RX/TX */ -GPIO(USBC_CC1_PD, A, 1, GPIO_ANALOG, NULL) -GPIO(USBC_CC2_PD, A, 3, GPIO_ANALOG, NULL) -GPIO(USBC_CC_EN, A, 4, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC_TX_DATA, A, 6, GPIO_OUT_LOW, NULL) -GPIO(USBC_CC_TX_EN, D, 7, GPIO_OUT_LOW, NULL) +GPIO(USBC_CC1_PD, A, 1, GPIO_ANALOG) +GPIO(USBC_CC2_PD, A, 3, GPIO_ANALOG) +GPIO(USBC_CC_EN, A, 4, GPIO_OUT_LOW) +GPIO(USBC_CC_TX_DATA, A, 6, GPIO_OUT_LOW) +GPIO(USBC_CC_TX_EN, D, 7, GPIO_OUT_LOW) #if 0 /* Alternate functions */ -GPIO(USBC_TX_CLKOUT, B, 1, GPIO_OUT_LOW, NULL) -GPIO(USBC_TX_CLKIN, B, 3, GPIO_OUT_LOW, NULL) +GPIO(USBC_TX_CLKOUT, B, 1, GPIO_OUT_LOW) +GPIO(USBC_TX_CLKIN, B, 3, GPIO_OUT_LOW) #endif /* System power */ -GPIO(PMIC_PWRON_L, D, 14, GPIO_ODR_HIGH, NULL) -GPIO(PMIC_WARM_RESET_L, E, 4, GPIO_ODR_HIGH, NULL) -GPIO(EN_PP5000, A, 14, GPIO_OUT_LOW, NULL) /* Proto 5+ */ +GPIO(PMIC_PWRON_L, D, 14, GPIO_ODR_HIGH) +GPIO(PMIC_WARM_RESET_L, E, 4, GPIO_ODR_HIGH) +GPIO(EN_PP5000, A, 14, GPIO_OUT_LOW) /* Proto 5+ */ /* * We are missing an external pull-up for EN_PP3300. Pull it up here. * EN_PP3300 is still controlled by PMIC though. */ -GPIO(EN_PP3300_RSVD, E, 13, GPIO_INPUT | GPIO_PULL_UP, NULL) +GPIO(EN_PP3300_RSVD, E, 13, GPIO_INPUT | GPIO_PULL_UP) /* sensor temp output and PMIC reset input */ -GPIO(P5_PMIC_THERM_L, B, 8, GPIO_ODR_HIGH, NULL) +GPIO(P5_PMIC_THERM_L, B, 8, GPIO_ODR_HIGH) /* TODO(crosbug.com/p/38333) remove P4_PMIC_THERM_L */ -GPIO(P4_PMIC_THERM_L, D, 12, GPIO_ODR_HIGH, NULL) +GPIO(P4_PMIC_THERM_L, D, 12, GPIO_ODR_HIGH) -GPIO(VBUS_SENSE, A, 0, GPIO_ANALOG, NULL) -GPIO(CHGR_IADP, B, 0, GPIO_ANALOG, NULL) -GPIO(CHGR_IBAT, C, 3, GPIO_ANALOG, NULL) +GPIO(VBUS_SENSE, A, 0, GPIO_ANALOG) +GPIO(CHGR_IADP, B, 0, GPIO_ANALOG) +GPIO(CHGR_IBAT, C, 3, GPIO_ANALOG) /* Inductive charging */ -GPIO(CHARGE_EN, D, 13, GPIO_OUT_LOW, NULL) -GPIO(BASE_CHG_VDD_EN, E, 5, GPIO_OUT_LOW, NULL) +GPIO(CHARGE_EN, D, 13, GPIO_OUT_LOW) +GPIO(BASE_CHG_VDD_EN, E, 5, GPIO_OUT_LOW) /* USB-C Power and muxes control */ -GPIO(USBC_CHARGE_EN_L, A, 7, GPIO_OUT_LOW, NULL) -GPIO(USBC_5V_EN, D, 8, GPIO_OUT_LOW, NULL) -GPIO(USBC_VCONN1_EN_L, F, 10, GPIO_OUT_HIGH, NULL) -GPIO(USBC_VCONN2_EN_L, D, 10, GPIO_OUT_HIGH, NULL) +GPIO(USBC_CHARGE_EN_L, A, 7, GPIO_OUT_LOW) +GPIO(USBC_5V_EN, D, 8, GPIO_OUT_LOW) +GPIO(USBC_VCONN1_EN_L, F, 10, GPIO_OUT_HIGH) +GPIO(USBC_VCONN2_EN_L, D, 10, GPIO_OUT_HIGH) -GPIO(USBC_CC1_DEVICE_ODL, A, 5, GPIO_ODR_LOW, NULL) -GPIO(USBC_CC2_DEVICE_ODL, E, 14, GPIO_ODR_LOW, NULL) +GPIO(USBC_CC1_DEVICE_ODL, A, 5, GPIO_ODR_LOW) +GPIO(USBC_CC2_DEVICE_ODL, E, 14, GPIO_ODR_LOW) /* Pericom PI3USB30592 mux controls on Proto 5+ */ -GPIO(USBC_MUX_CONF0, D, 3, GPIO_OUT_LOW, NULL) -GPIO(USBC_MUX_CONF1, D, 9, GPIO_OUT_LOW, NULL) -GPIO(USBC_MUX_CONF2, E, 0, GPIO_OUT_LOW, NULL) +GPIO(USBC_MUX_CONF0, D, 3, GPIO_OUT_LOW) +GPIO(USBC_MUX_CONF1, D, 9, GPIO_OUT_LOW) +GPIO(USBC_MUX_CONF2, E, 0, GPIO_OUT_LOW) /* TODO(crosbug.com/p/38333) remove USBC_DP_xxx GPIOs */ -GPIO(USBC_DP_MODE_L, D, 1, GPIO_OUT_HIGH, NULL) -GPIO(USBC_DP_POLARITY, D, 2, GPIO_OUT_HIGH, NULL) +GPIO(USBC_DP_MODE_L, D, 1, GPIO_OUT_HIGH) +GPIO(USBC_DP_POLARITY, D, 2, GPIO_OUT_HIGH) /* Inputs */ -GPIO(BOARD_ID0, E, 11, GPIO_INPUT, NULL) -GPIO(BOARD_ID1, E, 12, GPIO_INPUT, NULL) -GPIO(SH_SIGNAL, E, 2, GPIO_INPUT, NULL) +GPIO(BOARD_ID0, E, 11, GPIO_INPUT) +GPIO(BOARD_ID1, E, 12, GPIO_INPUT) +GPIO(SH_SIGNAL, E, 2, GPIO_INPUT) /* Lightbar reset */ -GPIO(LB_RST_L, D, 15, GPIO_ODR_HIGH | GPIO_PULL_UP, NULL) +GPIO(LB_RST_L, D, 15, GPIO_ODR_HIGH | GPIO_PULL_UP) #if 0 /* Alternate functions */ -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(UART_TX, D, 5, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, D, 6, GPIO_OUT_LOW, NULL) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(UART_TX, D, 5, GPIO_OUT_LOW) +GPIO(UART_RX, D, 6, GPIO_OUT_LOW) #endif /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(MASTER_I2C_SCL, A, 15, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, A, 14, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SCL, A, 9, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SDA, A, 10, GPIO_INPUT, NULL) +GPIO(MASTER_I2C_SCL, A, 15, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, A, 14, GPIO_INPUT) +GPIO(SLAVE_I2C_SCL, A, 9, GPIO_INPUT) +GPIO(SLAVE_I2C_SDA, A, 10, GPIO_INPUT) /* SCL gating for PI3USB9281 */ -GPIO(PERICOM_CLK_EN, C, 15, GPIO_OUT_HIGH, NULL) +GPIO(PERICOM_CLK_EN, C, 15, GPIO_OUT_HIGH) /* Case closed debugging. */ -GPIO(USB_PU_EN_L, C, 2, GPIO_OUT_HIGH, NULL) -GPIO(PD_DISABLE_DEBUG, C, 6, GPIO_OUT_LOW, NULL) -GPIO(SPI_FLASH_NSS, B, 9, GPIO_INPUT, NULL) -GPIO(VDDSPI_EN, C, 12, GPIO_OUT_LOW, NULL) -GPIO(SH_RESET, C, 4, GPIO_ODR_HIGH, NULL) -GPIO(SH_BOOT, C, 9, GPIO_ODR_HIGH, NULL) -GPIO(EC_INT_L, F, 2, GPIO_ODR_HIGH, NULL) -GPIO(ENTERING_RW, E, 15, GPIO_OUT_LOW, NULL) -GPIO(WP_L, F, 6, GPIO_INPUT, NULL) -GPIO(FW_DEBUG_MODE_L, C, 7, GPIO_ODR_HIGH, NULL) /* Proto 5+ */ +GPIO(USB_PU_EN_L, C, 2, GPIO_OUT_HIGH) +GPIO(PD_DISABLE_DEBUG, C, 6, GPIO_OUT_LOW) +GPIO(SPI_FLASH_NSS, B, 9, GPIO_INPUT) +GPIO(VDDSPI_EN, C, 12, GPIO_OUT_LOW) +GPIO(SH_RESET, C, 4, GPIO_ODR_HIGH) +GPIO(SH_BOOT, C, 9, GPIO_ODR_HIGH) +GPIO(EC_INT_L, F, 2, GPIO_ODR_HIGH) +GPIO(ENTERING_RW, E, 15, GPIO_OUT_LOW) +GPIO(WP_L, F, 6, GPIO_INPUT) +GPIO(FW_DEBUG_MODE_L, C, 7, GPIO_ODR_HIGH) /* Proto 5+ */ #if 0 /* Alternate functions */ -GPIO(SH_UART_TX, C, 11, GPIO_OUT_LOW, NULL) -GPIO(SH_UART_RX, C, 10, GPIO_INPUT, NULL) -GPIO(AP_UART_TX, B, 6, GPIO_OUT_LOW, NULL) -GPIO(AP_UART_RX, B, 7, GPIO_INPUT, NULL) +GPIO(SH_UART_TX, C, 11, GPIO_OUT_LOW) +GPIO(SH_UART_RX, C, 10, GPIO_INPUT) +GPIO(AP_UART_TX, B, 6, GPIO_OUT_LOW) +GPIO(AP_UART_RX, B, 7, GPIO_INPUT) #endif UNIMPLEMENTED(AP_RESET_L) diff --git a/board/ryu_sh/gpio.inc b/board/ryu_sh/gpio.inc index 767fc0aa43..f508ac8e9d 100644 --- a/board/ryu_sh/gpio.inc +++ b/board/ryu_sh/gpio.inc @@ -6,27 +6,27 @@ */ /* Interrupts */ -GPIO(AP_IN_SUSPEND, E, 9, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(AP_IN_SUSPEND, E, 9, GPIO_INT_BOTH, power_signal_interrupt) /* * TODO(gwendal): Follow Rambus work. * Combined accelerometer input. This will become an interrupt, once we have * support for it. */ -GPIO(ACC_IRQ, B, 12, GPIO_INPUT, NULL) +GPIO(ACC_IRQ, B, 12, GPIO_INPUT) /* Outputs */ -GPIO(SH_EC_SIGNAL, A, 7, GPIO_OUT_LOW, NULL) -GPIO(SH_IRQ_L, A, 11, GPIO_OUT_LOW, NULL) +GPIO(SH_EC_SIGNAL, A, 7, GPIO_OUT_LOW) +GPIO(SH_IRQ_L, A, 11, GPIO_OUT_LOW) /* Inputs */ -GPIO(LID_CLOSED, A, 2, GPIO_INPUT, NULL) -GPIO(BASE_PRESENT, A, 3, GPIO_INPUT, NULL) -GPIO(COMPASS_DRDY, B, 11, GPIO_INPUT, NULL) +GPIO(LID_CLOSED, A, 2, GPIO_INPUT) +GPIO(BASE_PRESENT, A, 3, GPIO_INPUT) +GPIO(COMPASS_DRDY, B, 11, GPIO_INPUT) #if 0 /* Alternate functions */ -GPIO(UART_TX, A, 9, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, A, 10, GPIO_OUT_LOW, NULL) +GPIO(UART_TX, A, 9, GPIO_OUT_LOW) +GPIO(UART_RX, A, 10, GPIO_OUT_LOW) #endif /* Needed to bypass flash write protection */ @@ -37,10 +37,10 @@ UNIMPLEMENTED(WP) * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SCL, B, 13, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 14, GPIO_INPUT, NULL) +GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT) +GPIO(MASTER_I2C_SCL, B, 13, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 14, GPIO_INPUT) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) /* USART1: PA9/PA10 */ ALTERNATE(B, 0x00C0, 1, MODULE_I2C, 0) /* I2C SLAVE:PB6/7 */ diff --git a/board/ryu_sh_loader/gpio.inc b/board/ryu_sh_loader/gpio.inc index 50b0e32a6d..d4c9e85054 100644 --- a/board/ryu_sh_loader/gpio.inc +++ b/board/ryu_sh_loader/gpio.inc @@ -6,20 +6,20 @@ */ /* Interrupts */ -GPIO(AP_IN_SUSPEND, E, 9, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(AP_IN_SUSPEND, E, 9, GPIO_INT_BOTH, power_signal_interrupt) /* Outputs */ -GPIO(SH_EC_SIGNAL, A, 7, GPIO_OUT_LOW, NULL) -GPIO(SH_IRQ_L, A, 11, GPIO_OUT_LOW, NULL) +GPIO(SH_EC_SIGNAL, A, 7, GPIO_OUT_LOW) +GPIO(SH_IRQ_L, A, 11, GPIO_OUT_LOW) /* Inputs */ -GPIO(LID_CLOSED, A, 2, GPIO_INPUT, NULL) -GPIO(BASE_PRESENT, A, 3, GPIO_INPUT, NULL) +GPIO(LID_CLOSED, A, 2, GPIO_INPUT) +GPIO(BASE_PRESENT, A, 3, GPIO_INPUT) #if 0 /* Alternate functions */ -GPIO(UART_TX, A, 9, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, A, 10, GPIO_OUT_LOW, NULL) +GPIO(UART_TX, A, 9, GPIO_OUT_LOW) +GPIO(UART_RX, A, 10, GPIO_OUT_LOW) #endif /* Needed to bypass flash write protection */ @@ -30,8 +30,8 @@ UNIMPLEMENTED(WP) * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT, NULL) +GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) /* USART1: PA9/PA10 */ ALTERNATE(B, 0x00C0, 1, MODULE_I2C, 0) /* I2C SLAVE:PB6/7 */ diff --git a/board/samus/gpio.inc b/board/samus/gpio.inc index 966292bf7f..91d51a58ce 100644 --- a/board/samus/gpio.inc +++ b/board/samus/gpio.inc @@ -6,99 +6,99 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ -GPIO(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ -GPIO(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ -GPIO(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, power_signal_interrupt) /* SUSWARN# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP1200_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.2V (DRAM) */ -GPIO(PP1800_PGOOD, L, 7, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.8V (DRAM) */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(PCH_BL_EN, M, 3, GPIO_INT_RISING, backlight_interrupt) /* PCH backlight input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ -GPIO(BKBOOST_DET, B, 5, GPIO_INT_RISING, bkboost_det_interrupt) /* Backboost detect */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_SLP_S0_L, G, 6, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S5_L, H, 1, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* SLP_S5# signal from PCH */ +GPIO_INT(PCH_SLP_SUS_L, G, 3, GPIO_INT_BOTH, power_signal_interrupt) /* SLP_SUS# signal from PCH */ +GPIO_INT(PCH_SUSWARN_L, G, 2, GPIO_INT_BOTH, power_signal_interrupt) /* SUSWARN# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP1200_PGOOD, H, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.2V (DRAM) */ +GPIO_INT(PP1800_PGOOD, L, 7, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.8V (DRAM) */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(PCH_BL_EN, M, 3, GPIO_INT_RISING, backlight_interrupt) /* PCH backlight input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_PULL_UP | GPIO_INT_BOTH_DSLEEP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(BKBOOST_DET, B, 5, GPIO_INT_RISING, bkboost_det_interrupt) /* Backboost detect */ /* Interrupt signal from PD MCU, external pull-down */ -GPIO(PD_MCU_INT, J, 5, GPIO_INT_RISING | GPIO_INT_DSLEEP, pd_mcu_interrupt) +GPIO_INT(PD_MCU_INT, J, 5, GPIO_INT_RISING | GPIO_INT_DSLEEP, pd_mcu_interrupt) /* * Combined accelerometer input. This will become an interrupt, once we have * support for it. */ -GPIO(ACCEL_INT, F, 7, GPIO_INPUT, NULL) +GPIO(ACCEL_INT, F, 7, GPIO_INPUT) /* * Ambient Light Sensor input. This could become an interrupt once supported. */ -GPIO(ALS_INT_L, N, 0, GPIO_INPUT, NULL) +GPIO(ALS_INT_L, N, 0, GPIO_INPUT) /* Other inputs */ -GPIO(BOARD_VERSION1, Q, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, Q, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB1_STATUS_L, E, 6, GPIO_INPUT, NULL) /* USB charger port 1 status output */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_STATUS_L, D, 7, GPIO_INPUT, NULL) /* USB charger port 2 status output */ -GPIO(PD_IN_RW, A, 5, GPIO_INPUT, NULL) /* PD is in RW */ -GPIO(PCH_HDA_SDO_L, G, 1, GPIO_INPUT, NULL) /* HDA_SDO signal to PCH to disable ME */ +GPIO(BOARD_VERSION1, Q, 7, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, Q, 5, GPIO_INPUT) /* Board version stuffing resistor 3 */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB1_STATUS_L, E, 6, GPIO_INPUT) /* USB charger port 1 status output */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_STATUS_L, D, 7, GPIO_INPUT) /* USB charger port 2 status output */ +GPIO(PD_IN_RW, A, 5, GPIO_INPUT) /* PD is in RW */ +GPIO(PCH_HDA_SDO_L, G, 1, GPIO_INPUT) /* HDA_SDO signal to PCH to disable ME */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(PP1200_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.20V supply */ -GPIO(PP3300_DSW_EN, F, 6, GPIO_OUT_LOW, NULL) /* Enable 3.3V DSW rail */ -GPIO(PP3300_DSW_GATED_EN, J, 3, GPIO_OUT_LOW, NULL) /* Enable 3.3V Gated DSW and core VDD */ -GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(PP1050_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(PP5000_USB_EN, C, 5, GPIO_OUT_LOW, NULL) /* Enable USB power */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PP1800_EN, L, 6, GPIO_OUT_LOW, NULL) /* Enable 1.8V supply */ -GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(USB_MCU_RST, B, 0, GPIO_OUT_LOW, NULL) /* USB PD MCU reset */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(LIGHTBAR_RESET_L, J, 2, GPIO_ODR_LOW, NULL) /* Reset lightbar controllers */ -GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW, NULL) /* Indicate when VccDSW is good */ -GPIO(PCH_RSMRST_L, C, 4, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_RTCRST_L, J, 1, GPIO_ODR_HIGH, NULL) /* Reset PCH RTC well */ -GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PCH_NMI_L, F, 2, GPIO_ODR_HIGH, NULL) /* Non-maskable interrupt pin to PCH */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* PWROK / APWROK signals to PCH */ -GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH, NULL) /* RCIN# line to PCH (for 8042 emulation) */ -GPIO(PCH_SYS_RST_L, F, 1, GPIO_ODR_HIGH, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_ODR_LOW, NULL) /* Reset touch screen */ -GPIO(PCH_ACOK, M, 6, GPIO_OUT_LOW, NULL) /* AC present signal buffered to PCH */ +GPIO(CPU_PROCHOT, B, 1, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(PP1200_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.20V supply */ +GPIO(PP3300_DSW_EN, F, 6, GPIO_OUT_LOW) /* Enable 3.3V DSW rail */ +GPIO(PP3300_DSW_GATED_EN, J, 3, GPIO_OUT_LOW) /* Enable 3.3V Gated DSW and core VDD */ +GPIO(PP3300_LTE_EN, D, 2, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(PP1050_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(PP5000_USB_EN, C, 5, GPIO_OUT_LOW) /* Enable USB power */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PP1800_EN, L, 6, GPIO_OUT_LOW) /* Enable 1.8V supply */ +GPIO(SYS_PWROK, H, 2, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(USB_MCU_RST, B, 0, GPIO_OUT_LOW) /* USB PD MCU reset */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_OUT_LOW) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 3, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(LIGHTBAR_RESET_L, J, 2, GPIO_ODR_LOW) /* Reset lightbar controllers */ +GPIO(PCH_DPWROK, G, 0, GPIO_OUT_LOW) /* Indicate when VccDSW is good */ +GPIO(PCH_RSMRST_L, C, 4, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_RTCRST_L, J, 1, GPIO_ODR_HIGH) /* Reset PCH RTC well */ +GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH) /* Wake signal from EC to PCH */ +GPIO(PCH_NMI_L, F, 2, GPIO_ODR_HIGH) /* Non-maskable interrupt pin to PCH */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH) /* Power button output to PCH */ +GPIO(PCH_PWROK, F, 5, GPIO_OUT_LOW) /* PWROK / APWROK signals to PCH */ +GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH) /* RCIN# line to PCH (for 8042 emulation) */ +GPIO(PCH_SYS_RST_L, F, 1, GPIO_ODR_HIGH) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_ODR_LOW) /* Reset touch screen */ +GPIO(PCH_ACOK, M, 6, GPIO_OUT_LOW) /* AC present signal buffered to PCH */ #ifndef HEY_USE_BUILTIN_CLKRUN -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Dunno. Probably important, though. */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Dunno. Probably important, though. */ #endif -GPIO(USB1_CTL1, E, 1, GPIO_OUT_LOW, NULL) /* USB charger port 1 CTL1 output */ -GPIO(USB1_CTL2, E, 2, GPIO_OUT_HIGH, NULL) /* USB charger port 1 CTL2 output */ -GPIO(USB1_CTL3, E, 3, GPIO_OUT_LOW, NULL) /* USB charger port 1 CTL3 output */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_HIGH, NULL) /* USB charger port 1 enable */ -GPIO(USB1_ILIM_SEL_L, E, 5, GPIO_OUT_HIGH, NULL) /* USB charger port 1 ILIM_SEL output */ -GPIO(USB2_CTL1, D, 0, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL1 output */ -GPIO(USB2_CTL2, D, 1, GPIO_OUT_HIGH, NULL) /* USB charger port 2 CTL2 output */ -GPIO(USB2_CTL3, D, 4, GPIO_OUT_LOW, NULL) /* USB charger port 2 CTL3 output */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_HIGH, NULL) /* USB charger port 2 enable */ -GPIO(USB2_ILIM_SEL_L, D, 6, GPIO_OUT_HIGH, NULL) /* USB charger port 2 ILIM_SEL output */ +GPIO(USB1_CTL1, E, 1, GPIO_OUT_LOW) /* USB charger port 1 CTL1 output */ +GPIO(USB1_CTL2, E, 2, GPIO_OUT_HIGH) /* USB charger port 1 CTL2 output */ +GPIO(USB1_CTL3, E, 3, GPIO_OUT_LOW) /* USB charger port 1 CTL3 output */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_HIGH) /* USB charger port 1 enable */ +GPIO(USB1_ILIM_SEL_L, E, 5, GPIO_OUT_HIGH) /* USB charger port 1 ILIM_SEL output */ +GPIO(USB2_CTL1, D, 0, GPIO_OUT_LOW) /* USB charger port 2 CTL1 output */ +GPIO(USB2_CTL2, D, 1, GPIO_OUT_HIGH) /* USB charger port 2 CTL2 output */ +GPIO(USB2_CTL3, D, 4, GPIO_OUT_LOW) /* USB charger port 2 CTL3 output */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_HIGH) /* USB charger port 2 enable */ +GPIO(USB2_ILIM_SEL_L, D, 6, GPIO_OUT_HIGH) /* USB charger port 2 ILIM_SEL output */ -GPIO(I2C0_SCL, B, 2, GPIO_ODR_HIGH, NULL) /* I2C port 0 SCL */ -GPIO(I2C0_SDA, B, 3, GPIO_ODR_HIGH, NULL) /* I2C port 0 SDA */ -GPIO(I2C1_SCL, A, 6, GPIO_ODR_HIGH, NULL) /* I2C port 1 SCL */ -GPIO(I2C1_SDA, A, 7, GPIO_ODR_HIGH, NULL) /* I2C port 1 SDA */ -GPIO(I2C5_SCL, B, 6, GPIO_ODR_HIGH, NULL) /* I2C port 5 SCL */ -GPIO(I2C5_SDA, B, 7, GPIO_ODR_HIGH, NULL) /* I2C port 5 SDA */ +GPIO(I2C0_SCL, B, 2, GPIO_ODR_HIGH) /* I2C port 0 SCL */ +GPIO(I2C0_SDA, B, 3, GPIO_ODR_HIGH) /* I2C port 0 SDA */ +GPIO(I2C1_SCL, A, 6, GPIO_ODR_HIGH) /* I2C port 1 SCL */ +GPIO(I2C1_SDA, A, 7, GPIO_ODR_HIGH) /* I2C port 1 SDA */ +GPIO(I2C5_SCL, B, 6, GPIO_ODR_HIGH) /* I2C port 5 SCL */ +GPIO(I2C5_SDA, B, 7, GPIO_ODR_HIGH) /* I2C port 5 SDA */ ALTERNATE(A, 0x03, 1, MODULE_UART, 0) /* UART0 */ ALTERNATE(A, 0x40, 3, MODULE_I2C, 0) /* I2C1 SCL */ diff --git a/board/samus_pd/gpio.inc b/board/samus_pd/gpio.inc index f06328938e..3a44daa662 100644 --- a/board/samus_pd/gpio.inc +++ b/board/samus_pd/gpio.inc @@ -6,118 +6,118 @@ */ /* Interrupts */ -GPIO(USB_C0_VBUS_WAKE, E, 6, GPIO_INT_BOTH, vbus0_evt) -GPIO(USB_C1_VBUS_WAKE, F, 2, GPIO_INT_BOTH, vbus1_evt) -GPIO(USB_C0_BC12_INT_L, B, 0, GPIO_INT_FALLING, usb0_evt) -GPIO(USB_C1_BC12_INT_L, C, 11, GPIO_INT_FALLING, usb1_evt) -GPIO(PCH_SLP_S0_L, C, 14, GPIO_INT_BOTH, pch_evt) -GPIO(PCH_SLP_S3_L, C, 15, GPIO_INT_BOTH, pch_evt) -GPIO(PCH_SLP_S5_L, D, 7, GPIO_INT_BOTH, pch_evt) -GPIO(WP_L, D, 2, GPIO_INT_BOTH, switch_interrupt) +GPIO_INT(USB_C0_VBUS_WAKE, E, 6, GPIO_INT_BOTH, vbus0_evt) +GPIO_INT(USB_C1_VBUS_WAKE, F, 2, GPIO_INT_BOTH, vbus1_evt) +GPIO_INT(USB_C0_BC12_INT_L, B, 0, GPIO_INT_FALLING, usb0_evt) +GPIO_INT(USB_C1_BC12_INT_L, C, 11, GPIO_INT_FALLING, usb1_evt) +GPIO_INT(PCH_SLP_S0_L, C, 14, GPIO_INT_BOTH, pch_evt) +GPIO_INT(PCH_SLP_S3_L, C, 15, GPIO_INT_BOTH, pch_evt) +GPIO_INT(PCH_SLP_S5_L, D, 7, GPIO_INT_BOTH, pch_evt) +GPIO_INT(WP_L, D, 2, GPIO_INT_BOTH, switch_interrupt) /* PD RX/TX */ -GPIO(USB_C0_CC1_PD, A, 0, GPIO_ANALOG, NULL) -GPIO(USB_C0_REF, A, 1, GPIO_ANALOG, NULL) -GPIO(USB_C1_CC1_PD, A, 2, GPIO_ANALOG, NULL) -GPIO(USB_C0_CC2_PD, A, 4, GPIO_ANALOG, NULL) -GPIO(USB_C1_CC2_PD, A, 5, GPIO_ANALOG, NULL) -GPIO(USB_C0_REF_PD_ODL, A, 6, GPIO_ODR_LOW, NULL) +GPIO(USB_C0_CC1_PD, A, 0, GPIO_ANALOG) +GPIO(USB_C0_REF, A, 1, GPIO_ANALOG) +GPIO(USB_C1_CC1_PD, A, 2, GPIO_ANALOG) +GPIO(USB_C0_CC2_PD, A, 4, GPIO_ANALOG) +GPIO(USB_C1_CC2_PD, A, 5, GPIO_ANALOG) +GPIO(USB_C0_REF_PD_ODL, A, 6, GPIO_ODR_LOW) -GPIO(USB_C_CC_EN, C, 10, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_CC_TX_EN, A, 15, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_CC_TX_EN, B, 9, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_CC1_TX_DATA, B, 4, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_CC1_TX_DATA, B, 14, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_CC2_TX_DATA, E, 14, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_CC2_TX_DATA, D, 3, GPIO_OUT_LOW, NULL) +GPIO(USB_C_CC_EN, C, 10, GPIO_OUT_LOW) +GPIO(USB_C1_CC_TX_EN, A, 15, GPIO_OUT_LOW) +GPIO(USB_C0_CC_TX_EN, B, 9, GPIO_OUT_LOW) +GPIO(USB_C1_CC1_TX_DATA, B, 4, GPIO_OUT_LOW) +GPIO(USB_C0_CC1_TX_DATA, B, 14, GPIO_OUT_LOW) +GPIO(USB_C1_CC2_TX_DATA, E, 14, GPIO_OUT_LOW) +GPIO(USB_C0_CC2_TX_DATA, D, 3, GPIO_OUT_LOW) #if 0 /* Alternate functions */ -GPIO(USB_C1_TX_CLKOUT, B, 1, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_TX_CLKOUT, E, 1, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_TX_CLKIN, B, 3, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_TX_CLKIN, B, 13, GPIO_OUT_LOW, NULL) +GPIO(USB_C1_TX_CLKOUT, B, 1, GPIO_OUT_LOW) +GPIO(USB_C0_TX_CLKOUT, E, 1, GPIO_OUT_LOW) +GPIO(USB_C1_TX_CLKIN, B, 3, GPIO_OUT_LOW) +GPIO(USB_C0_TX_CLKIN, B, 13, GPIO_OUT_LOW) #endif /* Power and muxes control */ -GPIO(PPVAR_BOOSTIN_SENSE, C, 1, GPIO_ANALOG, NULL) -GPIO(PP3300_USB_PD_EN, A, 8, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_CHARGE_EN_L, D, 12, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_CHARGE_EN_L, D, 13, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_5V_EN, D, 14, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_5V_EN, D, 15, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_CC1_VCONN1_EN_L, D, 8, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_CC2_VCONN1_EN_L, D, 9, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_CC1_VCONN1_EN_L, D, 10, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_CC2_VCONN1_EN_L, D, 11, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_CC_1A5_EN, B, 12, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_CC_1A5_EN, E, 12, GPIO_OUT_LOW, NULL) -GPIO(ILIM_ADJ_PWM, B, 15, GPIO_OUT_LOW, NULL) +GPIO(PPVAR_BOOSTIN_SENSE, C, 1, GPIO_ANALOG) +GPIO(PP3300_USB_PD_EN, A, 8, GPIO_OUT_HIGH) +GPIO(USB_C0_CHARGE_EN_L, D, 12, GPIO_OUT_LOW) +GPIO(USB_C1_CHARGE_EN_L, D, 13, GPIO_OUT_LOW) +GPIO(USB_C0_5V_EN, D, 14, GPIO_OUT_LOW) +GPIO(USB_C1_5V_EN, D, 15, GPIO_OUT_LOW) +GPIO(USB_C0_CC1_VCONN1_EN_L, D, 8, GPIO_OUT_HIGH) +GPIO(USB_C0_CC2_VCONN1_EN_L, D, 9, GPIO_OUT_HIGH) +GPIO(USB_C1_CC1_VCONN1_EN_L, D, 10, GPIO_OUT_HIGH) +GPIO(USB_C1_CC2_VCONN1_EN_L, D, 11, GPIO_OUT_HIGH) +GPIO(USB_C0_CC_1A5_EN, B, 12, GPIO_OUT_LOW) +GPIO(USB_C1_CC_1A5_EN, E, 12, GPIO_OUT_LOW) +GPIO(ILIM_ADJ_PWM, B, 15, GPIO_OUT_LOW) -GPIO(USB_C0_CC1_ODL, B, 8, GPIO_ODR_LOW, NULL) -GPIO(USB_C0_CC2_ODL, E, 0, GPIO_ODR_LOW, NULL) -GPIO(USB_C1_CC1_ODL, F, 9, GPIO_ODR_LOW, NULL) -GPIO(USB_C1_CC2_ODL, F, 10, GPIO_ODR_LOW, NULL) +GPIO(USB_C0_CC1_ODL, B, 8, GPIO_ODR_LOW) +GPIO(USB_C0_CC2_ODL, E, 0, GPIO_ODR_LOW) +GPIO(USB_C1_CC1_ODL, F, 9, GPIO_ODR_LOW) +GPIO(USB_C1_CC2_ODL, F, 10, GPIO_ODR_LOW) -GPIO(USB_C_BC12_SEL, C, 0, GPIO_OUT_LOW, NULL) -GPIO(USB_C0_SS1_EN_L, E, 2, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_SS2_EN_L, E, 3, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_SS1_EN_L, E, 9, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_SS2_EN_L, E, 10, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_SS1_DP_MODE, E, 4, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_SS2_DP_MODE, E, 5, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_SS1_DP_MODE, E, 11, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_SS2_DP_MODE, E, 13, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_DP_MODE_L, E, 8, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_DP_MODE_L, F, 6, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_DP_POLARITY, E, 7, GPIO_OUT_HIGH, NULL) -GPIO(USB_C1_DP_POLARITY, F, 3, GPIO_OUT_HIGH, NULL) -GPIO(USB_C0_DP_HPD, F, 0, GPIO_OUT_LOW, NULL) -GPIO(USB_C1_DP_HPD, F, 1, GPIO_OUT_LOW, NULL) +GPIO(USB_C_BC12_SEL, C, 0, GPIO_OUT_LOW) +GPIO(USB_C0_SS1_EN_L, E, 2, GPIO_OUT_HIGH) +GPIO(USB_C0_SS2_EN_L, E, 3, GPIO_OUT_HIGH) +GPIO(USB_C1_SS1_EN_L, E, 9, GPIO_OUT_HIGH) +GPIO(USB_C1_SS2_EN_L, E, 10, GPIO_OUT_HIGH) +GPIO(USB_C0_SS1_DP_MODE, E, 4, GPIO_OUT_HIGH) +GPIO(USB_C0_SS2_DP_MODE, E, 5, GPIO_OUT_HIGH) +GPIO(USB_C1_SS1_DP_MODE, E, 11, GPIO_OUT_HIGH) +GPIO(USB_C1_SS2_DP_MODE, E, 13, GPIO_OUT_HIGH) +GPIO(USB_C0_DP_MODE_L, E, 8, GPIO_OUT_HIGH) +GPIO(USB_C1_DP_MODE_L, F, 6, GPIO_OUT_HIGH) +GPIO(USB_C0_DP_POLARITY, E, 7, GPIO_OUT_HIGH) +GPIO(USB_C1_DP_POLARITY, F, 3, GPIO_OUT_HIGH) +GPIO(USB_C0_DP_HPD, F, 0, GPIO_OUT_LOW) +GPIO(USB_C1_DP_HPD, F, 1, GPIO_OUT_LOW) #if 0 /* Alternate functions */ -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(UART_TX, A, 9, GPIO_OUT_LOW, NULL) -GPIO(UART_RX, A, 10, GPIO_OUT_LOW, NULL) -GPIO(TP64, A, 13, GPIO_ODR_HIGH, NULL) -GPIO(TP71, A, 14, GPIO_ODR_HIGH, NULL) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(UART_TX, A, 9, GPIO_OUT_LOW) +GPIO(UART_RX, A, 10, GPIO_OUT_LOW) +GPIO(TP64, A, 13, GPIO_ODR_HIGH) +GPIO(TP71, A, 14, GPIO_ODR_HIGH) #endif /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(SLAVE_I2C_SCL, B, 6, GPIO_INPUT) +GPIO(SLAVE_I2C_SDA, B, 7, GPIO_INPUT) +GPIO(MASTER_I2C_SCL, B, 10, GPIO_INPUT) +GPIO(MASTER_I2C_SDA, B, 11, GPIO_INPUT) /* Case closed debugging. */ -GPIO(EC_INT, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_IN_RW, C, 12, GPIO_INPUT | GPIO_PULL_UP, NULL) -GPIO(EC_RST_L, C, 13, GPIO_OUT_HIGH, NULL) -GPIO(SPI_FLASH_CS_L, D, 0, GPIO_INPUT, NULL) -GPIO(SPI_FLASH_CSK, D, 1, GPIO_INPUT, NULL) -GPIO(SPI_FLASH_MOSI, C, 3, GPIO_INPUT, NULL) -GPIO(SPI_FLASH_MISO, C, 2, GPIO_INPUT, NULL) -GPIO(EC_JTAG_TCK, C, 6, GPIO_INPUT, NULL) -GPIO(EC_JTAG_TMS, C, 7, GPIO_INPUT, NULL) -GPIO(EC_JTAG_TDO, C, 8, GPIO_INPUT, NULL) -GPIO(EC_JTAG_TDI, C, 9, GPIO_INPUT, NULL) -GPIO(ENTERING_RW, B, 5, GPIO_OUT_LOW, NULL) -GPIO(PD_DISABLE_DEBUG, E, 15, GPIO_OUT_HIGH, NULL) -GPIO(PD_DEBUG_EN_L, D, 4, GPIO_INPUT | GPIO_PULL_UP, NULL) -GPIO(PD_SPI_PP3300_EN_L, A, 7, GPIO_OUT_HIGH, NULL) -GPIO(BST_DISABLE, A, 3, GPIO_OUT_LOW, NULL) +GPIO(EC_INT, B, 2, GPIO_OUT_LOW) +GPIO(EC_IN_RW, C, 12, GPIO_INPUT | GPIO_PULL_UP) +GPIO(EC_RST_L, C, 13, GPIO_OUT_HIGH) +GPIO(SPI_FLASH_CS_L, D, 0, GPIO_INPUT) +GPIO(SPI_FLASH_CSK, D, 1, GPIO_INPUT) +GPIO(SPI_FLASH_MOSI, C, 3, GPIO_INPUT) +GPIO(SPI_FLASH_MISO, C, 2, GPIO_INPUT) +GPIO(EC_JTAG_TCK, C, 6, GPIO_INPUT) +GPIO(EC_JTAG_TMS, C, 7, GPIO_INPUT) +GPIO(EC_JTAG_TDO, C, 8, GPIO_INPUT) +GPIO(EC_JTAG_TDI, C, 9, GPIO_INPUT) +GPIO(ENTERING_RW, B, 5, GPIO_OUT_LOW) +GPIO(PD_DISABLE_DEBUG, E, 15, GPIO_OUT_HIGH) +GPIO(PD_DEBUG_EN_L, D, 4, GPIO_INPUT | GPIO_PULL_UP) +GPIO(PD_SPI_PP3300_EN_L, A, 7, GPIO_OUT_HIGH) +GPIO(BST_DISABLE, A, 3, GPIO_OUT_LOW) #if 0 /* Alternate functions */ -GPIO(EC_UART_TX, C, 4, GPIO_OUT_LOW, NULL) -GPIO(EC_UART_RX, C, 5, GPIO_INPUT, NULL) -GPIO(AP_UART_TX, D, 5, GPIO_OUT_LOW, NULL) -GPIO(AP_UART_RX, D, 6, GPIO_INPUT, NULL) +GPIO(EC_UART_TX, C, 4, GPIO_OUT_LOW) +GPIO(EC_UART_RX, C, 5, GPIO_INPUT) +GPIO(AP_UART_TX, D, 5, GPIO_OUT_LOW) +GPIO(AP_UART_RX, D, 6, GPIO_INPUT) #endif ALTERNATE(B, 0x0008, 0, MODULE_USB_PD, 0) /* SPI1: SCK(PB3) */ diff --git a/board/snow/gpio.inc b/board/snow/gpio.inc index ea49c0b812..db7d92d3ca 100644 --- a/board/snow/gpio.inc +++ b/board/snow/gpio.inc @@ -6,65 +6,65 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) /* Keyboard power button */ -GPIO(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ -GPIO(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ -GPIO(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ -GPIO(SPI1_NSS, A, 4, GPIO_DEFAULT, spi_event) +GPIO_INT(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) /* Keyboard power button */ +GPIO_INT(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ +GPIO_INT(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ +GPIO_INT(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ +GPIO_INT(SPI1_NSS, A, 4, GPIO_DEFAULT, spi_event) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(AC_PWRBTN_L, A, 0, GPIO_INT_BOTH, NULL) -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) /* Write protection pin (low active) */ +GPIO(AC_PWRBTN_L, A, 0, GPIO_INT_BOTH) +GPIO(WP_L, B, 4, GPIO_INPUT) /* Write protection pin (low active) */ /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(I2C1_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(I2C2_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(I2C2_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(I2C1_SCL, B, 6, GPIO_INPUT) +GPIO(I2C1_SDA, B, 7, GPIO_INPUT) +GPIO(I2C2_SCL, B, 10, GPIO_INPUT) +GPIO(I2C2_SDA, B, 11, GPIO_INPUT) /* Outputs */ -GPIO(AC_STATUS, A, 5, GPIO_DEFAULT, NULL) -GPIO(SPI1_MISO, A, 6, GPIO_DEFAULT, NULL) -GPIO(EN_PP1350, A, 2, GPIO_OUT_LOW, NULL) /* DDR 1.35v rail enable */ -GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW, NULL) /* 5.0v rail enable */ -GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW, NULL) /* 3.3v rail enable */ -GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH, NULL) /* 5v rail ready */ -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) /* Force hard reset of the pmic */ +GPIO(AC_STATUS, A, 5, GPIO_DEFAULT) +GPIO(SPI1_MISO, A, 6, GPIO_DEFAULT) +GPIO(EN_PP1350, A, 2, GPIO_OUT_LOW) /* DDR 1.35v rail enable */ +GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW) /* 5.0v rail enable */ +GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW) /* 3.3v rail enable */ +GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH) /* 5v rail ready */ +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) /* Force hard reset of the pmic */ /* EC is R/W mode for the kbc mux */ -GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW, NULL) -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) +GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW) +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) /* To audio codec (KB noise cancellation) */ -GPIO(CODEC_INT, D, 1, GPIO_ODR_HIGH, NULL) -GPIO(LED_POWER_L, B, 3, GPIO_INPUT, NULL) /* Keyboard power LED */ -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT, NULL) +GPIO(CODEC_INT, D, 1, GPIO_ODR_HIGH) +GPIO(LED_POWER_L, B, 3, GPIO_INPUT) /* Keyboard power LED */ +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT) diff --git a/board/speedy/gpio.inc b/board/speedy/gpio.inc index 29efb848d1..294b097766 100644 --- a/board/speedy/gpio.inc +++ b/board/speedy/gpio.inc @@ -6,53 +6,53 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ -GPIO(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) -GPIO(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) -GPIO(AC_PRESENT, A, 8, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) +GPIO_INT(POWER_BUTTON_L, B, 5, GPIO_INT_BOTH, power_button_interrupt) /* wk6 */ /* active high, the name is for compatibility with existing code */ +GPIO_INT(SOC_POWER_GOOD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(SUSPEND_L, C, 7, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SPI1_NSS, A, 4, GPIO_INT_BOTH, spi_event) +GPIO_INT(AC_PRESENT, A, 8, GPIO_INT_BOTH | GPIO_PULL_UP, extpower_interrupt) /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) /* Other inputs */ -GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN, NULL) /* wk1 */ -GPIO(WP_L, B, 4, GPIO_INPUT, NULL) +GPIO(EC_WAKE, A, 0, GPIO_INPUT | GPIO_PULL_DOWN) /* wk1 */ +GPIO(WP_L, B, 4, GPIO_INPUT) /* Outputs */ -GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW, NULL) -GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW, NULL) -GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_OUT_LOW, NULL) -GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW, NULL) -GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW, NULL) /* Inverted from silegro */ -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT, NULL) -GPIO(POWER_LED, A, 2, GPIO_OUT_LOW, NULL) -GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW, NULL) -GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW, NULL) -GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW, NULL) -GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH, NULL) +GPIO(BAT_LED0, B, 11, GPIO_OUT_LOW) +GPIO(BAT_LED1, A, 11, GPIO_OUT_LOW) +GPIO(EC_BL_OVERRIDE, F, 1, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_OUT_LOW) +GPIO(ENTERING_RW, F, 0, GPIO_OUT_LOW) +GPIO(I2C1_SCL, B, 6, GPIO_ODR_HIGH) +GPIO(I2C1_SDA, B, 7, GPIO_ODR_HIGH) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_OUT_LOW) /* Inverted from silegro */ +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 4, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, A, 13, GPIO_KB_OUTPUT) +GPIO(POWER_LED, A, 2, GPIO_OUT_LOW) +GPIO(PMIC_PWRON, A, 12, GPIO_OUT_LOW) +GPIO(PMIC_RESET, B, 3, GPIO_OUT_LOW) +GPIO(PMIC_SOURCE_PWREN, B, 10, GPIO_OUT_LOW) +GPIO(PMIC_WARM_RESET_L, C, 3, GPIO_ODR_HIGH) ALTERNATE(A, 0x00f0, 0, MODULE_SPI, 0) ALTERNATE(A, 0x0600, 1, MODULE_UART, 0) diff --git a/board/spring/gpio.inc b/board/spring/gpio.inc index b49270ebbc..eedef23fbc 100644 --- a/board/spring/gpio.inc +++ b/board/spring/gpio.inc @@ -7,60 +7,59 @@ /* Inputs with interrupt handlers are first for efficiency */ /* Keyboard power button */ -GPIO(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) -GPIO(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ -GPIO(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ -GPIO(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) -GPIO(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ -GPIO(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ +GPIO_INT(KB_PWR_ON_L, B, 5, GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(PP1800_LDO2, A, 1, GPIO_INT_BOTH, power_signal_interrupt) /* LDO2 is ON (end of PMIC sequence) */ +GPIO_INT(SOC1V8_XPSHOLD, A, 3, GPIO_INT_BOTH, power_signal_interrupt) /* App Processor ON */ +GPIO_INT(CHARGER_INT_L, C, 4, GPIO_INT_FALLING, pmu_irq_handler) +GPIO_INT(LID_OPEN, C, 13, GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ +GPIO_INT(SUSPEND_L, A, 7, INT_BOTH_FLOATING, power_signal_interrupt) /* AP suspend/resume state */ /* Keyboard inputs */ -GPIO(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) -GPIO(USB_CHG_INT, A, 6, GPIO_INT_FALLING, extpower_interrupt) - -GPIO(WP_L, A, 13, GPIO_INPUT, NULL) /* Write protection pin (low active) */ +GPIO_INT(KB_IN00, C, 8, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN01, C, 9, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN02, C, 10, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN03, C, 11, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN04, C, 12, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN05, C, 14, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN06, C, 15, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(KB_IN07, D, 2, GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) +GPIO_INT(USB_CHG_INT, A, 6, GPIO_INT_FALLING, extpower_interrupt) /* Other inputs */ -GPIO(BCHGR_VACG, A, 0, GPIO_INT_BOTH, NULL) /* AC good on TPSChrome */ +GPIO(BCHGR_VACG, A, 0, GPIO_INT_BOTH) /* AC good on TPSChrome */ +GPIO(WP_L, A, 13, GPIO_INPUT) /* Write protection pin (low active) */ /* * I2C pins should be configured as inputs until I2C module is * initialized. This will avoid driving the lines unintentionally. */ -GPIO(I2C1_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C1_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(I2C2_SCL, B, 10, GPIO_INPUT, NULL) -GPIO(I2C2_SDA, B, 11, GPIO_INPUT, NULL) +GPIO(I2C1_SCL, B, 6, GPIO_INPUT) +GPIO(I2C1_SDA, B, 7, GPIO_INPUT) +GPIO(I2C2_SCL, B, 10, GPIO_INPUT) +GPIO(I2C2_SDA, B, 11, GPIO_INPUT) /* Outputs */ -GPIO(EN_PP1350, A, 14, GPIO_OUT_LOW, NULL) /* DDR 1.35v rail enable */ -GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW, NULL) /* 5.0v rail enable */ -GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW, NULL) /* 3.3v rail enable */ -GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH, NULL) /* 5v rail ready */ -GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW, NULL) /* Force hard reset of the pmic */ -GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW, NULL) /* EC is R/W mode for the kbc mux */ -GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW, NULL) -GPIO(EC_INT, B, 9, GPIO_ODR_HIGH, NULL) -GPIO(ID_MUX, D, 1, GPIO_OUT_LOW, NULL) -GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT, NULL) -GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT, NULL) -GPIO(BOOST_EN, B, 3, GPIO_OUT_HIGH, NULL) -GPIO(ILIM, B, 4, GPIO_OUT_LOW, NULL) +GPIO(EN_PP1350, A, 14, GPIO_OUT_LOW) /* DDR 1.35v rail enable */ +GPIO(EN_PP5000, A, 11, GPIO_OUT_LOW) /* 5.0v rail enable */ +GPIO(EN_PP3300, A, 8, GPIO_OUT_LOW) /* 3.3v rail enable */ +GPIO(PMIC_PWRON_L,A, 12, GPIO_OUT_HIGH) /* 5v rail ready */ +GPIO(PMIC_RESET, A, 15, GPIO_OUT_LOW) /* Force hard reset of the pmic */ +GPIO(ENTERING_RW, D, 0, GPIO_OUT_LOW) /* EC is R/W mode for the kbc mux */ +GPIO(CHARGER_EN, B, 2, GPIO_OUT_LOW) +GPIO(EC_INT, B, 9, GPIO_ODR_HIGH) +GPIO(ID_MUX, D, 1, GPIO_OUT_LOW) +GPIO(KB_OUT00, B, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT01, B, 8, GPIO_KB_OUTPUT) +GPIO(KB_OUT02, B, 12, GPIO_KB_OUTPUT) +GPIO(KB_OUT03, B, 13, GPIO_KB_OUTPUT) +GPIO(KB_OUT04, B, 14, GPIO_KB_OUTPUT) +GPIO(KB_OUT05, B, 15, GPIO_KB_OUTPUT) +GPIO(KB_OUT06, C, 0, GPIO_KB_OUTPUT) +GPIO(KB_OUT07, C, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT08, C, 2, GPIO_KB_OUTPUT) +GPIO(KB_OUT09, B, 1, GPIO_KB_OUTPUT) +GPIO(KB_OUT10, C, 5, GPIO_KB_OUTPUT) +GPIO(KB_OUT11, C, 6, GPIO_KB_OUTPUT) +GPIO(KB_OUT12, C, 7, GPIO_KB_OUTPUT) +GPIO(BOOST_EN, B, 3, GPIO_OUT_HIGH) +GPIO(ILIM, B, 4, GPIO_OUT_LOW) diff --git a/board/squawks/gpio.inc b/board/squawks/gpio.inc index a479672acc..78f7ad4d06 100644 --- a/board/squawks/gpio.inc +++ b/board/squawks/gpio.inc @@ -6,65 +6,65 @@ */ /* Inputs with interrupt handlers are first for efficiency */ -GPIO(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ -GPIO(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ -GPIO(PCH_SLP_S4_L, H, 1, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ -GPIO(PP3300_PCH_PGOOD, C, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ -GPIO(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ -GPIO(S5_PGOOD, G, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ -GPIO(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ -GPIO(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ -GPIO(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ -GPIO(UART0_RX, A, 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, uart_deepsleep_interrupt) /* UART0 RX input */ +GPIO_INT(POWER_BUTTON_L, A, 2, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(LID_OPEN, A, 3, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, H, 3, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* AC power present */ +GPIO_INT(PCH_SLP_S3_L, G, 7, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ +GPIO_INT(PCH_SLP_S4_L, H, 1, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PP1050_PGOOD, H, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 1.05V */ +GPIO_INT(PP3300_PCH_PGOOD, C, 4, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 3.3V (PCH supply) */ +GPIO_INT(PP5000_PGOOD, N, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on 5V */ +GPIO_INT(S5_PGOOD, G, 0, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on S5 supplies */ +GPIO_INT(VCORE_PGOOD, C, 6, GPIO_INT_BOTH, power_signal_interrupt) /* Power good on core VR */ +GPIO_INT(WP_L, A, 4, GPIO_INT_BOTH, switch_interrupt) /* Write protect input */ +GPIO_INT(JTAG_TCK, C, 0, GPIO_DEFAULT, jtag_interrupt) /* JTAG clock input */ +GPIO_INT(UART0_RX, A, 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, uart_deepsleep_interrupt) /* UART0 RX input */ /* Other inputs */ -GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT, NULL) /* Board version stuffing resistor 1 */ -GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT, NULL) /* Board version stuffing resistor 2 */ -GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT, NULL) /* Board version stuffing resistor 3 */ +GPIO(BOARD_VERSION1, Q, 5, GPIO_INPUT) /* Board version stuffing resistor 1 */ +GPIO(BOARD_VERSION2, Q, 6, GPIO_INPUT) /* Board version stuffing resistor 2 */ +GPIO(BOARD_VERSION3, Q, 7, GPIO_INPUT) /* Board version stuffing resistor 3 */ #ifdef CONFIG_CHIPSET_DEBUG -GPIO(PCH_SLP_SX_L, G, 3, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SLP_S0IX# signal from PCH */ -GPIO(PCH_SUS_STAT_L, G, 6, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SUS_STAT# signal from PCH */ -GPIO(PCH_SUSPWRDNACK, G, 2, GPIO_INPUT | GPIO_PULL_UP, NULL) /* SUSPWRDNACK signal from PCH */ +GPIO(PCH_SLP_SX_L, G, 3, GPIO_INPUT | GPIO_PULL_UP) /* SLP_S0IX# signal from PCH */ +GPIO(PCH_SUS_STAT_L, G, 6, GPIO_INPUT | GPIO_PULL_UP) /* SUS_STAT# signal from PCH */ +GPIO(PCH_SUSPWRDNACK, G, 2, GPIO_INPUT | GPIO_PULL_UP) /* SUSPWRDNACK signal from PCH */ #endif -GPIO(PP1000_S0IX_PGOOD, H, 6, GPIO_INPUT, NULL) /* Power good on 1.00V (S0iX supplies) */ -GPIO(USB1_OC_L, E, 7, GPIO_INPUT, NULL) /* USB port overcurrent warning */ -GPIO(USB2_OC_L, E, 0, GPIO_INPUT, NULL) /* USB port overcurrent warning */ +GPIO(PP1000_S0IX_PGOOD, H, 6, GPIO_INPUT) /* Power good on 1.00V (S0iX supplies) */ +GPIO(USB1_OC_L, E, 7, GPIO_INPUT) /* USB port overcurrent warning */ +GPIO(USB2_OC_L, E, 0, GPIO_INPUT) /* USB port overcurrent warning */ /* Outputs; all unasserted by default except for reset signals */ -GPIO(CPU_PROCHOT, B, 5, GPIO_OUT_LOW, NULL) /* Force CPU to think it's overheated */ -GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_ODR_HIGH, NULL) /* Enable backlight power */ -GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW, NULL) /* Enable touchpad power */ -GPIO(ENTERING_RW, D, 6, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH, NULL) /* Request that PCH drive LPC clock */ -GPIO(PCH_CORE_PWROK, F, 5, GPIO_OUT_LOW, NULL) /* Indicate core well power is stable */ -GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH, NULL) /* Power button output to PCH */ -GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH, NULL) /* Reset line to PCH (for 8042 emulation) */ -GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW, NULL) /* Reset PCH resume power plane logic */ -GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH, NULL) /* System management interrupt to PCH */ -GPIO(PCH_SOC_OVERRIDE, G, 1, GPIO_OUT_LOW, NULL) /* SOC override signal to PCH; when high, ME ignores security descriptor */ -GPIO(PCH_SYS_PWROK, J, 1, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready */ -GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH, NULL) /* Wake signal from EC to PCH */ -GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW, NULL) /* Enable 1.35V supply */ -GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW, NULL) /* Enable power to lots of peripherals */ -GPIO(PP3300_LTE_EN, D, 4, GPIO_OUT_LOW, NULL) /* Enable LTE radio */ -GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW, NULL) /* Enable WiFi power */ -GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW, NULL) /* Enable 5V supply */ -GPIO(PPSX_EN, L, 6, GPIO_OUT_LOW, NULL) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ -GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW, NULL) /* Enable 1.05V regulator */ -GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW, NULL) /* Reset touch screen */ -GPIO(USB_CTL1, E, 6, GPIO_OUT_LOW, NULL) /* USB control signal 1 to both ports */ -GPIO(USB_ILIM_SEL, E, 5, GPIO_OUT_LOW, NULL) /* USB current limit to both ports */ -GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW, NULL) /* USB port 1 output power enable */ -GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW, NULL) /* USB port 2 output power enable */ -GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW, NULL) /* Enable core power supplies */ -GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW, NULL) /* Disable WiFi radio */ -GPIO(PCH_SCI_L, M, 1, GPIO_ODR_HIGH, NULL) /* Assert SCI to PCH */ -GPIO(KBD_IRQ_L, M, 3, GPIO_ODR_HIGH, NULL) /* Negative edge triggered irq. */ +GPIO(CPU_PROCHOT, B, 5, GPIO_OUT_LOW) /* Force CPU to think it's overheated */ +GPIO(ENABLE_BACKLIGHT, M, 7, GPIO_ODR_HIGH) /* Enable backlight power */ +GPIO(ENABLE_TOUCHPAD, N, 1, GPIO_OUT_LOW) /* Enable touchpad power */ +GPIO(ENTERING_RW, D, 6, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(LPC_CLKRUN_L, M, 2, GPIO_ODR_HIGH) /* Request that PCH drive LPC clock */ +GPIO(PCH_CORE_PWROK, F, 5, GPIO_OUT_LOW) /* Indicate core well power is stable */ +GPIO(PCH_PWRBTN_L, H, 0, GPIO_ODR_HIGH) /* Power button output to PCH */ +GPIO(PCH_RCIN_L, F, 3, GPIO_ODR_HIGH) /* Reset line to PCH (for 8042 emulation) */ +GPIO(PCH_RSMRST_L, F, 1, GPIO_OUT_LOW) /* Reset PCH resume power plane logic */ +GPIO(PCH_SMI_L, F, 4, GPIO_ODR_HIGH) /* System management interrupt to PCH */ +GPIO(PCH_SOC_OVERRIDE, G, 1, GPIO_OUT_LOW) /* SOC override signal to PCH; when high, ME ignores security descriptor */ +GPIO(PCH_SYS_PWROK, J, 1, GPIO_OUT_LOW) /* EC thinks everything is up and ready */ +GPIO(PCH_WAKE_L, F, 0, GPIO_ODR_HIGH) /* Wake signal from EC to PCH */ +GPIO(PP1350_EN, H, 5, GPIO_OUT_LOW) /* Enable 1.35V supply */ +GPIO(PP3300_DX_EN, J, 2, GPIO_OUT_LOW) /* Enable power to lots of peripherals */ +GPIO(PP3300_LTE_EN, D, 4, GPIO_OUT_LOW) /* Enable LTE radio */ +GPIO(PP3300_WLAN_EN, J, 0, GPIO_OUT_LOW) /* Enable WiFi power */ +GPIO(PP5000_EN, H, 7, GPIO_OUT_LOW) /* Enable 5V supply */ +GPIO(PPSX_EN, L, 6, GPIO_OUT_LOW) /* Enable PP1350_PCH_SX, PP1000_PCH_SX */ +GPIO(SUSP_VR_EN, C, 7, GPIO_OUT_LOW) /* Enable 1.05V regulator */ +GPIO(TOUCHSCREEN_RESET_L, N, 7, GPIO_OUT_LOW) /* Reset touch screen */ +GPIO(USB_CTL1, E, 6, GPIO_OUT_LOW) /* USB control signal 1 to both ports */ +GPIO(USB_ILIM_SEL, E, 5, GPIO_OUT_LOW) /* USB current limit to both ports */ +GPIO(USB1_ENABLE, E, 4, GPIO_OUT_LOW) /* USB port 1 output power enable */ +GPIO(USB2_ENABLE, D, 5, GPIO_OUT_LOW) /* USB port 2 output power enable */ +GPIO(VCORE_EN, C, 5, GPIO_OUT_LOW) /* Enable core power supplies */ +GPIO(WLAN_OFF_L, J, 4, GPIO_OUT_LOW) /* Disable WiFi radio */ +GPIO(PCH_SCI_L, M, 1, GPIO_ODR_HIGH) /* Assert SCI to PCH */ +GPIO(KBD_IRQ_L, M, 3, GPIO_ODR_HIGH) /* Negative edge triggered irq. */ ALTERNATE(A, 0x03, 1, MODULE_UART, 0) /* UART0 */ ALTERNATE(B, 0x04, 3, MODULE_I2C, 0) /* I2C0 SCL */ diff --git a/board/strago/gpio.inc b/board/strago/gpio.inc index 410113509b..a99a4783ad 100644 --- a/board/strago/gpio.inc +++ b/board/strago/gpio.inc @@ -5,91 +5,91 @@ * found in the LICENSE file. */ -GPIO(LID_OPEN, PORT(2), 7, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ -GPIO(AC_PRESENT, PORT(3), 0, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* BC_ACOK / EC_ACIN - to know if battery or AC connected */ -GPIO(POWER_BUTTON_L, PORT(3), 5, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ -GPIO(RSMRST_L_PGOOD, PORT(6), 3, GPIO_INT_BOTH, power_signal_interrupt) /* RSMRST_N_PWRGD from power logic */ -GPIO(ALL_SYS_PGOOD, PORT(13), 0, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* ALL_SYS_PWRGD from power logic */ -GPIO(PCH_SLP_S4_L, PORT(20), 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ -GPIO(PCH_SLP_S3_L, PORT(20), 6, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ - -GPIO(KBD_KSO2, PORT(0), 1, GPIO_KB_OUTPUT_COL2, NULL) /* Negative edge triggered irq. */ - -GPIO(USB_ILIM_SEL, PORT(1), 3, GPIO_OUT_HIGH, NULL) /* USB current control */ - -GPIO(I2C_PORT0_SCL, PORT(1), 5, GPIO_ODR_HIGH, NULL) -GPIO(I2C_PORT0_SDA, PORT(1), 6, GPIO_ODR_HIGH, NULL) -GPIO(BOARD_ID2, PORT(1), 7, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ -GPIO(I2C_PORT1_SCL, PORT(2), 2, GPIO_ODR_HIGH, NULL) -GPIO(I2C_PORT1_SDA, PORT(2), 3, GPIO_ODR_HIGH, NULL) - -GPIO(PCH_SCI_L, PORT(2), 6, GPIO_ODR_HIGH, NULL) /* SCI output */ - -GPIO(VOLUME_UP, PORT(3), 1, GPIO_INT_FALLING, NULL) /* Volume up button */ -GPIO(VOLUME_DOWN, PORT(3), 4, GPIO_INT_FALLING, NULL) /* Volume down button */ -GPIO(USB2_ENABLE, PORT(3), 6, GPIO_OUT_HIGH, NULL) /* Enable power for USB2 Port */ - -GPIO(ENTERING_RW, PORT(4), 1, GPIO_OUT_LOW, NULL) /* Indicate when EC is entering RW code */ -GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH, NULL) /* SMI output */ -GPIO(USB_OC1_L, PORT(4), 5, GPIO_INT_FALLING, NULL) /* DB2 BC1.2 over current signal to EC */ -GPIO(DP_USB_C_HPD_Q, PORT(4), 6, GPIO_OUT_HIGH, NULL) /* DP hot plug detect from EC to SOC */ -GPIO(PWR_BTN_SELECT, PORT(4), 7, GPIO_OUT_HIGH, NULL) /* HIGH in clamshell mode and LOW in tablet mode */ - -GPIO(OTG_SW_EN, PORT(5), 0, GPIO_OUT_LOW, NULL) /* */ -GPIO(PCH_SUS_STAT_L, PORT(5), 1, GPIO_INT_FALLING, NULL) /* Signal to inform EC that SOC is entering low power state */ -GPIO(NC_52, PORT(5), 2, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ -GPIO(TRACKPAD_PWREN, PORT(5), 3, GPIO_OUT_HIGH, NULL) /* Enable power for Track Pad */ -GPIO(USB_OC0_L, PORT(5), 5, GPIO_INT_FALLING, NULL) /* Over current signal of the BC1.2 charger to EC */ -GPIO(TEMP_SENSOR_1, PORT(5), 6, GPIO_INPUT, NULL) /* EC_ADC0 */ -GPIO(TEMP_SENSOR_2, PORT(5), 7, GPIO_INPUT, NULL) /* EC_ADC0 */ - -GPIO(CHGR_PMON, PORT(6), 0, GPIO_ANALOG, NULL) -GPIO(NC_61, PORT(6), 1, GPIO_INPUT, NULL) /* NC */ -GPIO(TEMP_SENSOR_3, PORT(6), 2, GPIO_INPUT, NULL) /* */ -GPIO(USBPD_BST_OFF, PORT(6), 4, GPIO_OUT_HIGH, NULL) /* USB PD Boost Enable */ -GPIO(PCH_SYS_PWROK, PORT(6), 5, GPIO_OUT_LOW, NULL) /* EC thinks everything is up and ready (DELAY_ALL_SYS_PWRGD) */ -GPIO(PCH_WAKE_L, PORT(6), 6, GPIO_ODR_HIGH, NULL) /* PCH wake pin */ -GPIO(USB1_ENABLE, PORT(6), 7, GPIO_OUT_HIGH, NULL) /* Enable power for USB3 Port */ - -GPIO(USB_CTL1, PORT(10), 5, GPIO_OUT_HIGH, NULL) /* USB charging mode control */ - -GPIO(PCH_RCIN_L, PORT(11), 0, GPIO_ODR_HIGH, NULL) /* Reset line to PCH (for 8042 emulation) */ -GPIO(NC_115, PORT(11), 5, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ - -GPIO(USB_PD_EC_INT, PORT(12), 2, GPIO_INT_BOTH, NULL) /* Interrupt from USB PD Controller to EC */ -GPIO(STRAP_L, PORT(12), 3, GPIO_OUT_LOW, NULL) -GPIO(PERICOM_INT, PORT(12), 4, GPIO_INT_BOTH, NULL) /* */ -GPIO(GYRO_INT2, PORT(12), 7, GPIO_INT_FALLING, NULL) /* Gyro sensor interrupt 2 to EC */ - -GPIO(EC_PLUG_DETECT, PORT(13), 2, GPIO_INT_BOTH, NULL) -GPIO(BOARD_ID1, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP, NULL) /* Board Id 1 */ -GPIO(NC_135, PORT(13), 5, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ - -GPIO(THERMAL_PROBE_EN_L,PORT(14), 0, GPIO_OUT_HIGH, NULL) -GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW, NULL) /* RSMRST_N to PCH */ -GPIO(NC_145, PORT(14), 5, GPIO_OUT_LOW | GPIO_PULL_UP, NULL) /* NC */ -GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH, NULL) /* SPI PVT Chip select */ -GPIO(ALS_INT, PORT(14), 7, GPIO_INT_FALLING, NULL) /* ALS sensor interrupt to EC */ - -GPIO(WLAN_OFF_L, PORT(15), 0, GPIO_ODR_HIGH, NULL) /* Wireless LAN */ -GPIO(CPU_PROCHOT, PORT(15), 1, GPIO_OUT_LOW, NULL) -GPIO(KBD_IRQ_L, PORT(15), 2, GPIO_ODR_HIGH, NULL) /* Negative edge triggered irq. */ -GPIO(BOARD_ID0, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ -GPIO(CORE_PWROK, PORT(15), 5, GPIO_ODR_HIGH, NULL) /* CORE_PWR_OK_R */ -GPIO(LID_OPEN2, PORT(15), 6, GPIO_INT_BOTH_DSLEEP, NULL) /* LID_OPEN_OUT2_R */ -GPIO(PCH_SUSPWRDNACK, PORT(15), 7, GPIO_INT_FALLING, NULL) /* PMC SUSPWRDNACK signal from SOC to EC */ - -GPIO(PCH_PWRBTN_L, PORT(16), 0, GPIO_OUT_HIGH, NULL) /* Power button output to PCH */ -GPIO(GYRO_INT1, PORT(16), 1, GPIO_INT_FALLING, NULL) /* Gyro sensor interrupt 1 to EC */ -GPIO(CROSS_BAR_EN_NC, PORT(16), 3, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ - -GPIO(STARTUP_LATCH_SET, PORT(20), 1, GPIO_OUT_HIGH, NULL) /* Output from EC to POL signal of USB Type C Mux */ -GPIO(EC_BL_DISABLE_L, PORT(20), 2, GPIO_OUT_HIGH, NULL) /* EDP backligh disable signal from EC */ -GPIO(SMC_SHUTDOWN, PORT(20), 3, GPIO_OUT_LOW, NULL) /* Shutdown signal from EC to power sequencing PLD */ -GPIO(CROSS_BAR_MODE_NC, PORT(20), 4, GPIO_INPUT | GPIO_PULL_UP, NULL) /* NC */ - -GPIO(SUSPWRDNACK_SOC_EC,PORT(21), 0, GPIO_OUT_LOW, NULL) /* SUSPWRDNACK signal from MOIC device to EC */ -GPIO(GPIO_3_EC, PORT(21), 1, GPIO_OUT_LOW, NULL) /* Sleep SOIX signal from SOC to EC */ +GPIO_INT(LID_OPEN, PORT(2), 7, GPIO_INT_BOTH_DSLEEP, lid_interrupt) /* Lid switch */ +GPIO_INT(AC_PRESENT, PORT(3), 0, GPIO_INT_BOTH_DSLEEP, extpower_interrupt) /* BC_ACOK / EC_ACIN - to know if battery or AC connected */ +GPIO_INT(POWER_BUTTON_L, PORT(3), 5, GPIO_INT_BOTH_DSLEEP, power_button_interrupt) /* Power button */ +GPIO_INT(RSMRST_L_PGOOD, PORT(6), 3, GPIO_INT_BOTH, power_signal_interrupt) /* RSMRST_N_PWRGD from power logic */ +GPIO_INT(ALL_SYS_PGOOD, PORT(13), 0, GPIO_INT_BOTH_DSLEEP, power_signal_interrupt) /* ALL_SYS_PWRGD from power logic */ +GPIO_INT(PCH_SLP_S4_L, PORT(20), 0, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S4# signal from PCH */ +GPIO_INT(PCH_SLP_S3_L, PORT(20), 6, GPIO_INT_BOTH_DSLEEP | GPIO_PULL_UP, power_signal_interrupt) /* SLP_S3# signal from PCH */ + +GPIO(KBD_KSO2, PORT(0), 1, GPIO_KB_OUTPUT_COL2) /* Negative edge triggered irq. */ + +GPIO(USB_ILIM_SEL, PORT(1), 3, GPIO_OUT_HIGH) /* USB current control */ + +GPIO(I2C_PORT0_SCL, PORT(1), 5, GPIO_ODR_HIGH) +GPIO(I2C_PORT0_SDA, PORT(1), 6, GPIO_ODR_HIGH) +GPIO(BOARD_ID2, PORT(1), 7, GPIO_INPUT | GPIO_PULL_UP) /* NC */ +GPIO(I2C_PORT1_SCL, PORT(2), 2, GPIO_ODR_HIGH) +GPIO(I2C_PORT1_SDA, PORT(2), 3, GPIO_ODR_HIGH) + +GPIO(PCH_SCI_L, PORT(2), 6, GPIO_ODR_HIGH) /* SCI output */ + +GPIO(VOLUME_UP, PORT(3), 1, GPIO_INT_FALLING) /* Volume up button */ +GPIO(VOLUME_DOWN, PORT(3), 4, GPIO_INT_FALLING) /* Volume down button */ +GPIO(USB2_ENABLE, PORT(3), 6, GPIO_OUT_HIGH) /* Enable power for USB2 Port */ + +GPIO(ENTERING_RW, PORT(4), 1, GPIO_OUT_LOW) /* Indicate when EC is entering RW code */ +GPIO(PCH_SMI_L, PORT(4), 4, GPIO_ODR_HIGH) /* SMI output */ +GPIO(USB_OC1_L, PORT(4), 5, GPIO_INT_FALLING) /* DB2 BC1.2 over current signal to EC */ +GPIO(DP_USB_C_HPD_Q, PORT(4), 6, GPIO_OUT_HIGH) /* DP hot plug detect from EC to SOC */ +GPIO(PWR_BTN_SELECT, PORT(4), 7, GPIO_OUT_HIGH) /* HIGH in clamshell mode and LOW in tablet mode */ + +GPIO(OTG_SW_EN, PORT(5), 0, GPIO_OUT_LOW) /* */ +GPIO(PCH_SUS_STAT_L, PORT(5), 1, GPIO_INT_FALLING) /* Signal to inform EC that SOC is entering low power state */ +GPIO(NC_52, PORT(5), 2, GPIO_INPUT | GPIO_PULL_UP) /* NC */ +GPIO(TRACKPAD_PWREN, PORT(5), 3, GPIO_OUT_HIGH) /* Enable power for Track Pad */ +GPIO(USB_OC0_L, PORT(5), 5, GPIO_INT_FALLING) /* Over current signal of the BC1.2 charger to EC */ +GPIO(TEMP_SENSOR_1, PORT(5), 6, GPIO_INPUT) /* EC_ADC0 */ +GPIO(TEMP_SENSOR_2, PORT(5), 7, GPIO_INPUT) /* EC_ADC0 */ + +GPIO(CHGR_PMON, PORT(6), 0, GPIO_ANALOG) +GPIO(NC_61, PORT(6), 1, GPIO_INPUT) /* NC */ +GPIO(TEMP_SENSOR_3, PORT(6), 2, GPIO_INPUT) /* */ +GPIO(USBPD_BST_OFF, PORT(6), 4, GPIO_OUT_HIGH) /* USB PD Boost Enable */ +GPIO(PCH_SYS_PWROK, PORT(6), 5, GPIO_OUT_LOW) /* EC thinks everything is up and ready (DELAY_ALL_SYS_PWRGD) */ +GPIO(PCH_WAKE_L, PORT(6), 6, GPIO_ODR_HIGH) /* PCH wake pin */ +GPIO(USB1_ENABLE, PORT(6), 7, GPIO_OUT_HIGH) /* Enable power for USB3 Port */ + +GPIO(USB_CTL1, PORT(10), 5, GPIO_OUT_HIGH) /* USB charging mode control */ + +GPIO(PCH_RCIN_L, PORT(11), 0, GPIO_ODR_HIGH) /* Reset line to PCH (for 8042 emulation) */ +GPIO(NC_115, PORT(11), 5, GPIO_INPUT | GPIO_PULL_UP) /* NC */ + +GPIO(USB_PD_EC_INT, PORT(12), 2, GPIO_INT_BOTH) /* Interrupt from USB PD Controller to EC */ +GPIO(STRAP_L, PORT(12), 3, GPIO_OUT_LOW) +GPIO(PERICOM_INT, PORT(12), 4, GPIO_INT_BOTH) /* */ +GPIO(GYRO_INT2, PORT(12), 7, GPIO_INT_FALLING) /* Gyro sensor interrupt 2 to EC */ + +GPIO(EC_PLUG_DETECT, PORT(13), 2, GPIO_INT_BOTH) +GPIO(BOARD_ID1, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP) /* Board Id 1 */ +GPIO(NC_135, PORT(13), 5, GPIO_INPUT | GPIO_PULL_UP) /* NC */ + +GPIO(THERMAL_PROBE_EN_L,PORT(14), 0, GPIO_OUT_HIGH) +GPIO(PCH_RSMRST_L, PORT(14), 3, GPIO_OUT_LOW) /* RSMRST_N to PCH */ +GPIO(NC_145, PORT(14), 5, GPIO_OUT_LOW | GPIO_PULL_UP) /* NC */ +GPIO(PVT_CS0, PORT(14), 6, GPIO_ODR_HIGH) /* SPI PVT Chip select */ +GPIO(ALS_INT, PORT(14), 7, GPIO_INT_FALLING) /* ALS sensor interrupt to EC */ + +GPIO(WLAN_OFF_L, PORT(15), 0, GPIO_ODR_HIGH) /* Wireless LAN */ +GPIO(CPU_PROCHOT, PORT(15), 1, GPIO_OUT_LOW) +GPIO(KBD_IRQ_L, PORT(15), 2, GPIO_ODR_HIGH) /* Negative edge triggered irq. */ +GPIO(BOARD_ID0, PORT(15), 4, GPIO_INPUT | GPIO_PULL_UP) /* NC */ +GPIO(CORE_PWROK, PORT(15), 5, GPIO_ODR_HIGH) /* CORE_PWR_OK_R */ +GPIO(LID_OPEN2, PORT(15), 6, GPIO_INT_BOTH_DSLEEP) /* LID_OPEN_OUT2_R */ +GPIO(PCH_SUSPWRDNACK, PORT(15), 7, GPIO_INT_FALLING) /* PMC SUSPWRDNACK signal from SOC to EC */ + +GPIO(PCH_PWRBTN_L, PORT(16), 0, GPIO_OUT_HIGH) /* Power button output to PCH */ +GPIO(GYRO_INT1, PORT(16), 1, GPIO_INT_FALLING) /* Gyro sensor interrupt 1 to EC */ +GPIO(CROSS_BAR_EN_NC, PORT(16), 3, GPIO_INPUT | GPIO_PULL_UP) /* NC */ + +GPIO(STARTUP_LATCH_SET, PORT(20), 1, GPIO_OUT_HIGH) /* Output from EC to POL signal of USB Type C Mux */ +GPIO(EC_BL_DISABLE_L, PORT(20), 2, GPIO_OUT_HIGH) /* EDP backligh disable signal from EC */ +GPIO(SMC_SHUTDOWN, PORT(20), 3, GPIO_OUT_LOW) /* Shutdown signal from EC to power sequencing PLD */ +GPIO(CROSS_BAR_MODE_NC, PORT(20), 4, GPIO_INPUT | GPIO_PULL_UP) /* NC */ + +GPIO(SUSPWRDNACK_SOC_EC,PORT(21), 0, GPIO_OUT_LOW) /* SUSPWRDNACK signal from MOIC device to EC */ +GPIO(GPIO_3_EC, PORT(21), 1, GPIO_OUT_LOW) /* Sleep SOIX signal from SOC to EC */ UNIMPLEMENTED(WP_L) diff --git a/board/twinkie/gpio.inc b/board/twinkie/gpio.inc index 181603148c..15d76dbb45 100644 --- a/board/twinkie/gpio.inc +++ b/board/twinkie/gpio.inc @@ -4,37 +4,37 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -GPIO(CC2_ALERT_L, A, 7, GPIO_INT_BOTH | GPIO_PULL_UP, cc2_event) -GPIO(VBUS_ALERT_L, B, 2, GPIO_INT_BOTH | GPIO_PULL_UP, vbus_event) +GPIO_INT(CC2_ALERT_L, A, 7, GPIO_INT_BOTH | GPIO_PULL_UP, cc2_event) +GPIO_INT(VBUS_ALERT_L, B, 2, GPIO_INT_BOTH | GPIO_PULL_UP, vbus_event) -GPIO(CC1_EN, A, 0, GPIO_OUT_HIGH, NULL) -GPIO(CC1_PD, A, 1, GPIO_ANALOG, NULL) -GPIO(CC2_EN, A, 2, GPIO_OUT_HIGH, NULL) -GPIO(CC2_PD, A, 3, GPIO_ANALOG, NULL) -GPIO(DAC, A, 4, GPIO_ANALOG, NULL) -GPIO(CC2_TX_DATA, A, 6, GPIO_OUT_LOW, NULL) +GPIO(CC1_EN, A, 0, GPIO_OUT_HIGH) +GPIO(CC1_PD, A, 1, GPIO_ANALOG) +GPIO(CC2_EN, A, 2, GPIO_OUT_HIGH) +GPIO(CC2_PD, A, 3, GPIO_ANALOG) +GPIO(DAC, A, 4, GPIO_ANALOG) +GPIO(CC2_TX_DATA, A, 6, GPIO_OUT_LOW) -GPIO(CC1_RA, A, 8, GPIO_ODR_HIGH, NULL) -GPIO(USB_DM, A, 11, GPIO_ANALOG, NULL) -GPIO(USB_DP, A, 12, GPIO_ANALOG, NULL) -GPIO(CC1_RPUSB, A, 13, GPIO_ODR_HIGH, NULL) -GPIO(CC1_RP1A5, A, 14, GPIO_ODR_HIGH, NULL) -GPIO(CC1_RP3A0, A, 15, GPIO_ODR_HIGH, NULL) -GPIO(CC2_RPUSB, B, 0, GPIO_ODR_HIGH, NULL) +GPIO(CC1_RA, A, 8, GPIO_ODR_HIGH) +GPIO(USB_DM, A, 11, GPIO_ANALOG) +GPIO(USB_DP, A, 12, GPIO_ANALOG) +GPIO(CC1_RPUSB, A, 13, GPIO_ODR_HIGH) +GPIO(CC1_RP1A5, A, 14, GPIO_ODR_HIGH) +GPIO(CC1_RP3A0, A, 15, GPIO_ODR_HIGH) +GPIO(CC2_RPUSB, B, 0, GPIO_ODR_HIGH) -GPIO(CC1_TX_EN, B, 1, GPIO_OUT_LOW, NULL) -GPIO(CC2_TX_EN, B, 3, GPIO_OUT_LOW, NULL) -GPIO(CC1_TX_DATA, B, 4, GPIO_OUT_LOW, NULL) -GPIO(CC1_RD, B, 5, GPIO_ODR_HIGH, NULL) -GPIO(I2C_SCL, B, 6, GPIO_INPUT, NULL) -GPIO(I2C_SDA, B, 7, GPIO_INPUT, NULL) -GPIO(CC2_RD, B, 8, GPIO_ODR_HIGH, NULL) -GPIO(LED_G_L, B, 11, GPIO_ODR_HIGH, NULL) -GPIO(LED_R_L, B, 13, GPIO_ODR_HIGH, NULL) -GPIO(LED_B_L, B, 14, GPIO_ODR_HIGH, NULL) -GPIO(CC2_RA, B, 15, GPIO_ODR_HIGH, NULL) -GPIO(CC2_RP1A5, C, 14, GPIO_ODR_HIGH, NULL) -GPIO(CC2_RP3A0, C, 15, GPIO_ODR_HIGH, NULL) +GPIO(CC1_TX_EN, B, 1, GPIO_OUT_LOW) +GPIO(CC2_TX_EN, B, 3, GPIO_OUT_LOW) +GPIO(CC1_TX_DATA, B, 4, GPIO_OUT_LOW) +GPIO(CC1_RD, B, 5, GPIO_ODR_HIGH) +GPIO(I2C_SCL, B, 6, GPIO_INPUT) +GPIO(I2C_SDA, B, 7, GPIO_INPUT) +GPIO(CC2_RD, B, 8, GPIO_ODR_HIGH) +GPIO(LED_G_L, B, 11, GPIO_ODR_HIGH) +GPIO(LED_R_L, B, 13, GPIO_ODR_HIGH) +GPIO(LED_B_L, B, 14, GPIO_ODR_HIGH) +GPIO(CC2_RA, B, 15, GPIO_ODR_HIGH) +GPIO(CC2_RP1A5, C, 14, GPIO_ODR_HIGH) +GPIO(CC2_RP3A0, C, 15, GPIO_ODR_HIGH) /* Unimplemented signals which we need to emulate for now */ UNIMPLEMENTED(ENTERING_RW) diff --git a/chip/g/gpio.c b/chip/g/gpio.c index 0dd6122d54..8be9f06fca 100644 --- a/chip/g/gpio.c +++ b/chip/g/gpio.c @@ -174,9 +174,9 @@ static void gpio_invoke_handler(uint32_t port, uint32_t mask) { const struct gpio_info *g = gpio_list; int i; - for (i = 0; i < GPIO_COUNT; i++, g++) - if (g->irq_handler && port == g->port && (mask & g->mask)) - g->irq_handler(i); + for (i = 0; i < GPIO_IH_COUNT; i++, g++) + if (port == g->port && (mask & g->mask)) + gpio_irq_handlers[i](i); } static void gpio_interrupt(int port) diff --git a/chip/host/gpio.c b/chip/host/gpio.c index eda2c456bf..c6c415a084 100644 --- a/chip/host/gpio.c +++ b/chip/host/gpio.c @@ -43,14 +43,15 @@ test_mockable void gpio_set_level(enum gpio_signal signal, int value) const struct gpio_info *g = gpio_list + signal; const uint32_t flags = g->flags; const int old_value = gpio_values[signal]; + void (*ih)(enum gpio_signal signal) = gpio_irq_handlers[signal]; gpio_values[signal] = value; - if (g->irq_handler == NULL || !gpio_interrupt_enabled[signal]) + if (signal >= GPIO_IH_COUNT || !gpio_interrupt_enabled[signal]) return; if (gpio_interrupt_check(flags, old_value, value)) - g->irq_handler(signal); + ih(signal); } test_mockable int gpio_enable_interrupt(enum gpio_signal signal) diff --git a/chip/it83xx/gpio.c b/chip/it83xx/gpio.c index 7bdc41682c..09f7ff2492 100644 --- a/chip/it83xx/gpio.c +++ b/chip/it83xx/gpio.c @@ -330,8 +330,6 @@ void gpio_pre_init(void) } } - - /** * Handle a GPIO interrupt by calling the pins corresponding handler if * one exists. @@ -344,9 +342,9 @@ static void gpio_interrupt(int port, uint8_t mask) int i = 0; const struct gpio_info *g = gpio_list; - for (i = 0; i < GPIO_COUNT; i++, g++) { - if (port == g->port && (mask & g->mask) && g->irq_handler) { - g->irq_handler(i); + for (i = 0; i < GPIO_IH_COUNT; i++, g++) { + if (port == g->port && (mask & g->mask)) + gpio_irq_handlers[i](i); return; } } diff --git a/chip/lm4/gpio.c b/chip/lm4/gpio.c index e5236e31d2..97e886294b 100644 --- a/chip/lm4/gpio.c +++ b/chip/lm4/gpio.c @@ -150,9 +150,8 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags) int gpio_enable_interrupt(enum gpio_signal signal) { const struct gpio_info *g = gpio_list + signal; - /* Fail if no interrupt handler */ - if (!g->irq_handler) + if (signal >= GPIO_IH_COUNT) return EC_ERROR_UNKNOWN; LM4_GPIO_IM(g->port) |= g->mask; @@ -164,7 +163,7 @@ int gpio_disable_interrupt(enum gpio_signal signal) const struct gpio_info *g = gpio_list + signal; /* Fail if no interrupt handler */ - if (!g->irq_handler) + if (signal >= GPIO_IH_COUNT) return EC_ERROR_UNKNOWN; LM4_GPIO_IM(g->port) &= ~g->mask; @@ -305,9 +304,9 @@ static void gpio_interrupt(int port, uint32_t mis) int i = 0; const struct gpio_info *g = gpio_list; - for (i = 0; i < GPIO_COUNT && mis; i++, g++) { - if (port == g->port && (mis & g->mask) && g->irq_handler) { - g->irq_handler(i); + for (i = 0; i < GPIO_IH_COUNT && mis; i++, g++) { + if (port == g->port && (mis & g->mask)) { + gpio_irq_handlers[i](i); mis &= ~g->mask; } } diff --git a/chip/mec1322/gpio.c b/chip/mec1322/gpio.c index 783fa52bf4..06fca36f7e 100644 --- a/chip/mec1322/gpio.c +++ b/chip/mec1322/gpio.c @@ -218,12 +218,10 @@ static void gpio_interrupt(int girq, int port_offset) MEC1322_INT_SOURCE(girq) |= sts; - for (i = 0; i < GPIO_COUNT && sts; ++i, ++g) { - if (!g->irq_handler) - continue; + for (i = 0; i < GPIO_IH_COUNT && sts; ++i, ++g) { bit = (g->port - port_offset) * 8 + __builtin_ffs(g->mask) - 1; if (sts & (1 << bit)) - g->irq_handler(i); + gpio_irq_handlers[i](i); sts &= ~(1 << bit); } } diff --git a/chip/npcx/gpio.c b/chip/npcx/gpio.c index 8afd7d05fb..0b9b4b664f 100644 --- a/chip/npcx/gpio.c +++ b/chip/npcx/gpio.c @@ -350,9 +350,9 @@ void gpio_execute_isr(uint8_t port, uint8_t mask) int i; const struct gpio_info *g = gpio_list; /* Find GPIOs and execute interrupt service routine */ - for (i = 0; i < GPIO_COUNT; i++, g++) { - if (port == g->port && mask == g->mask && g->irq_handler) { - g->irq_handler(i); + for (i = 0; i < GPIO_IH_COUNT; i++, g++) { + if (port == g->port && mask == g->mask) { + gpio_irq_handlers[i](i); return; } } diff --git a/chip/nrf51/gpio.c b/chip/nrf51/gpio.c index ccb453d0c2..22a7d95fa1 100644 --- a/chip/nrf51/gpio.c +++ b/chip/nrf51/gpio.c @@ -193,7 +193,7 @@ int gpio_enable_interrupt(enum gpio_signal signal) const struct gpio_info *g = gpio_list + signal; /* Fail if not implemented or no interrupt handler */ - if (!g->mask || !g->irq_handler) + if (!g->mask || signal >= GPIO_IH_COUNT) return EC_ERROR_INVAL; /* If it's not shared, use INT0-INT3, otherwise use PORT. */ @@ -253,7 +253,7 @@ int gpio_disable_interrupt(enum gpio_signal signal) int i; /* Fail if not implemented or no interrupt handler */ - if (!g->mask || !g->irq_handler) + if (!g->mask || signal >= GPIO_IH_COUNT) return EC_ERROR_INVAL; /* If it's not shared, use INT0-INT3, otherwise use PORT. */ @@ -285,21 +285,24 @@ void gpio_interrupt(void) { const struct gpio_info *g; int i; + int signal; for (i = 0; i < NRF51_GPIOTE_IN_COUNT; i++) { if (NRF51_GPIOTE_IN(i)) { NRF51_GPIOTE_IN(i) = 0; g = gpio_ints[i]; - if (g && g->irq_handler) - g->irq_handler(g - gpio_list); + signal = g - gpio_list; + if (g && signal < GPIO_IH_COUNT) + gpio_irq_handlers[signal](signal); } } if (NRF51_GPIOTE_PORT) { NRF51_GPIOTE_PORT = 0; g = gpio_int_port; - if (g && g->irq_handler) - g->irq_handler(g - gpio_list); + signal = g - gpio_list; + if (g && signal < GPIO_IH_COUNT) + gpio_irq_handlers[signal](signal); } } DECLARE_IRQ(NRF51_PERID_GPIOTE, gpio_interrupt, 1); diff --git a/chip/stm32/gpio.c b/chip/stm32/gpio.c index ef7fc818ba..d58ce29328 100644 --- a/chip/stm32/gpio.c +++ b/chip/stm32/gpio.c @@ -16,9 +16,8 @@ /* Console output macros */ #define CPRINTS(format, args...) cprints(CC_GPIO, format, ## args) - /* For each EXTI bit, record which GPIO entry is using it */ -static const struct gpio_info *exti_events[16]; +static uint8_t exti_events[16]; void gpio_pre_init(void) { @@ -75,19 +74,23 @@ void gpio_set_level(enum gpio_signal signal, int value) int gpio_enable_interrupt(enum gpio_signal signal) { const struct gpio_info *g = gpio_list + signal; + const struct gpio_info *g_old = gpio_list; + uint32_t bit, group, shift, bank; /* Fail if not implemented or no interrupt handler */ - if (!g->mask || !g->irq_handler) + if (!g->mask || signal >= GPIO_IH_COUNT) return EC_ERROR_INVAL; bit = 31 - __builtin_clz(g->mask); - if ((exti_events[bit]) && (exti_events[bit] != g)) { + g_old += exti_events[bit]; + + if ((exti_events[bit]) && (exti_events[bit] != signal)) { CPRINTS("Overriding %s with %s on EXTI%d", - exti_events[bit]->name, g->name, bit); + g_old->name, g->name, bit); } - exti_events[bit] = g; + exti_events[bit] = signal; group = bit / 4; shift = (bit % 4) * 4; @@ -115,17 +118,17 @@ int gpio_enable_interrupt(enum gpio_signal signal) void gpio_interrupt(void) { int bit; - const struct gpio_info *g; /* process only GPIO EXTINTs (EXTINT0..15) not other EXTINTs */ uint32_t pending = STM32_EXTI_PR & 0xFFFF; + uint8_t signal; STM32_EXTI_PR = pending; while (pending) { bit = get_next_bit(&pending); - g = exti_events[bit]; - if (g && g->irq_handler) - g->irq_handler(g - gpio_list); + signal = exti_events[bit]; + if (signal < GPIO_IH_COUNT) + gpio_irq_handlers[signal](signal); } } #ifdef CHIP_FAMILY_STM32F0 diff --git a/include/backlight.h b/include/backlight.h index be905d0f47..4a11e15a4a 100644 --- a/include/backlight.h +++ b/include/backlight.h @@ -9,6 +9,7 @@ #define __CROS_EC_BACKLIGHT_H #include "common.h" +#include "gpio.h" /** * Interrupt handler for backlight. @@ -18,7 +19,7 @@ #ifdef CONFIG_BACKLIGHT_REQ_GPIO void backlight_interrupt(enum gpio_signal signal); #else -#define backlight_interrupt NULL -#endif +static inline void backlight_interrupt(enum gpio_signal signal) { } +#endif /* !CONFIG_BACKLIGHT_REQ_GPIO */ #endif /* __CROS_EC_BACKLIGHT_H */ diff --git a/include/chipset.h b/include/chipset.h index 952c243663..0237767fbf 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -14,6 +14,7 @@ #define __CROS_EC_CHIPSET_H #include "common.h" +#include "gpio.h" /* * Chipset state mask @@ -95,8 +96,7 @@ static inline void chipset_exit_hard_off(void) { } static inline void chipset_throttle_cpu(int throttle) { } static inline void chipset_force_shutdown(void) { } static inline void chipset_reset(int cold_reset) { } - -#define power_interrupt NULL +static inline void power_interrupt(enum gpio_signal signal) { } #endif /* !HAS_TASK_CHIPSET */ diff --git a/include/gpio.h b/include/gpio.h index f71622dfe6..0441ff6096 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -45,6 +45,15 @@ #define GPIO_INT_ANY (GPIO_INT_BOTH | GPIO_INT_LEVEL) #define GPIO_INT_BOTH_DSLEEP (GPIO_INT_BOTH | GPIO_INT_DSLEEP) +/* NOTE: This is normally included from board.h, thru config.h and common.h But, + * some boards and unit tests don't have a gpio_signal enum defined, so we + * define an emtpy one here.*/ +#ifndef __CROS_EC_GPIO_SIGNAL_H +enum gpio_signal { + NULL +}; +#endif /* __CROS_EC_GPIO_SIGNAL_H */ + /* GPIO signal definition structure, for use by board.c */ struct gpio_info { /* Signal name */ @@ -58,18 +67,20 @@ struct gpio_info { /* Flags (GPIO_*; see above) */ uint32_t flags; - - /* - * Interrupt handler. If non-NULL, and the signal's interrupt is - * enabled, this will be called in the context of the GPIO interrupt - * handler. - */ - void (*irq_handler)(enum gpio_signal signal); }; /* Signal information from board.c. Must match order from enum gpio_signal. */ extern const struct gpio_info gpio_list[]; +/* Interrupt handler table for those GPIOs which have IRQ handlers. + * + * If the signal's interrupt is enabled, this will be called in the + * context of the GPIO interrupt handler. + */ +extern void (* const gpio_irq_handlers[])(enum gpio_signal signal); +extern const int gpio_ih_count; +#define GPIO_IH_COUNT gpio_ih_count + /* GPIO alternate function structure, for use by board.c */ struct gpio_alt_func { /* Port base address */ diff --git a/include/gpio.wrap b/include/gpio.wrap index cf4fbb319a..1eb9f3643e 100644 --- a/include/gpio.wrap +++ b/include/gpio.wrap @@ -8,15 +8,26 @@ /* * The GPIO macro is used to define a new GPIO pin name and function. * - * The name is used to populate the gpio_signal enum by first prepending GPIO_ - * to the name. It is also used to construct the string name that is presented - * in the shell interface. Similarly, the port parameter has GPIO_ prepended to - * it before it is used to initialize the port base address of a gpio_info - * struct. The pin number is used to create a bitmask. The flags and signal - * parameters are passed on to the gpio_info directly. + * The name is used to populate the gpio_signal enum by first + * prepending GPIO_ to the name. It is also used to construct the + * string name that is presented in the shell interface. Similarly, + * the port parameter has GPIO_ prepended to it before it is used to + * initialize the port base address of a gpio_info struct. The pin + * number is used to create a bitmask. The flags parameter is passed + * on to the gpio_info directly. */ #ifndef GPIO -#define GPIO(name, port, pin, flags, signal) +#define GPIO(name, port, pin, flags) +#endif + +/* + * The GPIO_INT macro is used to define a GPIOs that have an IRQ handler. + * + * The IRQ handler pointers are stored as elements in the gpio_irq_handlers + * array. + */ +#ifndef GPIO_INT +#define GPIO_INT(name, port, pin, flags, signal) #endif /* @@ -61,5 +72,6 @@ * Once the gpio.inc file has been included these macros are no longer needed. */ #undef GPIO +#undef GPIO_INT #undef ALTERNATE #undef UNIMPLEMENTED diff --git a/include/gpio_list.h b/include/gpio_list.h index c7e2962747..c9bdd5668d 100644 --- a/include/gpio_list.h +++ b/include/gpio_list.h @@ -3,17 +3,21 @@ * found in the LICENSE file. */ +#include "gpio_signal.h" + #ifdef CONFIG_COMMON_GPIO_SHORTNAMES -#define GPIO(name, port, pin, flags, signal) \ - {#port#pin, GPIO_##port, (1 << pin), flags, signal}, +#define GPIO(name, port, pin, flags) \ + {#port#pin, GPIO_##port, (1 << pin), flags}, #else -#define GPIO(name, port, pin, flags, signal) \ - {#name, GPIO_##port, (1 << pin), flags, signal}, +#define GPIO(name, port, pin, flags) \ + {#name, GPIO_##port, (1 << pin), flags}, #endif #define UNIMPLEMENTED(name) \ - {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT, NULL}, + {#name, DUMMY_GPIO_BANK, 0, GPIO_DEFAULT}, +#define GPIO_INT(name, port, pin, flags, signal) \ + GPIO(name, port, pin, flags) /* GPIO signal list. */ const struct gpio_info gpio_list[] = { #include "gpio.wrap" @@ -33,3 +37,18 @@ const struct gpio_alt_func gpio_alt_funcs[] = { }; const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs); + +/* GPIO Interrupt Handlers */ +#define GPIO_INT(name, port, pin, flags, signal) signal, +void (* const gpio_irq_handlers[])(enum gpio_signal signal) = { + #include "gpio.wrap" +}; +const int gpio_ih_count = ARRAY_SIZE(gpio_irq_handlers); + +/* + * ALL GPIOs with interrupt handlers must be declared at the top of the gpio.inc + * file. + */ +#define GPIO_INT(name, port, pin, flags, signal) \ + BUILD_ASSERT(GPIO_##name < ARRAY_SIZE(gpio_irq_handlers)); +#include "gpio.wrap" diff --git a/include/gpio_signal.h b/include/gpio_signal.h index 83e9dfe6fa..bcec1b522f 100644 --- a/include/gpio_signal.h +++ b/include/gpio_signal.h @@ -3,10 +3,16 @@ * found in the LICENSE file. */ -#define GPIO(name, port, pin, flags, signal) GPIO_##name, +#ifndef __CROS_EC_GPIO_SIGNAL_H +#define __CROS_EC_GPIO_SIGNAL_H + +#define GPIO(name, port, pin, flags) GPIO_##name, #define UNIMPLEMENTED(name) GPIO_##name, +#define GPIO_INT(name, port, pin, flags, signal) GPIO_##name, enum gpio_signal { #include "gpio.wrap" GPIO_COUNT }; + +#endif /* __CROS_EC_GPIO_SIGNAL_H */ diff --git a/include/jtag.h b/include/jtag.h index 9c7835dfd0..cf927c2e2d 100644 --- a/include/jtag.h +++ b/include/jtag.h @@ -9,6 +9,7 @@ #define __CROS_EC_JTAG_H #include "common.h" +#include "gpio.h" /** * Pre-initialize the JTAG module. @@ -23,8 +24,7 @@ void jtag_pre_init(void); */ void jtag_interrupt(enum gpio_signal signal); #else -#define jtag_interrupt NULL -#endif - +static inline void jtag_interrupt(enum gpio_signal signal) { } +#endif /* !CONFIG_LOW_POWER_IDLE */ #endif /* __CROS_EC_JTAG_H */ diff --git a/include/keyboard_raw.h b/include/keyboard_raw.h index 9bdd1cce8f..8591700b47 100644 --- a/include/keyboard_raw.h +++ b/include/keyboard_raw.h @@ -68,7 +68,7 @@ void keyboard_raw_enable_interrupt(int enable); void keyboard_raw_gpio_interrupt(enum gpio_signal signal); #else -#define keyboard_raw_gpio_interrupt NULL -#endif +static inline void keyboard_raw_gpio_interrupt(enum gpio_signal signal) { } +#endif /* !HAS_TASK_KEYSCAN */ #endif /* __CROS_EC_KEYBOARD_RAW_H */ diff --git a/include/power.h b/include/power.h index 36054e8bd1..8f11c14868 100644 --- a/include/power.h +++ b/include/power.h @@ -100,7 +100,7 @@ enum power_state power_handle_state(enum power_state state); #ifdef HAS_TASK_CHIPSET void power_signal_interrupt(enum gpio_signal signal); #else -#define power_signal_interrupt NULL -#endif +static inline void power_signal_interrupt(enum gpio_signal signal) { } +#endif /* !HAS_TASK_CHIPSET */ #endif /* __CROS_EC_POWER_H */ diff --git a/include/switch.h b/include/switch.h index f59e56df52..c2b67393d0 100644 --- a/include/switch.h +++ b/include/switch.h @@ -19,7 +19,7 @@ */ void switch_interrupt(enum gpio_signal signal); #else -#define switch_interrupt NULL -#endif /* CONFIG_SWITCH */ +static inline void switch_interrupt(enum gpio_signal signal) { } +#endif /* !CONFIG_SWITCH */ #endif /* __CROS_EC_SWITCH_H */ diff --git a/include/uart.h b/include/uart.h index 6128962726..6499eb9453 100644 --- a/include/uart.h +++ b/include/uart.h @@ -10,6 +10,7 @@ #include <stdarg.h> /* For va_list */ #include "common.h" +#include "gpio.h" /** * Initialize the UART module. @@ -224,8 +225,8 @@ void uart_exit_dsleep(void); */ void uart_deepsleep_interrupt(enum gpio_signal signal); #else -#define uart_deepsleep_interrupt NULL -#endif +static inline void uart_deepsleep_interrupt(enum gpio_signal signal) { } +#endif /* !CONFIG_LOW_POWER_IDLE */ #ifdef CONFIG_UART_INPUT_FILTER /** |