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

Go to the source code of this file.

Macros

#define _GET_INDEX_REG(x)   ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, (x))
 
#define ASPEED_BUS   0
 

Functions

static int get_clock (unsigned int bus)
 
static int get_data (unsigned int bus)
 
static void set_clock (unsigned int bus, int clock)
 
static void set_data (unsigned int bus, int data)
 
int ast_software_i2c_read (struct ast_private *ast_priv, uint8_t edid[128])
 

Variables

static struct ast_privateast
 
static struct software_i2c_ops ast_ops
 

Macro Definition Documentation

◆ _GET_INDEX_REG

#define _GET_INDEX_REG (   x)    ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb7, (x))

Definition at line 12 of file ast_i2c.c.

◆ ASPEED_BUS

#define ASPEED_BUS   0

Definition at line 13 of file ast_i2c.c.

Function Documentation

◆ ast_software_i2c_read()

int ast_software_i2c_read ( struct ast_private ast_priv,
uint8_t  edid[128] 
)

Definition at line 90 of file ast_i2c.c.

References ASPEED_BUS, ast, ast_ops, i2c_read_bytes(), set_clock(), set_data(), software_i2c, and udelay().

Referenced by ast_select_mode().

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

◆ get_clock()

static int get_clock ( unsigned int  bus)
static

Definition at line 15 of file ast_i2c.c.

References _GET_INDEX_REG, count, and val.

◆ get_data()

static int get_data ( unsigned int  bus)
static

Definition at line 35 of file ast_i2c.c.

References _GET_INDEX_REG, count, and val.

◆ set_clock()

static void set_clock ( unsigned int  bus,
int  clock 
)
static

Definition at line 55 of file ast_i2c.c.

References ast, ast_get_index_reg_mask(), AST_IO_CRTC_PORT, and ast_set_index_reg_mask().

Referenced by ast_software_i2c_read().

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

◆ set_data()

static void set_data ( unsigned int  bus,
int  data 
)
static

Definition at line 69 of file ast_i2c.c.

Referenced by ast_software_i2c_read().

Here is the caller graph for this function:

Variable Documentation

◆ ast

struct ast_private* ast
static

Definition at line 10 of file ast_i2c.c.

Referenced by ast_backup_fw(), ast_crtc_do_set_base(), ast_crtc_load_lut(), ast_crtc_mode_set(), ast_detect_chip(), ast_detect_config_mode(), ast_dp501_read_edid(), ast_dram_init_2500(), ast_driver_load(), ast_enable_mmio(), ast_enable_vga(), ast_get_dp501_max_clk(), ast_get_dram_info(), ast_get_index_reg(), ast_get_index_reg_mask(), ast_get_vbios_mode_info(), ast_get_vram_info(), ast_hide_cursor(), ast_init_3rdtx(), ast_init_analog(), ast_init_dram_reg(), ast_init_dvo(), ast_is_vga_enabled(), ast_launch_m68k(), ast_load_palette_index(), ast_mindwm(), ast_moutdwm(), ast_open_key(), ast_post_chip_2300(), ast_post_chip_2500(), ast_post_gpu(), ast_select_mode(), ast_set_crtc_reg(), ast_set_dclk_reg(), ast_set_def_ext_reg(), ast_set_ext_reg(), ast_set_index_reg(), ast_set_index_reg_mask(), ast_set_offset_reg(), ast_set_start_address_crt1(), ast_set_std_reg(), ast_set_sync_reg(), ast_software_i2c_read(), ast_write_cmd(), ast_write_data(), cbr_dll2(), cbr_scan(), cbr_scan2(), cbr_scan3(), cbr_test(), cbr_test2(), cbr_test3(), cbr_test_2500(), cbrdlli_ast2150(), cbrscan_ast2150(), cbrtest_ast2150(), check_dram_size_2500(), clear_cmd_trigger(), ddr2_init(), ddr3_init(), ddr3_init_2500(), ddr4_init_2500(), ddr_init_common_2500(), ddr_phy_init_2500(), ddr_test_2500(), enable_cache_2500(), finetuneDQI_L(), finetuneDQSI(), get_ddr2_info(), get_ddr3_info(), get_fw_base(), mmc_test(), mmc_test2(), mmc_test_burst(), mmc_test_burst2(), mmc_test_single(), mmc_test_single2(), mmc_test_single_2500(), mmctestburst2_ast2150(), reset_mmc_2500(), send_ack(), send_nack(), set_clock(), set_cmd_trigger(), set_mpll_2500(), wait_ack(), and wait_nack().

◆ ast_ops

struct software_i2c_ops ast_ops
static
Initial value:
= {
.set_sda = set_data,
.set_scl = set_clock,
.get_sda = get_data,
.get_scl = get_clock,
}
static int get_data(unsigned int bus)
Definition: ast_i2c.c:35
static void set_data(unsigned int bus, int data)
Definition: ast_i2c.c:69
static int get_clock(unsigned int bus)
Definition: ast_i2c.c:15
static void set_clock(unsigned int bus, int clock)
Definition: ast_i2c.c:55

Definition at line 69 of file ast_i2c.c.

Referenced by ast_software_i2c_read().