aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/matrox/matroxfb_maven.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/matrox/matroxfb_maven.c')
-rw-r--r--drivers/video/matrox/matroxfb_maven.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c
index 042408a8c631..91af9159111f 100644
--- a/drivers/video/matrox/matroxfb_maven.c
+++ b/drivers/video/matrox/matroxfb_maven.c
@@ -458,9 +458,9 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat
458 0x00, /* 3E written multiple times */ 458 0x00, /* 3E written multiple times */
459 0x00, /* never written */ 459 0x00, /* never written */
460 }, MATROXFB_OUTPUT_MODE_NTSC, 525, 60 }; 460 }, MATROXFB_OUTPUT_MODE_NTSC, 525, 60 };
461 MINFO_FROM(md->primary_head); 461 struct matrox_fb_info *minfo = md->primary_head;
462 462
463 if (ACCESS_FBINFO(outputs[1]).mode == MATROXFB_OUTPUT_MODE_PAL) 463 if (minfo->outputs[1].mode == MATROXFB_OUTPUT_MODE_PAL)
464 *data = palregs; 464 *data = palregs;
465 else 465 else
466 *data = ntscregs; 466 *data = ntscregs;
@@ -496,11 +496,11 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat
496 /* Set saturation */ 496 /* Set saturation */
497 { 497 {
498 data->regs[0x20] = 498 data->regs[0x20] =
499 data->regs[0x22] = ACCESS_FBINFO(altout.tvo_params.saturation); 499 data->regs[0x22] = minfo->altout.tvo_params.saturation;
500 } 500 }
501 501
502 /* Set HUE */ 502 /* Set HUE */
503 data->regs[0x25] = ACCESS_FBINFO(altout.tvo_params.hue); 503 data->regs[0x25] = minfo->altout.tvo_params.hue;
504 return; 504 return;
505} 505}
506 506
@@ -741,9 +741,9 @@ static inline int maven_compute_timming(struct maven_data* md,
741 struct mavenregs* m) { 741 struct mavenregs* m) {
742 unsigned int tmpi; 742 unsigned int tmpi;
743 unsigned int a, bv, c; 743 unsigned int a, bv, c;
744 MINFO_FROM(md->primary_head); 744 struct matrox_fb_info *minfo = md->primary_head;
745 745
746 m->mode = ACCESS_FBINFO(outputs[1]).mode; 746 m->mode = minfo->outputs[1].mode;
747 if (m->mode != MATROXFB_OUTPUT_MODE_MONITOR) { 747 if (m->mode != MATROXFB_OUTPUT_MODE_MONITOR) {
748 unsigned int lmargin; 748 unsigned int lmargin;
749 unsigned int umargin; 749 unsigned int umargin;
@@ -1132,7 +1132,7 @@ static int maven_get_control (struct maven_data* md,
1132static int maven_out_compute(void* md, struct my_timming* mt) { 1132static int maven_out_compute(void* md, struct my_timming* mt) {
1133#define mdinfo ((struct maven_data*)md) 1133#define mdinfo ((struct maven_data*)md)
1134#define minfo (mdinfo->primary_head) 1134#define minfo (mdinfo->primary_head)
1135 return maven_compute_timming(md, mt, &ACCESS_FBINFO(hw).maven); 1135 return maven_compute_timming(md, mt, &minfo->hw.maven);
1136#undef minfo 1136#undef minfo
1137#undef mdinfo 1137#undef mdinfo
1138} 1138}
@@ -1140,7 +1140,7 @@ static int maven_out_compute(void* md, struct my_timming* mt) {
1140static int maven_out_program(void* md) { 1140static int maven_out_program(void* md) {
1141#define mdinfo ((struct maven_data*)md) 1141#define mdinfo ((struct maven_data*)md)
1142#define minfo (mdinfo->primary_head) 1142#define minfo (mdinfo->primary_head)
1143 return maven_program_timming(md, &ACCESS_FBINFO(hw).maven); 1143 return maven_program_timming(md, &minfo->hw.maven);
1144#undef minfo 1144#undef minfo
1145#undef mdinfo 1145#undef mdinfo
1146} 1146}
@@ -1184,16 +1184,18 @@ static struct matrox_altout maven_altout = {
1184 1184
1185static int maven_init_client(struct i2c_client* clnt) { 1185static int maven_init_client(struct i2c_client* clnt) {
1186 struct maven_data* md = i2c_get_clientdata(clnt); 1186 struct maven_data* md = i2c_get_clientdata(clnt);
1187 MINFO_FROM(container_of(clnt->adapter, struct i2c_bit_adapter, adapter)->minfo); 1187 struct matrox_fb_info *minfo = container_of(clnt->adapter,
1188 struct i2c_bit_adapter,
1189 adapter)->minfo;
1188 1190
1189 md->primary_head = MINFO; 1191 md->primary_head = minfo;
1190 md->client = clnt; 1192 md->client = clnt;
1191 down_write(&ACCESS_FBINFO(altout.lock)); 1193 down_write(&minfo->altout.lock);
1192 ACCESS_FBINFO(outputs[1]).output = &maven_altout; 1194 minfo->outputs[1].output = &maven_altout;
1193 ACCESS_FBINFO(outputs[1]).src = ACCESS_FBINFO(outputs[1]).default_src; 1195 minfo->outputs[1].src = minfo->outputs[1].default_src;
1194 ACCESS_FBINFO(outputs[1]).data = md; 1196 minfo->outputs[1].data = md;
1195 ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; 1197 minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR;
1196 up_write(&ACCESS_FBINFO(altout.lock)); 1198 up_write(&minfo->altout.lock);
1197 if (maven_get_reg(clnt, 0xB2) < 0x14) { 1199 if (maven_get_reg(clnt, 0xB2) < 0x14) {
1198 md->version = MGATVO_B; 1200 md->version = MGATVO_B;
1199 /* Tweak some things for this old chip */ 1201 /* Tweak some things for this old chip */
@@ -1218,14 +1220,14 @@ static int maven_shutdown_client(struct i2c_client* clnt) {
1218 struct maven_data* md = i2c_get_clientdata(clnt); 1220 struct maven_data* md = i2c_get_clientdata(clnt);
1219 1221
1220 if (md->primary_head) { 1222 if (md->primary_head) {
1221 MINFO_FROM(md->primary_head); 1223 struct matrox_fb_info *minfo = md->primary_head;
1222 1224
1223 down_write(&ACCESS_FBINFO(altout.lock)); 1225 down_write(&minfo->altout.lock);
1224 ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; 1226 minfo->outputs[1].src = MATROXFB_SRC_NONE;
1225 ACCESS_FBINFO(outputs[1]).output = NULL; 1227 minfo->outputs[1].output = NULL;
1226 ACCESS_FBINFO(outputs[1]).data = NULL; 1228 minfo->outputs[1].data = NULL;
1227 ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; 1229 minfo->outputs[1].mode = MATROXFB_OUTPUT_MODE_MONITOR;
1228 up_write(&ACCESS_FBINFO(altout.lock)); 1230 up_write(&minfo->altout.lock);
1229 md->primary_head = NULL; 1231 md->primary_head = NULL;
1230 } 1232 }
1231 return 0; 1233 return 0;