Home
last modified time | relevance | path

Searched refs:mdiodev (Results 1 – 25 of 44) sorted by relevance

12

/openbmc/linux/drivers/net/phy/
H A Dmdio_device.c26 void mdio_device_free(struct mdio_device *mdiodev) in mdio_device_free() argument
28 put_device(&mdiodev->dev); in mdio_device_free()
40 struct mdio_device *mdiodev = to_mdio_device(dev); in mdio_device_bus_match() local
46 return strcmp(mdiodev->modalias, drv->name) == 0; in mdio_device_bus_match()
51 struct mdio_device *mdiodev; in mdio_device_create() local
54 mdiodev = kzalloc(sizeof(*mdiodev), GFP_KERNEL); in mdio_device_create()
55 if (!mdiodev) in mdio_device_create()
58 mdiodev->dev.release = mdio_device_release; in mdio_device_create()
59 mdiodev->dev.parent = &bus->dev; in mdio_device_create()
60 mdiodev->dev.bus = &mdio_bus_type; in mdio_device_create()
[all …]
H A Dmdio_bus.c44 static int mdiobus_register_gpiod(struct mdio_device *mdiodev) in mdiobus_register_gpiod() argument
47 mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev, in mdiobus_register_gpiod()
49 if (IS_ERR(mdiodev->reset_gpio)) in mdiobus_register_gpiod()
50 return PTR_ERR(mdiodev->reset_gpio); in mdiobus_register_gpiod()
52 if (mdiodev->reset_gpio) in mdiobus_register_gpiod()
53 gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset"); in mdiobus_register_gpiod()
58 static int mdiobus_register_reset(struct mdio_device *mdiodev) in mdiobus_register_reset() argument
62 reset = reset_control_get_optional_exclusive(&mdiodev->dev, "phy"); in mdiobus_register_reset()
66 mdiodev->reset_ctrl = reset; in mdiobus_register_reset()
71 int mdiobus_register_device(struct mdio_device *mdiodev) in mdiobus_register_device() argument
[all …]
/openbmc/linux/drivers/net/dsa/xrs700x/
H A Dxrs700x_mdio.c27 struct mdio_device *mdiodev = context; in xrs700x_mdio_reg_read() local
28 struct device *dev = &mdiodev->dev; in xrs700x_mdio_reg_read()
34 ret = mdiodev_write(mdiodev, XRS_MDIO_IBA1, uval); in xrs700x_mdio_reg_read()
42 ret = mdiodev_write(mdiodev, XRS_MDIO_IBA0, uval); in xrs700x_mdio_reg_read()
48 ret = mdiodev_read(mdiodev, XRS_MDIO_IBD); in xrs700x_mdio_reg_read()
62 struct mdio_device *mdiodev = context; in xrs700x_mdio_reg_write() local
63 struct device *dev = &mdiodev->dev; in xrs700x_mdio_reg_write()
67 ret = mdiodev_write(mdiodev, XRS_MDIO_IBD, (u16)val); in xrs700x_mdio_reg_write()
75 ret = mdiodev_write(mdiodev, XRS_MDIO_IBA1, uval); in xrs700x_mdio_reg_write()
83 ret = mdiodev_write(mdiodev, XRS_MDIO_IBA0, uval); in xrs700x_mdio_reg_write()
[all …]
/openbmc/linux/include/linux/
H A Dmdio.h35 void (*device_free)(struct mdio_device *mdiodev);
36 void (*device_remove)(struct mdio_device *mdiodev);
73 int (*probe)(struct mdio_device *mdiodev);
76 void (*remove)(struct mdio_device *mdiodev);
79 void (*shutdown)(struct mdio_device *mdiodev);
100 void mdio_device_free(struct mdio_device *mdiodev);
102 int mdio_device_register(struct mdio_device *mdiodev);
103 void mdio_device_remove(struct mdio_device *mdiodev);
104 void mdio_device_reset(struct mdio_device *mdiodev, int value);
109 static inline void mdio_device_get(struct mdio_device *mdiodev) in mdio_device_get() argument
[all …]
/openbmc/linux/drivers/net/dsa/
H A Dmt7530-mdio.c144 mt7530_probe(struct mdio_device *mdiodev) in mt7530_probe() argument
151 dn = mdiodev->dev.of_node; in mt7530_probe()
153 priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL); in mt7530_probe()
157 priv->bus = mdiodev->bus; in mt7530_probe()
158 priv->dev = &mdiodev->dev; in mt7530_probe()
173 dev_info(&mdiodev->dev, "MT7530 adapts as multi-chip module\n"); in mt7530_probe()
175 priv->rstc = devm_reset_control_get(&mdiodev->dev, "mcm"); in mt7530_probe()
177 dev_err(&mdiodev->dev, "Couldn't get our reset line\n"); in mt7530_probe()
181 priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset", in mt7530_probe()
184 dev_err(&mdiodev->dev, "Couldn't get our reset line\n"); in mt7530_probe()
[all …]
H A Dlan9303_mdio.c99 static int lan9303_mdio_probe(struct mdio_device *mdiodev) in lan9303_mdio_probe() argument
104 sw_dev = devm_kzalloc(&mdiodev->dev, sizeof(struct lan9303_mdio), in lan9303_mdio_probe()
109 sw_dev->chip.regmap = devm_regmap_init(&mdiodev->dev, NULL, sw_dev, in lan9303_mdio_probe()
113 dev_err(&mdiodev->dev, "regmap init failed: %d\n", ret); in lan9303_mdio_probe()
118 sw_dev->device = mdiodev; in lan9303_mdio_probe()
119 dev_set_drvdata(&mdiodev->dev, sw_dev); in lan9303_mdio_probe()
120 sw_dev->chip.dev = &mdiodev->dev; in lan9303_mdio_probe()
124 ret = lan9303_probe(&sw_dev->chip, mdiodev->dev.of_node); in lan9303_mdio_probe()
128 dev_info(&mdiodev->dev, "LAN9303 MDIO driver loaded successfully\n"); in lan9303_mdio_probe()
133 static void lan9303_mdio_remove(struct mdio_device *mdiodev) in lan9303_mdio_remove() argument
[all …]
H A Ddsa_loop.c300 static int dsa_loop_drv_probe(struct mdio_device *mdiodev) in dsa_loop_drv_probe() argument
302 struct dsa_loop_pdata *pdata = mdiodev->dev.platform_data; in dsa_loop_drv_probe()
310 ds = devm_kzalloc(&mdiodev->dev, sizeof(*ds), GFP_KERNEL); in dsa_loop_drv_probe()
314 ds->dev = &mdiodev->dev; in dsa_loop_drv_probe()
317 ps = devm_kzalloc(&mdiodev->dev, sizeof(*ps), GFP_KERNEL); in dsa_loop_drv_probe()
327 ds->dev = &mdiodev->dev; in dsa_loop_drv_probe()
330 ps->bus = mdiodev->bus; in dsa_loop_drv_probe()
332 dev_set_drvdata(&mdiodev->dev, ds); in dsa_loop_drv_probe()
336 dev_info(&mdiodev->dev, "%s: 0x%0x\n", in dsa_loop_drv_probe()
342 static void dsa_loop_drv_remove(struct mdio_device *mdiodev) in dsa_loop_drv_remove() argument
[all …]
H A Dmv88e6060.c302 static int mv88e6060_probe(struct mdio_device *mdiodev) in mv88e6060_probe() argument
304 struct device *dev = &mdiodev->dev; in mv88e6060_probe()
313 priv->bus = mdiodev->bus; in mv88e6060_probe()
314 priv->sw_addr = mdiodev->addr; in mv88e6060_probe()
337 static void mv88e6060_remove(struct mdio_device *mdiodev) in mv88e6060_remove() argument
339 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); in mv88e6060_remove()
347 static void mv88e6060_shutdown(struct mdio_device *mdiodev) in mv88e6060_shutdown() argument
349 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); in mv88e6060_shutdown()
356 dev_set_drvdata(&mdiodev->dev, NULL); in mv88e6060_shutdown()
/openbmc/linux/drivers/net/dsa/microchip/
H A Dksz8863_smi.c134 static int ksz8863_smi_probe(struct mdio_device *mdiodev) in ksz8863_smi_probe() argument
136 struct device *ddev = &mdiodev->dev; in ksz8863_smi_probe()
143 dev = ksz_switch_alloc(&mdiodev->dev, mdiodev); in ksz8863_smi_probe()
156 dev->regmap[i] = devm_regmap_init(&mdiodev->dev, in ksz8863_smi_probe()
160 return dev_err_probe(&mdiodev->dev, in ksz8863_smi_probe()
167 if (mdiodev->dev.platform_data) in ksz8863_smi_probe()
168 dev->pdata = mdiodev->dev.platform_data; in ksz8863_smi_probe()
176 dev_set_drvdata(&mdiodev->dev, dev); in ksz8863_smi_probe()
181 static void ksz8863_smi_remove(struct mdio_device *mdiodev) in ksz8863_smi_remove() argument
183 struct ksz_device *dev = dev_get_drvdata(&mdiodev->dev); in ksz8863_smi_remove()
[all …]
/openbmc/linux/drivers/net/dsa/b53/
H A Db53_mdio.c292 static int b53_mdio_probe(struct mdio_device *mdiodev) in b53_mdio_probe() argument
301 if (mdiodev->addr != BRCM_PSEUDO_PHY_ADDR && mdiodev->addr != 0) { in b53_mdio_probe()
302 dev_err(&mdiodev->dev, "leaving address %d to PHY\n", in b53_mdio_probe()
303 mdiodev->addr); in b53_mdio_probe()
308 phy_id = mdiobus_read(mdiodev->bus, 0, 2) << 16; in b53_mdio_probe()
309 phy_id |= mdiobus_read(mdiodev->bus, 0, 3); in b53_mdio_probe()
320 dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id); in b53_mdio_probe()
332 strcmp(mdiodev->bus->name, "sf2 slave mii")) in b53_mdio_probe()
335 dev = b53_switch_alloc(&mdiodev->dev, &b53_mdio_ops, mdiodev->bus); in b53_mdio_probe()
341 dev->bus = mdiodev->bus; in b53_mdio_probe()
[all …]
/openbmc/linux/drivers/phy/broadcom/
H A Dphy-bcm-ns2-pcie.c18 struct mdio_device *mdiodev = phy_get_drvdata(p); in ns2_pci_phy_init() local
22 rc = mdiodev_write(mdiodev, BLK_ADDR_REG_OFFSET, PLL_AFE1_100MHZ_BLK); in ns2_pci_phy_init()
27 rc = mdiodev_write(mdiodev, PLL_CLK_AMP_OFFSET, PLL_CLK_AMP_2P05V); in ns2_pci_phy_init()
34 dev_err(&mdiodev->dev, "Error %d writing to phy\n", rc); in ns2_pci_phy_init()
43 static int ns2_pci_phy_probe(struct mdio_device *mdiodev) in ns2_pci_phy_probe() argument
45 struct device *dev = &mdiodev->dev; in ns2_pci_phy_probe()
55 phy_set_drvdata(phy, mdiodev); in ns2_pci_phy_probe()
H A Dphy-bcm-ns-usb3.c52 struct mdio_device *mdiodev; member
184 struct mdio_device *mdiodev = usb3->mdiodev; in bcm_ns_usb3_mdio_phy_write() local
186 return mdiodev_write(mdiodev, reg, value); in bcm_ns_usb3_mdio_phy_write()
189 static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev) in bcm_ns_usb3_mdio_probe() argument
191 struct device *dev = &mdiodev->dev; in bcm_ns_usb3_mdio_probe()
204 usb3->mdiodev = mdiodev; in bcm_ns_usb3_mdio_probe()
/openbmc/linux/drivers/net/dsa/realtek/
H A Drealtek-mdio.c143 static int realtek_mdio_probe(struct mdio_device *mdiodev) in realtek_mdio_probe() argument
146 struct device *dev = &mdiodev->dev; in realtek_mdio_probe()
156 priv = devm_kzalloc(&mdiodev->dev, in realtek_mdio_probe()
181 priv->mdio_addr = mdiodev->addr; in realtek_mdio_probe()
182 priv->bus = mdiodev->bus; in realtek_mdio_probe()
183 priv->dev = &mdiodev->dev; in realtek_mdio_probe()
239 static void realtek_mdio_remove(struct mdio_device *mdiodev) in realtek_mdio_remove() argument
241 struct realtek_priv *priv = dev_get_drvdata(&mdiodev->dev); in realtek_mdio_remove()
253 static void realtek_mdio_shutdown(struct mdio_device *mdiodev) in realtek_mdio_shutdown() argument
255 struct realtek_priv *priv = dev_get_drvdata(&mdiodev->dev); in realtek_mdio_shutdown()
[all …]
/openbmc/u-boot/board/gdsys/mpc8308/
H A Dstrider.c180 struct mii_dev *mdiodev = mdio_alloc(); in last_stage_init() local
181 if (!mdiodev) in last_stage_init()
183 strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); in last_stage_init()
184 mdiodev->read = bb_miiphy_read; in last_stage_init()
185 mdiodev->write = bb_miiphy_write; in last_stage_init()
187 retval = mdio_register(mdiodev); in last_stage_init()
262 struct mii_dev *mdiodev = mdio_alloc(); in last_stage_init() local
263 if (!mdiodev) in last_stage_init()
265 strncpy(mdiodev->name, bb_miiphy_buses[k].name, in last_stage_init()
267 mdiodev->read = bb_miiphy_read; in last_stage_init()
[all …]
H A Dhrcon.c163 struct mii_dev *mdiodev = mdio_alloc(); in last_stage_init() local
164 if (!mdiodev) in last_stage_init()
166 strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); in last_stage_init()
167 mdiodev->read = bb_miiphy_read; in last_stage_init()
168 mdiodev->write = bb_miiphy_write; in last_stage_init()
170 retval = mdio_register(mdiodev); in last_stage_init()
209 struct mii_dev *mdiodev = mdio_alloc(); in last_stage_init() local
210 if (!mdiodev) in last_stage_init()
212 strncpy(mdiodev->name, bb_miiphy_buses[k].name, in last_stage_init()
214 mdiodev->read = bb_miiphy_read; in last_stage_init()
[all …]
/openbmc/u-boot/scripts/coccinelle/net/
H A Dmdio_register.cocci17 + struct mii_dev *mdiodev = mdio_alloc();
18 + if (!mdiodev) return -ENOMEM;
19 + strncpy(mdiodev->name, devname, MDIO_NAME_LEN);
20 + mdiodev->read = readfunc;
21 + mdiodev->write = writefunc;
23 + retval = mdio_register(mdiodev);
/openbmc/linux/drivers/net/mdio/
H A Dof_mdio.c55 struct mdio_device *mdiodev; in of_mdiobus_register_device() local
58 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
59 if (IS_ERR(mdiodev)) in of_mdiobus_register_device()
60 return PTR_ERR(mdiodev); in of_mdiobus_register_device()
66 device_set_node(&mdiodev->dev, fwnode); in of_mdiobus_register_device()
69 rc = mdio_device_register(mdiodev); in of_mdiobus_register_device()
71 device_set_node(&mdiodev->dev, NULL); in of_mdiobus_register_device()
73 mdio_device_free(mdiodev); in of_mdiobus_register_device()
/openbmc/u-boot/drivers/net/
H A Dbcm-sf2-eth.c247 struct mii_dev *mdiodev = mdio_alloc(); in bcm_sf2_eth_register() local
249 if (!mdiodev) in bcm_sf2_eth_register()
251 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in bcm_sf2_eth_register()
252 mdiodev->read = eth->miiphy_read; in bcm_sf2_eth_register()
253 mdiodev->write = eth->miiphy_write; in bcm_sf2_eth_register()
255 retval = mdio_register(mdiodev); in bcm_sf2_eth_register()
H A Dsh_eth.c608 struct mii_dev *mdiodev; in sh_eth_initialize() local
645 mdiodev = mdio_alloc(); in sh_eth_initialize()
646 if (!mdiodev) in sh_eth_initialize()
648 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in sh_eth_initialize()
649 mdiodev->read = bb_miiphy_read; in sh_eth_initialize()
650 mdiodev->write = bb_miiphy_write; in sh_eth_initialize()
652 ret = mdio_register(mdiodev); in sh_eth_initialize()
814 struct mii_dev *mdiodev; in sh_ether_probe() local
834 mdiodev = mdio_alloc(); in sh_ether_probe()
835 if (!mdiodev) { in sh_ether_probe()
[all …]
H A Dsmc911x.c286 struct mii_dev *mdiodev = mdio_alloc(); in smc911x_initialize() local
287 if (!mdiodev) in smc911x_initialize()
289 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in smc911x_initialize()
290 mdiodev->read = smc911x_miiphy_read; in smc911x_initialize()
291 mdiodev->write = smc911x_miiphy_write; in smc911x_initialize()
293 retval = mdio_register(mdiodev); in smc911x_initialize()
H A Dravb.c470 struct mii_dev *mdiodev; in ravb_probe() local
492 mdiodev = mdio_alloc(); in ravb_probe()
493 if (!mdiodev) { in ravb_probe()
498 mdiodev->read = bb_miiphy_read; in ravb_probe()
499 mdiodev->write = bb_miiphy_write; in ravb_probe()
501 snprintf(mdiodev->name, sizeof(mdiodev->name), dev->name); in ravb_probe()
503 ret = mdio_register(mdiodev); in ravb_probe()
527 mdio_free(mdiodev); in ravb_probe()
/openbmc/u-boot/board/gdsys/a38x/
H A Dihs_phys.c106 struct mii_dev *mdiodev = mdio_alloc(); in register_miiphy_bus() local
109 if (!mdiodev) in register_miiphy_bus()
111 strncpy(mdiodev->name, in register_miiphy_bus()
114 mdiodev->read = bb_miiphy_read; in register_miiphy_bus()
115 mdiodev->write = bb_miiphy_write; in register_miiphy_bus()
117 retval = mdio_register(mdiodev); in register_miiphy_bus()
/openbmc/linux/drivers/net/dsa/qca/
H A Dar9331.c1025 static int ar9331_sw_probe(struct mdio_device *mdiodev) in ar9331_sw_probe() argument
1031 priv = devm_kzalloc(&mdiodev->dev, sizeof(*priv), GFP_KERNEL); in ar9331_sw_probe()
1035 priv->regmap = devm_regmap_init(&mdiodev->dev, &ar9331_sw_bus, priv, in ar9331_sw_probe()
1039 dev_err(&mdiodev->dev, "regmap init failed: %d\n", ret); in ar9331_sw_probe()
1043 priv->sw_reset = devm_reset_control_get(&mdiodev->dev, "switch"); in ar9331_sw_probe()
1045 dev_err(&mdiodev->dev, "missing switch reset\n"); in ar9331_sw_probe()
1049 priv->sbus = mdiodev->bus; in ar9331_sw_probe()
1050 priv->dev = &mdiodev->dev; in ar9331_sw_probe()
1057 ds->dev = &mdiodev->dev; in ar9331_sw_probe()
1062 dev_set_drvdata(&mdiodev->dev, priv); in ar9331_sw_probe()
[all …]
/openbmc/linux/drivers/net/pcs/
H A Dpcs-xpcs.c206 return mdiodev_c45_read(xpcs->mdiodev, dev, reg); in xpcs_read()
211 return mdiodev_c45_write(xpcs->mdiodev, dev, reg, val); in xpcs_write()
217 return mdiodev_c45_modify_changed(xpcs->mdiodev, dev, reg, mask, set); in xpcs_modify_changed()
309 dev_warn(&(__xpcs)->mdiodev->dev, ##__args); \
1106 phylink_mii_c45_pcs_get_state(xpcs->mdiodev, state); in xpcs_get_state()
1340 static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev, in xpcs_create() argument
1351 mdio_device_get(mdiodev); in xpcs_create()
1352 xpcs->mdiodev = mdiodev; in xpcs_create()
1392 mdio_device_put(mdiodev); in xpcs_create()
1401 mdio_device_put(xpcs->mdiodev); in xpcs_destroy()
[all …]
/openbmc/u-boot/arch/powerpc/cpu/mpc85xx/
H A Dether_fcc.c444 struct mii_dev *mdiodev = mdio_alloc(); in fec_initialize() local
445 if (!mdiodev) in fec_initialize()
447 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in fec_initialize()
448 mdiodev->read = bb_miiphy_read; in fec_initialize()
449 mdiodev->write = bb_miiphy_write; in fec_initialize()
451 retval = mdio_register(mdiodev); in fec_initialize()

12