Lines Matching refs:qmp
1261 int (*configure_dp_phy)(struct qmp_combo *qmp);
1262 void (*configure_dp_tx)(struct qmp_combo *qmp);
1263 int (*calibrate_dp_phy)(struct qmp_combo *qmp);
1264 void (*dp_aux_init)(struct qmp_combo *qmp);
1328 static void qmp_v3_dp_aux_init(struct qmp_combo *qmp);
1329 static void qmp_v3_configure_dp_tx(struct qmp_combo *qmp);
1330 static int qmp_v3_configure_dp_phy(struct qmp_combo *qmp);
1331 static int qmp_v3_calibrate_dp_phy(struct qmp_combo *qmp);
1333 static void qmp_v4_dp_aux_init(struct qmp_combo *qmp);
1334 static void qmp_v4_configure_dp_tx(struct qmp_combo *qmp);
1335 static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp);
1336 static int qmp_v4_calibrate_dp_phy(struct qmp_combo *qmp);
1338 static int qmp_v5_configure_dp_phy(struct qmp_combo *qmp);
1340 static void qmp_v6_dp_aux_init(struct qmp_combo *qmp);
1341 static int qmp_v6_configure_dp_phy(struct qmp_combo *qmp);
1833 static int qmp_combo_dp_serdes_init(struct qmp_combo *qmp) in qmp_combo_dp_serdes_init() argument
1835 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_dp_serdes_init()
1836 void __iomem *serdes = qmp->dp_serdes; in qmp_combo_dp_serdes_init()
1837 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_combo_dp_serdes_init()
1866 static void qmp_v3_dp_aux_init(struct qmp_combo *qmp) in qmp_v3_dp_aux_init() argument
1870 qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_v3_dp_aux_init()
1875 qmp->dp_serdes + QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN); in qmp_v3_dp_aux_init()
1877 writel(DP_PHY_PD_CTL_PSR_PWRDN, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_v3_dp_aux_init()
1883 qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_v3_dp_aux_init()
1889 qmp->dp_serdes + QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN); in qmp_v3_dp_aux_init()
1891 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG0); in qmp_v3_dp_aux_init()
1892 writel(0x13, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v3_dp_aux_init()
1893 writel(0x24, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2); in qmp_v3_dp_aux_init()
1894 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG3); in qmp_v3_dp_aux_init()
1895 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG4); in qmp_v3_dp_aux_init()
1896 writel(0x26, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG5); in qmp_v3_dp_aux_init()
1897 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG6); in qmp_v3_dp_aux_init()
1898 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG7); in qmp_v3_dp_aux_init()
1899 writel(0xbb, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG8); in qmp_v3_dp_aux_init()
1900 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG9); in qmp_v3_dp_aux_init()
1901 qmp->dp_aux_cfg = 0; in qmp_v3_dp_aux_init()
1906 qmp->dp_dp_phy + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK); in qmp_v3_dp_aux_init()
1909 static int qmp_combo_configure_dp_swing(struct qmp_combo *qmp, in qmp_combo_configure_dp_swing() argument
1912 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_combo_configure_dp_swing()
1913 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_configure_dp_swing()
1939 writel(voltage_swing_cfg, qmp->dp_tx + drv_lvl_reg); in qmp_combo_configure_dp_swing()
1940 writel(pre_emphasis_cfg, qmp->dp_tx + emp_post_reg); in qmp_combo_configure_dp_swing()
1941 writel(voltage_swing_cfg, qmp->dp_tx2 + drv_lvl_reg); in qmp_combo_configure_dp_swing()
1942 writel(pre_emphasis_cfg, qmp->dp_tx2 + emp_post_reg); in qmp_combo_configure_dp_swing()
1947 static void qmp_v3_configure_dp_tx(struct qmp_combo *qmp) in qmp_v3_configure_dp_tx() argument
1949 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v3_configure_dp_tx()
1952 if (qmp_combo_configure_dp_swing(qmp, QSERDES_V3_TX_TX_DRV_LVL, in qmp_v3_configure_dp_tx()
1964 writel(drvr_en, qmp->dp_tx + QSERDES_V3_TX_HIGHZ_DRVR_EN); in qmp_v3_configure_dp_tx()
1965 writel(bias_en, qmp->dp_tx + QSERDES_V3_TX_TRANSCEIVER_BIAS_EN); in qmp_v3_configure_dp_tx()
1966 writel(drvr_en, qmp->dp_tx2 + QSERDES_V3_TX_HIGHZ_DRVR_EN); in qmp_v3_configure_dp_tx()
1967 writel(bias_en, qmp->dp_tx2 + QSERDES_V3_TX_TRANSCEIVER_BIAS_EN); in qmp_v3_configure_dp_tx()
1970 static bool qmp_combo_configure_dp_mode(struct qmp_combo *qmp) in qmp_combo_configure_dp_mode() argument
1993 writel(val, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_combo_configure_dp_mode()
1995 writel(0x5c, qmp->dp_dp_phy + QSERDES_DP_PHY_MODE); in qmp_combo_configure_dp_mode()
2000 static int qmp_v3_configure_dp_phy(struct qmp_combo *qmp) in qmp_v3_configure_dp_phy() argument
2002 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v3_configure_dp_phy()
2006 qmp_combo_configure_dp_mode(qmp); in qmp_v3_configure_dp_phy()
2008 writel(0x05, qmp->dp_dp_phy + QSERDES_V3_DP_PHY_TX0_TX1_LANE_CTL); in qmp_v3_configure_dp_phy()
2009 writel(0x05, qmp->dp_dp_phy + QSERDES_V3_DP_PHY_TX2_TX3_LANE_CTL); in qmp_v3_configure_dp_phy()
2032 writel(phy_vco_div, qmp->dp_dp_phy + QSERDES_V3_DP_PHY_VCO_DIV); in qmp_v3_configure_dp_phy()
2034 clk_set_rate(qmp->dp_link_hw.clk, dp_opts->link_rate * 100000); in qmp_v3_configure_dp_phy()
2035 clk_set_rate(qmp->dp_pixel_hw.clk, pixel_freq); in qmp_v3_configure_dp_phy()
2037 writel(0x04, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2); in qmp_v3_configure_dp_phy()
2038 writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2039 writel(0x05, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2040 writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2041 writel(0x09, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2043 writel(0x20, qmp->dp_serdes + QSERDES_V3_COM_RESETSM_CNTRL); in qmp_v3_configure_dp_phy()
2045 if (readl_poll_timeout(qmp->dp_serdes + QSERDES_V3_COM_C_READY_STATUS, in qmp_v3_configure_dp_phy()
2052 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2054 if (readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V3_DP_PHY_STATUS, in qmp_v3_configure_dp_phy()
2061 writel(0x18, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2063 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v3_configure_dp_phy()
2065 return readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V3_DP_PHY_STATUS, in qmp_v3_configure_dp_phy()
2076 static int qmp_v3_calibrate_dp_phy(struct qmp_combo *qmp) in qmp_v3_calibrate_dp_phy() argument
2081 qmp->dp_aux_cfg++; in qmp_v3_calibrate_dp_phy()
2082 qmp->dp_aux_cfg %= ARRAY_SIZE(cfg1_settings); in qmp_v3_calibrate_dp_phy()
2083 val = cfg1_settings[qmp->dp_aux_cfg]; in qmp_v3_calibrate_dp_phy()
2085 writel(val, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v3_calibrate_dp_phy()
2090 static void qmp_v4_dp_aux_init(struct qmp_combo *qmp) in qmp_v4_dp_aux_init() argument
2094 qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_v4_dp_aux_init()
2097 writel(0x17, qmp->dp_serdes + QSERDES_V4_COM_BIAS_EN_CLKBUFLR_EN); in qmp_v4_dp_aux_init()
2099 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG0); in qmp_v4_dp_aux_init()
2100 writel(0x13, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v4_dp_aux_init()
2101 writel(0xa4, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2); in qmp_v4_dp_aux_init()
2102 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG3); in qmp_v4_dp_aux_init()
2103 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG4); in qmp_v4_dp_aux_init()
2104 writel(0x26, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG5); in qmp_v4_dp_aux_init()
2105 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG6); in qmp_v4_dp_aux_init()
2106 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG7); in qmp_v4_dp_aux_init()
2107 writel(0xb7, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG8); in qmp_v4_dp_aux_init()
2108 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG9); in qmp_v4_dp_aux_init()
2109 qmp->dp_aux_cfg = 0; in qmp_v4_dp_aux_init()
2114 qmp->dp_dp_phy + QSERDES_V4_DP_PHY_AUX_INTERRUPT_MASK); in qmp_v4_dp_aux_init()
2117 static void qmp_v6_dp_aux_init(struct qmp_combo *qmp) in qmp_v6_dp_aux_init() argument
2121 qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_v6_dp_aux_init()
2124 writel(0x17, qmp->dp_serdes + QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN); in qmp_v6_dp_aux_init()
2126 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG0); in qmp_v6_dp_aux_init()
2127 writel(0x13, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v6_dp_aux_init()
2128 writel(0xa4, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2); in qmp_v6_dp_aux_init()
2129 writel(0x00, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG3); in qmp_v6_dp_aux_init()
2130 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG4); in qmp_v6_dp_aux_init()
2131 writel(0x26, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG5); in qmp_v6_dp_aux_init()
2132 writel(0x0a, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG6); in qmp_v6_dp_aux_init()
2133 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG7); in qmp_v6_dp_aux_init()
2134 writel(0xb7, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG8); in qmp_v6_dp_aux_init()
2135 writel(0x03, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG9); in qmp_v6_dp_aux_init()
2136 qmp->dp_aux_cfg = 0; in qmp_v6_dp_aux_init()
2141 qmp->dp_dp_phy + QSERDES_V4_DP_PHY_AUX_INTERRUPT_MASK); in qmp_v6_dp_aux_init()
2144 static void qmp_v4_configure_dp_tx(struct qmp_combo *qmp) in qmp_v4_configure_dp_tx() argument
2147 writel(0x27, qmp->dp_tx + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v4_configure_dp_tx()
2148 writel(0x27, qmp->dp_tx2 + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v4_configure_dp_tx()
2150 writel(0x20, qmp->dp_tx + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v4_configure_dp_tx()
2151 writel(0x20, qmp->dp_tx2 + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v4_configure_dp_tx()
2153 qmp_combo_configure_dp_swing(qmp, QSERDES_V4_TX_TX_DRV_LVL, in qmp_v4_configure_dp_tx()
2157 static int qmp_v456_configure_dp_phy(struct qmp_combo *qmp, in qmp_v456_configure_dp_phy() argument
2162 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v456_configure_dp_phy()
2166 writel(0x0f, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_CFG_1); in qmp_v456_configure_dp_phy()
2168 qmp_combo_configure_dp_mode(qmp); in qmp_v456_configure_dp_phy()
2170 writel(0x13, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v456_configure_dp_phy()
2171 writel(0xa4, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2); in qmp_v456_configure_dp_phy()
2173 writel(0x05, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_TX0_TX1_LANE_CTL); in qmp_v456_configure_dp_phy()
2174 writel(0x05, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_TX2_TX3_LANE_CTL); in qmp_v456_configure_dp_phy()
2197 writel(phy_vco_div, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_VCO_DIV); in qmp_v456_configure_dp_phy()
2199 clk_set_rate(qmp->dp_link_hw.clk, dp_opts->link_rate * 100000); in qmp_v456_configure_dp_phy()
2200 clk_set_rate(qmp->dp_pixel_hw.clk, pixel_freq); in qmp_v456_configure_dp_phy()
2202 writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v456_configure_dp_phy()
2203 writel(0x05, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v456_configure_dp_phy()
2204 writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v456_configure_dp_phy()
2205 writel(0x09, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v456_configure_dp_phy()
2207 writel(0x20, qmp->dp_serdes + com_resetm_ctrl_reg); in qmp_v456_configure_dp_phy()
2209 if (readl_poll_timeout(qmp->dp_serdes + com_c_ready_status_reg, in qmp_v456_configure_dp_phy()
2216 if (readl_poll_timeout(qmp->dp_serdes + QSERDES_V4_COM_CMN_STATUS, in qmp_v456_configure_dp_phy()
2223 if (readl_poll_timeout(qmp->dp_serdes + QSERDES_V4_COM_CMN_STATUS, in qmp_v456_configure_dp_phy()
2230 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v456_configure_dp_phy()
2232 if (readl_poll_timeout(qmp->dp_dp_phy + dp_phy_status_reg, in qmp_v456_configure_dp_phy()
2239 if (readl_poll_timeout(qmp->dp_dp_phy + dp_phy_status_reg, in qmp_v456_configure_dp_phy()
2249 static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp) in qmp_v4_configure_dp_phy() argument
2251 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v4_configure_dp_phy()
2257 ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V4_COM_RESETSM_CNTRL, in qmp_v4_configure_dp_phy()
2285 writel(drvr0_en, qmp->dp_tx + QSERDES_V4_TX_HIGHZ_DRVR_EN); in qmp_v4_configure_dp_phy()
2286 writel(bias0_en, qmp->dp_tx + QSERDES_V4_TX_TRANSCEIVER_BIAS_EN); in qmp_v4_configure_dp_phy()
2287 writel(drvr1_en, qmp->dp_tx2 + QSERDES_V4_TX_HIGHZ_DRVR_EN); in qmp_v4_configure_dp_phy()
2288 writel(bias1_en, qmp->dp_tx2 + QSERDES_V4_TX_TRANSCEIVER_BIAS_EN); in qmp_v4_configure_dp_phy()
2290 writel(0x18, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v4_configure_dp_phy()
2292 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v4_configure_dp_phy()
2294 if (readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V4_DP_PHY_STATUS, in qmp_v4_configure_dp_phy()
2301 writel(0x0a, qmp->dp_tx + QSERDES_V4_TX_TX_POL_INV); in qmp_v4_configure_dp_phy()
2302 writel(0x0a, qmp->dp_tx2 + QSERDES_V4_TX_TX_POL_INV); in qmp_v4_configure_dp_phy()
2304 writel(0x27, qmp->dp_tx + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v4_configure_dp_phy()
2305 writel(0x27, qmp->dp_tx2 + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v4_configure_dp_phy()
2307 writel(0x20, qmp->dp_tx + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v4_configure_dp_phy()
2308 writel(0x20, qmp->dp_tx2 + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v4_configure_dp_phy()
2313 static int qmp_v5_configure_dp_phy(struct qmp_combo *qmp) in qmp_v5_configure_dp_phy() argument
2315 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v5_configure_dp_phy()
2321 ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V4_COM_RESETSM_CNTRL, in qmp_v5_configure_dp_phy()
2344 writel(drvr0_en, qmp->dp_tx + QSERDES_V5_5NM_TX_HIGHZ_DRVR_EN); in qmp_v5_configure_dp_phy()
2345 writel(bias0_en, qmp->dp_tx + QSERDES_V5_5NM_TX_TRANSCEIVER_BIAS_EN); in qmp_v5_configure_dp_phy()
2346 writel(drvr1_en, qmp->dp_tx2 + QSERDES_V5_5NM_TX_HIGHZ_DRVR_EN); in qmp_v5_configure_dp_phy()
2347 writel(bias1_en, qmp->dp_tx2 + QSERDES_V5_5NM_TX_TRANSCEIVER_BIAS_EN); in qmp_v5_configure_dp_phy()
2349 writel(0x18, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v5_configure_dp_phy()
2351 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v5_configure_dp_phy()
2353 if (readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V4_DP_PHY_STATUS, in qmp_v5_configure_dp_phy()
2360 writel(0x0a, qmp->dp_tx + QSERDES_V5_5NM_TX_TX_POL_INV); in qmp_v5_configure_dp_phy()
2361 writel(0x0a, qmp->dp_tx2 + QSERDES_V5_5NM_TX_TX_POL_INV); in qmp_v5_configure_dp_phy()
2363 writel(0x27, qmp->dp_tx + QSERDES_V5_5NM_TX_TX_DRV_LVL); in qmp_v5_configure_dp_phy()
2364 writel(0x27, qmp->dp_tx2 + QSERDES_V5_5NM_TX_TX_DRV_LVL); in qmp_v5_configure_dp_phy()
2366 writel(0x20, qmp->dp_tx + QSERDES_V5_5NM_TX_TX_EMP_POST1_LVL); in qmp_v5_configure_dp_phy()
2367 writel(0x20, qmp->dp_tx2 + QSERDES_V5_5NM_TX_TX_EMP_POST1_LVL); in qmp_v5_configure_dp_phy()
2372 static int qmp_v6_configure_dp_phy(struct qmp_combo *qmp) in qmp_v6_configure_dp_phy() argument
2374 const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts; in qmp_v6_configure_dp_phy()
2380 ret = qmp_v456_configure_dp_phy(qmp, QSERDES_V6_COM_RESETSM_CNTRL, in qmp_v6_configure_dp_phy()
2403 writel(drvr0_en, qmp->dp_tx + QSERDES_V4_TX_HIGHZ_DRVR_EN); in qmp_v6_configure_dp_phy()
2404 writel(bias0_en, qmp->dp_tx + QSERDES_V4_TX_TRANSCEIVER_BIAS_EN); in qmp_v6_configure_dp_phy()
2405 writel(drvr1_en, qmp->dp_tx2 + QSERDES_V4_TX_HIGHZ_DRVR_EN); in qmp_v6_configure_dp_phy()
2406 writel(bias1_en, qmp->dp_tx2 + QSERDES_V4_TX_TRANSCEIVER_BIAS_EN); in qmp_v6_configure_dp_phy()
2408 writel(0x18, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v6_configure_dp_phy()
2410 writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG); in qmp_v6_configure_dp_phy()
2412 if (readl_poll_timeout(qmp->dp_dp_phy + QSERDES_V6_DP_PHY_STATUS, in qmp_v6_configure_dp_phy()
2419 writel(0x0a, qmp->dp_tx + QSERDES_V4_TX_TX_POL_INV); in qmp_v6_configure_dp_phy()
2420 writel(0x0a, qmp->dp_tx2 + QSERDES_V4_TX_TX_POL_INV); in qmp_v6_configure_dp_phy()
2422 writel(0x27, qmp->dp_tx + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v6_configure_dp_phy()
2423 writel(0x27, qmp->dp_tx2 + QSERDES_V4_TX_TX_DRV_LVL); in qmp_v6_configure_dp_phy()
2425 writel(0x20, qmp->dp_tx + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v6_configure_dp_phy()
2426 writel(0x20, qmp->dp_tx2 + QSERDES_V4_TX_TX_EMP_POST1_LVL); in qmp_v6_configure_dp_phy()
2435 static int qmp_v4_calibrate_dp_phy(struct qmp_combo *qmp) in qmp_v4_calibrate_dp_phy() argument
2440 qmp->dp_aux_cfg++; in qmp_v4_calibrate_dp_phy()
2441 qmp->dp_aux_cfg %= ARRAY_SIZE(cfg1_settings); in qmp_v4_calibrate_dp_phy()
2442 val = cfg1_settings[qmp->dp_aux_cfg]; in qmp_v4_calibrate_dp_phy()
2444 writel(val, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1); in qmp_v4_calibrate_dp_phy()
2452 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_configure() local
2453 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_dp_configure()
2455 memcpy(&qmp->dp_opts, dp_opts, sizeof(*dp_opts)); in qmp_combo_dp_configure()
2456 if (qmp->dp_opts.set_voltages) { in qmp_combo_dp_configure()
2457 cfg->configure_dp_tx(qmp); in qmp_combo_dp_configure()
2458 qmp->dp_opts.set_voltages = 0; in qmp_combo_dp_configure()
2466 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_calibrate() local
2467 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_dp_calibrate()
2470 return cfg->calibrate_dp_phy(qmp); in qmp_combo_dp_calibrate()
2475 static int qmp_combo_com_init(struct qmp_combo *qmp) in qmp_combo_com_init() argument
2477 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_com_init()
2478 void __iomem *com = qmp->com; in qmp_combo_com_init()
2481 mutex_lock(&qmp->phy_mutex); in qmp_combo_com_init()
2482 if (qmp->init_count++) { in qmp_combo_com_init()
2483 mutex_unlock(&qmp->phy_mutex); in qmp_combo_com_init()
2487 ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs); in qmp_combo_com_init()
2489 dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret); in qmp_combo_com_init()
2493 ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_combo_com_init()
2495 dev_err(qmp->dev, "reset assert failed\n"); in qmp_combo_com_init()
2499 ret = reset_control_bulk_deassert(cfg->num_resets, qmp->resets); in qmp_combo_com_init()
2501 dev_err(qmp->dev, "reset deassert failed\n"); in qmp_combo_com_init()
2505 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_combo_com_init()
2529 qphy_setbits(qmp->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], in qmp_combo_com_init()
2532 mutex_unlock(&qmp->phy_mutex); in qmp_combo_com_init()
2537 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_combo_com_init()
2539 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_combo_com_init()
2541 mutex_unlock(&qmp->phy_mutex); in qmp_combo_com_init()
2546 static int qmp_combo_com_exit(struct qmp_combo *qmp) in qmp_combo_com_exit() argument
2548 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_com_exit()
2550 mutex_lock(&qmp->phy_mutex); in qmp_combo_com_exit()
2551 if (--qmp->init_count) { in qmp_combo_com_exit()
2552 mutex_unlock(&qmp->phy_mutex); in qmp_combo_com_exit()
2556 reset_control_bulk_assert(cfg->num_resets, qmp->resets); in qmp_combo_com_exit()
2558 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_combo_com_exit()
2560 regulator_bulk_disable(cfg->num_vregs, qmp->vregs); in qmp_combo_com_exit()
2562 mutex_unlock(&qmp->phy_mutex); in qmp_combo_com_exit()
2569 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_init() local
2570 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_dp_init()
2573 ret = qmp_combo_com_init(qmp); in qmp_combo_dp_init()
2577 cfg->dp_aux_init(qmp); in qmp_combo_dp_init()
2584 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_exit() local
2586 qmp_combo_com_exit(qmp); in qmp_combo_dp_exit()
2593 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_power_on() local
2594 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_dp_power_on()
2595 void __iomem *tx = qmp->dp_tx; in qmp_combo_dp_power_on()
2596 void __iomem *tx2 = qmp->dp_tx2; in qmp_combo_dp_power_on()
2598 qmp_combo_dp_serdes_init(qmp); in qmp_combo_dp_power_on()
2604 cfg->configure_dp_tx(qmp); in qmp_combo_dp_power_on()
2607 cfg->configure_dp_phy(qmp); in qmp_combo_dp_power_on()
2614 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_dp_power_off() local
2617 writel(DP_PHY_PD_CTL_PSR_PWRDN, qmp->dp_dp_phy + QSERDES_DP_PHY_PD_CTL); in qmp_combo_dp_power_off()
2624 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_usb_power_on() local
2625 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_usb_power_on()
2626 void __iomem *serdes = qmp->serdes; in qmp_combo_usb_power_on()
2627 void __iomem *tx = qmp->tx; in qmp_combo_usb_power_on()
2628 void __iomem *rx = qmp->rx; in qmp_combo_usb_power_on()
2629 void __iomem *tx2 = qmp->tx2; in qmp_combo_usb_power_on()
2630 void __iomem *rx2 = qmp->rx2; in qmp_combo_usb_power_on()
2631 void __iomem *pcs = qmp->pcs; in qmp_combo_usb_power_on()
2638 ret = clk_prepare_enable(qmp->pipe_clk); in qmp_combo_usb_power_on()
2640 dev_err(qmp->dev, "pipe_clk enable failed err=%d\n", ret); in qmp_combo_usb_power_on()
2666 dev_err(qmp->dev, "phy initialization timed-out\n"); in qmp_combo_usb_power_on()
2673 clk_disable_unprepare(qmp->pipe_clk); in qmp_combo_usb_power_on()
2680 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_usb_power_off() local
2681 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_usb_power_off()
2683 clk_disable_unprepare(qmp->pipe_clk); in qmp_combo_usb_power_off()
2686 qphy_setbits(qmp->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET); in qmp_combo_usb_power_off()
2689 qphy_clrbits(qmp->pcs, cfg->regs[QPHY_START_CTRL], in qmp_combo_usb_power_off()
2693 qphy_clrbits(qmp->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], in qmp_combo_usb_power_off()
2701 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_usb_init() local
2704 ret = qmp_combo_com_init(qmp); in qmp_combo_usb_init()
2710 qmp_combo_com_exit(qmp); in qmp_combo_usb_init()
2717 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_usb_exit() local
2724 return qmp_combo_com_exit(qmp); in qmp_combo_usb_exit()
2729 struct qmp_combo *qmp = phy_get_drvdata(phy); in qmp_combo_usb_set_mode() local
2731 qmp->mode = mode; in qmp_combo_usb_set_mode()
2753 static void qmp_combo_enable_autonomous_mode(struct qmp_combo *qmp) in qmp_combo_enable_autonomous_mode() argument
2755 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_enable_autonomous_mode()
2756 void __iomem *pcs_usb = qmp->pcs_usb ?: qmp->pcs; in qmp_combo_enable_autonomous_mode()
2757 void __iomem *pcs_misc = qmp->pcs_misc; in qmp_combo_enable_autonomous_mode()
2760 if (qmp->mode == PHY_MODE_USB_HOST_SS || in qmp_combo_enable_autonomous_mode()
2761 qmp->mode == PHY_MODE_USB_DEVICE_SS) in qmp_combo_enable_autonomous_mode()
2782 static void qmp_combo_disable_autonomous_mode(struct qmp_combo *qmp) in qmp_combo_disable_autonomous_mode() argument
2784 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_disable_autonomous_mode()
2785 void __iomem *pcs_usb = qmp->pcs_usb ?: qmp->pcs; in qmp_combo_disable_autonomous_mode()
2786 void __iomem *pcs_misc = qmp->pcs_misc; in qmp_combo_disable_autonomous_mode()
2802 struct qmp_combo *qmp = dev_get_drvdata(dev); in qmp_combo_runtime_suspend() local
2803 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_runtime_suspend()
2805 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->mode); in qmp_combo_runtime_suspend()
2807 if (!qmp->init_count) { in qmp_combo_runtime_suspend()
2812 qmp_combo_enable_autonomous_mode(qmp); in qmp_combo_runtime_suspend()
2814 clk_disable_unprepare(qmp->pipe_clk); in qmp_combo_runtime_suspend()
2815 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_combo_runtime_suspend()
2822 struct qmp_combo *qmp = dev_get_drvdata(dev); in qmp_combo_runtime_resume() local
2823 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_runtime_resume()
2826 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->mode); in qmp_combo_runtime_resume()
2828 if (!qmp->init_count) { in qmp_combo_runtime_resume()
2833 ret = clk_bulk_prepare_enable(cfg->num_clks, qmp->clks); in qmp_combo_runtime_resume()
2837 ret = clk_prepare_enable(qmp->pipe_clk); in qmp_combo_runtime_resume()
2840 clk_bulk_disable_unprepare(cfg->num_clks, qmp->clks); in qmp_combo_runtime_resume()
2844 qmp_combo_disable_autonomous_mode(qmp); in qmp_combo_runtime_resume()
2854 static int qmp_combo_vreg_init(struct qmp_combo *qmp) in qmp_combo_vreg_init() argument
2856 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_vreg_init()
2857 struct device *dev = qmp->dev; in qmp_combo_vreg_init()
2861 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL); in qmp_combo_vreg_init()
2862 if (!qmp->vregs) in qmp_combo_vreg_init()
2866 qmp->vregs[i].supply = cfg->vreg_list[i].name; in qmp_combo_vreg_init()
2868 ret = devm_regulator_bulk_get(dev, num, qmp->vregs); in qmp_combo_vreg_init()
2875 ret = regulator_set_load(qmp->vregs[i].consumer, in qmp_combo_vreg_init()
2879 qmp->vregs[i].supply); in qmp_combo_vreg_init()
2887 static int qmp_combo_reset_init(struct qmp_combo *qmp) in qmp_combo_reset_init() argument
2889 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_reset_init()
2890 struct device *dev = qmp->dev; in qmp_combo_reset_init()
2894 qmp->resets = devm_kcalloc(dev, cfg->num_resets, in qmp_combo_reset_init()
2895 sizeof(*qmp->resets), GFP_KERNEL); in qmp_combo_reset_init()
2896 if (!qmp->resets) in qmp_combo_reset_init()
2900 qmp->resets[i].id = cfg->reset_list[i]; in qmp_combo_reset_init()
2902 ret = devm_reset_control_bulk_get_exclusive(dev, cfg->num_resets, qmp->resets); in qmp_combo_reset_init()
2909 static int qmp_combo_clk_init(struct qmp_combo *qmp) in qmp_combo_clk_init() argument
2911 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_clk_init()
2912 struct device *dev = qmp->dev; in qmp_combo_clk_init()
2916 qmp->clks = devm_kcalloc(dev, num, sizeof(*qmp->clks), GFP_KERNEL); in qmp_combo_clk_init()
2917 if (!qmp->clks) in qmp_combo_clk_init()
2921 qmp->clks[i].id = cfg->clk_list[i]; in qmp_combo_clk_init()
2923 return devm_clk_bulk_get(dev, num, qmp->clks); in qmp_combo_clk_init()
2949 static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np) in phy_pipe_clk_register() argument
2951 struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed; in phy_pipe_clk_register()
2955 snprintf(name, sizeof(name), "%s::pipe_clk", dev_name(qmp->dev)); in phy_pipe_clk_register()
2963 return devm_clk_hw_register(qmp->dev, &fixed->hw); in phy_pipe_clk_register()
3029 const struct qmp_combo *qmp; in qmp_dp_pixel_clk_recalc_rate() local
3032 qmp = container_of(hw, struct qmp_combo, dp_pixel_hw); in qmp_dp_pixel_clk_recalc_rate()
3033 dp_opts = &qmp->dp_opts; in qmp_dp_pixel_clk_recalc_rate()
3069 const struct qmp_combo *qmp; in qmp_dp_link_clk_recalc_rate() local
3072 qmp = container_of(hw, struct qmp_combo, dp_link_hw); in qmp_dp_link_clk_recalc_rate()
3073 dp_opts = &qmp->dp_opts; in qmp_dp_link_clk_recalc_rate()
3093 struct qmp_combo *qmp = data; in qmp_dp_clks_hw_get() local
3102 return &qmp->dp_link_hw; in qmp_dp_clks_hw_get()
3104 return &qmp->dp_pixel_hw; in qmp_dp_clks_hw_get()
3107 static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np) in phy_dp_clks_register() argument
3113 snprintf(name, sizeof(name), "%s::link_clk", dev_name(qmp->dev)); in phy_dp_clks_register()
3116 qmp->dp_link_hw.init = &init; in phy_dp_clks_register()
3117 ret = devm_clk_hw_register(qmp->dev, &qmp->dp_link_hw); in phy_dp_clks_register()
3121 snprintf(name, sizeof(name), "%s::vco_div_clk", dev_name(qmp->dev)); in phy_dp_clks_register()
3124 qmp->dp_pixel_hw.init = &init; in phy_dp_clks_register()
3125 ret = devm_clk_hw_register(qmp->dev, &qmp->dp_pixel_hw); in phy_dp_clks_register()
3134 struct qmp_combo *qmp = data; in qmp_combo_clk_hw_get() local
3138 return &qmp->pipe_clk_fixed.hw; in qmp_combo_clk_hw_get()
3140 return &qmp->dp_link_hw; in qmp_combo_clk_hw_get()
3142 return &qmp->dp_pixel_hw; in qmp_combo_clk_hw_get()
3148 static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np, in qmp_combo_register_clocks() argument
3153 ret = phy_pipe_clk_register(qmp, usb_np); in qmp_combo_register_clocks()
3157 ret = phy_dp_clks_register(qmp, dp_np); in qmp_combo_register_clocks()
3164 if (usb_np == qmp->dev->of_node) in qmp_combo_register_clocks()
3165 return devm_of_clk_add_hw_provider(qmp->dev, qmp_combo_clk_hw_get, qmp); in qmp_combo_register_clocks()
3171 &qmp->pipe_clk_fixed.hw); in qmp_combo_register_clocks()
3179 ret = devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, usb_np); in qmp_combo_register_clocks()
3183 ret = of_clk_add_hw_provider(dp_np, qmp_dp_clks_hw_get, qmp); in qmp_combo_register_clocks()
3187 return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, dp_np); in qmp_combo_register_clocks()
3190 static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np) in qmp_combo_parse_dt_lecacy_dp() argument
3192 struct device *dev = qmp->dev; in qmp_combo_parse_dt_lecacy_dp()
3202 qmp->dp_tx = devm_of_iomap(dev, np, 0, NULL); in qmp_combo_parse_dt_lecacy_dp()
3203 if (IS_ERR(qmp->dp_tx)) in qmp_combo_parse_dt_lecacy_dp()
3204 return PTR_ERR(qmp->dp_tx); in qmp_combo_parse_dt_lecacy_dp()
3206 qmp->dp_dp_phy = devm_of_iomap(dev, np, 2, NULL); in qmp_combo_parse_dt_lecacy_dp()
3207 if (IS_ERR(qmp->dp_dp_phy)) in qmp_combo_parse_dt_lecacy_dp()
3208 return PTR_ERR(qmp->dp_dp_phy); in qmp_combo_parse_dt_lecacy_dp()
3210 qmp->dp_tx2 = devm_of_iomap(dev, np, 3, NULL); in qmp_combo_parse_dt_lecacy_dp()
3211 if (IS_ERR(qmp->dp_tx2)) in qmp_combo_parse_dt_lecacy_dp()
3212 return PTR_ERR(qmp->dp_tx2); in qmp_combo_parse_dt_lecacy_dp()
3217 static int qmp_combo_parse_dt_lecacy_usb(struct qmp_combo *qmp, struct device_node *np) in qmp_combo_parse_dt_lecacy_usb() argument
3219 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_parse_dt_lecacy_usb()
3220 struct device *dev = qmp->dev; in qmp_combo_parse_dt_lecacy_usb()
3227 qmp->tx = devm_of_iomap(dev, np, 0, NULL); in qmp_combo_parse_dt_lecacy_usb()
3228 if (IS_ERR(qmp->tx)) in qmp_combo_parse_dt_lecacy_usb()
3229 return PTR_ERR(qmp->tx); in qmp_combo_parse_dt_lecacy_usb()
3231 qmp->rx = devm_of_iomap(dev, np, 1, NULL); in qmp_combo_parse_dt_lecacy_usb()
3232 if (IS_ERR(qmp->rx)) in qmp_combo_parse_dt_lecacy_usb()
3233 return PTR_ERR(qmp->rx); in qmp_combo_parse_dt_lecacy_usb()
3235 qmp->pcs = devm_of_iomap(dev, np, 2, NULL); in qmp_combo_parse_dt_lecacy_usb()
3236 if (IS_ERR(qmp->pcs)) in qmp_combo_parse_dt_lecacy_usb()
3237 return PTR_ERR(qmp->pcs); in qmp_combo_parse_dt_lecacy_usb()
3240 qmp->pcs_usb = qmp->pcs + cfg->pcs_usb_offset; in qmp_combo_parse_dt_lecacy_usb()
3242 qmp->tx2 = devm_of_iomap(dev, np, 3, NULL); in qmp_combo_parse_dt_lecacy_usb()
3243 if (IS_ERR(qmp->tx2)) in qmp_combo_parse_dt_lecacy_usb()
3244 return PTR_ERR(qmp->tx2); in qmp_combo_parse_dt_lecacy_usb()
3246 qmp->rx2 = devm_of_iomap(dev, np, 4, NULL); in qmp_combo_parse_dt_lecacy_usb()
3247 if (IS_ERR(qmp->rx2)) in qmp_combo_parse_dt_lecacy_usb()
3248 return PTR_ERR(qmp->rx2); in qmp_combo_parse_dt_lecacy_usb()
3250 qmp->pcs_misc = devm_of_iomap(dev, np, 5, NULL); in qmp_combo_parse_dt_lecacy_usb()
3251 if (IS_ERR(qmp->pcs_misc)) { in qmp_combo_parse_dt_lecacy_usb()
3253 qmp->pcs_misc = NULL; in qmp_combo_parse_dt_lecacy_usb()
3256 qmp->pipe_clk = devm_get_clk_from_child(dev, np, NULL); in qmp_combo_parse_dt_lecacy_usb()
3257 if (IS_ERR(qmp->pipe_clk)) { in qmp_combo_parse_dt_lecacy_usb()
3258 return dev_err_probe(dev, PTR_ERR(qmp->pipe_clk), in qmp_combo_parse_dt_lecacy_usb()
3265 static int qmp_combo_parse_dt_legacy(struct qmp_combo *qmp, struct device_node *usb_np, in qmp_combo_parse_dt_legacy() argument
3268 struct platform_device *pdev = to_platform_device(qmp->dev); in qmp_combo_parse_dt_legacy()
3271 qmp->serdes = devm_platform_ioremap_resource(pdev, 0); in qmp_combo_parse_dt_legacy()
3272 if (IS_ERR(qmp->serdes)) in qmp_combo_parse_dt_legacy()
3273 return PTR_ERR(qmp->serdes); in qmp_combo_parse_dt_legacy()
3275 qmp->com = devm_platform_ioremap_resource(pdev, 1); in qmp_combo_parse_dt_legacy()
3276 if (IS_ERR(qmp->com)) in qmp_combo_parse_dt_legacy()
3277 return PTR_ERR(qmp->com); in qmp_combo_parse_dt_legacy()
3279 qmp->dp_serdes = devm_platform_ioremap_resource(pdev, 2); in qmp_combo_parse_dt_legacy()
3280 if (IS_ERR(qmp->dp_serdes)) in qmp_combo_parse_dt_legacy()
3281 return PTR_ERR(qmp->dp_serdes); in qmp_combo_parse_dt_legacy()
3283 ret = qmp_combo_parse_dt_lecacy_usb(qmp, usb_np); in qmp_combo_parse_dt_legacy()
3287 ret = qmp_combo_parse_dt_lecacy_dp(qmp, dp_np); in qmp_combo_parse_dt_legacy()
3294 static int qmp_combo_parse_dt(struct qmp_combo *qmp) in qmp_combo_parse_dt() argument
3296 struct platform_device *pdev = to_platform_device(qmp->dev); in qmp_combo_parse_dt()
3297 const struct qmp_phy_cfg *cfg = qmp->cfg; in qmp_combo_parse_dt()
3299 struct device *dev = qmp->dev; in qmp_combo_parse_dt()
3309 qmp->com = base + offs->com; in qmp_combo_parse_dt()
3310 qmp->tx = base + offs->txa; in qmp_combo_parse_dt()
3311 qmp->rx = base + offs->rxa; in qmp_combo_parse_dt()
3312 qmp->tx2 = base + offs->txb; in qmp_combo_parse_dt()
3313 qmp->rx2 = base + offs->rxb; in qmp_combo_parse_dt()
3315 qmp->serdes = base + offs->usb3_serdes; in qmp_combo_parse_dt()
3316 qmp->pcs_misc = base + offs->usb3_pcs_misc; in qmp_combo_parse_dt()
3317 qmp->pcs = base + offs->usb3_pcs; in qmp_combo_parse_dt()
3318 qmp->pcs_usb = base + offs->usb3_pcs_usb; in qmp_combo_parse_dt()
3320 qmp->dp_serdes = base + offs->dp_serdes; in qmp_combo_parse_dt()
3322 qmp->dp_tx = base + offs->dp_txa; in qmp_combo_parse_dt()
3323 qmp->dp_tx2 = base + offs->dp_txb; in qmp_combo_parse_dt()
3325 qmp->dp_tx = base + offs->txa; in qmp_combo_parse_dt()
3326 qmp->dp_tx2 = base + offs->txb; in qmp_combo_parse_dt()
3328 qmp->dp_dp_phy = base + offs->dp_dp_phy; in qmp_combo_parse_dt()
3330 qmp->pipe_clk = devm_clk_get(dev, "usb3_pipe"); in qmp_combo_parse_dt()
3331 if (IS_ERR(qmp->pipe_clk)) { in qmp_combo_parse_dt()
3332 return dev_err_probe(dev, PTR_ERR(qmp->pipe_clk), in qmp_combo_parse_dt()
3341 struct qmp_combo *qmp = dev_get_drvdata(dev); in qmp_combo_phy_xlate() local
3348 return qmp->usb_phy; in qmp_combo_phy_xlate()
3350 return qmp->dp_phy; in qmp_combo_phy_xlate()
3358 struct qmp_combo *qmp; in qmp_combo_probe() local
3364 qmp = devm_kzalloc(dev, sizeof(*qmp), GFP_KERNEL); in qmp_combo_probe()
3365 if (!qmp) in qmp_combo_probe()
3368 qmp->dev = dev; in qmp_combo_probe()
3370 qmp->cfg = of_device_get_match_data(dev); in qmp_combo_probe()
3371 if (!qmp->cfg) in qmp_combo_probe()
3374 mutex_init(&qmp->phy_mutex); in qmp_combo_probe()
3376 ret = qmp_combo_clk_init(qmp); in qmp_combo_probe()
3380 ret = qmp_combo_reset_init(qmp); in qmp_combo_probe()
3384 ret = qmp_combo_vreg_init(qmp); in qmp_combo_probe()
3397 ret = qmp_combo_parse_dt_legacy(qmp, usb_np, dp_np); in qmp_combo_probe()
3402 ret = qmp_combo_parse_dt(qmp); in qmp_combo_probe()
3417 ret = qmp_combo_register_clocks(qmp, usb_np, dp_np); in qmp_combo_probe()
3421 qmp->usb_phy = devm_phy_create(dev, usb_np, &qmp_combo_usb_phy_ops); in qmp_combo_probe()
3422 if (IS_ERR(qmp->usb_phy)) { in qmp_combo_probe()
3423 ret = PTR_ERR(qmp->usb_phy); in qmp_combo_probe()
3428 phy_set_drvdata(qmp->usb_phy, qmp); in qmp_combo_probe()
3430 qmp->dp_phy = devm_phy_create(dev, dp_np, &qmp_combo_dp_phy_ops); in qmp_combo_probe()
3431 if (IS_ERR(qmp->dp_phy)) { in qmp_combo_probe()
3432 ret = PTR_ERR(qmp->dp_phy); in qmp_combo_probe()
3437 phy_set_drvdata(qmp->dp_phy, qmp); in qmp_combo_probe()
3439 dev_set_drvdata(dev, qmp); in qmp_combo_probe()