coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <delay.h>
#include <device/i2c_simple.h>
#include <string.h>
#include "drivers/i2c/ww_ring/ww_ring_programs.h"
Go to the source code of this file.
Data Structures | |
struct | TiLp55231 |
Macros | |
#define | WW_RING_BASE_ADDR 0x32 |
#define | LP55231_ENGCTRL1_REG 0x00 |
#define | LP55231_ENGCTRL2_REG 0x01 |
#define | LP55231_D1_CRT_CTRL_REG 0x26 |
#define | LP55231_MISC_REG 0x36 |
#define | LP55231_VARIABLE_REG 0x3c |
#define | LP55231_RESET_REG 0x3d |
#define | LP55231_ENG1_PROG_START 0x4c |
#define | LP55231_PROG_PAGE_REG 0x4f |
#define | LP55231_PROG_BASE_REG 0x50 |
#define | LP55231_CRT_CTRL_DEFAULT 0xaf |
#define | LP55231_ENGCTRL1_CHIP_EN 0x40 |
#define | LP55231_ENGCTRL1_ALL_ENG_GO 0x2a |
#define | LP55231_ENGCTRL2_ALL_DISABLE 0 |
#define | LP55231_ENGCTRL2_ALL_LOAD 0x15 |
#define | LP55231_ENGCTRL2_ALL_RUN 0x2a |
#define | LP55231_MISC_AUTOINCR (1 << 6) |
#define | LP55231_MISC_PUMP_1X (1 << 3) |
#define | LP55231_MISC_INT_CLK (3 << 0) |
#define | LP55231_VARIABLE_COOKIE 0xb4 |
#define | LP55231_RESET_VALUE 0xff |
#define | LP55231_PROG_PAGE_SIZE 32 |
#define | LP55231_PROG_PAGES 6 |
#define | LP55231_MAX_PROG_SIZE (LP55231_PROG_PAGE_SIZE * LP55231_PROG_PAGES) |
#define | LP55231_I2C_BASE_ADDR 0x32 |
Functions | |
static void | ww_ring_init (unsigned int i2c_bus) |
static int | ledc_transfer (TiLp55231 *ledc, struct i2c_msg *segs, int seg_count, int reset) |
static int | ledc_write (TiLp55231 *ledc, uint8_t start_addr, const uint8_t *data, unsigned int count) |
static int | ledc_read (TiLp55231 *ledc, uint8_t addr, uint8_t *data) |
static int | ledc_reset (TiLp55231 *ledc) |
static void | ledc_write_program (TiLp55231 *ledc, uint8_t load_addr, const uint8_t *program, unsigned int count) |
static void | ledc_write_engctrl2 (TiLp55231 *ledc, uint8_t value) |
static void | ledc_run_program (TiLp55231 *ledc, const TiLp55231Program *program_desc) |
static int | ledc_init_validate (TiLp55231 *ledc) |
int | ww_ring_display_pattern (unsigned int i2c_bus, enum display_pattern pattern) |
Variables | |
static TiLp55231 | lp55231s [WW_RING_NUM_LED_CONTROLLERS] |
#define LP55231_MAX_PROG_SIZE (LP55231_PROG_PAGE_SIZE * LP55231_PROG_PAGES) |
|
static |
Definition at line 278 of file ww_ring.c.
References BIOS_WARNING, ledc_read(), ledc_reset(), ledc_write(), LP55231_CRT_CTRL_DEFAULT, LP55231_D1_CRT_CTRL_REG, LP55231_ENGCTRL1_CHIP_EN, LP55231_ENGCTRL1_REG, LP55231_MISC_AUTOINCR, LP55231_MISC_INT_CLK, LP55231_MISC_PUMP_1X, LP55231_MISC_REG, LP55231_VARIABLE_COOKIE, LP55231_VARIABLE_REG, and printk.
Referenced by ww_ring_init().
Definition at line 156 of file ww_ring.c.
References addr, ARRAY_SIZE, i2c_msg::buf, TiLp55231::dev_addr, i2c_msg::flags, I2C_M_RD, ledc_transfer(), i2c_msg::len, LP55231_RESET_REG, and i2c_msg::slave.
Referenced by ledc_init_validate(), and ledc_reset().
|
static |
Definition at line 181 of file ww_ring.c.
References BIOS_WARNING, TiLp55231::dev_addr, ledc_read(), ledc_write(), LP55231_RESET_REG, LP55231_RESET_VALUE, and printk.
Referenced by ledc_init_validate().
|
static |
Definition at line 248 of file ww_ring.c.
References TiLp55231Program::engine_start_addr, ledc_write(), ledc_write_engctrl2(), ledc_write_program(), TiLp55231Program::load_addr, LP55231_ENG1_PROG_START, LP55231_ENGCTRL1_ALL_ENG_GO, LP55231_ENGCTRL1_CHIP_EN, LP55231_ENGCTRL1_REG, LP55231_ENGCTRL2_ALL_DISABLE, LP55231_ENGCTRL2_ALL_LOAD, LP55231_ENGCTRL2_ALL_RUN, TiLp55231Program::program_size, and TiLp55231Program::program_text.
Referenced by ww_ring_display_pattern().
|
static |
Definition at line 103 of file ww_ring.c.
References BIOS_WARNING, i2c_msg::buf, TiLp55231::i2c_bus, i2c_transfer(), printk, reset(), and i2c_msg::slave.
Referenced by ledc_read(), and ledc_write().
|
static |
Definition at line 133 of file ww_ring.c.
References BIOS_WARNING, i2c_msg::buf, count, TiLp55231::data_buffer, TiLp55231::dev_addr, i2c_msg::flags, ledc_transfer(), i2c_msg::len, LP55231_RESET_REG, memcpy(), printk, and i2c_msg::slave.
Referenced by ledc_init_validate(), ledc_reset(), ledc_run_program(), ledc_write_engctrl2(), and ledc_write_program().
Definition at line 241 of file ww_ring.c.
References ledc_write(), LP55231_ENGCTRL2_REG, udelay(), and value.
Referenced by ledc_run_program(), and ww_ring_display_pattern().
|
static |
Definition at line 211 of file ww_ring.c.
References BIOS_WARNING, count, ledc_write(), LP55231_MAX_PROG_SIZE, LP55231_PROG_BASE_REG, LP55231_PROG_PAGE_REG, LP55231_PROG_PAGE_SIZE, and printk.
Referenced by ledc_run_program().
int ww_ring_display_pattern | ( | unsigned int | i2c_bus, |
enum display_pattern | pattern | ||
) |
Definition at line 326 of file ww_ring.c.
References BIOS_WARNING, WwRingStateProg::led_pattern, ledc_run_program(), ledc_write_engctrl2(), LP55231_ENGCTRL2_ALL_DISABLE, lp55231s, pattern, printk, WwRingStateProg::programs, ww_ring_init(), WW_RING_NUM_LED_CONTROLLERS, and wwr_state_programs.
Referenced by display_pattern().
Definition at line 370 of file ww_ring.c.
References BIOS_INFO, BIOS_WARNING, count, TiLp55231::dev_addr, TiLp55231::i2c_bus, i2c_bus, ledc_init_validate(), LP55231_I2C_BASE_ADDR, lp55231s, printk, and WW_RING_NUM_LED_CONTROLLERS.
Referenced by ww_ring_display_pattern().
|
static |
Definition at line 88 of file ww_ring.c.
Referenced by ww_ring_display_pattern(), and ww_ring_init().