Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54906
b: refs/heads/master
c: e296927
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed May 8, 2007
1 parent 7410d5a commit 84f3d15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9b2696de920e7366e2ce0cdc3b3b7fc11e44e99
refs/heads/master: e296927bcc910ffa9e171c0108a4bf74c0836553
18 changes: 6 additions & 12 deletions trunk/drivers/video/nvidia/nv_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ static void nvidia_gpio_setscl(void *data, int state)
struct nvidia_par *par = chan->par;
u32 val;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base + 1);
val = VGA_RD08(par->PCIO, 0x3d5) & 0xf0;
val = NVReadCrtc(par, chan->ddc_base + 1) & 0xf0;

if (state)
val |= 0x20;
else
val &= ~0x20;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base + 1);
VGA_WR08(par->PCIO, 0x3d5, val | 0x1);
NVWriteCrtc(par, chan->ddc_base + 1, val | 0x01);
}

static void nvidia_gpio_setsda(void *data, int state)
Expand All @@ -48,16 +46,14 @@ static void nvidia_gpio_setsda(void *data, int state)
struct nvidia_par *par = chan->par;
u32 val;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base + 1);
val = VGA_RD08(par->PCIO, 0x3d5) & 0xf0;
val = NVReadCrtc(par, chan->ddc_base + 1) & 0xf0;

if (state)
val |= 0x10;
else
val &= ~0x10;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base + 1);
VGA_WR08(par->PCIO, 0x3d5, val | 0x1);
NVWriteCrtc(par, chan->ddc_base + 1, val | 0x01);
}

static int nvidia_gpio_getscl(void *data)
Expand All @@ -66,8 +62,7 @@ static int nvidia_gpio_getscl(void *data)
struct nvidia_par *par = chan->par;
u32 val = 0;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base);
if (VGA_RD08(par->PCIO, 0x3d5) & 0x04)
if (NVReadCrtc(par, chan->ddc_base) & 0x04)
val = 1;

return val;
Expand All @@ -79,8 +74,7 @@ static int nvidia_gpio_getsda(void *data)
struct nvidia_par *par = chan->par;
u32 val = 0;

VGA_WR08(par->PCIO, 0x3d4, chan->ddc_base);
if (VGA_RD08(par->PCIO, 0x3d5) & 0x08)
if (NVReadCrtc(par, chan->ddc_base) & 0x08)
val = 1;

return val;
Expand Down

0 comments on commit 84f3d15

Please sign in to comment.