static void dwc2_set_param_speed(struct dwc2_hsotg *hsotg) { int val; val = hsotg->params.phy_type == DWC2_PHY_TYPE_PARAM_FS ? DWC2_SPEED_PARAM_FULL : DWC2_SPEED_PARAM_HIGH; if (dwc2_is_fs_iot(hsotg)) val = DWC2_SPEED_PARAM_FULL; if (dwc2_is_hs_iot(hsotg)) val = DWC2_SPEED_PARAM_HIGH; hsotg->params.speed = val; }
static void dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg) { int val; u32 hs_phy_type = hsotg->hw_params.hs_phy_type; val = DWC2_PHY_TYPE_PARAM_FS; if (hs_phy_type != GHWCFG2_HS_PHY_TYPE_NOT_SUPPORTED) { if (hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI || hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI_ULPI) val = DWC2_PHY_TYPE_PARAM_UTMI; else val = DWC2_PHY_TYPE_PARAM_ULPI; } if (dwc2_is_fs_iot(hsotg)) hsotg->params.phy_type = DWC2_PHY_TYPE_PARAM_FS; hsotg->params.phy_type = val; }
int dwc2_init_params(struct dwc2_hsotg *hsotg) { const struct of_device_id *match; struct dwc2_core_params params; match = of_match_device(dwc2_of_match_table, hsotg->dev); if (match && match->data) params = *((struct dwc2_core_params *)match->data); else params = params_default; if (dwc2_is_fs_iot(hsotg)) { params.speed = DWC2_SPEED_PARAM_FULL; params.phy_type = DWC2_PHY_TYPE_PARAM_FS; } dwc2_set_parameters(hsotg, ¶ms); return 0; }