power: charger-manager: Add uevent_notify for cable notification
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Wed, 16 Jul 2014 05:14:40 +0000 (14:14 +0900)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 06:17:53 +0000 (15:17 +0900)
Charger-manager works with cable notification from extcon sub system,
and it has to notify users when charging status is updated due to the
cable connection.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
drivers/power/charger-manager.c

index aca5a33..5a1baf1 100644 (file)
@@ -1176,7 +1176,9 @@ static void charger_extcon_work(struct work_struct *work)
                                        cable->min_uA, cable->max_uA);
        }
 
-       try_charger_enable(cable->cm, cable->attached);
+       if (!try_charger_enable(cable->cm, cable->attached))
+               uevent_notify(cable->cm,
+                       cable->attached ? "CHARGING" : "DISCHARGING");
 }
 
 /**