]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00277805-6 usb: chipidea: add ci_hdrc_enter_lpm API
authorPeter Chen <peter.chen@freescale.com>
Tue, 13 Aug 2013 07:18:01 +0000 (15:18 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:26 +0000 (10:06 +0200)
It is used to let the PHY enters low power mode at
controller suspend routine.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/core.c
include/linux/usb/chipidea.h

index 619d13e29995dc9ac5010081068528b0f4932d91..20aa600e0bfeb76edb65dd55f3d97af9085d2dbf 100644 (file)
@@ -539,6 +539,20 @@ void ci_hdrc_remove_device(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(ci_hdrc_remove_device);
 
+void ci_hdrc_enter_lpm(struct platform_device *pdev, bool enable)
+{
+       struct ci_hdrc *ci = platform_get_drvdata(pdev);
+       enum ci_hw_regs reg = ci->hw_bank.lpm ? OP_DEVLC : OP_PORTSC;
+
+       if (enable)
+               hw_write(ci, reg, PORTSC_PHCD(ci->hw_bank.lpm),
+                               PORTSC_PHCD(ci->hw_bank.lpm));
+       else
+               hw_write(ci, reg, PORTSC_PHCD(ci->hw_bank.lpm),
+                               0);
+}
+EXPORT_SYMBOL_GPL(ci_hdrc_enter_lpm);
+
 static inline void ci_role_destroy(struct ci_hdrc *ci)
 {
        ci_hdrc_gadget_destroy(ci);
index bbe779f640bed0c91869d527b67d9d797b8441b7..1eaa2c3a8101053871c2c01418977b44d889eef1 100644 (file)
@@ -43,4 +43,5 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
 /* Remove ci hdrc device */
 void ci_hdrc_remove_device(struct platform_device *pdev);
 
+void ci_hdrc_enter_lpm(struct platform_device *pdev, bool enable);
 #endif