drivers/gpu/drm/ast/ast_dp501.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ast/ast_dp501.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/ast/ast_dp501.c- Extension
.c- Size
- 14607 bytes
- Lines
- 602
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/firmware.hlinux/module.hdrm/drm_atomic_state_helper.hdrm/drm_edid.hdrm/drm_modeset_helper_vtables.hdrm/drm_probe_helper.hast_drv.h
Detected Declarations
function ast_release_firmwarefunction ast_load_dp501_microcodefunction send_ackfunction send_nackfunction wait_ackfunction wait_nackfunction set_cmd_triggerfunction clear_cmd_triggerfunction wait_fw_readyfunction ast_write_cmdfunction ast_write_datafunction ast_read_datafunction clear_cmdfunction ast_set_dp501_video_outputfunction get_fw_basefunction ast_backup_fwfunction ast_launch_m68kfunction ast_dp501_is_connectedfunction ast_dp512_read_edid_blockfunction ast_init_dvofunction ast_init_analogfunction ast_init_3rdtxfunction ast_dp501_encoder_helper_atomic_enablefunction ast_dp501_encoder_helper_atomic_disablefunction ast_dp501_connector_helper_get_modesfunction ast_dp501_connector_helper_detect_ctxfunction ast_dp501_output_init
Annotated Snippet
if (wait_ack(ast)) {
clear_cmd_trigger(ast);
send_nack(ast);
return true;
}
} while (retry++ < 100);
}
clear_cmd_trigger(ast);
send_nack(ast);
return false;
}
static bool ast_write_data(struct ast_device *ast, u8 data)
{
if (wait_nack(ast)) {
send_nack(ast);
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x9a, 0x00, data);
send_ack(ast);
if (wait_ack(ast)) {
send_nack(ast);
return true;
}
}
send_nack(ast);
return false;
}
#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
static void ast_set_dp501_video_output(struct ast_device *ast, u8 mode)
{
ast_write_cmd(ast, 0x40);
ast_write_data(ast, mode);
msleep(10);
}
static u32 get_fw_base(struct ast_device *ast)
{
return ast_mindwm(ast, AST_REG_SCU104) & 0x7fffffff;
}
bool ast_backup_fw(struct ast_device *ast, u8 *addr, u32 size)
{
u32 i, data;
u32 boot_address;
if (ast->config_mode != ast_use_p2a)
return false;
data = ast_mindwm(ast, AST_REG_SCU100) & 0x01;
if (data) {
boot_address = get_fw_base(ast);
for (i = 0; i < size; i += 4)
*(u32 *)(addr + i) = ast_mindwm(ast, boot_address + i);
return true;
}
return false;
}
static bool ast_launch_m68k(struct ast_device *ast)
{
u32 i, data, len = 0;
u32 boot_address;
u8 *fw_addr = NULL;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/firmware.h`, `linux/module.h`, `drm/drm_atomic_state_helper.h`, `drm/drm_edid.h`, `drm/drm_modeset_helper_vtables.h`, `drm/drm_probe_helper.h`, `ast_drv.h`.
- Detected declarations: `function ast_release_firmware`, `function ast_load_dp501_microcode`, `function send_ack`, `function send_nack`, `function wait_ack`, `function wait_nack`, `function set_cmd_trigger`, `function clear_cmd_trigger`, `function wait_fw_ready`, `function ast_write_cmd`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.