coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c File Reference
#include <device/mmio.h>
#include <assert.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <soc/grf.h>
#include <soc/soc.h>
#include <types.h>
Include dependency graph for gpio.c:

Go to the source code of this file.

Functions

static void gpio_set_dir (gpio_t gpio, enum gpio_dir dir)
 
static void gpio_set_pull (gpio_t gpio, enum gpio_pull pull)
 
void gpio_input (gpio_t gpio)
 
void gpio_input_pulldown (gpio_t gpio)
 
void gpio_input_pullup (gpio_t gpio)
 
void gpio_input_irq (gpio_t gpio, enum gpio_irq_type type, enum gpio_pull pull)
 
int gpio_irq_status (gpio_t gpio)
 
int gpio_get (gpio_t gpio)
 
void gpio_set (gpio_t gpio, int value)
 
void gpio_output (gpio_t gpio, int value)
 

Function Documentation

◆ gpio_get()

◆ gpio_input()

◆ gpio_input_irq()

◆ gpio_input_pulldown()

void gpio_input_pulldown ( gpio_t  gpio)

Definition at line 34 of file gpio.c.

References GPIO_INPUT, GPIO_OUTPUT_ENABLE, GPIO_PULL_MASK, GPIO_PULLDOWN, GPIO_PULLDOWN_ENABLE, gpio_set_dir(), gpio_set_pull(), and gpio_setbits32().

Referenced by configure_display(), configure_vop(), variant_board_sku(), and variant_memory_params().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gpio_input_pullup()

void gpio_input_pullup ( gpio_t  gpio)

◆ gpio_irq_status()

int gpio_irq_status ( gpio_t  gpio)

Definition at line 81 of file gpio.c.

References BIT, gpio_port, rockchip_gpio_regs::int_status, mask, rockchip_gpio_regs::porta_eoi, read32(), and setbits32.

Here is the call graph for this function:

◆ gpio_output()

void gpio_output ( gpio_t  gpio,
int  value 
)

Definition at line 104 of file gpio.c.

References gpio_or32(), GPIO_OUTPUT, GPIO_OUTPUT_ENABLE, GPIO_PULLNONE, gpio_set(), gpio_set_dir(), gpio_set_pull(), and value.

Referenced by assert_wifi_reset(), bootblock_mainboard_early_init(), bootblock_mainboard_init(), bridge_anx7625_power_on(), bridge_ps8640_power_on(), configure_3g(), configure_audio(), configure_backlight(), configure_backlight_and_bridge(), configure_codec(), configure_display(), configure_emmc(), configure_ext_buck(), configure_gpios(), configure_hdmi(), configure_mipi_panel(), configure_panel_backlight(), configure_sdmmc(), configure_spi_flash(), configure_touchpad(), configure_touchscreen(), configure_usb(), configure_usb_hub(), configure_vop(), die_notify(), display_startup(), do_board_reset(), finalize_boot(), mainboard_early_init(), mainboard_enable(), mainboard_init(), mainboard_power_on_backlight(), mb_configure_dp1_pwr(), mb_configure_dp2_pwr(), mb_configure_dp3_pwr(), mb_hda_amp_enable(), mb_usb2_fp1_pwr_enable(), mb_usb2_fp2_pwr_enable(), mb_usb31_fp_pwr_enable(), mb_usb31_rp1_pwr_enable(), mb_usb31_rp2_pwr_enable(), mtk_spi_init(), mtk_usb_prepare(), platform_romstage_main(), power_off_lte_module(), power_on_anx7625(), power_on_panel(), power_on_ps8640(), power_on_ps8640_bridge(), power_on_sn65dsi86_bridge(), prepare_sdmmc(), program_display_sel_gpios(), rk_hdmi_get_edid(), rockchip_spi_init(), set_scl(), setup_chromeos_gpios(), setup_pinmux(), setup_usb(), spi_ctrlr_claim_bus(), spi_ctrlr_release_bus(), tegra_set_scl(), tegra_set_sda(), uart_init(), usb3_hub_reset(), and variant_ramstage_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gpio_set()

◆ gpio_set_dir()

static void gpio_set_dir ( gpio_t  gpio,
enum gpio_dir  dir 
)
static

Definition at line 11 of file gpio.c.

References clrsetbits32, gpio_port, and rockchip_gpio_regs::swporta_ddr.

Referenced by gpio_input(), gpio_input_irq(), gpio_input_pulldown(), gpio_input_pullup(), and gpio_output().

Here is the caller graph for this function:

◆ gpio_set_pull()

static void gpio_set_pull ( gpio_t  gpio,
enum gpio_pull  pull 
)
static

Definition at line 17 of file gpio.c.

References clrsetbits32, CONFIG, gpio_get_pull_val(), gpio_grf_reg(), is_pmu_gpio(), pull, RK_CLRSETBITS, and write32().

Here is the call graph for this function: