Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186916
b: refs/heads/master
c: a29aaf5
h: refs/heads/master
v: v3
  • Loading branch information
Moiz Sonasath authored and Samuel Ortiz committed Mar 7, 2010
1 parent ef04409 commit a2637b9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e82c60ae7d3a7f19c4b9b3e7bd6ea298fa5efe93
refs/heads/master: a29aaf55cd6faa75e35abfe00bd3ffc537490485
13 changes: 13 additions & 0 deletions trunk/drivers/mfd/twl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
int status;
unsigned i;
struct twl4030_platform_data *pdata = client->dev.platform_data;
u8 temp;

if (!pdata) {
dev_dbg(&client->dev, "no platform data?\n");
Expand Down Expand Up @@ -1025,6 +1026,18 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto fail;
}

/* Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface.
* Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0,
* SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0.
*/

if (twl_class_is_4030()) {
twl_i2c_read_u8(TWL4030_MODULE_INTBR, &temp, REG_GPPUPDCTR1);
temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \
I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU);
twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
}

status = add_children(pdata, id->driver_data);
fail:
if (status < 0)
Expand Down
15 changes: 15 additions & 0 deletions trunk/include/linux/i2c/twl.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);

/*----------------------------------------------------------------------*/

/*Interface Bit Register (INTBR) offsets
*(Use TWL_4030_MODULE_INTBR)
*/

#define REG_GPPUPDCTR1 0x0F

/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */

#define I2C_SCL_CTRL_PU BIT(0)
#define I2C_SDA_CTRL_PU BIT(2)
#define SR_I2C_SCL_CTRL_PU BIT(4)
#define SR_I2C_SDA_CTRL_PU BIT(6)

/*----------------------------------------------------------------------*/

/*
* Keypad register offsets (use TWL4030_MODULE_KEYPAD)
* ... SIH/interrupt only
Expand Down

0 comments on commit a2637b9

Please sign in to comment.