Commit 84d826c8 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Remove unused value dp501_maxclk

Remove reading the link-rate. The value is maintained by the connector
code but never used.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220207141544.30015-5-tzimmermann@suse.de
parent 042ddf66
...@@ -272,64 +272,6 @@ static bool ast_launch_m68k(struct drm_device *dev) ...@@ -272,64 +272,6 @@ static bool ast_launch_m68k(struct drm_device *dev)
return true; return true;
} }
u8 ast_get_dp501_max_clk(struct drm_device *dev)
{
struct ast_private *ast = to_ast_private(dev);
u32 boot_address, offset, data;
u8 linkcap[4], linkrate, linklanes, maxclk = 0xff;
u32 *plinkcap;
if (ast->config_mode == ast_use_p2a) {
boot_address = get_fw_base(ast);
/* validate FW version */
offset = AST_DP501_GBL_VERSION;
data = ast_mindwm(ast, boot_address + offset);
if ((data & AST_DP501_FW_VERSION_MASK) != AST_DP501_FW_VERSION_1) /* version: 1x */
return maxclk;
/* Read Link Capability */
offset = AST_DP501_LINKRATE;
plinkcap = (u32 *)linkcap;
*plinkcap = ast_mindwm(ast, boot_address + offset);
if (linkcap[2] == 0) {
linkrate = linkcap[0];
linklanes = linkcap[1];
data = (linkrate == 0x0a) ? (90 * linklanes) : (54 * linklanes);
if (data > 0xff)
data = 0xff;
maxclk = (u8)data;
}
} else {
if (!ast->dp501_fw_buf)
return AST_DP501_DEFAULT_DCLK; /* 1024x768 as default */
/* dummy read */
offset = 0x0000;
data = readl(ast->dp501_fw_buf + offset);
/* validate FW version */
offset = AST_DP501_GBL_VERSION;
data = readl(ast->dp501_fw_buf + offset);
if ((data & AST_DP501_FW_VERSION_MASK) != AST_DP501_FW_VERSION_1) /* version: 1x */
return maxclk;
/* Read Link Capability */
offset = AST_DP501_LINKRATE;
plinkcap = (u32 *)linkcap;
*plinkcap = readl(ast->dp501_fw_buf + offset);
if (linkcap[2] == 0) {
linkrate = linkcap[0];
linklanes = linkcap[1];
data = (linkrate == 0x0a) ? (90 * linklanes) : (54 * linklanes);
if (data > 0xff)
data = 0xff;
maxclk = (u8)data;
}
}
return maxclk;
}
bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)
{ {
struct ast_private *ast = to_ast_private(dev); struct ast_private *ast = to_ast_private(dev);
......
...@@ -171,7 +171,6 @@ struct ast_private { ...@@ -171,7 +171,6 @@ struct ast_private {
} config_mode; } config_mode;
enum ast_tx_chip tx_chip_type; enum ast_tx_chip tx_chip_type;
u8 dp501_maxclk;
u8 *dp501_fw_addr; u8 *dp501_fw_addr;
const struct firmware *dp501_fw; /* dp501 fw */ const struct firmware *dp501_fw; /* dp501 fw */
}; };
......
...@@ -1284,16 +1284,15 @@ static int ast_get_modes(struct drm_connector *connector) ...@@ -1284,16 +1284,15 @@ static int ast_get_modes(struct drm_connector *connector)
int ret; int ret;
if (ast->tx_chip_type == AST_TX_DP501) { if (ast->tx_chip_type == AST_TX_DP501) {
ast->dp501_maxclk = 0xff;
edid = kmalloc(128, GFP_KERNEL); edid = kmalloc(128, GFP_KERNEL);
if (!edid) if (!edid)
return -ENOMEM; return -ENOMEM;
flags = ast_dp501_read_edid(connector->dev, (u8 *)edid); flags = ast_dp501_read_edid(connector->dev, (u8 *)edid);
if (flags) if (!flags) {
ast->dp501_maxclk = ast_get_dp501_max_clk(connector->dev);
else
kfree(edid); kfree(edid);
edid = NULL;
}
} }
if (!flags && ast_connector->i2c) if (!flags && ast_connector->i2c)
edid = drm_get_edid(connector, &ast_connector->i2c->adapter); edid = drm_get_edid(connector, &ast_connector->i2c->adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment