diff options
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/bq27x00_battery.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c index ed6846f6133..e0ab81f4cc3 100644 --- a/drivers/power/bq27x00_battery.c +++ b/drivers/power/bq27x00_battery.c @@ -50,9 +50,9 @@ #include "../staging/triune/ts81001.h" #endif /* CONFIG_OLIO_TS81001 */ - #ifdef OLIODEBUG -#define do { olio_debug(format, ...) printk("OLIO %s: ", __FUNCTION__); \ +#define olio_debug(format, ...) do { \ + printk("OLIO %s: ", __FUNCTION__); \ printk(format, ##__VA_ARGS__); } while(0) #else #define olio_debug(format, ...) @@ -974,9 +974,11 @@ static void bq27x00_update(struct bq27x00_device_info *di) bool is_bq274xx = di->chip == BQ274XX; bool is_bq276xx = di->chip == BQ276XX; + olio_debug ("entered\n"); + cache.flags = bq27xxx_read(di, BQ27XXX_REG_FLAGS, !is_bq27500); - printk ("%s OLIO Cache flags read from bq is 0x%x\n", __FUNCTION__, cache.flags); + printk ("Cache flags read from bq is 0x%x\n", cache.flags); if (cache.flags >= 0) { if (is_bq27200 && (cache.flags & BQ27200_FLAG_CI)) { @@ -1210,13 +1212,11 @@ static int bq27x00_charger_status(struct bq27x00_device_info *di) { olio_debug("Got client data for dev %s\n", dev_name(ts81001->dev)); -#ifdef CHG_FLAGS_WORKING - if(di->cache.flags & BQ27XXX_FLAG_CHG) { -#endif - ts81001->ops->request_charge(ts81001); -#ifdef CHG_FLAGS_WORKING + if(di->cache.flags & BQ27XXX_FLAG_FC) { + ts81001->ops->request_charge(ts81001, 100); + } else { + ts81001->ops->request_charge(ts81001, 390); } -#endif state = ts81001->ops->get_status(ts81001); @@ -1509,6 +1509,7 @@ static int __init bq27x00_powersupply_init(struct bq27x00_device_info *di) } ret = enable_irq_wake(di->irq); + if (ret) { dev_err(di->dev, "failed to enable irq: %d, as wake\n", di->irq); return ret; |