#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include "ast_drv.h"
MODULE_FIRMWARE(…) …;
static void ast_release_firmware(void *data)
{ … }
static int ast_load_dp501_microcode(struct drm_device *dev)
{ … }
static void send_ack(struct ast_device *ast)
{ … }
static void send_nack(struct ast_device *ast)
{ … }
static bool wait_ack(struct ast_device *ast)
{ … }
static bool wait_nack(struct ast_device *ast)
{ … }
static void set_cmd_trigger(struct ast_device *ast)
{ … }
static void clear_cmd_trigger(struct ast_device *ast)
{ … }
#if 0
static bool wait_fw_ready(struct ast_device *ast)
{
u8 waitready;
u32 retry = 0;
do {
waitready = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd2, 0xff);
waitready &= 0x40;
udelay(100);
} while ((!waitready) && (retry++ < 1000));
if (retry < 1000)
return true;
else
return false;
}
#endif
static bool ast_write_cmd(struct drm_device *dev, u8 data)
{ … }
static bool ast_write_data(struct drm_device *dev, u8 data)
{ … }
#if 0
static bool ast_read_data(struct drm_device *dev, u8 *data)
{
struct ast_device *ast = to_ast_device(dev);
u8 tmp;
*data = 0;
if (wait_ack(ast) == false)
return false;
tmp = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd3, 0xff);
*data = tmp;
if (wait_nack(ast) == false) {
send_nack(ast);
return false;
}
send_nack(ast);
return true;
}
static void clear_cmd(struct ast_device *ast)
{
send_nack(ast);
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x9a, 0x00, 0x00);
}
#endif
void ast_set_dp501_video_output(struct drm_device *dev, u8 mode)
{ … }
static u32 get_fw_base(struct ast_device *ast)
{ … }
bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)
{ … }
static bool ast_launch_m68k(struct drm_device *dev)
{ … }
bool ast_dp501_is_connected(struct ast_device *ast)
{ … }
bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)
{ … }
static bool ast_init_dvo(struct drm_device *dev)
{ … }
static void ast_init_analog(struct drm_device *dev)
{ … }
void ast_init_3rdtx(struct drm_device *dev)
{ … }