Lines Matching +full:lpc1850 +full:- +full:creg

1 // SPDX-License-Identifier: GPL-2.0-only
17 /* USB OTG PHY register offset and bit in CREG */
33 ret = clk_set_rate(lpc->clk, 480000000); in lpc18xx_usb_otg_phy_init()
37 return clk_prepare(lpc->clk); in lpc18xx_usb_otg_phy_init()
44 clk_unprepare(lpc->clk); in lpc18xx_usb_otg_phy_exit()
54 ret = clk_enable(lpc->clk); in lpc18xx_usb_otg_phy_power_on()
58 /* The bit in CREG is cleared to enable the PHY */ in lpc18xx_usb_otg_phy_power_on()
59 ret = regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0, in lpc18xx_usb_otg_phy_power_on()
62 clk_disable(lpc->clk); in lpc18xx_usb_otg_phy_power_on()
74 ret = regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0, in lpc18xx_usb_otg_phy_power_off()
80 clk_disable(lpc->clk); in lpc18xx_usb_otg_phy_power_off()
98 lpc = devm_kzalloc(&pdev->dev, sizeof(*lpc), GFP_KERNEL); in lpc18xx_usb_otg_phy_probe()
100 return -ENOMEM; in lpc18xx_usb_otg_phy_probe()
102 lpc->reg = syscon_node_to_regmap(pdev->dev.of_node->parent); in lpc18xx_usb_otg_phy_probe()
103 if (IS_ERR(lpc->reg)) { in lpc18xx_usb_otg_phy_probe()
104 dev_err(&pdev->dev, "failed to get syscon\n"); in lpc18xx_usb_otg_phy_probe()
105 return PTR_ERR(lpc->reg); in lpc18xx_usb_otg_phy_probe()
108 lpc->clk = devm_clk_get(&pdev->dev, NULL); in lpc18xx_usb_otg_phy_probe()
109 if (IS_ERR(lpc->clk)) { in lpc18xx_usb_otg_phy_probe()
110 dev_err(&pdev->dev, "failed to get clock\n"); in lpc18xx_usb_otg_phy_probe()
111 return PTR_ERR(lpc->clk); in lpc18xx_usb_otg_phy_probe()
114 lpc->phy = devm_phy_create(&pdev->dev, NULL, &lpc18xx_usb_otg_phy_ops); in lpc18xx_usb_otg_phy_probe()
115 if (IS_ERR(lpc->phy)) { in lpc18xx_usb_otg_phy_probe()
116 dev_err(&pdev->dev, "failed to create PHY\n"); in lpc18xx_usb_otg_phy_probe()
117 return PTR_ERR(lpc->phy); in lpc18xx_usb_otg_phy_probe()
120 phy_set_drvdata(lpc->phy, lpc); in lpc18xx_usb_otg_phy_probe()
122 phy_provider = devm_of_phy_provider_register(&pdev->dev, in lpc18xx_usb_otg_phy_probe()
129 { .compatible = "nxp,lpc1850-usb-otg-phy" },
137 .name = "lpc18xx-usb-otg-phy",