aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2020-02-23 13:20:11 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2020-02-28 17:50:45 +0100
commitc16517d26de30c90dabce1e456615fd7fbdce07c (patch)
treee7371ee12a3c413a064885b634ee4c975ad7f96a /target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch
parent955634b473284847e3c8281a6ac85655329d8b06 (diff)
downloadupstream-c16517d26de30c90dabce1e456615fd7fbdce07c.tar.gz
upstream-c16517d26de30c90dabce1e456615fd7fbdce07c.tar.bz2
upstream-c16517d26de30c90dabce1e456615fd7fbdce07c.zip
kernel: copy kernel 4.19 code to 5.4
No changes were done to the patches while coping them. Currently they do not apply on top of kernel 5.4. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch')
-rw-r--r--target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch b/target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch
new file mode 100644
index 0000000000..ed4aadf2be
--- /dev/null
+++ b/target/linux/generic/backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch
@@ -0,0 +1,63 @@
+From 28b5c129ca6e585ec95c160ec4297bc6c6360b6f Mon Sep 17 00:00:00 2001
+From: Minas Harutyunyan <minas.harutyunyan@synopsys.com>
+Date: Mon, 4 Mar 2019 17:08:07 +0400
+Subject: usb: dwc2: Set lpm mode parameters depend on HW configuration
+
+If core not supported lpm, i.e. BCM2835 then confusing warnings seen
+in log.
+
+To avoid these warnings, added function dwc2_set_param_lpm() to set
+lpm and other lpm related parameters based on lpm support by core.
+
+Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+---
+ drivers/usb/dwc2/params.c | 23 ++++++++++++++++++-----
+ 1 file changed, 18 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/dwc2/params.c
++++ b/drivers/usb/dwc2/params.c
+@@ -273,6 +273,23 @@ static void dwc2_set_param_power_down(st
+ hsotg->params.power_down = val;
+ }
+
++static void dwc2_set_param_lpm(struct dwc2_hsotg *hsotg)
++{
++ struct dwc2_core_params *p = &hsotg->params;
++
++ p->lpm = hsotg->hw_params.lpm_mode;
++ if (p->lpm) {
++ p->lpm_clock_gating = true;
++ p->besl = true;
++ p->hird_threshold_en = true;
++ p->hird_threshold = 4;
++ } else {
++ p->lpm_clock_gating = false;
++ p->besl = false;
++ p->hird_threshold_en = false;
++ }
++}
++
+ /**
+ * dwc2_set_default_params() - Set all core parameters to their
+ * auto-detected default values.
+@@ -291,6 +308,7 @@ static void dwc2_set_default_params(stru
+ dwc2_set_param_speed(hsotg);
+ dwc2_set_param_phy_utmi_width(hsotg);
+ dwc2_set_param_power_down(hsotg);
++ dwc2_set_param_lpm(hsotg);
+ p->phy_ulpi_ddr = false;
+ p->phy_ulpi_ext_vbus = false;
+
+@@ -303,11 +321,6 @@ static void dwc2_set_default_params(stru
+ p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
+ p->uframe_sched = true;
+ p->external_id_pin_ctl = false;
+- p->lpm = true;
+- p->lpm_clock_gating = true;
+- p->besl = true;
+- p->hird_threshold_en = true;
+- p->hird_threshold = 4;
+ p->ipg_isoc_en = false;
+ p->max_packet_count = hw->max_packet_count;
+ p->max_transfer_size = hw->max_transfer_size;