Loading Documentation/devicetree/bindings/usb/msm-hsusb.txt +4 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,10 @@ Optional properties : ext-hub-reset-gpio GPIO. It should be driven LOW to RESET the HUB. - qcom,usb2-enable-uicc: If present, usb2 port will be used for uicc card connection. - usb-phy: phandle for the PHY device, if described as a separate device tree node - qcom,pm-qos-latency: This property represents the maximum tolerable CPU latency in microsecs, which is used as a vote to keep the CPUs in a high enough power state when USB bus is in use (not suspended). Example MSM HSUSB EHCI controller device node : ehci: qcom,ehci-host@f9a55000 { Loading drivers/usb/host/ehci-msm2.c +15 −2 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct msm_hcd { int wakeup_irq; void __iomem *usb_phy_ctrl_reg; struct pinctrl *hsusb_pinctrl; struct pm_qos_request pm_qos_req_dma; }; static inline struct msm_hcd *hcd_to_mhcd(struct usb_hcd *hcd) Loading Loading @@ -802,6 +803,9 @@ static int msm_ehci_suspend(struct msm_hcd *mhcd) enable_irq_wake(mhcd->async_irq); enable_irq(mhcd->async_irq); } pm_qos_update_request(&mhcd->pm_qos_req_dma, PM_QOS_DEFAULT_VALUE); pm_relax(mhcd->dev); dev_info(mhcd->dev, "EHCI USB in low power mode\n"); Loading Loading @@ -854,6 +858,10 @@ static int msm_ehci_resume(struct msm_hcd *mhcd) pm_stay_awake(mhcd->dev); pdata = mhcd->dev->platform_data; if (pdata) pm_qos_update_request(&mhcd->pm_qos_req_dma, pdata->pm_qos_latency + 1); /* Vote for TCXO when waking up the phy */ if (mhcd->xo_clk) clk_prepare_enable(mhcd->xo_clk); Loading Loading @@ -890,8 +898,7 @@ static int msm_ehci_resume(struct msm_hcd *mhcd) } skip_phy_resume: pdata = mhcd->dev->platform_data; if (pdata && pdata->is_uicc) { if (pdata->is_uicc) { /* put the controller in normal mode */ func_ctrl = msm_ulpi_read(mhcd, ULPI_FUNC_CTRL); func_ctrl &= ~ULPI_FUNC_CTRL_OPMODE_MASK; Loading Loading @@ -1303,6 +1310,8 @@ struct msm_usb_host_platform_data *ehci_msm2_dt_to_pdata( "qcom,ext-hub-reset-gpio", 0); pdata->is_uicc = of_property_read_bool(node, "qcom,usb2-enable-uicc"); of_property_read_u32(node, "qcom,pm-qos-latency", &pdata->pm_qos_latency); return pdata; } Loading Loading @@ -1597,6 +1606,10 @@ static int ehci_msm2_probe(struct platform_device *pdev) mhcd->pmic_gpio_dp_irq = 0; } } pm_qos_add_request(&mhcd->pm_qos_req_dma, PM_QOS_CPU_DMA_LATENCY, pdata->pm_qos_latency + 1); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); Loading include/linux/usb/msm_hsusb.h +1 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,7 @@ struct msm_usb_host_platform_data { int resume_gpio; int ext_hub_reset_gpio; bool is_uicc; int pm_qos_latency; }; /** Loading Loading
Documentation/devicetree/bindings/usb/msm-hsusb.txt +4 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,10 @@ Optional properties : ext-hub-reset-gpio GPIO. It should be driven LOW to RESET the HUB. - qcom,usb2-enable-uicc: If present, usb2 port will be used for uicc card connection. - usb-phy: phandle for the PHY device, if described as a separate device tree node - qcom,pm-qos-latency: This property represents the maximum tolerable CPU latency in microsecs, which is used as a vote to keep the CPUs in a high enough power state when USB bus is in use (not suspended). Example MSM HSUSB EHCI controller device node : ehci: qcom,ehci-host@f9a55000 { Loading
drivers/usb/host/ehci-msm2.c +15 −2 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ struct msm_hcd { int wakeup_irq; void __iomem *usb_phy_ctrl_reg; struct pinctrl *hsusb_pinctrl; struct pm_qos_request pm_qos_req_dma; }; static inline struct msm_hcd *hcd_to_mhcd(struct usb_hcd *hcd) Loading Loading @@ -802,6 +803,9 @@ static int msm_ehci_suspend(struct msm_hcd *mhcd) enable_irq_wake(mhcd->async_irq); enable_irq(mhcd->async_irq); } pm_qos_update_request(&mhcd->pm_qos_req_dma, PM_QOS_DEFAULT_VALUE); pm_relax(mhcd->dev); dev_info(mhcd->dev, "EHCI USB in low power mode\n"); Loading Loading @@ -854,6 +858,10 @@ static int msm_ehci_resume(struct msm_hcd *mhcd) pm_stay_awake(mhcd->dev); pdata = mhcd->dev->platform_data; if (pdata) pm_qos_update_request(&mhcd->pm_qos_req_dma, pdata->pm_qos_latency + 1); /* Vote for TCXO when waking up the phy */ if (mhcd->xo_clk) clk_prepare_enable(mhcd->xo_clk); Loading Loading @@ -890,8 +898,7 @@ static int msm_ehci_resume(struct msm_hcd *mhcd) } skip_phy_resume: pdata = mhcd->dev->platform_data; if (pdata && pdata->is_uicc) { if (pdata->is_uicc) { /* put the controller in normal mode */ func_ctrl = msm_ulpi_read(mhcd, ULPI_FUNC_CTRL); func_ctrl &= ~ULPI_FUNC_CTRL_OPMODE_MASK; Loading Loading @@ -1303,6 +1310,8 @@ struct msm_usb_host_platform_data *ehci_msm2_dt_to_pdata( "qcom,ext-hub-reset-gpio", 0); pdata->is_uicc = of_property_read_bool(node, "qcom,usb2-enable-uicc"); of_property_read_u32(node, "qcom,pm-qos-latency", &pdata->pm_qos_latency); return pdata; } Loading Loading @@ -1597,6 +1606,10 @@ static int ehci_msm2_probe(struct platform_device *pdev) mhcd->pmic_gpio_dp_irq = 0; } } pm_qos_add_request(&mhcd->pm_qos_req_dma, PM_QOS_CPU_DMA_LATENCY, pdata->pm_qos_latency + 1); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); Loading
include/linux/usb/msm_hsusb.h +1 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,7 @@ struct msm_usb_host_platform_data { int resume_gpio; int ext_hub_reset_gpio; bool is_uicc; int pm_qos_latency; }; /** Loading