u-boot-brain/drivers/phy/nop-phy.c
Marek Vasut 1220aa9a65 phy: nop-phy: Add standard usb-nop-xceiv compat string
The USB no-op PHY uses "usb-nop-xceiv" compatible string. This driver is
compatible with USB no-op PHY, so add the compatible string.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Ye Li <ye.li@nxp.com>
Cc: uboot-imx <uboot-imx@nxp.com>
2021-04-18 04:29:35 +02:00

62 lines
1.2 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
* Written by Jean-Jacques Hiblot <jjhiblot@ti.com>
*/
#include <clk.h>
#include <common.h>
#include <dm.h>
#include <dm/device.h>
#include <dm/device_compat.h>
#include <generic-phy.h>
struct nop_phy_priv {
struct clk_bulk bulk;
};
static int nop_phy_init(struct phy *phy)
{
struct nop_phy_priv *priv = dev_get_priv(phy->dev);
if (CONFIG_IS_ENABLED(CLK))
return clk_enable_bulk(&priv->bulk);
return 0;
}
static int nop_phy_probe(struct udevice *dev)
{
struct nop_phy_priv *priv = dev_get_priv(dev);
int ret;
if (CONFIG_IS_ENABLED(CLK)) {
ret = clk_get_bulk(dev, &priv->bulk);
if (ret < 0) {
dev_err(dev, "Failed to get clk: %d\n", ret);
return ret;
}
}
return 0;
}
static const struct udevice_id nop_phy_ids[] = {
{ .compatible = "nop-phy" },
{ .compatible = "usb-nop-xceiv" },
{ }
};
static struct phy_ops nop_phy_ops = {
.init = nop_phy_init,
};
U_BOOT_DRIVER(nop_phy) = {
.name = "nop_phy",
.id = UCLASS_PHY,
.of_match = nop_phy_ids,
.ops = &nop_phy_ops,
.probe = nop_phy_probe,
.priv_auto = sizeof(struct nop_phy_priv),
};