Messages in this thread Patch in this message | | | From | "Kim, Milo" <> | Date | Thu, 17 Nov 2011 21:43:06 -0800 | Subject | [PATCH] power: lp8727 - add supported i2c functionality check routine |
| |
Hi, Anton
I send the patch for lp8727 charger driver.
Signed-off-by: Woogyom Kim <milo.kim@ti.com>
From c72a8a461d19ace81d9d092e8a23de741dd2144f Mon Sep 17 00:00:00 2001 From: Milo(Woogyom) Kim <milo.kim@ti.com> Date: Fri, 18 Nov 2011 14:30:59 +0900 Subject: [PATCH] power : lp8727 - 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. --- 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 6d13f83..b15b575 100755 --- 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; -- 1.7.4.1 Thanks & BR Milo (Woogyom)
| |