Lines Matching +full:nxp +full:- +full:i
1 // SPDX-License-Identifier: GPL-2.0
2 /* NXP TJA1100 BroadRReach PHY driver
190 if (phydev->link) in tja11xx_config_aneg_cable_test()
193 if (!phydev->drv->cable_test_start || in tja11xx_config_aneg_cable_test()
194 !phydev->drv->cable_test_get_status) in tja11xx_config_aneg_cable_test()
201 ret = phydev->drv->cable_test_start(phydev); in tja11xx_config_aneg_cable_test()
208 ret = phydev->drv->cable_test_get_status(phydev, &finished); in tja11xx_config_aneg_cable_test()
223 switch (phydev->master_slave_set) { in tja11xx_config_aneg()
234 return -ENOTSUPP; in tja11xx_config_aneg()
257 phydev->autoneg = AUTONEG_DISABLE; in tja11xx_config_init()
258 phydev->speed = SPEED_100; in tja11xx_config_init()
259 phydev->duplex = DUPLEX_FULL; in tja11xx_config_init()
261 switch (phydev->phy_id & PHY_ID_MASK) { in tja11xx_config_init()
278 return -EINVAL; in tja11xx_config_init()
306 phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN; in tja11xx_read_status()
307 phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED; in tja11xx_read_status()
318 phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE; in tja11xx_read_status()
320 phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE; in tja11xx_read_status()
322 if (phydev->link) { in tja11xx_read_status()
328 phydev->link = 0; in tja11xx_read_status()
357 int i; in tja11xx_get_strings() local
359 for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) { in tja11xx_get_strings()
360 strncpy(data + i * ETH_GSTRING_LEN, in tja11xx_get_strings()
361 tja11xx_hw_stats[i].string, ETH_GSTRING_LEN); in tja11xx_get_strings()
368 int i, ret; in tja11xx_get_stats() local
370 for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) { in tja11xx_get_stats()
371 ret = phy_read(phydev, tja11xx_hw_stats[i].reg); in tja11xx_get_stats()
373 data[i] = U64_MAX; in tja11xx_get_stats()
375 data[i] = ret & tja11xx_hw_stats[i].mask; in tja11xx_get_stats()
376 data[i] >>= tja11xx_hw_stats[i].off; in tja11xx_get_stats()
406 return -EOPNOTSUPP; in tja11xx_hwmon_read()
441 struct device *dev = &phydev->mdio.dev; in tja11xx_hwmon_register()
442 int i; in tja11xx_hwmon_register() local
444 priv->hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); in tja11xx_hwmon_register()
445 if (!priv->hwmon_name) in tja11xx_hwmon_register()
446 return -ENOMEM; in tja11xx_hwmon_register()
448 for (i = 0; priv->hwmon_name[i]; i++) in tja11xx_hwmon_register()
449 if (hwmon_is_bad_char(priv->hwmon_name[i])) in tja11xx_hwmon_register()
450 priv->hwmon_name[i] = '_'; in tja11xx_hwmon_register()
452 priv->hwmon_dev = in tja11xx_hwmon_register()
453 devm_hwmon_device_register_with_info(dev, priv->hwmon_name, in tja11xx_hwmon_register()
458 return PTR_ERR_OR_ZERO(priv->hwmon_dev); in tja11xx_hwmon_register()
463 struct device *dev = &phydev->mdio.dev; in tja11xx_probe()
468 return -ENOMEM; in tja11xx_probe()
470 priv->phydev = phydev; in tja11xx_probe()
479 struct phy_device *phydev_phy0 = priv->phydev; in tja1102_p1_register()
480 struct mii_bus *bus = phydev_phy0->mdio.bus; in tja1102_p1_register()
481 struct device *dev = &phydev_phy0->mdio.dev; in tja1102_p1_register()
482 struct device_node *np = dev->of_node; in tja1102_p1_register()
494 } else if (addr != phydev_phy0->mdio.addr + 1) { in tja1102_p1_register()
496 * If some day NXP will decide to bring chips with more in tja1102_p1_register()
499 dev_err(dev, "Unexpected address. Should be: %i\n", in tja1102_p1_register()
500 phydev_phy0->mdio.addr + 1); in tja1102_p1_register()
512 dev_err(dev, "Can't create PHY device for Port 1: %i\n", in tja1102_p1_register()
518 * the mii_bus->dev, which is not correct in case. in tja1102_p1_register()
520 phy->mdio.dev.parent = dev; in tja1102_p1_register()
526 * interrupt line, so -EPROBE_DEFER would make no sense in tja1102_p1_register()
529 dev_err(dev, "Can't register Port 1. Unexpected error: %i\n", in tja1102_p1_register()
538 struct device *dev = &phydev->mdio.dev; in tja1102_p0_probe()
544 return -ENOMEM; in tja1102_p0_probe()
546 priv->phydev = phydev; in tja1102_p0_probe()
547 INIT_WORK(&priv->phy_register_work, tja1102_p1_register); in tja1102_p0_probe()
553 schedule_work(&priv->phy_register_work); in tja1102_p0_probe()
562 if ((phydev->phy_id & PHY_ID_MASK) != PHY_ID_TJA1102) in tja1102_match_phy_device()
601 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in tja11xx_config_intr()
627 * | BI_DA+ | BI_DA- | Result
629 * | + short to - | - short to + | short
697 .name = "NXP TJA1100",
715 .name = "NXP TJA1101",
732 .name = "NXP TJA1102 Port 0",
755 .name = "NXP TJA1102 Port 1",
792 MODULE_DESCRIPTION("NXP TJA11xx BoardR-Reach PHY driver");