From: a17671 Date: Fri, 1 Mar 2019 04:47:11 +0000 (+0800) Subject: usbpd:Add the missing changes back X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db1299e7ce7dd21057ed538f048ec10cfd87520c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usbpd:Add the missing changes back There are some lines missing After the merge conflict of Moto changes and usbpd compliance patch Add them back Change-Id: Ib962f1b6d732bced3ee8ac85c119803f197dd84a Signed-off-by: a17671 Reviewed-on: https://gerrit.mot.com/1315964 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- diff --git a/drivers/power/supply/s2mu00x_battery.c b/drivers/power/supply/s2mu00x_battery.c index 29a87f87d289..0ecd3f3dc454 100644 --- a/drivers/power/supply/s2mu00x_battery.c +++ b/drivers/power/supply/s2mu00x_battery.c @@ -4268,6 +4268,7 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) battery->dev = &pdev->dev; mutex_init(&battery->iolock); + mutex_init(&battery->ifconn_lock); wake_lock_init(&battery->monitor_wake_lock, WAKE_LOCK_SUSPEND, "sec-battery-monitor"); @@ -4281,12 +4282,15 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) battery->input_current = 0; battery->charging_current = 0; battery->topoff_current = 0; + battery->small_input_flag = 0; battery->max_input_current = battery->pdata->max_input_current; battery->max_charging_current = battery->pdata->max_charging_current; #if defined(CONFIG_USE_CCIC) battery->pdo_max_input_vol = battery->pdata->pdo_max_input_vol; battery->pdo_max_chg_power = battery->pdata->pdo_max_chg_power; + battery->pd_input_current= 2000; + battery->pd_attach = false; #endif battery->temp_high = battery->pdata->temp_high; battery->temp_high_recovery = battery->pdata->temp_high_recovery; @@ -4298,6 +4302,8 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) battery->charging_disabled = false; battery->is_recharging = false; battery->cable_type = POWER_SUPPLY_TYPE_BATTERY; + battery->pd_attach = false; + #if defined(CHARGER_S2MU106) psy = power_supply_get_by_name(battery->pdata->charger_name); if (!psy) @@ -4401,7 +4407,6 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) if (ret < 0) pr_err("%s: Fail to execute property\n", __func__); - #if 0 #if defined(CONFIG_IFCONN_NOTIFIER) ifconn_notifier_register(&battery->ifconn_nb, @@ -4417,7 +4422,6 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) muic_notifier_register(&battery->batt_nb, s2mu00x_battery_handle_notification, MUIC_NOTIFY_DEV_CHARGER); #endif - /* Kick off monitoring thread */ pr_info("%s: start battery monitoring work\n", __func__); queue_delayed_work(battery->monitor_wqueue, &battery->monitor_work, 5*HZ); @@ -4552,6 +4556,11 @@ static int s2mu00x_battery_probe(struct platform_device *pdev) muic_notifier_register(&battery->batt_nb, s2mu00x_battery_handle_notification, MUIC_NOTIFY_DEV_CHARGER); #endif + ifconn_notifier_register(&battery->ifconn_nb, + s2mu00x_ifconn_handle_notification, + IFCONN_NOTIFY_BATTERY, + IFCONN_NOTIFY_CCIC); + /* Kick off monitoring thread */ pr_info("%s: start battery monitoring work\n", __func__);