e = new_gpio_entry(bios);
e->tag = DCB_GPIO_TVDAC0;
e->line = tvdac_gpio[1] >> 4;
- e->invert = tvdac_gpio[0] & 2;
+ e->state[0] = !!(tvdac_gpio[0] & 2);
+ e->state[1] = !e->state[0];
}
goto no_table;
}
e->line = (e->entry & 0x001f);
- e->invert = ((e->entry & 0xf800) >> 11) != 4;
+ e->state[0] = ((e->entry & 0xf800) >> 11) != 4;
+ e->state[1] = !e->state[0];
} else {
e->entry = ROM32(entry[0]);
e->tag = (e->entry & 0x0000ff00) >> 8;
value = NVReadCRTC(dev, 0, reg) >> shift;
- return (ent->invert ? 1 : 0) ^ (value & 1);
+ return (value & 1) == ent->state[1];
}
int
if (!get_gpio_location(ent, ®, &shift, &mask))
return -ENODEV;
- value = ((ent->invert ? 1 : 0) ^ (state ? 1 : 0)) << shift;
+ value = ent->state[state & 1] << shift;
mask = ~(mask << shift);
NVWriteCRTC(dev, 0, reg, value | (NVReadCRTC(dev, 0, reg) & mask));