drm/ast: Support device quirks
Define struct ast_device_quirks and add an instance for each hardware generation. The type will provide information about per-gen constants and oddities. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>> Link: https://lore.kernel.org/r/20251007150343.273718-3-tzimmermann@suse.depull/1354/merge
parent
4b3374d790
commit
703f473126
|
|
@ -211,6 +211,9 @@ void ast_2000_detect_tx_chip(struct ast_device *ast, bool need_post)
|
|||
__ast_device_set_tx_chip(ast, tx_chip);
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2000_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2000_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -228,7 +231,7 @@ struct drm_device *ast_2000_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2000_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2000_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -432,6 +432,9 @@ static void ast_2100_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2100_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2100_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -449,7 +452,7 @@ struct drm_device *ast_2100_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2100_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2000_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ static void ast_2200_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2200_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2200_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -60,7 +63,7 @@ struct drm_device *ast_2200_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2200_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2000_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -1407,6 +1407,9 @@ static void ast_2300_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2300_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2300_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -1424,7 +1427,7 @@ struct drm_device *ast_2300_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2300_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2000_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ static void ast_2400_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2400_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2400_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -61,7 +64,7 @@ struct drm_device *ast_2400_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2400_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2000_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -618,6 +618,9 @@ static void ast_2500_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2500_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2500_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -635,7 +638,7 @@ struct drm_device *ast_2500_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2500_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2500_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ static void ast_2600_detect_widescreen(struct ast_device *ast)
|
|||
ast->support_wuxga = true;
|
||||
}
|
||||
|
||||
static const struct ast_device_quirks ast_2600_device_quirks = {
|
||||
};
|
||||
|
||||
struct drm_device *ast_2600_device_create(struct pci_dev *pdev,
|
||||
const struct drm_driver *drv,
|
||||
enum ast_chip chip,
|
||||
|
|
@ -76,7 +79,7 @@ struct drm_device *ast_2600_device_create(struct pci_dev *pdev,
|
|||
return ERR_CAST(ast);
|
||||
dev = &ast->base;
|
||||
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs);
|
||||
ast_device_init(ast, chip, config_mode, regs, ioregs, &ast_2600_device_quirks);
|
||||
|
||||
ast->dclk_table = ast_2500_dclk_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,10 @@ void ast_device_init(struct ast_device *ast,
|
|||
enum ast_chip chip,
|
||||
enum ast_config_mode config_mode,
|
||||
void __iomem *regs,
|
||||
void __iomem *ioregs)
|
||||
void __iomem *ioregs,
|
||||
const struct ast_device_quirks *quirks)
|
||||
{
|
||||
ast->quirks = quirks;
|
||||
ast->chip = chip;
|
||||
ast->config_mode = config_mode;
|
||||
ast->regs = regs;
|
||||
|
|
|
|||
|
|
@ -164,9 +164,14 @@ to_ast_connector(struct drm_connector *connector)
|
|||
* Device
|
||||
*/
|
||||
|
||||
struct ast_device_quirks {
|
||||
};
|
||||
|
||||
struct ast_device {
|
||||
struct drm_device base;
|
||||
|
||||
const struct ast_device_quirks *quirks;
|
||||
|
||||
void __iomem *regs;
|
||||
void __iomem *ioregs;
|
||||
void __iomem *dp501_fw_buf;
|
||||
|
|
@ -414,7 +419,8 @@ void ast_device_init(struct ast_device *ast,
|
|||
enum ast_chip chip,
|
||||
enum ast_config_mode config_mode,
|
||||
void __iomem *regs,
|
||||
void __iomem *ioregs);
|
||||
void __iomem *ioregs,
|
||||
const struct ast_device_quirks *quirks);
|
||||
void __ast_device_set_tx_chip(struct ast_device *ast, enum ast_tx_chip tx_chip);
|
||||
|
||||
/* ast_2000.c */
|
||||
|
|
|
|||
Loading…
Reference in New Issue