drm/radeon: 9800 SE has only one quadpipe
[safe/jmp/linux-2.6] / drivers / mfd / twl-core.c
index d81003f..562cd49 100644 (file)
 #define TWL_NUM_SLAVES         4
 
 #if defined(CONFIG_INPUT_TWL4030_PWRBUTTON) \
-       || defined(CONFIG_INPUT_TWL4030_PWBUTTON_MODULE)
+       || defined(CONFIG_INPUT_TWL4030_PWRBUTTON_MODULE)
 #define twl_has_pwrbutton()    true
 #else
 #define twl_has_pwrbutton()    false
 /* subchip/slave 3 0x4B - AUDIO */
 #define TWL6030_BASEADD_AUDIO          0x0000
 #define TWL6030_BASEADD_RSV            0x0000
+#define TWL6030_BASEADD_ZERO           0x0000
 
 /* Few power values */
 #define R_CFG_BOOT                     0x05
@@ -313,9 +314,11 @@ static struct twl_mapping twl6030_map[] = {
        { SUB_CHIP_ID1, TWL6030_BASEADD_CHARGER },
        { SUB_CHIP_ID1, TWL6030_BASEADD_GASGAUGE },
        { SUB_CHIP_ID1, TWL6030_BASEADD_PWM },
-       { SUB_CHIP_ID2, TWL6030_BASEADD_RSV },
-       { SUB_CHIP_ID2, TWL6030_BASEADD_RSV },
+       { SUB_CHIP_ID0, TWL6030_BASEADD_ZERO },
+       { SUB_CHIP_ID1, TWL6030_BASEADD_ZERO },
 
+       { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO },
+       { SUB_CHIP_ID2, TWL6030_BASEADD_ZERO },
        { SUB_CHIP_ID2, TWL6030_BASEADD_RSV },
        { SUB_CHIP_ID2, TWL6030_BASEADD_RSV },
        { SUB_CHIP_ID2, TWL6030_BASEADD_RSV },
@@ -958,6 +961,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");
@@ -1025,6 +1029,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)