Lines Matching +full:ssc +full:- +full:range
1 // SPDX-License-Identifier: GPL-2.0
3 * Renesas R-Car Gen3 for USB3.0 PHY driver
65 writew(val, r->base + USB30_CLKSET1); in write_clkset1_for_usb_extal()
72 switch (r->ssc_range) { in rcar_gen3_phy_usb3_enable_ssc()
83 dev_err(&r->phy->dev, "%s: unsupported range (%x)\n", __func__, in rcar_gen3_phy_usb3_enable_ssc()
84 r->ssc_range); in rcar_gen3_phy_usb3_enable_ssc()
88 writew(val, r->base + USB30_SSC_SET); in rcar_gen3_phy_usb3_enable_ssc()
94 if (r->ssc_range) in rcar_gen3_phy_usb3_select_usb_extal()
97 r->base + USB30_CLKSET0); in rcar_gen3_phy_usb3_select_usb_extal()
98 writew(PHY_ENABLE_RESET_EN, r->base + USB30_PHY_ENABLE); in rcar_gen3_phy_usb3_select_usb_extal()
108 dev_vdbg(&r->phy->dev, "%s: enter (%d, %d, %d)\n", __func__, in rcar_gen3_phy_usb3_init()
109 r->usb3s_clk, r->usb_extal, r->ssc_range); in rcar_gen3_phy_usb3_init()
111 if (!r->usb3s_clk && r->usb_extal) in rcar_gen3_phy_usb3_init()
115 writew(VBUS_EN_VBUS_EN, r->base + USB30_VBUS_EN); in rcar_gen3_phy_usb3_init()
126 { .compatible = "renesas,rcar-gen3-usb3-phy" },
133 struct device *dev = &pdev->dev; in rcar_gen3_phy_usb3_probe()
139 if (!dev->of_node) { in rcar_gen3_phy_usb3_probe()
141 return -EINVAL; in rcar_gen3_phy_usb3_probe()
146 return -ENOMEM; in rcar_gen3_phy_usb3_probe()
148 r->base = devm_platform_ioremap_resource(pdev, 0); in rcar_gen3_phy_usb3_probe()
149 if (IS_ERR(r->base)) in rcar_gen3_phy_usb3_probe()
150 return PTR_ERR(r->base); in rcar_gen3_phy_usb3_probe()
154 r->usb3s_clk = !!clk_get_rate(clk); in rcar_gen3_phy_usb3_probe()
159 r->usb_extal = !!clk_get_rate(clk); in rcar_gen3_phy_usb3_probe()
163 if (!r->usb3s_clk && !r->usb_extal) { in rcar_gen3_phy_usb3_probe()
165 ret = -EINVAL; in rcar_gen3_phy_usb3_probe()
170 * devm_phy_create() will call pm_runtime_enable(&phy->dev); in rcar_gen3_phy_usb3_probe()
171 * And then, phy-core will manage runtime pm for this device. in rcar_gen3_phy_usb3_probe()
175 r->phy = devm_phy_create(dev, NULL, &rcar_gen3_phy_usb3_ops); in rcar_gen3_phy_usb3_probe()
176 if (IS_ERR(r->phy)) { in rcar_gen3_phy_usb3_probe()
178 ret = PTR_ERR(r->phy); in rcar_gen3_phy_usb3_probe()
182 of_property_read_u32(dev->of_node, "renesas,ssc-range", &r->ssc_range); in rcar_gen3_phy_usb3_probe()
185 phy_set_drvdata(r->phy, r); in rcar_gen3_phy_usb3_probe()
204 pm_runtime_disable(&pdev->dev); in rcar_gen3_phy_usb3_remove()
218 MODULE_DESCRIPTION("Renesas R-Car Gen3 USB 3.0 PHY");