drivers/video/fbdev/aty/mach64_gx.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/aty/mach64_gx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/aty/mach64_gx.c- Extension
.c- Size
- 20792 bytes
- Lines
- 909
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/fb.hasm/io.hvideo/mach64.hatyfb.h
Detected Declarations
function aty_dac_waste4function aty_StrobeClockfunction aty_st_514function aty_set_dac_514function aty_var_to_pll_514function aty_pll_514_to_varfunction aty_set_pll_514function aty_set_dac_ATI68860_Bfunction aty_set_dac_ATT21C498function aty_var_to_pll_18818function aty_pll_18818_to_varfunction aty_ICS2595_put1bitfunction aty_set_pll18818function aty_var_to_pll_1703function aty_pll_1703_to_varfunction aty_set_pll_1703function aty_var_to_pll_8398function aty_pll_8398_to_varfunction aty_set_pll_8398function aty_var_to_pll_408function aty_pll_408_to_varfunction aty_set_pll_408function aty_set_dac_unsupportedfunction dummy
Annotated Snippet
if (vclk_per <= RGB514_clocks[i].limit) {
pll->ibm514.m = RGB514_clocks[i].m;
pll->ibm514.n = RGB514_clocks[i].n;
return 0;
}
return -EINVAL;
}
static u32 aty_pll_514_to_var(const struct fb_info *info,
const union aty_pll *pll)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
u8 df, vco_div_count, ref_div_count;
df = pll->ibm514.m >> 6;
vco_div_count = pll->ibm514.m & 0x3f;
ref_div_count = pll->ibm514.n;
return ((par->ref_clk_per * ref_div_count) << (3 - df))/
(vco_div_count + 65);
}
static void aty_set_pll_514(const struct fb_info *info,
const union aty_pll *pll)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
aty_st_514(0x06, 0x02, par); /* DAC Operation */
aty_st_514(0x10, 0x01, par); /* PLL Control 1 */
aty_st_514(0x70, 0x01, par); /* Misc Control 1 */
aty_st_514(0x8f, 0x1f, par); /* PLL Ref. Divider Input */
aty_st_514(0x03, 0x00, par); /* Sync Control */
aty_st_514(0x05, 0x00, par); /* Power Management */
aty_st_514(0x20, pll->ibm514.m, par); /* F0 / M0 */
aty_st_514(0x21, pll->ibm514.n, par); /* F1 / N0 */
}
const struct aty_dac_ops aty_dac_ibm514 = {
.set_dac = aty_set_dac_514,
};
const struct aty_pll_ops aty_pll_ibm514 = {
.var_to_pll = aty_var_to_pll_514,
.pll_to_var = aty_pll_514_to_var,
.set_pll = aty_set_pll_514,
};
/*
* ATI 68860-B DAC
*/
static int aty_set_dac_ATI68860_B(const struct fb_info *info,
const union aty_pll *pll, u32 bpp,
u32 accel)
{
struct atyfb_par *par = (struct atyfb_par *) info->par;
u32 gModeReg, devSetupRegA, temp, mask;
gModeReg = 0;
devSetupRegA = 0;
switch (bpp) {
case 8:
gModeReg = 0x83;
devSetupRegA =
0x60 | 0x00 /*(info->mach64DAC8Bit ? 0x00 : 0x01) */ ;
break;
case 15:
gModeReg = 0xA0;
devSetupRegA = 0x60;
break;
case 16:
gModeReg = 0xA1;
devSetupRegA = 0x60;
break;
case 24:
gModeReg = 0xC0;
devSetupRegA = 0x60;
break;
case 32:
gModeReg = 0xE3;
devSetupRegA = 0x60;
break;
}
if (!accel) {
gModeReg = 0x80;
devSetupRegA = 0x61;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/fb.h`, `asm/io.h`, `video/mach64.h`, `atyfb.h`.
- Detected declarations: `function aty_dac_waste4`, `function aty_StrobeClock`, `function aty_st_514`, `function aty_set_dac_514`, `function aty_var_to_pll_514`, `function aty_pll_514_to_var`, `function aty_set_pll_514`, `function aty_set_dac_ATI68860_B`, `function aty_set_dac_ATT21C498`, `function aty_var_to_pll_18818`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
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.