Lines Matching full:xpcs
4 * Synopsys DesignWare XPCS helpers
11 #include <linux/pcs/pcs-xpcs.h>
17 #include "pcs-xpcs.h"
154 int (*pma_config)(struct dw_xpcs *xpcs);
179 int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface) in xpcs_get_an_mode() argument
183 compat = xpcs_find_compat(xpcs->desc, interface); in xpcs_get_an_mode()
206 int xpcs_read(struct dw_xpcs *xpcs, int dev, u32 reg) in xpcs_read() argument
208 return mdiodev_c45_read(xpcs->mdiodev, dev, reg); in xpcs_read()
211 int xpcs_write(struct dw_xpcs *xpcs, int dev, u32 reg, u16 val) in xpcs_write() argument
213 return mdiodev_c45_write(xpcs->mdiodev, dev, reg, val); in xpcs_write()
216 static int xpcs_modify_changed(struct dw_xpcs *xpcs, int dev, u32 reg, in xpcs_modify_changed() argument
219 return mdiodev_c45_modify_changed(xpcs->mdiodev, dev, reg, mask, set); in xpcs_modify_changed()
222 static int xpcs_read_vendor(struct dw_xpcs *xpcs, int dev, u32 reg) in xpcs_read_vendor() argument
224 return xpcs_read(xpcs, dev, DW_VENDOR | reg); in xpcs_read_vendor()
227 static int xpcs_write_vendor(struct dw_xpcs *xpcs, int dev, int reg, in xpcs_write_vendor() argument
230 return xpcs_write(xpcs, dev, DW_VENDOR | reg, val); in xpcs_write_vendor()
233 int xpcs_read_vpcs(struct dw_xpcs *xpcs, int reg) in xpcs_read_vpcs() argument
235 return xpcs_read_vendor(xpcs, MDIO_MMD_PCS, reg); in xpcs_read_vpcs()
238 int xpcs_write_vpcs(struct dw_xpcs *xpcs, int reg, u16 val) in xpcs_write_vpcs() argument
240 return xpcs_write_vendor(xpcs, MDIO_MMD_PCS, reg, val); in xpcs_write_vpcs()
243 static int xpcs_poll_reset(struct dw_xpcs *xpcs, int dev) in xpcs_poll_reset() argument
251 ret = xpcs_read(xpcs, dev, MDIO_CTRL1); in xpcs_poll_reset()
259 static int xpcs_soft_reset(struct dw_xpcs *xpcs, in xpcs_soft_reset() argument
278 ret = xpcs_write(xpcs, dev, MDIO_CTRL1, MDIO_CTRL1_RESET); in xpcs_soft_reset()
282 return xpcs_poll_reset(xpcs, dev); in xpcs_soft_reset()
291 static int xpcs_read_fault_c73(struct dw_xpcs *xpcs, in xpcs_read_fault_c73() argument
298 xpcs_warn(xpcs, state, "Link fault condition detected!\n"); in xpcs_read_fault_c73()
302 ret = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_STAT2); in xpcs_read_fault_c73()
307 xpcs_warn(xpcs, state, "Receiver fault detected!\n"); in xpcs_read_fault_c73()
309 xpcs_warn(xpcs, state, "Transmitter fault detected!\n"); in xpcs_read_fault_c73()
311 ret = xpcs_read_vendor(xpcs, MDIO_MMD_PCS, DW_VR_XS_PCS_DIG_STS); in xpcs_read_fault_c73()
316 xpcs_warn(xpcs, state, "FIFO fault condition detected!\n"); in xpcs_read_fault_c73()
320 ret = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_PCS_10GBRT_STAT1); in xpcs_read_fault_c73()
325 xpcs_warn(xpcs, state, "Link is not locked!\n"); in xpcs_read_fault_c73()
327 ret = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_PCS_10GBRT_STAT2); in xpcs_read_fault_c73()
332 xpcs_warn(xpcs, state, "Link has errors!\n"); in xpcs_read_fault_c73()
339 static void xpcs_config_usxgmii(struct dw_xpcs *xpcs, int speed) in xpcs_config_usxgmii() argument
367 ret = xpcs_read_vpcs(xpcs, MDIO_CTRL1); in xpcs_config_usxgmii()
371 ret = xpcs_write_vpcs(xpcs, MDIO_CTRL1, ret | DW_USXGMII_EN); in xpcs_config_usxgmii()
375 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1); in xpcs_config_usxgmii()
382 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1, ret); in xpcs_config_usxgmii()
386 ret = xpcs_read_vpcs(xpcs, MDIO_CTRL1); in xpcs_config_usxgmii()
390 ret = xpcs_write_vpcs(xpcs, MDIO_CTRL1, ret | DW_USXGMII_RST); in xpcs_config_usxgmii()
397 pr_err("%s: XPCS access returned %pe\n", __func__, ERR_PTR(ret)); in xpcs_config_usxgmii()
400 static int _xpcs_config_aneg_c73(struct dw_xpcs *xpcs, in _xpcs_config_aneg_c73() argument
405 /* By default, in USXGMII mode XPCS operates at 10G baud and in _xpcs_config_aneg_c73()
418 ret = xpcs_write(xpcs, MDIO_MMD_AN, DW_SR_AN_ADV3, adv); in _xpcs_config_aneg_c73()
431 ret = xpcs_write(xpcs, MDIO_MMD_AN, DW_SR_AN_ADV2, adv); in _xpcs_config_aneg_c73()
442 return xpcs_write(xpcs, MDIO_MMD_AN, DW_SR_AN_ADV1, adv); in _xpcs_config_aneg_c73()
445 static int xpcs_config_aneg_c73(struct dw_xpcs *xpcs, in xpcs_config_aneg_c73() argument
450 ret = _xpcs_config_aneg_c73(xpcs, compat); in xpcs_config_aneg_c73()
454 ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_CTRL1); in xpcs_config_aneg_c73()
460 return xpcs_write(xpcs, MDIO_MMD_AN, MDIO_CTRL1, ret); in xpcs_config_aneg_c73()
463 static int xpcs_aneg_done_c73(struct dw_xpcs *xpcs, in xpcs_aneg_done_c73() argument
470 ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_AN_LPA); in xpcs_aneg_done_c73()
476 xpcs_config_aneg_c73(xpcs, compat); in xpcs_aneg_done_c73()
486 static int xpcs_read_lpa_c73(struct dw_xpcs *xpcs, in xpcs_read_lpa_c73() argument
501 ret = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_AN_LPA + i); in xpcs_read_lpa_c73()
513 static int xpcs_get_max_xlgmii_speed(struct dw_xpcs *xpcs, in xpcs_get_max_xlgmii_speed() argument
567 static void xpcs_resolve_pma(struct dw_xpcs *xpcs, in xpcs_resolve_pma() argument
578 state->speed = xpcs_get_max_xlgmii_speed(xpcs, state); in xpcs_resolve_pma()
591 struct dw_xpcs *xpcs; in xpcs_validate() local
594 xpcs = phylink_pcs_to_xpcs(pcs); in xpcs_validate()
595 compat = xpcs_find_compat(xpcs->desc, state->interface); in xpcs_validate()
611 void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) in xpcs_get_interfaces() argument
616 const struct dw_xpcs_compat *compat = &xpcs->desc->compat[i]; in xpcs_get_interfaces()
624 int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) in xpcs_config_eee() argument
628 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); in xpcs_config_eee()
645 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0, ret); in xpcs_config_eee()
649 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1); in xpcs_config_eee()
658 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret); in xpcs_config_eee()
662 static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, in xpcs_config_aneg_c37_sgmii() argument
667 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) in xpcs_config_aneg_c37_sgmii()
668 xpcs_write_vpcs(xpcs, DW_VR_XS_PCS_DIG_CTRL1, DW_CL37_BP | DW_EN_VSMMD1); in xpcs_config_aneg_c37_sgmii()
675 * DW xPCS used with DW EQoS MAC is always MAC side SGMII. in xpcs_config_aneg_c37_sgmii()
686 mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL); in xpcs_config_aneg_c37_sgmii()
691 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, in xpcs_config_aneg_c37_sgmii()
697 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL); in xpcs_config_aneg_c37_sgmii()
705 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) { in xpcs_config_aneg_c37_sgmii()
714 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL, ret); in xpcs_config_aneg_c37_sgmii()
718 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1); in xpcs_config_aneg_c37_sgmii()
727 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) in xpcs_config_aneg_c37_sgmii()
730 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); in xpcs_config_aneg_c37_sgmii()
735 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, in xpcs_config_aneg_c37_sgmii()
741 static int xpcs_config_aneg_c37_1000basex(struct dw_xpcs *xpcs, in xpcs_config_aneg_c37_1000basex() argument
749 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) in xpcs_config_aneg_c37_1000basex()
750 xpcs_write_vpcs(xpcs, DW_VR_XS_PCS_DIG_CTRL1, DW_CL37_BP | DW_EN_VSMMD1); in xpcs_config_aneg_c37_1000basex()
757 mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL); in xpcs_config_aneg_c37_1000basex()
762 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, in xpcs_config_aneg_c37_1000basex()
768 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL); in xpcs_config_aneg_c37_1000basex()
773 if (!xpcs->pcs.poll) in xpcs_config_aneg_c37_1000basex()
775 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL, ret); in xpcs_config_aneg_c37_1000basex()
785 ret = xpcs_modify_changed(xpcs, MDIO_MMD_VEND2, in xpcs_config_aneg_c37_1000basex()
794 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS, 0); in xpcs_config_aneg_c37_1000basex()
799 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, in xpcs_config_aneg_c37_1000basex()
808 static int xpcs_config_2500basex(struct dw_xpcs *xpcs) in xpcs_config_2500basex() argument
812 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1); in xpcs_config_2500basex()
817 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); in xpcs_config_2500basex()
821 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL); in xpcs_config_2500basex()
827 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, ret); in xpcs_config_2500basex()
830 int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface, in xpcs_do_config() argument
836 compat = xpcs_find_compat(xpcs->desc, interface); in xpcs_do_config()
840 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) { in xpcs_do_config()
841 ret = txgbe_xpcs_switch_mode(xpcs, interface); in xpcs_do_config()
851 ret = xpcs_config_aneg_c73(xpcs, compat); in xpcs_do_config()
857 ret = xpcs_config_aneg_c37_sgmii(xpcs, neg_mode); in xpcs_do_config()
862 ret = xpcs_config_aneg_c37_1000basex(xpcs, neg_mode, in xpcs_do_config()
868 ret = xpcs_config_2500basex(xpcs); in xpcs_do_config()
877 ret = compat->pma_config(xpcs); in xpcs_do_config()
891 struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); in xpcs_config() local
893 return xpcs_do_config(xpcs, interface, advertising, neg_mode); in xpcs_config()
896 static int xpcs_get_state_c73(struct dw_xpcs *xpcs, in xpcs_get_state_c73() argument
909 pcs_stat1 = xpcs_read(xpcs, MDIO_MMD_PCS, MDIO_STAT1); in xpcs_get_state_c73()
919 ret = xpcs_read_fault_c73(xpcs, state, pcs_stat1); in xpcs_get_state_c73()
921 ret = xpcs_soft_reset(xpcs, compat); in xpcs_get_state_c73()
927 return xpcs_do_config(xpcs, state->interface, NULL, in xpcs_get_state_c73()
942 an_stat1 = xpcs_read(xpcs, MDIO_MMD_AN, MDIO_STAT1); in xpcs_get_state_c73()
948 state->an_complete = xpcs_aneg_done_c73(xpcs, state, compat, in xpcs_get_state_c73()
955 ret = xpcs_read_lpa_c73(xpcs, state, an_stat1); in xpcs_get_state_c73()
963 xpcs_resolve_pma(xpcs, state); in xpcs_get_state_c73()
969 static int xpcs_get_state_c37_sgmii(struct dw_xpcs *xpcs, in xpcs_get_state_c37_sgmii() argument
983 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS); in xpcs_get_state_c37_sgmii()
1010 speed = xpcs_read(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1); in xpcs_get_state_c37_sgmii()
1022 duplex = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_ADVERTISE); in xpcs_get_state_c37_sgmii()
1031 xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS, 0); in xpcs_get_state_c37_sgmii()
1037 static int xpcs_get_state_c37_1000basex(struct dw_xpcs *xpcs, in xpcs_get_state_c37_1000basex() argument
1047 lpa = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_LPA); in xpcs_get_state_c37_1000basex()
1051 bmsr = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_BMSR); in xpcs_get_state_c37_1000basex()
1056 if (!xpcs->pcs.poll) { in xpcs_get_state_c37_1000basex()
1059 an_intr = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS); in xpcs_get_state_c37_1000basex()
1062 xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS, an_intr); in xpcs_get_state_c37_1000basex()
1072 static int xpcs_get_state_2500basex(struct dw_xpcs *xpcs, in xpcs_get_state_2500basex() argument
1077 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_STS); in xpcs_get_state_2500basex()
1097 struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); in xpcs_get_state() local
1101 compat = xpcs_find_compat(xpcs->desc, state->interface); in xpcs_get_state()
1107 phylink_mii_c45_pcs_get_state(xpcs->mdiodev, state); in xpcs_get_state()
1110 ret = xpcs_get_state_c73(xpcs, state, compat); in xpcs_get_state()
1118 ret = xpcs_get_state_c37_sgmii(xpcs, state); in xpcs_get_state()
1125 ret = xpcs_get_state_c37_1000basex(xpcs, state); in xpcs_get_state()
1132 ret = xpcs_get_state_2500basex(xpcs, state); in xpcs_get_state()
1143 static void xpcs_link_up_sgmii(struct dw_xpcs *xpcs, unsigned int neg_mode, in xpcs_link_up_sgmii() argument
1152 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1, val); in xpcs_link_up_sgmii()
1157 static void xpcs_link_up_1000basex(struct dw_xpcs *xpcs, unsigned int neg_mode, in xpcs_link_up_1000basex() argument
1181 ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1, val); in xpcs_link_up_1000basex()
1189 struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); in xpcs_link_up() local
1192 return xpcs_config_usxgmii(xpcs, speed); in xpcs_link_up()
1194 return xpcs_link_up_sgmii(xpcs, neg_mode, speed, duplex); in xpcs_link_up()
1196 return xpcs_link_up_1000basex(xpcs, neg_mode, speed, duplex); in xpcs_link_up()
1202 struct dw_xpcs *xpcs = phylink_pcs_to_xpcs(pcs); in xpcs_an_restart() local
1205 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1); in xpcs_an_restart()
1208 xpcs_write(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1, ret); in xpcs_an_restart()
1212 static int xpcs_get_id(struct dw_xpcs *xpcs) in xpcs_get_id() argument
1220 ret = xpcs_read(xpcs, MDIO_MMD_PCS, MII_PHYSID1); in xpcs_get_id()
1226 ret = xpcs_read(xpcs, MDIO_MMD_PCS, MII_PHYSID2); in xpcs_get_id()
1237 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_PHYSID1); in xpcs_get_id()
1243 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, MII_PHYSID2); in xpcs_get_id()
1251 if (xpcs->info.pcs == DW_XPCS_ID_NATIVE) in xpcs_get_id()
1252 xpcs->info.pcs = id; in xpcs_get_id()
1255 ret = xpcs_read(xpcs, MDIO_MMD_PMAPMD, MDIO_DEVID1); in xpcs_get_id()
1261 ret = xpcs_read(xpcs, MDIO_MMD_PMAPMD, MDIO_DEVID2); in xpcs_get_id()
1272 if (xpcs->info.pma == DW_XPCS_PMA_ID_NATIVE) in xpcs_get_id()
1273 xpcs->info.pma = id; in xpcs_get_id()
1376 struct dw_xpcs *xpcs; in xpcs_create_data() local
1378 xpcs = kzalloc(sizeof(*xpcs), GFP_KERNEL); in xpcs_create_data()
1379 if (!xpcs) in xpcs_create_data()
1383 xpcs->mdiodev = mdiodev; in xpcs_create_data()
1384 xpcs->pcs.ops = &xpcs_phylink_ops; in xpcs_create_data()
1385 xpcs->pcs.neg_mode = true; in xpcs_create_data()
1386 xpcs->pcs.poll = true; in xpcs_create_data()
1388 return xpcs; in xpcs_create_data()
1391 static void xpcs_free_data(struct dw_xpcs *xpcs) in xpcs_free_data() argument
1393 mdio_device_put(xpcs->mdiodev); in xpcs_free_data()
1394 kfree(xpcs); in xpcs_free_data()
1397 static int xpcs_init_clks(struct dw_xpcs *xpcs) in xpcs_init_clks() argument
1403 struct device *dev = &xpcs->mdiodev->dev; in xpcs_init_clks()
1407 xpcs->clks[i].id = ids[i]; in xpcs_init_clks()
1409 ret = clk_bulk_get_optional(dev, DW_XPCS_NUM_CLKS, xpcs->clks); in xpcs_init_clks()
1413 ret = clk_bulk_prepare_enable(DW_XPCS_NUM_CLKS, xpcs->clks); in xpcs_init_clks()
1420 static void xpcs_clear_clks(struct dw_xpcs *xpcs) in xpcs_clear_clks() argument
1422 clk_bulk_disable_unprepare(DW_XPCS_NUM_CLKS, xpcs->clks); in xpcs_clear_clks()
1424 clk_bulk_put(DW_XPCS_NUM_CLKS, xpcs->clks); in xpcs_clear_clks()
1427 static int xpcs_init_id(struct dw_xpcs *xpcs) in xpcs_init_id() argument
1432 info = dev_get_platdata(&xpcs->mdiodev->dev); in xpcs_init_id()
1434 xpcs->info.pcs = DW_XPCS_ID_NATIVE; in xpcs_init_id()
1435 xpcs->info.pma = DW_XPCS_PMA_ID_NATIVE; in xpcs_init_id()
1437 xpcs->info = *info; in xpcs_init_id()
1440 ret = xpcs_get_id(xpcs); in xpcs_init_id()
1447 if ((xpcs->info.pcs & desc->mask) != desc->id) in xpcs_init_id()
1450 xpcs->desc = desc; in xpcs_init_id()
1455 if (!xpcs->desc) in xpcs_init_id()
1461 static int xpcs_init_iface(struct dw_xpcs *xpcs, phy_interface_t interface) in xpcs_init_iface() argument
1465 compat = xpcs_find_compat(xpcs->desc, interface); in xpcs_init_iface()
1469 if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) { in xpcs_init_iface()
1470 xpcs->pcs.poll = false; in xpcs_init_iface()
1474 return xpcs_soft_reset(xpcs, compat); in xpcs_init_iface()
1480 struct dw_xpcs *xpcs; in xpcs_create() local
1483 xpcs = xpcs_create_data(mdiodev); in xpcs_create()
1484 if (IS_ERR(xpcs)) in xpcs_create()
1485 return xpcs; in xpcs_create()
1487 ret = xpcs_init_clks(xpcs); in xpcs_create()
1491 ret = xpcs_init_id(xpcs); in xpcs_create()
1495 ret = xpcs_init_iface(xpcs, interface); in xpcs_create()
1499 return xpcs; in xpcs_create()
1502 xpcs_clear_clks(xpcs); in xpcs_create()
1505 xpcs_free_data(xpcs); in xpcs_create()
1511 * xpcs_create_mdiodev() - create a DW xPCS instance with the MDIO @addr
1516 * Return: a pointer to the DW XPCS handle if successful, otherwise -ENODEV if
1524 struct dw_xpcs *xpcs; in xpcs_create_mdiodev() local
1530 xpcs = xpcs_create(mdiodev, interface); in xpcs_create_mdiodev()
1540 return xpcs; in xpcs_create_mdiodev()
1545 * xpcs_create_fwnode() - Create a DW xPCS instance from @fwnode
1546 * @fwnode: fwnode handle poining to the DW XPCS device
1549 * Return: a pointer to the DW XPCS handle if successful, otherwise -ENODEV if
1559 struct dw_xpcs *xpcs; in xpcs_create_fwnode() local
1568 xpcs = xpcs_create(mdiodev, interface); in xpcs_create_fwnode()
1578 return xpcs; in xpcs_create_fwnode()
1582 void xpcs_destroy(struct dw_xpcs *xpcs) in xpcs_destroy() argument
1584 if (!xpcs) in xpcs_destroy()
1587 xpcs_clear_clks(xpcs); in xpcs_destroy()
1589 xpcs_free_data(xpcs); in xpcs_destroy()
1593 MODULE_DESCRIPTION("Synopsys DesignWare XPCS library");