return 0;
}
+#if defined(CONFIG_IFCONN_NOTIFIER)
+static int exynos_set_charger(bool enable)
+{
+ if (enable) {
+ pr_info("%s - revert usb notification\n", __func__);
+ check_usb_vbus_state(0);
+ }
+
+ return 0;
+}
+#endif
+
#if defined(CONFIG_BATTERY_SAMSUNG_V2)
static int usb_blocked_chg_control(int set)
{
.set_host = exynos_set_host,
.set_peripheral = exynos_set_peripheral,
#if defined(CONFIG_IFCONN_NOTIFIER)
+ .set_charger = exynos_set_charger,
.charger_detect = 0,
+ .usb_noti_done = 0,
#endif
.vbus_detect_gpio = -1,
.is_wakelock = 0,
n->pre_peri_delay_us * 1000);
#if defined(CONFIG_IFCONN_NOTIFIER)
pr_info("Charger status in usb detect = %d\n", n->charger_detect);
- if (n->set_peripheral && n->charger_detect == 0)
+ if (n->set_peripheral && n->charger_detect == 0) {
n->set_peripheral(true);
+ n->usb_noti_done = 1;
+ }
#else
if (n->set_peripheral)
n->set_peripheral(true);
}
break;
case NOTIFY_EVENT_CHARGER:
- if (n->set_charger)
- n->set_charger(enable);
#if defined(CONFIG_IFCONN_NOTIFIER)
pr_info("%s charger detect = %d\n", __func__, enable);
- if (enable)
+ if (enable) {
n->charger_detect = 1;
- else
+ if (n->usb_noti_done) {
+ n->set_charger(enable);
+ n->usb_noti_done = 0;
+ }
+ } else {
n->charger_detect = 0;
+ }
+#else
+ if (n->set_charger)
+ n->set_charger(enable);
#endif
break;
case NOTIFY_EVENT_MMDOCK: