summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_dp501.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-06-21 15:53:43 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-06-27 15:26:34 +0300
commitecf64579fe3dda39bf986686a181027b80c9d075 (patch)
tree1277d093c2bc7ab38ecbeb12a0f4b04ca3adcc5a /drivers/gpu/drm/ast/ast_dp501.c
parenta74ec2bcdc2298ab025a75b9d5683aabf4e4c043 (diff)
downloadlinux-ecf64579fe3dda39bf986686a181027b80c9d075.tar.xz
drm/ast: Distinguish among chip generations
ASpeed distinguishes among various generations of the AST graphics chipset with various models. [1] The most-recent model AST 2600 is of the 7th generation, the AST 2500 is of the 6th generation, and so on. The ast driver simply picks one of the models as representative for the whole generation. In several places, individual models of the same generation need to be handled differently, which then requires additional code for detecting the model. Introduce different generations of the Aspeed chipset. In the source code, refer to the generation instead of the representation model where possible. The few places that require per-model handling are now clearly marked. In the enum ast_chip, we arrange each model's value such that it encodes the generation. This allows for an easy test. The actual values are ordered, but not of interest to the driver. v2: * use __ast_gen_is_eq() (Jingfeng) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://web.archive.org/web/20141007093258/http://www.aspeedtech.com/products.php?fPath=20 # 1 Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600 Reviewed-by: Sui Jingfeng <suijingfeng@loongson.cn> Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-10-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_dp501.c')
-rw-r--r--drivers/gpu/drm/ast/ast_dp501.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ast/ast_dp501.c b/drivers/gpu/drm/ast/ast_dp501.c
index 1bc35a992369..a5d285850ffb 100644
--- a/drivers/gpu/drm/ast/ast_dp501.c
+++ b/drivers/gpu/drm/ast/ast_dp501.c
@@ -350,7 +350,7 @@ static bool ast_init_dvo(struct drm_device *dev)
data |= 0x00000500;
ast_write32(ast, 0x12008, data);
- if (ast->chip == AST2300) {
+ if (IS_AST_GEN4(ast)) {
data = ast_read32(ast, 0x12084);
/* multi-pins for DVO single-edge */
data |= 0xfffe0000;
@@ -366,7 +366,7 @@ static bool ast_init_dvo(struct drm_device *dev)
data &= 0xffffffcf;
data |= 0x00000020;
ast_write32(ast, 0x12090, data);
- } else { /* AST2400 */
+ } else { /* AST GEN5+ */
data = ast_read32(ast, 0x12088);
/* multi-pins for DVO single-edge */
data |= 0x30000000;
@@ -437,7 +437,7 @@ void ast_init_3rdtx(struct drm_device *dev)
struct ast_device *ast = to_ast_device(dev);
u8 jreg;
- if (ast->chip == AST2300 || ast->chip == AST2400) {
+ if (IS_AST_GEN4(ast) || IS_AST_GEN5(ast)) {
jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff);
switch (jreg & 0x0e) {
case 0x04: