/**
* struct dsa_ops - DSA operations
*
- * @port_enable: Initialize a switch port for I/O.
+ * @port_probe: Initialize a switch port.
+ * @port_enable: Enable I/O for a port.
* @port_disable: Disable I/O for a port.
* @xmit: Insert the DSA tag for transmission.
* DSA drivers receive a copy of the packet with headroom and
* master including any additional headers.
*/
struct dsa_ops {
+ int (*port_probe)(struct udevice *dev, int port,
+ struct phy_device *phy);
int (*port_enable)(struct udevice *dev, int port,
struct phy_device *phy);
void (*port_disable)(struct udevice *dev, int port,
static int dsa_port_probe(struct udevice *pdev)
{
struct udevice *dev = dev_get_parent(pdev);
+ struct dsa_ops *ops = dsa_get_ops(dev);
struct dsa_port_pdata *port_pdata;
struct dsa_priv *dsa_priv;
struct udevice *master;
dsa_port_set_hwaddr(pdev, master);
+ if (ops->port_probe) {
+ err = ops->port_probe(dev, port_pdata->index,
+ port_pdata->phy);
+ if (err)
+ return err;
+ }
+
return 0;
}