Lines Matching +full:mt7628 +full:- +full:usbphy

1 // SPDX-License-Identifier: GPL-2.0-or-later
63 writel(val, phy->base + reg); in u2_phy_w32()
68 return readl(phy->base + reg); in u2_phy_r32()
97 regmap_update_bits(phy->sysctl, RT_SYSC_REG_CLKCFG1, in ralink_usb_phy_power_on()
98 phy->clk, phy->clk); in ralink_usb_phy_power_on()
101 regmap_update_bits(phy->sysctl, RT_SYSC_REG_SYSCFG1, in ralink_usb_phy_power_on()
106 reset_control_deassert(phy->rsthost); in ralink_usb_phy_power_on()
107 reset_control_deassert(phy->rstdev); in ralink_usb_phy_power_on()
115 if (phy->base) in ralink_usb_phy_power_on()
119 regmap_read(phy->sysctl, RT_SYSC_REG_USB_PHY_CFG, &t); in ralink_usb_phy_power_on()
120 dev_info(&phy->phy->dev, "remote usb device wakeup %s\n", in ralink_usb_phy_power_on()
123 dev_info(&phy->phy->dev, "UTMI 8bit 60MHz\n"); in ralink_usb_phy_power_on()
125 dev_info(&phy->phy->dev, "UTMI 16bit 30MHz\n"); in ralink_usb_phy_power_on()
135 regmap_update_bits(phy->sysctl, RT_SYSC_REG_CLKCFG1, in ralink_usb_phy_power_off()
136 phy->clk, 0); in ralink_usb_phy_power_off()
139 reset_control_assert(phy->rstdev); in ralink_usb_phy_power_off()
140 reset_control_assert(phy->rsthost); in ralink_usb_phy_power_off()
153 .compatible = "ralink,rt3352-usbphy",
158 .compatible = "mediatek,mt7620-usbphy",
163 .compatible = "mediatek,mt7628-usbphy",
172 struct device *dev = &pdev->dev; in ralink_usb_phy_probe()
178 return -ENOMEM; in ralink_usb_phy_probe()
180 phy->clk = (uintptr_t)device_get_match_data(&pdev->dev); in ralink_usb_phy_probe()
181 phy->base = NULL; in ralink_usb_phy_probe()
183 phy->sysctl = syscon_regmap_lookup_by_phandle(dev->of_node, "ralink,sysctl"); in ralink_usb_phy_probe()
184 if (IS_ERR(phy->sysctl)) { in ralink_usb_phy_probe()
186 return PTR_ERR(phy->sysctl); in ralink_usb_phy_probe()
189 /* The MT7628 and MT7688 require extra setup of PHY registers. */ in ralink_usb_phy_probe()
190 if (of_device_is_compatible(dev->of_node, "mediatek,mt7628-usbphy")) { in ralink_usb_phy_probe()
191 phy->base = devm_platform_ioremap_resource(pdev, 0); in ralink_usb_phy_probe()
192 if (IS_ERR(phy->base)) { in ralink_usb_phy_probe()
194 return PTR_ERR(phy->base); in ralink_usb_phy_probe()
198 phy->rsthost = devm_reset_control_get(&pdev->dev, "host"); in ralink_usb_phy_probe()
199 if (IS_ERR(phy->rsthost)) { in ralink_usb_phy_probe()
201 return PTR_ERR(phy->rsthost); in ralink_usb_phy_probe()
204 phy->rstdev = devm_reset_control_get(&pdev->dev, "device"); in ralink_usb_phy_probe()
205 if (IS_ERR(phy->rstdev)) { in ralink_usb_phy_probe()
207 return PTR_ERR(phy->rstdev); in ralink_usb_phy_probe()
210 phy->phy = devm_phy_create(dev, NULL, &ralink_usb_phy_ops); in ralink_usb_phy_probe()
211 if (IS_ERR(phy->phy)) { in ralink_usb_phy_probe()
213 return PTR_ERR(phy->phy); in ralink_usb_phy_probe()
215 phy_set_drvdata(phy->phy, phy); in ralink_usb_phy_probe()
226 .name = "ralink-usb-phy",