diff options
author | Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> | 2012-06-22 16:22:25 +0300 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 13:00:27 +0200 |
commit | 8a894015184176f5cb268f0223082b31e0dd6786 (patch) | |
tree | 5319497d399594f2d4ff93dc131e3291b5074c1f /drivers/power | |
parent | fe342b51d771e5f74b805e2fd7ad431902f493d7 (diff) | |
download | kernel_samsung_tuna-8a894015184176f5cb268f0223082b31e0dd6786.zip kernel_samsung_tuna-8a894015184176f5cb268f0223082b31e0dd6786.tar.gz kernel_samsung_tuna-8a894015184176f5cb268f0223082b31e0dd6786.tar.bz2 |
MFD: TWL6030: Implementation of the ProDB00110684 errata
This errata affects only TWL6030 ES2.1. Each time a charge is
enabled via SW, a THMREG interrupt triggers (Internal USB charger
fault interrupt line).
Workaround: Interrupt (the bit #1 of CHARGERUSB_INT_MASK) has to be
masked before enabling the charge, and unmasked after charge is
enabled.
Change-Id: I14074e384a863c82ba61af9ea9434afe75cc2bc8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/twl6030_bci_battery.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/power/twl6030_bci_battery.c b/drivers/power/twl6030_bci_battery.c index cae20f8..d1a8f43 100644 --- a/drivers/power/twl6030_bci_battery.c +++ b/drivers/power/twl6030_bci_battery.c @@ -654,6 +654,7 @@ static void twl6030_start_usb_charger_sw(struct twl6030_bci_device_info *di) { int ret; u8 reg = 0; + u8 reg_int_mask = 0; if (!is_battery_present(di)) { dev_dbg(di->dev, "BATTERY NOT DETECTED!\n"); @@ -679,6 +680,23 @@ static void twl6030_start_usb_charger_sw(struct twl6030_bci_device_info *di) return; } + if (di->errata & TWL6030_ERRATA_DB00110684) { + /* mask CHARGERUSB_THMREG interrupt */ + + ret = twl_i2c_read_u8(TWL6030_MODULE_CHARGER, ®_int_mask, + CHARGERUSB_INT_MASK); + + if (ret) + goto err; + + reg_int_mask &= ~MASK_MCHARGERUSB_THMREG; + + ret = twl_i2c_write_u8(TWL6030_MODULE_CHARGER, reg_int_mask, + CHARGERUSB_INT_MASK); + if (ret) + goto err; + } + twl6030_config_vichrg_reg(di, di->charger_outcurrentmA); twl6030_config_cinlimit_reg(di, di->charger_incurrentmA); twl6030_config_voreg_reg(di, di->platform_data->max_bat_voltagemV); @@ -697,6 +715,17 @@ static void twl6030_start_usb_charger_sw(struct twl6030_bci_device_info *di) di->charge_status = POWER_SUPPLY_STATUS_CHARGING; } + + if (di->errata & TWL6030_ERRATA_DB00110684) { + /* unmask CHARGERUSB_THMREG interrupt */ + reg_int_mask |= MASK_MCHARGERUSB_THMREG; + + ret = twl_i2c_write_u8(TWL6030_MODULE_CHARGER, reg_int_mask, + CHARGERUSB_INT_MASK); + if (ret) + goto err; + } + return; err: pr_err("%s: Error access to TWL6030 (%d)\n", __func__, ret); |