Lines Matching +full:swap +full:- +full:dx +full:- +full:lanes
1 // SPDX-License-Identifier: GPL-2.0
81 #define PORT_REGS(p) ((p)->priv->regs + (p)->id * 0x1000)
84 * struct mvebu_cp110_utmi - PHY driver data
99 * struct mvebu_cp110_utmi_port - PHY port data
104 * @swap_dx: whether to swap d+/d- signals
159 * Set Control VDAT Reference Voltage - 0.325V and in mvebu_cp110_utmi_port_setup()
160 * Control VSRC Reference Voltage - 0.6V in mvebu_cp110_utmi_port_setup()
167 /* Swap D+/D- */ in mvebu_cp110_utmi_port_setup()
170 if (port->swap_dx) in mvebu_cp110_utmi_port_setup()
178 struct mvebu_cp110_utmi *utmi = port->priv; in mvebu_cp110_utmi_phy_power_off()
182 regmap_clear_bits(utmi->syscon, SYSCON_UTMI_CFG_REG(port->id), in mvebu_cp110_utmi_phy_power_off()
186 int test = regmap_test_bits(utmi->syscon, in mvebu_cp110_utmi_phy_power_off()
195 regmap_clear_bits(utmi->syscon, SYSCON_USB_CFG_REG, USB_CFG_PLL_MASK); in mvebu_cp110_utmi_phy_power_off()
203 struct mvebu_cp110_utmi *utmi = port->priv; in mvebu_cp110_utmi_phy_power_on()
204 struct device *dev = &phy->dev; in mvebu_cp110_utmi_phy_power_on()
221 if (port->dr_mode == USB_DR_MODE_PERIPHERAL) { in mvebu_cp110_utmi_phy_power_on()
222 regmap_update_bits(utmi->syscon, SYSCON_USB_CFG_REG, in mvebu_cp110_utmi_phy_power_on()
225 (port->id << USB_CFG_DEVICE_MUX_OFFSET)); in mvebu_cp110_utmi_phy_power_on()
240 regmap_set_bits(utmi->syscon, SYSCON_UTMI_CFG_REG(port->id), in mvebu_cp110_utmi_phy_power_on()
276 regmap_set_bits(utmi->syscon, SYSCON_USB_CFG_REG, USB_CFG_PLL_MASK); in mvebu_cp110_utmi_phy_power_on()
288 { .compatible = "marvell,cp110-utmi-phy" },
295 struct device *dev = &pdev->dev; in mvebu_cp110_utmi_phy_probe()
304 return -ENOMEM; in mvebu_cp110_utmi_phy_probe()
306 utmi->dev = dev; in mvebu_cp110_utmi_phy_probe()
309 utmi->syscon = syscon_regmap_lookup_by_phandle(dev->of_node, in mvebu_cp110_utmi_phy_probe()
310 "marvell,system-controller"); in mvebu_cp110_utmi_phy_probe()
311 if (IS_ERR(utmi->syscon)) { in mvebu_cp110_utmi_phy_probe()
313 return PTR_ERR(utmi->syscon); in mvebu_cp110_utmi_phy_probe()
317 utmi->regs = devm_platform_ioremap_resource(pdev, 0); in mvebu_cp110_utmi_phy_probe()
318 if (IS_ERR(utmi->regs)) in mvebu_cp110_utmi_phy_probe()
319 return PTR_ERR(utmi->regs); in mvebu_cp110_utmi_phy_probe()
321 for_each_available_child_of_node(dev->of_node, child) { in mvebu_cp110_utmi_phy_probe()
338 return -ENOMEM; in mvebu_cp110_utmi_phy_probe()
341 port->dr_mode = of_usb_get_dr_mode_by_phy(child, -1); in mvebu_cp110_utmi_phy_probe()
342 if ((port->dr_mode != USB_DR_MODE_HOST) && in mvebu_cp110_utmi_phy_probe()
343 (port->dr_mode != USB_DR_MODE_PERIPHERAL)) { in mvebu_cp110_utmi_phy_probe()
344 dev_err(&pdev->dev, in mvebu_cp110_utmi_phy_probe()
347 port->dr_mode = USB_DR_MODE_HOST; in mvebu_cp110_utmi_phy_probe()
350 if (port->dr_mode == USB_DR_MODE_PERIPHERAL) { in mvebu_cp110_utmi_phy_probe()
356 port->dr_mode = USB_DR_MODE_HOST; in mvebu_cp110_utmi_phy_probe()
360 of_property_for_each_u32(dev->of_node, "swap-dx-lanes", swap_dx) in mvebu_cp110_utmi_phy_probe()
362 port->swap_dx = 1; in mvebu_cp110_utmi_phy_probe()
365 utmi->ops = &mvebu_cp110_utmi_phy_ops; in mvebu_cp110_utmi_phy_probe()
368 phy = devm_phy_create(dev, child, utmi->ops); in mvebu_cp110_utmi_phy_probe()
375 port->priv = utmi; in mvebu_cp110_utmi_phy_probe()
376 port->id = port_id; in mvebu_cp110_utmi_phy_probe()
392 .name = "mvebu-cp110-utmi-phy",