coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lp_gpio.c File Reference
#include <stdint.h>
#include <arch/io.h>
#include <device/pci_ops.h>
#include <device/device.h>
#include <device/pci.h>
#include "pch.h"
#include "lp_gpio.h"
Include dependency graph for lp_gpio.c:

Go to the source code of this file.

Functions

static u16 get_gpio_base (void)
 
static int lp_gpio_to_pirq (int gpio)
 
void setup_pch_lp_gpios (const struct pch_lp_gpio_map map[])
 
int get_gpio (int gpio_num)
 
unsigned int get_gpios (const int *gpio_num_array)
 
void set_gpio (int gpio_num, int value)
 
int gpio_is_native (int gpio_num)
 

Function Documentation

◆ get_gpio()

int get_gpio ( int  gpio_num)

Definition at line 102 of file lp_gpio.c.

References get_gpio_base(), GPI_LEVEL, GPIO_CONFIG0, inl(), and MAX_GPIO_NUMBER.

Referenced by get_gpios().

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

◆ get_gpio_base()

static u16 get_gpio_base ( void  )
static

Definition at line 12 of file lp_gpio.c.

References GPIO_BASE, PCH_LPC_DEV, pci_read_config16(), and pcidev_on_root().

Referenced by get_gpio(), gpio_is_native(), set_gpio(), and setup_pch_lp_gpios().

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

◆ get_gpios()

unsigned int get_gpios ( const int *  gpio_num_array)

Definition at line 116 of file lp_gpio.c.

References get_gpio(), and pch_lp_gpio_map::gpio.

Here is the call graph for this function:

◆ gpio_is_native()

int gpio_is_native ( int  gpio_num)

Definition at line 145 of file lp_gpio.c.

References get_gpio_base(), GPIO_CONFIG0, and inl().

Here is the call graph for this function:

◆ lp_gpio_to_pirq()

static int lp_gpio_to_pirq ( int  gpio)
static

Definition at line 27 of file lp_gpio.c.

Referenced by setup_pch_lp_gpios().

Here is the caller graph for this function:

◆ set_gpio()

void set_gpio ( int  gpio_num,
int  value 
)

Definition at line 131 of file lp_gpio.c.

References pch_lp_gpio_map::conf0, get_gpio_base(), GPIO_CONFIG0, GPO_LEVEL_MASK, GPO_LEVEL_SHIFT, inl(), MAX_GPIO_NUMBER, outl(), and value.

Here is the call graph for this function:

◆ setup_pch_lp_gpios()

void setup_pch_lp_gpios ( const struct pch_lp_gpio_map  map[])