Lines Matching +full:d +full:- +full:phy
2 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
5 * SPDX-License-Identifier: GPL-2.0+
14 #include <generic-phy.h>
17 #include <reset-uclass.h>
44 static int sti_usb_phy_deassert(struct sti_usb_phy *phy) in sti_usb_phy_deassert() argument
48 ret = reset_deassert(&phy->global_ctl); in sti_usb_phy_deassert()
50 pr_err("PHY global deassert failed: %d", ret); in sti_usb_phy_deassert()
54 ret = reset_deassert(&phy->port_ctl); in sti_usb_phy_deassert()
56 pr_err("PHY port deassert failed: %d", ret); in sti_usb_phy_deassert()
61 static int sti_usb_phy_init(struct phy *usb_phy) in sti_usb_phy_init()
63 struct udevice *dev = usb_phy->dev; in sti_usb_phy_init()
64 struct sti_usb_phy *phy = dev_get_priv(dev); in sti_usb_phy_init() local
68 reg = (void __iomem *)phy->regmap->base + phy->ctrl; in sti_usb_phy_init()
73 reg = (void __iomem *)phy->regmap->base + phy->param; in sti_usb_phy_init()
77 return sti_usb_phy_deassert(phy); in sti_usb_phy_init()
80 static int sti_usb_phy_exit(struct phy *usb_phy) in sti_usb_phy_exit()
82 struct udevice *dev = usb_phy->dev; in sti_usb_phy_exit()
83 struct sti_usb_phy *phy = dev_get_priv(dev); in sti_usb_phy_exit() local
86 ret = reset_assert(&phy->port_ctl); in sti_usb_phy_exit()
88 pr_err("PHY port assert failed: %d", ret); in sti_usb_phy_exit()
92 ret = reset_assert(&phy->global_ctl); in sti_usb_phy_exit()
94 pr_err("PHY global assert failed: %d", ret); in sti_usb_phy_exit()
117 pr_err("Can't get syscfg phandle: %d\n", ret); in sti_usb_phy_probe()
124 pr_err("unable to find syscon device (%d)\n", ret); in sti_usb_phy_probe()
128 priv->regmap = syscon_get_regmap(syscon); in sti_usb_phy_probe()
129 if (!priv->regmap) { in sti_usb_phy_probe()
131 return -ENODEV; in sti_usb_phy_probe()
134 /* get phy param offset */ in sti_usb_phy_probe()
135 count = fdtdec_get_int_array_count(gd->fdt_blob, dev_of_offset(dev), in sti_usb_phy_probe()
140 pr_err("Bad PHY st,syscfg property %d\n", count); in sti_usb_phy_probe()
141 return -EINVAL; in sti_usb_phy_probe()
145 pr_err("Unsupported PHY param count %d\n", count); in sti_usb_phy_probe()
146 return -EINVAL; in sti_usb_phy_probe()
149 priv->param = cells[PHYPARAM_REG]; in sti_usb_phy_probe()
150 priv->ctrl = cells[PHYCTRL_REG]; in sti_usb_phy_probe()
153 ret = reset_get_by_name(dev, "global", &priv->global_ctl); in sti_usb_phy_probe()
155 pr_err("can't get global reset for %s (%d)", dev->name, ret); in sti_usb_phy_probe()
160 ret = reset_get_by_name(dev, "port", &priv->port_ctl); in sti_usb_phy_probe()
162 pr_err("can't get port reset for %s (%d)", dev->name, ret); in sti_usb_phy_probe()
170 { .compatible = "st,stih407-usb2-phy" },