From e436a0784e6ad6279a300c86ef2f0450ab66748f Mon Sep 17 00:00:00 2001 From: Elaine Zhang Date: Tue, 10 Jan 2017 16:40:55 +0800 Subject: [PATCH] Revert "mfd: fusb302: avoid sending notifier to USB/DP during PM suspend" This reverts commit 082f43af91698a82583053679ec0d0be89b36b2d. Change-Id: Iae816df6de573c03cf87b0091fb920c4673dbb54 Signed-off-by: Elaine Zhang --- drivers/mfd/fusb302.c | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/drivers/mfd/fusb302.c b/drivers/mfd/fusb302.c index 96b3344b4bdf..53b236b1dc0d 100644 --- a/drivers/mfd/fusb302.c +++ b/drivers/mfd/fusb302.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include @@ -249,32 +248,6 @@ static void platform_fusb_notify(struct fusb30x_chip *chip) usb_ss = 1; } - if (chip->notify.power_role == 0 && - chip->notify.is_pd_connected && - chip->pd_output_vol > 0 && chip->pd_output_cur > 0) { - extcon_set_state(chip->extcon, EXTCON_CHG_USB_FAST, - true); - property.intval = - (chip->pd_output_cur << 15 | - chip->pd_output_vol); - extcon_set_property(chip->extcon, EXTCON_CHG_USB_FAST, - EXTCON_PROP_USB_TYPEC_POLARITY, - property); - extcon_sync(chip->extcon, EXTCON_CHG_USB_FAST); - } - -#ifdef CONFIG_FREEZER - /* - * If system enter PM suspend, we need to wait until - * PM resume all of devices completion, then the flag - * pm_freezing will be set to false, and we can send - * notifier to USB/DP module safety, it make sure that - * USB/DP can enable power domain successfully. - */ - while (pm_freezing) - usleep_range(10000, 11000); -#endif - property.intval = flip; extcon_set_property(chip->extcon, EXTCON_USB, EXTCON_PROP_USB_TYPEC_POLARITY, property); @@ -296,6 +269,18 @@ static void platform_fusb_notify(struct fusb30x_chip *chip) extcon_sync(chip->extcon, EXTCON_USB); extcon_sync(chip->extcon, EXTCON_USB_HOST); extcon_sync(chip->extcon, EXTCON_DISP_DP); + if (chip->notify.power_role == 0 && + chip->notify.is_pd_connected && + chip->pd_output_vol > 0 && chip->pd_output_cur > 0) { + extcon_set_state(chip->extcon, EXTCON_CHG_USB_FAST, true); + property.intval = + (chip->pd_output_cur << 15 | + chip->pd_output_vol); + extcon_set_property(chip->extcon, EXTCON_CHG_USB_FAST, + EXTCON_PROP_USB_TYPEC_POLARITY, + property); + extcon_sync(chip->extcon, EXTCON_CHG_USB_FAST); + } } } -- 2.34.1