@@ -25,6 +25,7 @@
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/i2c.h>
+#include <linux/i2c/pmbus.h>
#include "pmbus.h"
/*
@@ -167,14 +168,26 @@ static int pmbus_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct pmbus_driver_info *info;
+ struct pmbus_platform_data *pdata = NULL;
+ struct device *dev = &client->dev;
info = devm_kzalloc(&client->dev, sizeof(struct pmbus_driver_info),
GFP_KERNEL);
if (!info)
return -ENOMEM;
+ if (!strcmp(id->name, "dps460") || !strcmp(id->name, "dps460") ||
+ !strcmp(id->name, "sgd009")) {
+ pdata = kzalloc(sizeof(struct pmbus_platform_data), GFP_KERNEL);
+ if (!pdata) {
+ kfree(info);
+ return -ENOMEM;
+ }
+ pdata->flags = PMBUS_SKIP_STATUS_CHECK;
+ }
info->pages = id->driver_data;
info->identify = pmbus_identify;
+ dev->platform_data = pdata;
return pmbus_do_probe(client, id, info);
}
@@ -199,6 +212,9 @@ static const struct i2c_device_id pmbus_id[] = {
{"tps544c20", 1},
{"tps544c25", 1},
{"udt020", 1},
+ {"dps460", 1},
+ {"dps800", 1},
+ {"sgd009", 1},
{}
};
@@ -1931,8 +1931,11 @@ EXPORT_SYMBOL_GPL(pmbus_do_probe);
int pmbus_do_remove(struct i2c_client *client)
{
struct pmbus_data *data = i2c_get_clientdata(client);
+ const struct pmbus_platform_data *pdata =
+ dev_get_platdata(&client->dev);
hwmon_device_unregister(data->hwmon_dev);
kfree(data->group.attrs);
+ kfree(pdata);
return 0;
}
EXPORT_SYMBOL_GPL(pmbus_do_remove);