Lines Matching +full:d +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
13 #include <generic-phy.h>
16 #include <reset-uclass.h>
43 static int sti_usb_phy_deassert(struct sti_usb_phy *phy) in sti_usb_phy_deassert() argument
47 ret = reset_deassert(&phy->global_ctl); in sti_usb_phy_deassert()
49 pr_err("PHY global deassert failed: %d", ret); in sti_usb_phy_deassert()
53 ret = reset_deassert(&phy->port_ctl); in sti_usb_phy_deassert()
55 pr_err("PHY port deassert failed: %d", ret); in sti_usb_phy_deassert()
60 static int sti_usb_phy_init(struct phy *usb_phy) in sti_usb_phy_init()
62 struct udevice *dev = usb_phy->dev; in sti_usb_phy_init()
63 struct sti_usb_phy *phy = dev_get_priv(dev); in sti_usb_phy_init() local
67 reg = (void __iomem *)phy->regmap->ranges[0].start + phy->ctrl; in sti_usb_phy_init()
72 reg = (void __iomem *)phy->regmap->ranges[0].start + phy->param; in sti_usb_phy_init()
76 return sti_usb_phy_deassert(phy); in sti_usb_phy_init()
79 static int sti_usb_phy_exit(struct phy *usb_phy) in sti_usb_phy_exit()
81 struct udevice *dev = usb_phy->dev; in sti_usb_phy_exit()
82 struct sti_usb_phy *phy = dev_get_priv(dev); in sti_usb_phy_exit() local
85 ret = reset_assert(&phy->port_ctl); in sti_usb_phy_exit()
87 pr_err("PHY port assert failed: %d", ret); in sti_usb_phy_exit()
91 ret = reset_assert(&phy->global_ctl); in sti_usb_phy_exit()
93 pr_err("PHY global assert failed: %d", ret); in sti_usb_phy_exit()
116 pr_err("Can't get syscfg phandle: %d\n", ret); in sti_usb_phy_probe()
123 pr_err("unable to find syscon device (%d)\n", ret); in sti_usb_phy_probe()
127 priv->regmap = syscon_get_regmap(syscon); in sti_usb_phy_probe()
128 if (!priv->regmap) { in sti_usb_phy_probe()
130 return -ENODEV; in sti_usb_phy_probe()
133 /* get phy param offset */ in sti_usb_phy_probe()
134 count = fdtdec_get_int_array_count(gd->fdt_blob, dev_of_offset(dev), in sti_usb_phy_probe()
139 pr_err("Bad PHY st,syscfg property %d\n", count); in sti_usb_phy_probe()
140 return -EINVAL; in sti_usb_phy_probe()
144 pr_err("Unsupported PHY param count %d\n", count); in sti_usb_phy_probe()
145 return -EINVAL; in sti_usb_phy_probe()
148 priv->param = cells[PHYPARAM_REG]; in sti_usb_phy_probe()
149 priv->ctrl = cells[PHYCTRL_REG]; in sti_usb_phy_probe()
152 ret = reset_get_by_name(dev, "global", &priv->global_ctl); in sti_usb_phy_probe()
154 pr_err("can't get global reset for %s (%d)", dev->name, ret); in sti_usb_phy_probe()
159 ret = reset_get_by_name(dev, "port", &priv->port_ctl); in sti_usb_phy_probe()
161 pr_err("can't get port reset for %s (%d)", dev->name, ret); in sti_usb_phy_probe()
169 { .compatible = "st,stih407-usb2-phy" },