Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ast: Move display-clock tables to per-Gen source files

Move display-clock tables to the appropriate per-Gen source files.
The tables are almost identical, except for mode entries 0x17 and
0x1a. Rename to tables to match common style.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-2-tzimmermann@suse.de

+72 -62
+34
drivers/gpu/drm/ast/ast_2000.c
··· 147 147 148 148 return 0; 149 149 } 150 + 151 + /* 152 + * Mode setting 153 + */ 154 + 155 + const struct ast_vbios_dclk_info ast_2000_dclk_table[] = { 156 + {0x2c, 0xe7, 0x03}, /* 00: VCLK25_175 */ 157 + {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */ 158 + {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */ 159 + {0x76, 0x63, 0x01}, /* 03: VCLK36 */ 160 + {0xee, 0x67, 0x01}, /* 04: VCLK40 */ 161 + {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */ 162 + {0xc6, 0x64, 0x01}, /* 06: VCLK50 */ 163 + {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */ 164 + {0x80, 0x64, 0x00}, /* 08: VCLK65 */ 165 + {0x7b, 0x63, 0x00}, /* 09: VCLK75 */ 166 + {0x67, 0x62, 0x00}, /* 0a: VCLK78_75 */ 167 + {0x7c, 0x62, 0x00}, /* 0b: VCLK94_5 */ 168 + {0x8e, 0x62, 0x00}, /* 0c: VCLK108 */ 169 + {0x85, 0x24, 0x00}, /* 0d: VCLK135 */ 170 + {0x67, 0x22, 0x00}, /* 0e: VCLK157_5 */ 171 + {0x6a, 0x22, 0x00}, /* 0f: VCLK162 */ 172 + {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */ 173 + {0x68, 0x6f, 0x80}, /* 11: VCLK83.5 */ 174 + {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */ 175 + {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */ 176 + {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */ 177 + {0x47, 0x6c, 0x80}, /* 15: VCLK71 */ 178 + {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */ 179 + {0x77, 0x58, 0x80}, /* 17: VCLK119 */ 180 + {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */ 181 + {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */ 182 + {0x3b, 0x2c, 0x81}, /* 1a: VCLK118_25 */ 183 + };
+34
drivers/gpu/drm/ast/ast_2500.c
··· 567 567 568 568 return 0; 569 569 } 570 + 571 + /* 572 + * Mode setting 573 + */ 574 + 575 + const struct ast_vbios_dclk_info ast_2500_dclk_table[] = { 576 + {0x2c, 0xe7, 0x03}, /* 00: VCLK25_175 */ 577 + {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */ 578 + {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */ 579 + {0x76, 0x63, 0x01}, /* 03: VCLK36 */ 580 + {0xee, 0x67, 0x01}, /* 04: VCLK40 */ 581 + {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */ 582 + {0xc6, 0x64, 0x01}, /* 06: VCLK50 */ 583 + {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */ 584 + {0x80, 0x64, 0x00}, /* 08: VCLK65 */ 585 + {0x7b, 0x63, 0x00}, /* 09: VCLK75 */ 586 + {0x67, 0x62, 0x00}, /* 0a: VCLK78_75 */ 587 + {0x7c, 0x62, 0x00}, /* 0b: VCLK94_5 */ 588 + {0x8e, 0x62, 0x00}, /* 0c: VCLK108 */ 589 + {0x85, 0x24, 0x00}, /* 0d: VCLK135 */ 590 + {0x67, 0x22, 0x00}, /* 0e: VCLK157_5 */ 591 + {0x6a, 0x22, 0x00}, /* 0f: VCLK162 */ 592 + {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */ 593 + {0x68, 0x6f, 0x80}, /* 11: VCLK83.5 */ 594 + {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */ 595 + {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */ 596 + {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */ 597 + {0x47, 0x6c, 0x80}, /* 15: VCLK71 */ 598 + {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */ 599 + {0x58, 0x01, 0x42}, /* 17: VCLK119 */ 600 + {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */ 601 + {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */ 602 + {0x44, 0x20, 0x43}, /* 1a: VCLK118_25 */ 603 + };
+2
drivers/gpu/drm/ast/ast_drv.h
··· 417 417 418 418 /* ast_2000.c */ 419 419 int ast_2000_post(struct ast_device *ast); 420 + extern const struct ast_vbios_dclk_info ast_2000_dclk_table[]; 420 421 421 422 /* ast_2100.c */ 422 423 int ast_2100_post(struct ast_device *ast); ··· 428 427 /* ast_2500.c */ 429 428 void ast_2500_patch_ahb(void __iomem *regs); 430 429 int ast_2500_post(struct ast_device *ast); 430 + extern const struct ast_vbios_dclk_info ast_2500_dclk_table[]; 431 431 432 432 /* ast_2600.c */ 433 433 int ast_2600_post(struct ast_device *ast);
+2 -2
drivers/gpu/drm/ast/ast_mode.c
··· 373 373 const struct ast_vbios_dclk_info *clk_info; 374 374 375 375 if (IS_AST_GEN6(ast) || IS_AST_GEN7(ast)) 376 - clk_info = &dclk_table_ast2500[vmode->dclk_index]; 376 + clk_info = &ast_2500_dclk_table[vmode->dclk_index]; 377 377 else 378 - clk_info = &dclk_table[vmode->dclk_index]; 378 + clk_info = &ast_2000_dclk_table[vmode->dclk_index]; 379 379 380 380 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc0, 0x00, clk_info->param1); 381 381 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc1, 0x00, clk_info->param2);
-60
drivers/gpu/drm/ast/ast_tables.h
··· 33 33 #define HiCModeIndex 3 34 34 #define TrueCModeIndex 4 35 35 36 - static const struct ast_vbios_dclk_info dclk_table[] = { 37 - {0x2C, 0xE7, 0x03}, /* 00: VCLK25_175 */ 38 - {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */ 39 - {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */ 40 - {0x76, 0x63, 0x01}, /* 03: VCLK36 */ 41 - {0xEE, 0x67, 0x01}, /* 04: VCLK40 */ 42 - {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */ 43 - {0xC6, 0x64, 0x01}, /* 06: VCLK50 */ 44 - {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */ 45 - {0x80, 0x64, 0x00}, /* 08: VCLK65 */ 46 - {0x7B, 0x63, 0x00}, /* 09: VCLK75 */ 47 - {0x67, 0x62, 0x00}, /* 0A: VCLK78_75 */ 48 - {0x7C, 0x62, 0x00}, /* 0B: VCLK94_5 */ 49 - {0x8E, 0x62, 0x00}, /* 0C: VCLK108 */ 50 - {0x85, 0x24, 0x00}, /* 0D: VCLK135 */ 51 - {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */ 52 - {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */ 53 - {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */ 54 - {0x68, 0x6f, 0x80}, /* 11: VCLK83.5 */ 55 - {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */ 56 - {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */ 57 - {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */ 58 - {0x47, 0x6c, 0x80}, /* 15: VCLK71 */ 59 - {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */ 60 - {0x77, 0x58, 0x80}, /* 17: VCLK119 */ 61 - {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */ 62 - {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */ 63 - {0x3b, 0x2c, 0x81}, /* 1A: VCLK118_25 */ 64 - }; 65 - 66 - static const struct ast_vbios_dclk_info dclk_table_ast2500[] = { 67 - {0x2C, 0xE7, 0x03}, /* 00: VCLK25_175 */ 68 - {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */ 69 - {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */ 70 - {0x76, 0x63, 0x01}, /* 03: VCLK36 */ 71 - {0xEE, 0x67, 0x01}, /* 04: VCLK40 */ 72 - {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */ 73 - {0xC6, 0x64, 0x01}, /* 06: VCLK50 */ 74 - {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */ 75 - {0x80, 0x64, 0x00}, /* 08: VCLK65 */ 76 - {0x7B, 0x63, 0x00}, /* 09: VCLK75 */ 77 - {0x67, 0x62, 0x00}, /* 0A: VCLK78_75 */ 78 - {0x7C, 0x62, 0x00}, /* 0B: VCLK94_5 */ 79 - {0x8E, 0x62, 0x00}, /* 0C: VCLK108 */ 80 - {0x85, 0x24, 0x00}, /* 0D: VCLK135 */ 81 - {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */ 82 - {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */ 83 - {0x4d, 0x4c, 0x80}, /* 10: VCLK154 */ 84 - {0x68, 0x6f, 0x80}, /* 11: VCLK83.5 */ 85 - {0x28, 0x49, 0x80}, /* 12: VCLK106.5 */ 86 - {0x37, 0x49, 0x80}, /* 13: VCLK146.25 */ 87 - {0x1f, 0x45, 0x80}, /* 14: VCLK148.5 */ 88 - {0x47, 0x6c, 0x80}, /* 15: VCLK71 */ 89 - {0x25, 0x65, 0x80}, /* 16: VCLK88.75 */ 90 - {0x58, 0x01, 0x42}, /* 17: VCLK119 */ 91 - {0x32, 0x67, 0x80}, /* 18: VCLK85_5 */ 92 - {0x6a, 0x6d, 0x80}, /* 19: VCLK97_75 */ 93 - {0x44, 0x20, 0x43}, /* 1A: VCLK118_25 */ 94 - }; 95 - 96 36 static const struct ast_vbios_stdtable vbios_stdtable[] = { 97 37 /* MD_2_3_400 */ 98 38 {