diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2011-11-18 06:43:06 +0100 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2012-01-04 05:34:20 +0100 |
commit | 998a8e7a72f6a81f540d3a3774d8e8aae6c7f9f2 (patch) | |
tree | f7ff4549c84c810605badc151d3c6df5eef6d81c /drivers/power | |
parent | power_supply: Add LP8727 charger driver (diff) | |
download | linux-998a8e7a72f6a81f540d3a3774d8e8aae6c7f9f2.tar.xz linux-998a8e7a72f6a81f540d3a3774d8e8aae6c7f9f2.zip |
lp8727_charger: Add supported i2c functionality check routine
lp8727 i2c r/w functions are based on SMBUS I2C BLOCK. So the driver needs to
check whether i2c bus supports this functionality or not.
Signed-off-by: Woogyom Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/lp8727_charger.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 2a649e07ddde..a7e5cc2b4d74 100644 --- a/drivers/power/lp8727_charger.c +++ b/drivers/power/lp8727_charger.c @@ -425,6 +425,9 @@ static int lp8727_probe(struct i2c_client *cl, const struct i2c_device_id *id) struct lp8727_chg *pchg; int ret; + if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) + return -EIO; + pchg = kzalloc(sizeof(*pchg), GFP_KERNEL); if (!pchg) return -ENOMEM; |