sisfb: add RAM type detection for XGI Z9
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 13 Feb 2011 22:11:26 +0000 (22:11 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 22 Mar 2011 06:20:33 +0000 (15:20 +0900)
Detect the XGI Z9 RAM type as "documented" by the XGI's xgifb driver.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/video/sis/sis_main.c

index f0c48e84bcdbcc515be6deecc7a536bd2aef4ba1..de03567883758c2ddbe720f756852e6873852905 100644 (file)
@@ -4955,7 +4955,13 @@ sisfb_post_xgi_ramtype(struct sis_video_info *ivideo)
                v1 = bios[0x1d2];
        }
        if (!(ramtype & 0x80)) {
-               if (ivideo->chip == XGI_20) {
+               if (sisfb_xgi_is21(ivideo)) {
+                       SiS_SetRegAND(SISCR, 0xb4, 0xfd); /* GPIO control */
+                       SiS_SetRegOR(SISCR, 0x4a, 0x80);  /* GPIOH EN */
+                       reg = SiS_GetReg(SISCR, 0x48);
+                       SiS_SetRegOR(SISCR, 0xb4, 0x02);
+                       ramtype = reg & 0x01;             /* GPIOH */
+               } else if (ivideo->chip == XGI_20) {
                        SiS_SetReg(SISCR, 0x97, v1);
                        reg = SiS_GetReg(SISCR, 0x97);
                        if (reg & 0x10) {