]> Gentwo Git Trees - linux/.git/commitdiff
drm/ast: Move display-clock tables to per-Gen source files
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 22 Sep 2025 08:36:01 +0000 (10:36 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 29 Sep 2025 11:28:07 +0000 (13:28 +0200)
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
drivers/gpu/drm/ast/ast_2000.c
drivers/gpu/drm/ast/ast_2500.c
drivers/gpu/drm/ast/ast_drv.h
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/ast/ast_tables.h

index 41c2aa1e425aa1f4e3848e31265060ef8d917bfc..a31daf7c2ceb5c1ea9ac4660b3d3cbd40a9595e1 100644 (file)
@@ -147,3 +147,37 @@ int ast_2000_post(struct ast_device *ast)
 
        return 0;
 }
+
+/*
+ * Mode setting
+ */
+
+const struct ast_vbios_dclk_info ast_2000_dclk_table[] = {
+       {0x2c, 0xe7, 0x03},                     /* 00: VCLK25_175       */
+       {0x95, 0x62, 0x03},                     /* 01: VCLK28_322       */
+       {0x67, 0x63, 0x01},                     /* 02: VCLK31_5         */
+       {0x76, 0x63, 0x01},                     /* 03: VCLK36           */
+       {0xee, 0x67, 0x01},                     /* 04: VCLK40           */
+       {0x82, 0x62, 0x01},                     /* 05: VCLK49_5         */
+       {0xc6, 0x64, 0x01},                     /* 06: VCLK50           */
+       {0x94, 0x62, 0x01},                     /* 07: VCLK56_25        */
+       {0x80, 0x64, 0x00},                     /* 08: VCLK65           */
+       {0x7b, 0x63, 0x00},                     /* 09: VCLK75           */
+       {0x67, 0x62, 0x00},                     /* 0a: VCLK78_75        */
+       {0x7c, 0x62, 0x00},                     /* 0b: VCLK94_5         */
+       {0x8e, 0x62, 0x00},                     /* 0c: VCLK108          */
+       {0x85, 0x24, 0x00},                     /* 0d: VCLK135          */
+       {0x67, 0x22, 0x00},                     /* 0e: VCLK157_5        */
+       {0x6a, 0x22, 0x00},                     /* 0f: VCLK162          */
+       {0x4d, 0x4c, 0x80},                     /* 10: VCLK154          */
+       {0x68, 0x6f, 0x80},                     /* 11: VCLK83.5         */
+       {0x28, 0x49, 0x80},                     /* 12: VCLK106.5        */
+       {0x37, 0x49, 0x80},                     /* 13: VCLK146.25       */
+       {0x1f, 0x45, 0x80},                     /* 14: VCLK148.5        */
+       {0x47, 0x6c, 0x80},                     /* 15: VCLK71           */
+       {0x25, 0x65, 0x80},                     /* 16: VCLK88.75        */
+       {0x77, 0x58, 0x80},                     /* 17: VCLK119          */
+       {0x32, 0x67, 0x80},                     /* 18: VCLK85_5         */
+       {0x6a, 0x6d, 0x80},                     /* 19: VCLK97_75        */
+       {0x3b, 0x2c, 0x81},                     /* 1a: VCLK118_25       */
+};
index 1e541498ea6743c193471106ec937ad3b450a7c4..b12fec161f2b06aabaf39a106077052ec161be34 100644 (file)
@@ -567,3 +567,37 @@ int ast_2500_post(struct ast_device *ast)
 
        return 0;
 }
