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 <gpio.h>
#include <soc/iomap.h>
Include dependency graph for gpio.c:

Go to the source code of this file.

Functions

static int gpio_not_valid (gpio_t gpio)
 
void gpio_tlmm_config_set (gpio_t gpio, unsigned int func, unsigned int pull, unsigned int drvstr, unsigned int enable)
 
void gpio_tlmm_config_get (gpio_t gpio, unsigned int *func, unsigned int *pull, unsigned int *drvstr, unsigned int *enable)
 
int gpio_get (gpio_t gpio)
 
void gpio_set (gpio_t gpio, int value)
 
void gpio_input_pulldown (gpio_t gpio)
 
void gpio_input_pullup (gpio_t gpio)
 
void gpio_input (gpio_t gpio)
 

Function Documentation

◆ gpio_get()

int gpio_get ( gpio_t  gpio)

Definition at line 88 of file gpio.c.

References GPIO_IN_OUT_ADDR, GPIO_IO_IN_MASK, GPIO_IO_IN_SHIFT, gpio_not_valid(), and read32().

Here is the call graph for this function:

◆ gpio_input()

void gpio_input ( gpio_t  gpio)

Definition at line 117 of file gpio.c.

References GPIO_2MA, GPIO_DISABLE, GPIO_FUNC_DISABLE, GPIO_NO_PULL, and gpio_tlmm_config_set().

Here is the call graph for this function:

◆ gpio_input_pulldown()

void gpio_input_pulldown ( gpio_t  gpio)

Definition at line 105 of file gpio.c.

References GPIO_2MA, GPIO_DISABLE, GPIO_FUNC_DISABLE, GPIO_PULL_DOWN, and gpio_tlmm_config_set().

Here is the call graph for this function:

◆ gpio_input_pullup()

void gpio_input_pullup ( gpio_t  gpio)

Definition at line 111 of file gpio.c.

References GPIO_2MA, GPIO_DISABLE, GPIO_FUNC_DISABLE, GPIO_PULL_UP, and gpio_tlmm_config_set().

Here is the call graph for this function:

◆ gpio_not_valid()

static int gpio_not_valid ( gpio_t  gpio)
inlinestatic

Definition at line 15 of file gpio.c.

References GPIO_MAX_NUM.

Referenced by gpio_get(), gpio_set(), gpio_tlmm_config_get(), and gpio_tlmm_config_set().

Here is the caller graph for this function:

◆ gpio_set()

void gpio_set ( gpio_t  gpio,
int  value 
)

Definition at line 97 of file gpio.c.

References GPIO_IN_OUT_ADDR, GPIO_IO_OUT_SHIFT, gpio_not_valid(), value, and write32().

Here is the call graph for this function:

◆ gpio_tlmm_config_get()

void gpio_tlmm_config_get ( gpio_t  gpio,
unsigned int *  func,
unsigned int *  pull,
unsigned int *  drvstr,
unsigned int *  enable 
)

◆ gpio_tlmm_config_set()

void gpio_tlmm_config_set ( gpio_t  gpio,
unsigned int  func,
unsigned int  pull,
unsigned int  drvstr,
unsigned int  enable 
)