aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/ast/ast_main.c')
-rw-r--r--drivers/gpu/drm/ast/ast_main.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index c6987e044661..01f938c2da28 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -35,6 +35,23 @@
#include "ast_drv.h"
+static int ast_init_pci_config(struct pci_dev *pdev)
+{
+ int err;
+ u16 pcis04;
+
+ err = pci_read_config_word(pdev, PCI_COMMAND, &pcis04);
+ if (err)
+ goto out;
+
+ pcis04 |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
+
+ err = pci_write_config_word(pdev, PCI_COMMAND, pcis04);
+
+out:
+ return pcibios_err_to_errno(err);
+}
+
static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)
{
struct device_node *np = dev->dev->of_node;
@@ -399,6 +416,10 @@ struct ast_device *ast_device_create(const struct drm_driver *drv,
return ERR_PTR(-EIO);
}
+ ret = ast_init_pci_config(pdev);
+ if (ret)
+ return ERR_PTR(ret);
+
if (!ast_is_vga_enabled(dev)) {
drm_info(dev, "VGA not enabled on entry, requesting chip POST\n");
need_post = true;