+
+/*
+ * Mode setting
+ */
+
+const struct ast_vbios_dclk_info ast_2500_dclk_table[] = {
+       {0x2c, 0xe7, 0x03},                     /* 00: VCLK25_175       */
+       {0x95, 0x62, 0x03},                     /* 01: VCLK28_322       */
+       {0x67, 0x63, 0x01},                     /* 02: VCLK31_5         */
+       {0x76, 0x63, 0x01},                     /* 03: VCLK36           */
+       {0xee, 0x67, 0x01},                     /* 04: VCLK40           */
+       {0x82, 0x62, 0x01},                     /* 05: VCLK49_5         */
+       {0xc6, 0x64, 0x01},                     /* 06: VCLK50           */
+       {0x94, 0x62, 0x01},                     /* 07: VCLK56_25        */
+       {0x80, 0x64, 0x00},                     /* 08: VCLK65           */
+       {0x7b, 0x63, 0x00},                     /* 09: VCLK75           */
+       {0x67, 0x62, 0x00},                     /* 0a: VCLK78_75        */
+       {0x7c, 0x62, 0x00},                     /* 0b: VCLK94_5         */
+       {0x8e, 0x62, 0x00},                     /* 0c: VCLK108          */
+       {0x85, 0x24, 0x00},                     /* 0d: VCLK135          */
+       {0x67, 0x22, 0x00},                     /* 0e: VCLK157_5        */
+       {0x6a, 0x22, 0x00},                     /* 0f: VCLK162          */
+       {0x4d, 0x4c, 0x80},                     /* 10: VCLK154          */
+       {0x68, 0x6f, 0x80},                     /* 11: VCLK83.5         */
+       {0x28, 0x49, 0x80},                     /* 12: VCLK106.5        */
+       {0x37, 0x49, 0x80},                     /* 13: VCLK146.25       */
+       {0x1f, 0x45, 0x80},                     /* 14: VCLK148.5        */
+       {0x47, 0x6c, 0x80},                     /* 15: VCLK71           */
+       {0x25, 0x65, 0x80},                     /* 16: VCLK88.75        */
+       {0x58, 0x01, 0x42},                     /* 17: VCLK119          */
+       {0x32, 0x67, 0x80},                     /* 18: VCLK85_5         */
+       {0x6a, 0x6d, 0x80},                     /* 19: VCLK97_75        */
+       {0x44, 0x20, 0x43},                     /* 1a: VCLK118_25       */
+};
index c15aef014f698c9134437787609dc7e376973430..482d1eb79d6406aaf2d986da84850b5ec801cba7 100644 (file)
@@ -417,6 +417,7 @@ int ast_mm_init(struct ast_device *ast);
 
 /* ast_2000.c */
 int ast_2000_post(struct ast_device *ast);
+extern const struct ast_vbios_dclk_info ast_2000_dclk_table[];
 
 /* ast_2100.c */
 int ast_2100_post(struct ast_device *ast);
@@ -427,6 +428,7 @@ int ast_2300_post(struct ast_device *ast);
 /* ast_2500.c */
 void ast_2500_patch_ahb(void __iomem *regs);
 int ast_2500_post(struct ast_device *ast);
+extern const struct ast_vbios_dclk_info ast_2500_dclk_table[];
 
 /* ast_2600.c */
 int ast_2600_post(struct ast_device *ast);
index b4e8edc7c7678ddcf3ca47dfaf3ae71ca2ab8e29..6b9d510c509dfb9101500dcc91b31e60a7a38728 100644 (file)
@@ -373,9 +373,9 @@ static void ast_set_dclk_reg(struct ast_device *ast,
        const struct ast_vbios_dclk_info *clk_info;
 
        if (IS_AST_GEN6(ast) || IS_AST_GEN7(ast))
-               clk_info = &dclk_table_ast2500[vmode->dclk_index];
+               clk_info = &ast_2500_dclk_table[vmode->dclk_index];
        else
-               clk_info = &dclk_table[vmode->dclk_index];
+               clk_info = &ast_2000_dclk_table[vmode->dclk_index];
 
        ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc0, 0x00, clk_info->param1);
        ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc1, 0x00, clk_info->param2);
index f1c9f7e1f1fcde19f6eae78035a429f79d49cdbb..7da5b5c60f41c40f8115fa5506d2e8b6acd9e34c 100644 (file)
 #define HiCModeIndex           3
 #define TrueCModeIndex         4
 
-static const struct ast_vbios_dclk_info dclk_table[] = {
-       {0x2C, 0xE7, 0x03},                     /* 00: VCLK25_175       */
-       {0x95, 0x62, 0x03},                     /* 01: VCLK28_322       */
-       {0x67, 0x63, 0x01},                     /* 02: VCLK31_5         */
-       {0x76, 0x63, 0x01},                     /* 03: VCLK36           */
-       {0xEE, 0x67, 0x01},                     /* 04: VCLK40           */
-       {0x82, 0x62, 0x01},                     /* 05: VCLK49_5         */
-       {0xC6, 0x64, 0x01},                     /* 06: VCLK50           */
-       {0x94, 0x62, 0x01},                     /* 07: VCLK56_25        */
-       {0x80, 0x64, 0x00},                     /* 08: VCLK65           */
-       {0x7B, 0x63, 0x00},                     /* 09: VCLK75           */
-       {0x67, 0x62, 0x00},                     /* 0A: VCLK78_75        */
-       {0x7C, 0x62, 0x00},                     /* 0B: VCLK94_5         */
-       {0x8E, 0x62, 0x00},                     /* 0C: VCLK108          */
-       {0x85, 0x24, 0x00},                     /* 0D: VCLK135          */
-       {0x67, 0x22, 0x00},                     /* 0E: VCLK157_5        */
-       {0x6A, 0x22, 0x00},                     /* 0F: VCLK162          */
-       {0x4d, 0x4c, 0x80},                     /* 10: VCLK154          */
-       {0x68, 0x6f, 0x80},                     /* 11: VCLK83.5         */
-       {0x28, 0x49, 0x80},                     /* 12: VCLK106.5        */
-       {0x37, 0x49, 0x80},                     /* 13: VCLK146.25       */
-       {0x1f, 0x45, 0x80},                     /* 14: VCLK148.5        */
-       {0x47, 0x6c, 0x80},                     /* 15: VCLK71           */
-       {0x25, 0x65, 0x80},                     /* 16: VCLK88.75        */
-       {0x77, 0x58, 0x80},                     /* 17: VCLK119          */
-       {0x32, 0x67, 0x80},                     /* 18: VCLK85_5         */
-       {0x6a, 0x6d, 0x80},                     /* 19: VCLK97_75        */
-       {0x3b, 0x2c, 0x81},                     /* 1A: VCLK118_25       */
-};
-
-static const struct ast_vbios_dclk_info dclk_table_ast2500[] = {
-       {0x2C, 0xE7, 0x03},                     /* 00: VCLK25_175       */
-       {0x95, 0x62, 0x03},                     /* 01: VCLK28_322       */
-       {0x67, 0x63, 0x01},                     /* 02: VCLK31_5         */
-       {0x76, 0x63, 0x01},                     /* 03: VCLK36           */
-       {0xEE, 0x67, 0x01},                     /* 04: VCLK40           */
-       {0x82, 0x62, 0x01},                     /* 05: VCLK49_5         */
-       {0xC6, 0x64, 0x01},                     /* 06: VCLK50           */
-       {0x94, 0x62, 0x01},                     /* 07: VCLK56_25        */
-       {0x80, 0x64, 0x00},                     /* 08: VCLK65           */
-       {0x7B, 0x63, 0x00},                     /* 09: VCLK75           */
-       {0x67, 0x62, 0x00},                     /* 0A: VCLK78_75        */
-       {0x7C, 0x62, 0x00},                     /* 0B: VCLK94_5         */
-       {0x8E, 0x62, 0x00},                     /* 0C: VCLK108          */
-       {0x85, 0x24, 0x00},                     /* 0D: VCLK135          */
-       {0x67, 0x22, 0x00},                     /* 0E: VCLK157_5        */
-       {0x6A, 0x22, 0x00},                     /* 0F: VCLK162          */
-       {0x4d, 0x4c, 0x80},                     /* 10: VCLK154          */
-       {0x68, 0x6f, 0x80},                     /* 11: VCLK83.5         */
-       {0x28, 0x49, 0x80},                     /* 12: VCLK106.5        */
-       {0x37, 0x49, 0x80},                     /* 13: VCLK146.25       */
-       {0x1f, 0x45, 0x80},                     /* 14: VCLK148.5        */
-       {0x47, 0x6c, 0x80},                     /* 15: VCLK71           */
-       {0x25, 0x65, 0x80},                     /* 16: VCLK88.75        */
-       {0x58, 0x01, 0x42},                     /* 17: VCLK119          */
-       {0x32, 0x67, 0x80},                     /* 18: VCLK85_5         */
-       {0x6a, 0x6d, 0x80},                     /* 19: VCLK97_75        */
-       {0x44, 0x20, 0x43},                     /* 1A: VCLK118_25       */
-};
-
 static const struct ast_vbios_stdtable vbios_stdtable[] = {
        /* MD_2_3_400 */
        {