coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
software_i2c.c File Reference
#include <device/i2c_simple.h>
#include <gpio.h>
#include <soc/pinmux.h>
#include "i2c.h"
Include dependency graph for software_i2c.c:

Go to the source code of this file.

Functions

static void tegra_set_sda (unsigned int bus, int high)
 
static void tegra_set_scl (unsigned int bus, int high)
 
static int tegra_get_sda (unsigned int bus)
 
static int tegra_get_scl (unsigned int bus)
 
void tegra_software_i2c_init (unsigned int bus)
 
void tegra_software_i2c_disable (unsigned int bus)
 

Variables

struct {
   int   pinmux_func
 
   gpio_t   sda
 
   gpio_t   scl
 
pins []
 
static struct software_i2c_ops tegra_ops
 

Function Documentation

◆ tegra_get_scl()

static int tegra_get_scl ( unsigned int  bus)
static

Definition at line 47 of file software_i2c.c.

References gpio_get(), pins, and scl.

Here is the call graph for this function:

◆ tegra_get_sda()

static int tegra_get_sda ( unsigned int  bus)
static

Definition at line 42 of file software_i2c.c.

References gpio_get(), pins, and sda.

Here is the call graph for this function:

◆ tegra_set_scl()

static void tegra_set_scl ( unsigned int  bus,
int  high 
)
static

Definition at line 34 of file software_i2c.c.

References gpio_input_pullup(), gpio_output(), pins, and scl.

Referenced by tegra_software_i2c_init().

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

◆ tegra_set_sda()

static void tegra_set_sda ( unsigned int  bus,
int  high 
)
static

Definition at line 26 of file software_i2c.c.

References gpio_input_pullup(), gpio_output(), pins, and sda.

Referenced by tegra_software_i2c_init().

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

◆ tegra_software_i2c_disable()

void tegra_software_i2c_disable ( unsigned int  bus)

Definition at line 68 of file software_i2c.c.

References GPIO_MODE_SPIO, GPIO_PINMUX_SHIFT, gpio_set_mode(), NULL, pinmux_func, PINMUX_INPUT_ENABLE, pinmux_set_config(), pins, scl, sda, and software_i2c.

Here is the call graph for this function:

◆ tegra_software_i2c_init()

void tegra_software_i2c_init ( unsigned int  bus)

Definition at line 59 of file software_i2c.c.

References software_i2c, tegra_ops, tegra_set_scl(), and tegra_set_sda().

Here is the call graph for this function:

Variable Documentation

◆ pinmux_func

int pinmux_func

Definition at line 10 of file software_i2c.c.

Referenced by tegra_software_i2c_disable().

◆ 

struct { ... } pins[]
Initial value:
= {
[0]{.pinmux_func = PINMUX_GEN1_I2C_SCL_FUNC_I2C1,
.sda = GPIO(C5), .scl = GPIO(C4)},
[1]{.pinmux_func = PINMUX_GEN2_I2C_SCL_FUNC_I2C2,
.sda = GPIO(T6), .scl = GPIO(T5)},
[2]{.pinmux_func = PINMUX_CAM_I2C_SCL_FUNC_I2C3,
.sda = GPIO(BB2), .scl = GPIO(BB1)},
[3]{.pinmux_func = PINMUX_DDC_SCL_FUNC_I2C4,
.sda = GPIO(V5), .scl = GPIO(V4)},
[4]{.pinmux_func = PINMUX_PWR_I2C_SCL_FUNC_I2CPMU,
.sda = GPIO(Z7), .scl = GPIO(Z6)},
}
@ GPIO
Definition: chip.h:84
#define C4
Definition: jpeg.c:633

Referenced by board_id(), get_board_id(), mtk_pcie_set_pinmux(), panel_id(), ram_code(), sku_id(), tegra_get_scl(), tegra_get_sda(), tegra_set_scl(), tegra_set_sda(), and tegra_software_i2c_disable().

◆ scl

◆ sda

◆ tegra_ops

struct software_i2c_ops tegra_ops
static
Initial value:
= {
.set_sda = tegra_set_sda,
.set_scl = tegra_set_scl,
.get_sda = tegra_get_sda,
.get_scl = tegra_get_scl,
}
static void tegra_set_sda(unsigned int bus, int high)
Definition: software_i2c.c:26
static int tegra_get_sda(unsigned int bus)
Definition: software_i2c.c:42
static int tegra_get_scl(unsigned int bus)
Definition: software_i2c.c:47
static void tegra_set_scl(unsigned int bus, int high)
Definition: software_i2c.c:34

Definition at line 47 of file software_i2c.c.

Referenced by tegra_software_i2c_init().