Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294284
b: refs/heads/master
c: 2c4c8a8
h: refs/heads/master
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed Feb 12, 2012
1 parent fe154ce commit e4e0c34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: e75892715db800ee96fe4ac0407b73b57d866a68
refs/heads/master: 2c4c8a8a73b64a8ea86ad85d8a59a5914d2f81ea
10 changes: 8 additions & 2 deletions trunk/drivers/video/via/via_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void via_i2c_setscl(void *data, int state)
val |= 0x01;
break;
case VIA_PORT_GPIO:
val |= 0x80;
val |= 0x82;
break;
default:
printk(KERN_ERR "viafb_i2c: specify wrong i2c type.\n");
Expand All @@ -67,6 +67,9 @@ static int via_i2c_getscl(void *data)
int ret = 0;

spin_lock_irqsave(&i2c_vdev->reg_lock, flags);
if (adap_data->type == VIA_PORT_GPIO)
via_write_reg_mask(adap_data->io_port, adap_data->ioport_index,
0, 0x80);
if (via_read_reg(adap_data->io_port, adap_data->ioport_index) & 0x08)
ret = 1;
spin_unlock_irqrestore(&i2c_vdev->reg_lock, flags);
Expand All @@ -80,6 +83,9 @@ static int via_i2c_getsda(void *data)
int ret = 0;

spin_lock_irqsave(&i2c_vdev->reg_lock, flags);
if (adap_data->type == VIA_PORT_GPIO)
via_write_reg_mask(adap_data->io_port, adap_data->ioport_index,
0, 0x40);
if (via_read_reg(adap_data->io_port, adap_data->ioport_index) & 0x04)
ret = 1;
spin_unlock_irqrestore(&i2c_vdev->reg_lock, flags);
Expand All @@ -103,7 +109,7 @@ static void via_i2c_setsda(void *data, int state)
val |= 0x01;
break;
case VIA_PORT_GPIO:
val |= 0x40;
val |= 0x42;
break;
default:
printk(KERN_ERR "viafb_i2c: specify wrong i2c type.\n");
Expand Down

0 comments on commit e4e0c34

Please sign in to comment.