Commit 9382ec27 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/mgag200: Move ER/EW3 register initialization to per-model code

The register initialization code contains special cases for G200ER
and G200EW3 hardware. Move this to per-model code.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Tested-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220728124103.30159-4-tzimmermann@suse.de
parent 1ee181fe
...@@ -27,6 +27,8 @@ static void mgag200_g200er_init_registers(struct mga_device *mdev) ...@@ -27,6 +27,8 @@ static void mgag200_g200er_init_registers(struct mga_device *mdev)
WREG_DAC(0x90, 0); /* G200ER specific */ WREG_DAC(0x90, 0); /* G200ER specific */
mgag200_init_registers(mdev); mgag200_init_registers(mdev);
WREG_ECRT(0x24, 0x5); /* G200ER specific */
} }
/* /*
......
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
#include "mgag200_drv.h" #include "mgag200_drv.h"
static void mgag200_g200ew3_init_registers(struct mga_device *mdev)
{
mgag200_g200wb_init_registers(mdev); // same as G200WB
WREG_ECRT(0x34, 0x5); // G200EW3 specific
}
/* /*
* DRM device * DRM device
*/ */
...@@ -50,7 +57,7 @@ struct mga_device *mgag200_g200ew3_device_create(struct pci_dev *pdev, ...@@ -50,7 +57,7 @@ struct mga_device *mgag200_g200ew3_device_create(struct pci_dev *pdev,
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
mgag200_g200wb_init_registers(mdev); // same as G200WB mgag200_g200ew3_init_registers(mdev);
vram_available = mgag200_g200ew3_device_probe_vram(mdev); vram_available = mgag200_g200ew3_device_probe_vram(mdev);
......
...@@ -287,12 +287,6 @@ void mgag200_init_registers(struct mga_device *mdev) ...@@ -287,12 +287,6 @@ void mgag200_init_registers(struct mga_device *mdev)
MGAREG_CRTC11_VINTCLR); MGAREG_CRTC11_VINTCLR);
WREG_CRT(0x11, crtc11); WREG_CRT(0x11, crtc11);
if (mdev->type == G200_ER)
WREG_ECRT(0x24, 0x5);
if (mdev->type == G200_EW3)
WREG_ECRT(0x34, 0x5);
misc = RREG8(MGA_MISC_IN); misc = RREG8(MGA_MISC_IN);
misc |= MGAREG_MISC_IOADSEL; misc |= MGAREG_MISC_IOADSEL;
WREG8(MGA_MISC_OUT, misc); WREG8(MGA_MISC_OUT, misc);
......
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