diff options
author | John Youn <johnyoun@synopsys.com> | 2018-02-16 13:12:28 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-03-13 11:47:57 +0300 |
commit | 03ea6d6e9e1ff1b0222eb723eee5990d3511cc4d (patch) | |
tree | 7c3de89430541615faa028a17078895802571086 /drivers/usb | |
parent | f260b2508557dc2ffbe45192510b5dfdef44a21d (diff) | |
download | linux-03ea6d6e9e1ff1b0222eb723eee5990d3511cc4d.tar.xz |
usb: dwc2: Enable power down
Enable the power down option based on the core capability.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: Artur Petrosyan <arturp@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/params.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index daf0f9ac7149..6c7588a2f485 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -252,6 +252,20 @@ static void dwc2_set_param_tx_fifo_sizes(struct dwc2_hsotg *hsotg) p->g_tx_fifo_size[i] = depth_average; } +static void dwc2_set_param_power_down(struct dwc2_hsotg *hsotg) +{ + int val; + + if (hsotg->hw_params.hibernation) + val = 2; + else if (hsotg->hw_params.power_optimized) + val = 1; + else + val = 0; + + hsotg->params.power_down = val; +} + /** * dwc2_set_default_params() - Set all core parameters to their * auto-detected default values. @@ -266,6 +280,7 @@ static void dwc2_set_default_params(struct dwc2_hsotg *hsotg) dwc2_set_param_phy_type(hsotg); dwc2_set_param_speed(hsotg); dwc2_set_param_phy_utmi_width(hsotg); + dwc2_set_param_power_down(hsotg); p->phy_ulpi_ddr = false; p->phy_ulpi_ext_vbus = false; @@ -278,7 +293,6 @@ static void dwc2_set_default_params(struct dwc2_hsotg *hsotg) p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a); p->uframe_sched = true; p->external_id_pin_ctl = false; - p->power_down = false; p->lpm = true; p->lpm_clock_gating = true; p->besl = true; |