From ebc8a767c00bf03ea0db1dff4c3ec56919189f77 Mon Sep 17 00:00:00 2001 From: Rohit Sisodia Date: Thu, 18 Nov 2021 12:14:59 -0600 Subject: [PATCH] Revert "(CR) power:fet_control Remove ps_notification cb" This reverts commit e7c24f09b40f98dc3ba5f23586e3db0769d99997. Change-Id: I7765f6c6234bd85452fe7260ee2e43615e6a7053 Reviewed-on: https://gerrit.mot.com/2121057 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Reviewed-by: Yinjun Chen Submit-Approved: Yinjun Chen Tested-by: Yinjun Chen --- drivers/power/fet-control/fet_control.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/power/fet-control/fet_control.c b/drivers/power/fet-control/fet_control.c index 87e89e4b2f9b..2fe17f6d975b 100755 --- a/drivers/power/fet-control/fet_control.c +++ b/drivers/power/fet-control/fet_control.c @@ -322,7 +322,7 @@ static void update_work(struct work_struct *work) /* Main current in uA */ main_curr = get_ps_int_prop(data->main_batt_psy, POWER_SUPPLY_PROP_CURRENT_NOW); - if (main_curr > 0 || usbtype != POWER_SUPPLY_USB_TYPE_UNKNOWN) + if (main_curr > 0) pr_info("Charging Main\n"); else main_chg = -1; @@ -388,7 +388,7 @@ static void update_work(struct work_struct *work) schedule_delayed_work(&data->update, msecs_to_jiffies(hb_sched_time)); } -/* + static int ps_notify_callback(struct notifier_block *nb, unsigned long event, void *p) { @@ -427,7 +427,7 @@ static int ps_notify_callback(struct notifier_block *nb, return 0; } -*/ + static int parse_dt(struct device_node *node) { int rc = 0; @@ -571,11 +571,11 @@ static int fet_control_probe(struct platform_device *pdev) gpio_get_value(fetControlData.vbus_ocp_fault_n_gpio) ); // Notify on plug/unplug - /*fetControlData.ps_notif.notifier_call = ps_notify_callback; + fetControlData.ps_notif.notifier_call = ps_notify_callback; if (power_supply_reg_notifier(&fetControlData.ps_notif)) { pr_err("Failed to register notifier\n"); goto fail; - }*/ + } // Work to update the fet & charge current states. INIT_DELAYED_WORK(&fetControlData.update, update_work);