Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193557
b: refs/heads/master
c: 4da62e6
h: refs/heads/master
i:
  193555: 236d4ca
v: v3
  • Loading branch information
Jonathan Corbet committed Apr 27, 2010
1 parent ef865d0 commit 7ebd224
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 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: c774c13dd2826eb91ab6396fd8501df2fc2d83b3
refs/heads/master: 4da62e6c6e056d709e5dc04ac7c5e81692cf924f
19 changes: 13 additions & 6 deletions trunk/drivers/video/via/via_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,18 @@ static int create_i2c_bus(struct i2c_adapter *adapter,
return i2c_bit_add_bus(adapter);
}

/*
* By default, we only activate busses on ports 2c and 31 to avoid
* conflicts with other possible users; that default can be changed
* below.
*/
static struct via_i2c_adap_cfg adap_configs[] = {
[VIA_I2C_ADAP_26] = { VIA_I2C_I2C, VIASR, 0x26 },
[VIA_I2C_ADAP_31] = { VIA_I2C_I2C, VIASR, 0x31 },
[VIA_I2C_ADAP_25] = { VIA_I2C_GPIO, VIASR, 0x25 },
[VIA_I2C_ADAP_2C] = { VIA_I2C_GPIO, VIASR, 0x2c },
[VIA_I2C_ADAP_3D] = { VIA_I2C_GPIO, VIASR, 0x3d },
{ 0, 0, 0 }
[VIA_I2C_ADAP_26] = { VIA_I2C_I2C, VIASR, 0x26, 0 },
[VIA_I2C_ADAP_31] = { VIA_I2C_I2C, VIASR, 0x31, 1 },
[VIA_I2C_ADAP_25] = { VIA_I2C_GPIO, VIASR, 0x25, 0 },
[VIA_I2C_ADAP_2C] = { VIA_I2C_GPIO, VIASR, 0x2c, 1 },
[VIA_I2C_ADAP_3D] = { VIA_I2C_GPIO, VIASR, 0x3d, 0 },
{ 0, 0, 0, 0 }
};

int viafb_create_i2c_busses(struct viafb_par *viapar)
Expand All @@ -189,6 +194,8 @@ int viafb_create_i2c_busses(struct viafb_par *viapar)

if (adap_cfg->type == 0)
break;
if (!adap_cfg->is_active)
continue;

ret = create_i2c_bus(&i2c_stuff->adapter,
&i2c_stuff->algo, adap_cfg,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/video/via/via_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct via_i2c_adap_cfg {
enum via_i2c_type type;
u_int16_t io_port;
u_int8_t ioport_index;
u8 is_active;
};

struct via_i2c_stuff {
Expand Down

0 comments on commit 7ebd224

Please sign in to comment.