Commit 1955acc6 authored by Petr Vandrovec's avatar Petr Vandrovec

[PATCH] (2/3) matroxfb for 2.5.3

  this patch adds support for older MGA-TVO-B (found on G200-TV)
to matroxfb.

			Petr Vandrovec
parent 213d2214
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
* *
* (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz> * (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz>
* *
* Version: 1.51 2001/01/19 * Portions Copyright (c) 2001 Matrox Graphics Inc.
*
* Version: 1.62 2001/11/29
* *
* See matroxfb_base.c for contributors. * See matroxfb_base.c for contributors.
* *
...@@ -25,10 +27,14 @@ ...@@ -25,10 +27,14 @@
#define MODE_TV(x) (((x) == MODE_PAL) || ((x) == MODE_NTSC)) #define MODE_TV(x) (((x) == MODE_PAL) || ((x) == MODE_NTSC))
#define MODE_MONITOR MATROXFB_OUTPUT_MODE_MONITOR #define MODE_MONITOR MATROXFB_OUTPUT_MODE_MONITOR
#define MGATVO_B 1
#define MGATVO_C 2
struct maven_data { struct maven_data {
struct matrox_fb_info* primary_head; struct matrox_fb_info* primary_head;
struct i2c_client* client; struct i2c_client* client;
int mode; int mode;
int version;
}; };
static int maven_get_reg(struct i2c_client* c, char reg) { static int maven_get_reg(struct i2c_client* c, char reg) {
...@@ -623,8 +629,13 @@ static inline int maven_compute_timming(struct maven_data* md, ...@@ -623,8 +629,13 @@ static inline int maven_compute_timming(struct maven_data* md,
m->regs[0xA2] = mt->VTotal - mt->VSyncStart - 1; /* stop vblanking */ m->regs[0xA2] = mt->VTotal - mt->VSyncStart - 1; /* stop vblanking */
m->regs[0xA3] = (mt->VTotal - mt->VSyncStart - 1) >> 8; m->regs[0xA3] = (mt->VTotal - mt->VSyncStart - 1) >> 8;
/* something end... [A6]+1..[A8] */ /* something end... [A6]+1..[A8] */
m->regs[0xA4] = 0x01; if (md->version == MGATVO_B) {
m->regs[0xA5] = 0x00; m->regs[0xA4] = 0x04;
m->regs[0xA5] = 0x00;
} else {
m->regs[0xA4] = 0x01;
m->regs[0xA5] = 0x00;
}
/* something start... 0..[A4]-1 */ /* something start... 0..[A4]-1 */
m->regs[0xA6] = 0x00; m->regs[0xA6] = 0x00;
m->regs[0xA7] = 0x00; m->regs[0xA7] = 0x00;
...@@ -924,6 +935,11 @@ static int maven_init_client(struct i2c_client* clnt) { ...@@ -924,6 +935,11 @@ static int maven_init_client(struct i2c_client* clnt) {
ACCESS_FBINFO(altout.output) = &maven_altout; ACCESS_FBINFO(altout.output) = &maven_altout;
up_write(&ACCESS_FBINFO(altout.lock)); up_write(&ACCESS_FBINFO(altout.lock));
ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY;
if (maven_get_reg(clnt, 0xB2) < 0x14) {
md->version = MGATVO_B;
} else {
md->version = MGATVO_C;
}
return 0; return 0;
} }
......
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