TPS65910: GPIO: Add GPIO driver
[linux-2.6-block.git] / drivers / mfd / tps65910.c
index dbcdfb55bb8dd7818313cdfa3eba06628e96aca4..5a6a7be1f8cf7c7910bb02de3ca107434164511d 100644 (file)
@@ -135,8 +135,13 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
                            const struct i2c_device_id *id)
 {
        struct tps65910 *tps65910;
+       struct tps65910_board *pmic_plat_data;
        int ret = 0;
 
+       pmic_plat_data = dev_get_platdata(&i2c->dev);
+       if (!pmic_plat_data)
+               return -EINVAL;
+
        tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL);
        if (tps65910 == NULL)
                return -ENOMEM;
@@ -154,6 +159,8 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
        if (ret < 0)
                goto err;
 
+       tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base);
+
        return ret;
 
 err: