lkml.org 
[lkml]   [2011]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
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)

\
 
 \ /
  Last update: 2011-11-18 07:03    [from the cache]
©2003-2011 Jasper Spaans