diff options
| -rw-r--r-- | drivers/mfd/twl-core.c | 13 | ||||
| -rw-r--r-- | include/linux/i2c/twl.h | 15 |
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 942a1e837819..7ccc39f3aa48 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c | |||
| @@ -958,6 +958,7 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 958 | int status; | 958 | int status; |
| 959 | unsigned i; | 959 | unsigned i; |
| 960 | struct twl4030_platform_data *pdata = client->dev.platform_data; | 960 | struct twl4030_platform_data *pdata = client->dev.platform_data; |
| 961 | u8 temp; | ||
| 961 | 962 | ||
| 962 | if (!pdata) { | 963 | if (!pdata) { |
| 963 | dev_dbg(&client->dev, "no platform data?\n"); | 964 | dev_dbg(&client->dev, "no platform data?\n"); |
| @@ -1025,6 +1026,18 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 1025 | goto fail; | 1026 | goto fail; |
| 1026 | } | 1027 | } |
| 1027 | 1028 | ||
| 1029 | /* Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface. | ||
| 1030 | * Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0, | ||
| 1031 | * SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0. | ||
| 1032 | */ | ||
| 1033 | |||
| 1034 | if (twl_class_is_4030()) { | ||
| 1035 | twl_i2c_read_u8(TWL4030_MODULE_INTBR, &temp, REG_GPPUPDCTR1); | ||
| 1036 | temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \ | ||
| 1037 | I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU); | ||
| 1038 | twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); | ||
| 1039 | } | ||
| 1040 | |||
| 1028 | status = add_children(pdata, id->driver_data); | 1041 | status = add_children(pdata, id->driver_data); |
| 1029 | fail: | 1042 | fail: |
| 1030 | if (status < 0) | 1043 | if (status < 0) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 9733e9e53f2b..e28d4c0e45bd 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -239,6 +239,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | |||
| 239 | 239 | ||
| 240 | /*----------------------------------------------------------------------*/ | 240 | /*----------------------------------------------------------------------*/ |
| 241 | 241 | ||
| 242 | /*Interface Bit Register (INTBR) offsets | ||
| 243 | *(Use TWL_4030_MODULE_INTBR) | ||
| 244 | */ | ||
| 245 | |||
| 246 | #define REG_GPPUPDCTR1 0x0F | ||
| 247 | |||
| 248 | /*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */ | ||
| 249 | |||
| 250 | #define I2C_SCL_CTRL_PU BIT(0) | ||
| 251 | #define I2C_SDA_CTRL_PU BIT(2) | ||
| 252 | #define SR_I2C_SCL_CTRL_PU BIT(4) | ||
| 253 | #define SR_I2C_SDA_CTRL_PU BIT(6) | ||
| 254 | |||
| 255 | /*----------------------------------------------------------------------*/ | ||
| 256 | |||
| 242 | /* | 257 | /* |
| 243 | * Keypad register offsets (use TWL4030_MODULE_KEYPAD) | 258 | * Keypad register offsets (use TWL4030_MODULE_KEYPAD) |
| 244 | * ... SIH/interrupt only | 259 | * ... SIH/interrupt only |
