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

Go to the source code of this file.

Data Structures

struct  rockchip_gpio_regs
 
union  gpio_t
 

Macros

#define GPIO(p, b, i)   ((gpio_t){.port = p, .bank = GPIO_##b, .idx = i})
 

Enumerations

enum  { GPIO_A = 0 , GPIO_B , GPIO_C , GPIO_D }
 
enum  gpio_pull {
  GPIO_NO_PULL , GPIO_PULL_DOWN , GPIO_KEEPER , GPIO_PULL_UP ,
  GPIO_PULLNONE = 0 , GPIO_PULLUP = 1 , GPIO_PULLDOWN = 2
}
 
enum  gpio_dir { GPIO_INPUT = 0 , GPIO_OUTPUT = 1 }
 
enum  gpio_irq_type {
  IRQ_TYPE_EDGE_RISING , IRQ_TYPE_EDGE_FALLING , IRQ_TYPE_LEVEL_HIGH , IRQ_TYPE_LEVEL_LOW ,
  IRQ_TYPE_LEVEL , IRQ_TYPE_RISING_EDGE , IRQ_TYPE_FALLING_EDGE , IRQ_TYPE_DUAL_EDGE ,
  IRQ_TYPE_LEVEL = 0 , IRQ_TYPE_RISING_EDGE = 1 , IRQ_TYPE_FALLING_EDGE = 2 , IRQ_TYPE_DUAL_EDGE = 3 ,
  IRQ_TYPE_EDGE_RISING = 0 , IRQ_TYPE_EDGE_FALLING , IRQ_TYPE_LEVEL_HIGH , IRQ_TYPE_LEVEL_LOW
}
 

Functions

 check_member (rockchip_gpio_regs, ls_sync, 0x60)
 
int is_pmu_gpio (gpio_t gpio)
 
voidgpio_grf_reg (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)
 
u32 gpio_get_pull_val (gpio_t gpio, enum gpio_pull pull)
 

Variables

struct rockchip_gpio_regsgpio_port []
 

Macro Definition Documentation

◆ GPIO

#define GPIO (   p,
  b,
 
)    ((gpio_t){.port = p, .bank = GPIO_##b, .idx = i})

Definition at line 8 of file gpio.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GPIO_A 
GPIO_B 
GPIO_C 
GPIO_D 

Definition at line 46 of file gpio.h.

◆ gpio_dir

enum gpio_dir
Enumerator
GPIO_INPUT 
GPIO_OUTPUT 

Definition at line 67 of file gpio.h.

◆ gpio_irq_type

Enumerator
IRQ_TYPE_EDGE_RISING 
IRQ_TYPE_EDGE_FALLING 
IRQ_TYPE_LEVEL_HIGH 
IRQ_TYPE_LEVEL_LOW 
IRQ_TYPE_LEVEL 
IRQ_TYPE_RISING_EDGE 
IRQ_TYPE_FALLING_EDGE 
IRQ_TYPE_DUAL_EDGE 
IRQ_TYPE_LEVEL 
IRQ_TYPE_RISING_EDGE 
IRQ_TYPE_FALLING_EDGE 
IRQ_TYPE_DUAL_EDGE 
IRQ_TYPE_EDGE_RISING 
IRQ_TYPE_EDGE_FALLING 
IRQ_TYPE_LEVEL_HIGH 
IRQ_TYPE_LEVEL_LOW 

Definition at line 72 of file gpio.h.

◆ gpio_pull

enum gpio_pull
Enumerator
GPIO_NO_PULL 
GPIO_PULL_DOWN 
GPIO_KEEPER 
GPIO_PULL_UP 
GPIO_PULLNONE 
GPIO_PULLUP 
GPIO_PULLDOWN 

Definition at line 61 of file gpio.h.

Function Documentation

◆ check_member()

check_member ( rockchip_gpio_regs  ,
ls_sync  ,
0x60   
)

◆ gpio_get_pull_val()

u32 gpio_get_pull_val ( gpio_t  gpio,
enum gpio_pull  pull 
)

Definition at line 39 of file gpio.c.

References GPIO_PULLDOWN, GPIO_PULLNONE, GPIO_PULLUP, IS_GPIO_BANK, pull, PULLDOWN_1V8, PULLNONE_1V8, and PULLUP_1V8.

Referenced by gpio_set_pull().

Here is the caller graph for this function:

◆ gpio_grf_reg()

void* gpio_grf_reg ( gpio_t  gpio)

Definition at line 31 of file gpio.c.

References rk3399_pmugrf_regs::gpio0_p, rk3288_pmu_regs::gpio0pull, rk3288_grf_regs::gpio1_p, rk3399_grf_regs::gpio2_p, is_pmu_gpio(), rk3288_grf, rk3288_pmu, rk3399_grf, and rk3399_pmugrf.

Referenced by gpio_set_pull().

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

◆ gpio_input_irq()

◆ gpio_irq_status()

◆ is_pmu_gpio()

int is_pmu_gpio ( gpio_t  gpio)

Definition at line 24 of file gpio.c.

References PMU_GPIO_PORT, PMU_GPIO_PORT0, and PMU_GPIO_PORT1.

Referenced by gpio_grf_reg(), and gpio_set_pull().

Here is the caller graph for this function:

Variable Documentation

◆ gpio_port

struct rockchip_gpio_regs* gpio_port[]
extern

Definition at line 10 of file gpio.c.

Referenced by gpio_get(), gpio_input_irq(), gpio_irq_status(), gpio_set(), and gpio_set_dir().