#ifndef __HW_H__
#define __HW_H__
#include <linux/seq_file.h>
#include "viamode.h"
#include "global.h"
#include "via_modesetting.h"
#define viafb_read_reg(p, i) …
#define viafb_write_reg(i, p, d) …
#define viafb_write_reg_mask(i, p, d, m) …
#define VIA_LDVP0 …
#define VIA_LDVP1 …
#define VIA_DVP0 …
#define VIA_CRT …
#define VIA_DVP1 …
#define VIA_LVDS1 …
#define VIA_LVDS2 …
#define VIA_STATE_ON …
#define VIA_STATE_STANDBY …
#define VIA_STATE_SUSPEND …
#define VIA_STATE_OFF …
#define VIA_HSYNC_NEGATIVE …
#define VIA_VSYNC_NEGATIVE …
#define IGA2_HOR_TOTAL_SHADOW_FORMULA(x) …
#define IGA2_HOR_BLANK_END_SHADOW_FORMULA(x, y) …
#define IGA2_VER_TOTAL_SHADOW_FORMULA(x) …
#define IGA2_VER_ADDR_SHADOW_FORMULA(x) …
#define IGA2_VER_BLANK_START_SHADOW_FORMULA(x) …
#define IGA2_VER_BLANK_END_SHADOW_FORMULA(x, y) …
#define IGA2_VER_SYNC_START_SHADOW_FORMULA(x) …
#define IGA2_VER_SYNC_END_SHADOW_FORMULA(x, y) …
#define IGA2_SHADOW_HOR_TOTAL_REG_NUM …
#define IGA2_SHADOW_HOR_BLANK_END_REG_NUM …
#define IGA2_SHADOW_VER_TOTAL_REG_NUM …
#define IGA2_SHADOW_VER_ADDR_REG_NUM …
#define IGA2_SHADOW_VER_BLANK_START_REG_NUM …
#define IGA2_SHADOW_VER_BLANK_END_REG_NUM …
#define IGA2_SHADOW_VER_SYNC_START_REG_NUM …
#define IGA2_SHADOW_VER_SYNC_END_REG_NUM …
#define IGA1_FETCH_COUNT_REG_NUM …
#define IGA1_FETCH_COUNT_ALIGN_BYTE …
#define IGA1_FETCH_COUNT_PATCH_VALUE …
#define IGA1_FETCH_COUNT_FORMULA(x, y) …
#define IGA2_FETCH_COUNT_REG_NUM …
#define IGA2_FETCH_COUNT_ALIGN_BYTE …
#define IGA2_FETCH_COUNT_PATCH_VALUE …
#define IGA2_FETCH_COUNT_FORMULA(x, y) …
#define IGA1_STARTING_ADDR_REG_NUM …
#define IGA2_STARTING_ADDR_REG_NUM …
#define K800_IGA1_FIFO_MAX_DEPTH …
#define K800_IGA1_FIFO_THRESHOLD …
#define K800_IGA1_FIFO_HIGH_THRESHOLD …
#define K800_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define K800_IGA2_FIFO_MAX_DEPTH …
#define K800_IGA2_FIFO_THRESHOLD …
#define K800_IGA2_FIFO_HIGH_THRESHOLD …
#define K800_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define P880_IGA1_FIFO_MAX_DEPTH …
#define P880_IGA1_FIFO_THRESHOLD …
#define P880_IGA1_FIFO_HIGH_THRESHOLD …
#define P880_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define P880_IGA2_FIFO_MAX_DEPTH …
#define P880_IGA2_FIFO_THRESHOLD …
#define P880_IGA2_FIFO_HIGH_THRESHOLD …
#define P880_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define CN700_IGA1_FIFO_MAX_DEPTH …
#define CN700_IGA1_FIFO_THRESHOLD …
#define CN700_IGA1_FIFO_HIGH_THRESHOLD …
#define CN700_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define CN700_IGA2_FIFO_MAX_DEPTH …
#define CN700_IGA2_FIFO_THRESHOLD …
#define CN700_IGA2_FIFO_HIGH_THRESHOLD …
#define CN700_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define CX700_IGA1_FIFO_MAX_DEPTH …
#define CX700_IGA1_FIFO_THRESHOLD …
#define CX700_IGA1_FIFO_HIGH_THRESHOLD …
#define CX700_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define CX700_IGA2_FIFO_MAX_DEPTH …
#define CX700_IGA2_FIFO_THRESHOLD …
#define CX700_IGA2_FIFO_HIGH_THRESHOLD …
#define CX700_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define K8M890_IGA1_FIFO_MAX_DEPTH …
#define K8M890_IGA1_FIFO_THRESHOLD …
#define K8M890_IGA1_FIFO_HIGH_THRESHOLD …
#define K8M890_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define K8M890_IGA2_FIFO_MAX_DEPTH …
#define K8M890_IGA2_FIFO_THRESHOLD …
#define K8M890_IGA2_FIFO_HIGH_THRESHOLD …
#define K8M890_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define P4M890_IGA1_FIFO_MAX_DEPTH …
#define P4M890_IGA1_FIFO_THRESHOLD …
#define P4M890_IGA1_FIFO_HIGH_THRESHOLD …
#define P4M890_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define P4M890_IGA2_FIFO_MAX_DEPTH …
#define P4M890_IGA2_FIFO_THRESHOLD …
#define P4M890_IGA2_FIFO_HIGH_THRESHOLD …
#define P4M890_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define P4M900_IGA1_FIFO_MAX_DEPTH …
#define P4M900_IGA1_FIFO_THRESHOLD …
#define P4M900_IGA1_FIFO_HIGH_THRESHOLD …
#define P4M900_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define P4M900_IGA2_FIFO_MAX_DEPTH …
#define P4M900_IGA2_FIFO_THRESHOLD …
#define P4M900_IGA2_FIFO_HIGH_THRESHOLD …
#define P4M900_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX800_IGA1_FIFO_MAX_DEPTH …
#define VX800_IGA1_FIFO_THRESHOLD …
#define VX800_IGA1_FIFO_HIGH_THRESHOLD …
#define VX800_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX800_IGA2_FIFO_MAX_DEPTH …
#define VX800_IGA2_FIFO_THRESHOLD …
#define VX800_IGA2_FIFO_HIGH_THRESHOLD …
#define VX800_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX855_IGA1_FIFO_MAX_DEPTH …
#define VX855_IGA1_FIFO_THRESHOLD …
#define VX855_IGA1_FIFO_HIGH_THRESHOLD …
#define VX855_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX855_IGA2_FIFO_MAX_DEPTH …
#define VX855_IGA2_FIFO_THRESHOLD …
#define VX855_IGA2_FIFO_HIGH_THRESHOLD …
#define VX855_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX900_IGA1_FIFO_MAX_DEPTH …
#define VX900_IGA1_FIFO_THRESHOLD …
#define VX900_IGA1_FIFO_HIGH_THRESHOLD …
#define VX900_IGA1_DISPLAY_QUEUE_EXPIRE_NUM …
#define VX900_IGA2_FIFO_MAX_DEPTH …
#define VX900_IGA2_FIFO_THRESHOLD …
#define VX900_IGA2_FIFO_HIGH_THRESHOLD …
#define VX900_IGA2_DISPLAY_QUEUE_EXPIRE_NUM …
#define IGA1_FIFO_DEPTH_SELECT_REG_NUM …
#define IGA1_FIFO_THRESHOLD_REG_NUM …
#define IGA1_FIFO_HIGH_THRESHOLD_REG_NUM …
#define IGA1_DISPLAY_QUEUE_EXPIRE_NUM_REG_NUM …
#define IGA2_FIFO_DEPTH_SELECT_REG_NUM …
#define IGA2_FIFO_THRESHOLD_REG_NUM …
#define IGA2_FIFO_HIGH_THRESHOLD_REG_NUM …
#define IGA2_DISPLAY_QUEUE_EXPIRE_NUM_REG_NUM …
#define IGA1_FIFO_DEPTH_SELECT_FORMULA(x) …
#define IGA1_FIFO_THRESHOLD_FORMULA(x) …
#define IGA1_DISPLAY_QUEUE_EXPIRE_NUM_FORMULA(x) …
#define IGA1_FIFO_HIGH_THRESHOLD_FORMULA(x) …
#define IGA2_FIFO_DEPTH_SELECT_FORMULA(x) …
#define IGA2_FIFO_THRESHOLD_FORMULA(x) …
#define IGA2_DISPLAY_QUEUE_EXPIRE_NUM_FORMULA(x) …
#define IGA2_FIFO_HIGH_THRESHOLD_FORMULA(x) …
#define LCD_POWER_SEQ_TD0 …
#define LCD_POWER_SEQ_TD1 …
#define LCD_POWER_SEQ_TD2 …
#define LCD_POWER_SEQ_TD3 …
#define CLE266_POWER_SEQ_UNIT …
#define K800_POWER_SEQ_UNIT …
#define P880_POWER_SEQ_UNIT …
#define CLE266_POWER_SEQ_FORMULA(x) …
#define K800_POWER_SEQ_FORMULA(x) …
#define P880_POWER_SEQ_FORMULA(x) …
#define LCD_POWER_SEQ_TD0_REG_NUM …
#define LCD_POWER_SEQ_TD1_REG_NUM …
#define LCD_POWER_SEQ_TD2_REG_NUM …
#define LCD_POWER_SEQ_TD3_REG_NUM …
#define CLE266_LCD_HOR_SCF_FORMULA(x, y) …
#define CLE266_LCD_VER_SCF_FORMULA(x, y) …
#define K800_LCD_HOR_SCF_FORMULA(x, y) …
#define K800_LCD_VER_SCF_FORMULA(x, y) …
#define LCD_HOR_SCALING_FACTOR_REG_NUM …
#define LCD_VER_SCALING_FACTOR_REG_NUM …
#define LCD_HOR_SCALING_FACTOR_REG_NUM_CLE …
#define LCD_VER_SCALING_FACTOR_REG_NUM_CLE …
struct io_register { … };
struct iga2_shadow_hor_total { … };
struct iga2_shadow_hor_blank_end { … };
struct iga2_shadow_ver_total { … };
struct iga2_shadow_ver_addr { … };
struct iga2_shadow_ver_blank_start { … };
struct iga2_shadow_ver_blank_end { … };
struct iga2_shadow_ver_sync_start { … };
struct iga2_shadow_ver_sync_end { … };
struct iga1_fetch_count { … };
struct iga2_fetch_count { … };
struct fetch_count { … };
struct iga1_starting_addr { … };
struct iga2_starting_addr { … };
struct starting_addr { … };
struct lcd_pwd_seq_td0 { … };
struct lcd_pwd_seq_td1 { … };
struct lcd_pwd_seq_td2 { … };
struct lcd_pwd_seq_td3 { … };
struct _lcd_pwd_seq_timer { … };
struct _lcd_hor_scaling_factor { … };
struct _lcd_ver_scaling_factor { … };
struct _lcd_scaling_factor { … };
struct pll_limit { … };
struct rgbLUT { … };
struct lcd_pwd_seq_timer { … };
struct iga1_fifo_depth_select { … };
struct iga1_fifo_threshold_select { … };
struct iga1_fifo_high_threshold_select { … };
struct iga1_display_queue_expire_num { … };
struct iga2_fifo_depth_select { … };
struct iga2_fifo_threshold_select { … };
struct iga2_fifo_high_threshold_select { … };
struct iga2_display_queue_expire_num { … };
struct fifo_depth_select { … };
struct fifo_threshold_select { … };
struct fifo_high_threshold_select { … };
struct display_queue_expire_num { … };
struct iga2_shadow_crtc_timing { … };
#define CLE266_FUNCTION3 …
#define KM400_FUNCTION3 …
#define CN400_FUNCTION2 …
#define CN400_FUNCTION3 …
#define CN700_FUNCTION2 …
#define CN700_FUNCTION3 …
#define CX700_FUNCTION2 …
#define CX700_FUNCTION3 …
#define KM800_FUNCTION3 …
#define KM890_FUNCTION3 …
#define P4M890_FUNCTION3 …
#define CN750_FUNCTION3 …
#define P4M900_FUNCTION3 …
#define VX800_FUNCTION3 …
#define VX855_FUNCTION3 …
#define VX900_FUNCTION3 …
struct IODATA { … };
struct pci_device_id_info { … };
struct via_device_mapping { … };
extern int viafb_SAMM_ON;
extern int viafb_dual_fb;
extern int viafb_LCD2_ON;
extern int viafb_LCD_ON;
extern int viafb_DVI_ON;
extern int viafb_hotplug;
struct via_display_timing var_to_timing(const struct fb_var_screeninfo *var,
u16 cxres, u16 cyres);
void viafb_fill_crtc_timing(const struct fb_var_screeninfo *var,
u16 cxres, u16 cyres, int iga);
void viafb_set_vclock(u32 CLK, int set_iga);
void viafb_load_reg(int timing_value, int viafb_load_reg_num,
struct io_register *reg,
int io_type);
void via_set_source(u32 devices, u8 iga);
void via_set_state(u32 devices, u8 state);
void via_set_sync_polarity(u32 devices, u8 polarity);
u32 via_parse_odev(char *input, char **end);
void via_odev_to_seq(struct seq_file *m, u32 odev);
void init_ad9389(void);
void viafb_lock_crt(void);
void viafb_unlock_crt(void);
void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga);
void viafb_write_regx(struct io_reg RegTable[], int ItemNum);
void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active);
void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
*p_gfx_dpa_setting);
int viafb_setmode(void);
void viafb_fill_var_timing_info(struct fb_var_screeninfo *var,
const struct fb_videomode *mode);
void viafb_init_chip_info(int chip_type);
void viafb_init_dac(int set_iga);
int viafb_get_refresh(int hres, int vres, u32 float_refresh);
void viafb_update_device_setting(int hres, int vres, int bpp, int flag);
void viafb_set_iga_path(void);
void viafb_set_primary_color_register(u8 index, u8 red, u8 green, u8 blue);
void viafb_set_secondary_color_register(u8 index, u8 red, u8 green, u8 blue);
void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len);
#endif