Lines Matching +full:skip +full:- +full:power +full:- +full:up
1 // SPDX-License-Identifier: GPL-2.0
79 #define PORT_REGS(p) ((p)->priv->regs + (p)->id * 0x1000)
82 * struct mvebu_cp110_utmi - PHY driver data
97 * struct mvebu_cp110_utmi_port - PHY port data
155 * Set Control VDAT Reference Voltage - 0.325V and in mvebu_cp110_utmi_port_setup()
156 * Control VSRC Reference Voltage - 0.6V in mvebu_cp110_utmi_port_setup()
167 struct mvebu_cp110_utmi *utmi = port->priv; in mvebu_cp110_utmi_phy_power_off()
170 /* Power down UTMI PHY port */ in mvebu_cp110_utmi_phy_power_off()
171 regmap_clear_bits(utmi->syscon, SYSCON_UTMI_CFG_REG(port->id), in mvebu_cp110_utmi_phy_power_off()
175 int test = regmap_test_bits(utmi->syscon, in mvebu_cp110_utmi_phy_power_off()
178 /* skip PLL shutdown if there are active UTMI PHY ports */ in mvebu_cp110_utmi_phy_power_off()
183 /* PLL Power down if all UTMI PHYs are down */ in mvebu_cp110_utmi_phy_power_off()
184 regmap_clear_bits(utmi->syscon, SYSCON_USB_CFG_REG, USB_CFG_PLL_MASK); in mvebu_cp110_utmi_phy_power_off()
192 struct mvebu_cp110_utmi *utmi = port->priv; in mvebu_cp110_utmi_phy_power_on()
193 struct device *dev = &phy->dev; in mvebu_cp110_utmi_phy_power_on()
197 /* It is necessary to power off UTMI before configuration */ in mvebu_cp110_utmi_phy_power_on()
200 dev_err(dev, "UTMI power OFF before power ON failed\n"); in mvebu_cp110_utmi_phy_power_on()
210 if (port->dr_mode == USB_DR_MODE_PERIPHERAL) { in mvebu_cp110_utmi_phy_power_on()
211 regmap_update_bits(utmi->syscon, SYSCON_USB_CFG_REG, in mvebu_cp110_utmi_phy_power_on()
214 (port->id << USB_CFG_DEVICE_MUX_OFFSET)); in mvebu_cp110_utmi_phy_power_on()
222 /* Wait for UTMI power down */ in mvebu_cp110_utmi_phy_power_on()
228 /* Power UP UTMI PHY */ in mvebu_cp110_utmi_phy_power_on()
229 regmap_set_bits(utmi->syscon, SYSCON_UTMI_CFG_REG(port->id), in mvebu_cp110_utmi_phy_power_on()
264 /* PLL Power up */ in mvebu_cp110_utmi_phy_power_on()
265 regmap_set_bits(utmi->syscon, SYSCON_USB_CFG_REG, USB_CFG_PLL_MASK); in mvebu_cp110_utmi_phy_power_on()
277 { .compatible = "marvell,cp110-utmi-phy" },
284 struct device *dev = &pdev->dev; in mvebu_cp110_utmi_phy_probe()
292 return -ENOMEM; in mvebu_cp110_utmi_phy_probe()
294 utmi->dev = dev; in mvebu_cp110_utmi_phy_probe()
297 utmi->syscon = syscon_regmap_lookup_by_phandle(dev->of_node, in mvebu_cp110_utmi_phy_probe()
298 "marvell,system-controller"); in mvebu_cp110_utmi_phy_probe()
299 if (IS_ERR(utmi->syscon)) { in mvebu_cp110_utmi_phy_probe()
301 return PTR_ERR(utmi->syscon); in mvebu_cp110_utmi_phy_probe()
305 utmi->regs = devm_platform_ioremap_resource(pdev, 0); in mvebu_cp110_utmi_phy_probe()
306 if (IS_ERR(utmi->regs)) in mvebu_cp110_utmi_phy_probe()
307 return PTR_ERR(utmi->regs); in mvebu_cp110_utmi_phy_probe()
309 for_each_available_child_of_node(dev->of_node, child) { in mvebu_cp110_utmi_phy_probe()
326 return -ENOMEM; in mvebu_cp110_utmi_phy_probe()
329 port->dr_mode = of_usb_get_dr_mode_by_phy(child, -1); in mvebu_cp110_utmi_phy_probe()
330 if ((port->dr_mode != USB_DR_MODE_HOST) && in mvebu_cp110_utmi_phy_probe()
331 (port->dr_mode != USB_DR_MODE_PERIPHERAL)) { in mvebu_cp110_utmi_phy_probe()
332 dev_err(&pdev->dev, in mvebu_cp110_utmi_phy_probe()
335 port->dr_mode = USB_DR_MODE_HOST; in mvebu_cp110_utmi_phy_probe()
338 if (port->dr_mode == USB_DR_MODE_PERIPHERAL) { in mvebu_cp110_utmi_phy_probe()
344 port->dr_mode = USB_DR_MODE_HOST; in mvebu_cp110_utmi_phy_probe()
349 utmi->ops = &mvebu_cp110_utmi_phy_ops; in mvebu_cp110_utmi_phy_probe()
352 phy = devm_phy_create(dev, child, utmi->ops); in mvebu_cp110_utmi_phy_probe()
359 port->priv = utmi; in mvebu_cp110_utmi_phy_probe()
360 port->id = port_id; in mvebu_cp110_utmi_phy_probe()
376 .name = "mvebu-cp110-utmi-phy",