]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10174-2 usb: chipidea: host: keep controller power if host has dev connected
authorLi Jun <jun.li@freescale.com>
Thu, 29 Jan 2015 02:32:32 +0000 (10:32 +0800)
committerLi Jun <jun.li@freescale.com>
Thu, 29 Jan 2015 04:47:42 +0000 (12:47 +0800)
This patch is to keep usb controller power on while system suspend if there
is usb device connected by telling GPC to keep mega fast domain power.

Signed-off-by: Li Jun <jun.li@freescale.com>
drivers/usb/chipidea/host.c

index 85febf7c0e0114ac33b3ee2c8a1c07229796800f..4bfb1d43532bfb2eb9296134fd6f20a0bb296963 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/usb/hcd.h>
 #include <linux/usb/chipidea.h>
 #include <linux/regulator/consumer.h>
+#include <linux/imx_gpc.h>
 
 #include "../host/ehci.h"
 
@@ -378,11 +379,16 @@ static void ci_hdrc_host_restore_from_power_lost(struct ci_hdrc *ci)
 
 static void ci_hdrc_host_suspend(struct ci_hdrc *ci)
 {
+       if (ci_hdrc_host_has_device(ci))
+               imx_gpc_mf_request_on(ci->irq, 1);
+
        ci_hdrc_host_save_for_power_lost(ci);
 }
 
 static void ci_hdrc_host_resume(struct ci_hdrc *ci, bool power_lost)
 {
+       imx_gpc_mf_request_on(ci->irq, 0);
+
        if (power_lost)
                ci_hdrc_host_restore_from_power_lost(ci);
 }