Messages in this thread | | | From | Chanwoo Choi <> | Subject | [PATCH 0/2] charger-manager: Use EXTCON Subsystem to control charger cable | Date | Thu, 12 Jul 2012 15:03:16 +0900 |
| |
This patchset add support EXTCON Subsystem in which charger-manager identify the type of external connector and enable/disable charger(regulator) according to the state of charger cable(external connector).
First patch control charger(regulator) of charger-manager when external connector is attached or detached. If USB/TA cable is attached and thenE XTCON subsystem notify the state of external connector to notifee(charger-manager) which is registered in notifier chain of EXTCON, charger-manager enable charger (regulator) for charging according to 'struct charger_cable'.
Second patch protect host device from over current. The charger-manager set proper current limit of charger(regulator) for charging according to type of charger cable when external connector is attached.
For example, if TA cable(external connector) is attached, charger-manager enable charger('vinchg1' regulator) and set limit current within 65000~675000uA.
static struct charger_cable charger_cable_vinchg1[] = { { .extcon_name = "max8997-muic", .name = "USB", .min_uA = 475000, .max_uA = 475000 + 25000, }, { .extcon_name = "max8997-muic", .name = "TA", .min_uA = 650000, .max_uA = 650000 + 25000, }, };
static strcut charger_regulator nuri_regulators[] = { { .regulator_name = "vinchg1", .cables = charger_cable_vinchg1, .num_cables = ARRAY_SIZE(charger_cable_vinchg1), }, };
static struct charger_desc nuri_charger_desc = { // ......
.charger_regulators = nuri_regulators, .num_charger_regulators = ARRAY_SIZE(nuri_regulators), };
Chanwoo Choi (2): charger-manager: Use EXTCON Subsystem to detect charger cables for charging charger-manager: Set current limit of regulator for over current protection
drivers/power/charger-manager.c | 152 +++++++++++++++++++++++++++++---- include/linux/power/charger-manager.h | 67 ++++++++++++++- 2 files changed, 202 insertions(+), 17 deletions(-)
| |