Lines Matching +full:jh7110 +full:- +full:sys +full:- +full:syscon

1 // SPDX-License-Identifier: GPL-2.0+
3 * StarFive JH7110 USB 2.0 PHY driver
13 #include <linux/mfd/syscon.h>
40 /* Host mode enable the LS speed keep-alive signal */ in usb2_set_ls_keepalive()
41 val = readl(phy->regs + USB_LS_KEEPALIVE_OFF); in usb2_set_ls_keepalive()
47 writel(val, phy->regs + USB_LS_KEEPALIVE_OFF); in usb2_set_ls_keepalive()
61 return -EINVAL; in usb2_phy_set_mode()
64 if (mode != phy->mode) { in usb2_phy_set_mode()
65 dev_dbg(&_phy->dev, "Changing phy to %d\n", mode); in usb2_phy_set_mode()
66 phy->mode = mode; in usb2_phy_set_mode()
71 regmap_update_bits(phy->sys_syscon, SYSCON_USB_SPLIT_OFFSET, in usb2_phy_set_mode()
82 ret = clk_set_rate(phy->usb_125m_clk, USB_125M_CLK_RATE); in jh7110_usb2_phy_init()
86 ret = clk_prepare_enable(phy->app_125m); in jh7110_usb2_phy_init()
97 clk_disable_unprepare(phy->app_125m); in jh7110_usb2_phy_exit()
112 struct device *dev = &pdev->dev; in jh7110_usb_phy_probe()
117 return -ENOMEM; in jh7110_usb_phy_probe()
119 phy->usb_125m_clk = devm_clk_get(dev, "125m"); in jh7110_usb_phy_probe()
120 if (IS_ERR(phy->usb_125m_clk)) in jh7110_usb_phy_probe()
121 return dev_err_probe(dev, PTR_ERR(phy->usb_125m_clk), in jh7110_usb_phy_probe()
124 phy->app_125m = devm_clk_get(dev, "app_125m"); in jh7110_usb_phy_probe()
125 if (IS_ERR(phy->app_125m)) in jh7110_usb_phy_probe()
126 return dev_err_probe(dev, PTR_ERR(phy->app_125m), in jh7110_usb_phy_probe()
129 phy->regs = devm_platform_ioremap_resource(pdev, 0); in jh7110_usb_phy_probe()
130 if (IS_ERR(phy->regs)) in jh7110_usb_phy_probe()
131 return dev_err_probe(dev, PTR_ERR(phy->regs), in jh7110_usb_phy_probe()
134 phy->phy = devm_phy_create(dev, NULL, &jh7110_usb2_phy_ops); in jh7110_usb_phy_probe()
135 if (IS_ERR(phy->phy)) in jh7110_usb_phy_probe()
136 return dev_err_probe(dev, PTR_ERR(phy->phy), in jh7110_usb_phy_probe()
139 phy_set_drvdata(phy->phy, phy); in jh7110_usb_phy_probe()
142 phy->sys_syscon = in jh7110_usb_phy_probe()
143 syscon_regmap_lookup_by_compatible("starfive,jh7110-sys-syscon"); in jh7110_usb_phy_probe()
144 if (IS_ERR(phy->sys_syscon)) in jh7110_usb_phy_probe()
145 return dev_err_probe(dev, PTR_ERR(phy->sys_syscon), in jh7110_usb_phy_probe()
146 "Failed to get sys-syscon\n"); in jh7110_usb_phy_probe()
152 { .compatible = "starfive,jh7110-usb-phy" },
161 .name = "jh7110-usb-phy",
166 MODULE_DESCRIPTION("StarFive JH7110 USB 2.0 PHY driver");