mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-16 18:26:42 +00:00
phy: bcm-ns-usb2: drop support for old binding variant
The old binding was incorrectly designed and ended up being deprecated 3 years ago. Finally it has been dropped so relevant code it not needed anymore. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Link: https://lore.kernel.org/r/20240913044557.28315-2-zajec5@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
c3639d423d
commit
0175a673e4
@ -24,9 +24,6 @@ struct bcm_ns_usb2 {
|
||||
struct phy *phy;
|
||||
struct regmap *clkset;
|
||||
void __iomem *base;
|
||||
|
||||
/* Deprecated binding */
|
||||
void __iomem *dmu;
|
||||
};
|
||||
|
||||
static int bcm_ns_usb2_phy_init(struct phy *phy)
|
||||
@ -49,10 +46,7 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
|
||||
goto err_clk_off;
|
||||
}
|
||||
|
||||
if (usb2->base)
|
||||
usb2ctl = readl(usb2->base);
|
||||
else
|
||||
usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
|
||||
usb2ctl = readl(usb2->base);
|
||||
|
||||
if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) {
|
||||
usb_pll_pdiv = usb2ctl;
|
||||
@ -66,24 +60,16 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
|
||||
usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate;
|
||||
|
||||
/* Unlock DMU PLL settings with some magic value */
|
||||
if (usb2->clkset)
|
||||
regmap_write(usb2->clkset, 0, 0x0000ea68);
|
||||
else
|
||||
writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
|
||||
regmap_write(usb2->clkset, 0, 0x0000ea68);
|
||||
|
||||
/* Write USB 2.0 PLL control setting */
|
||||
usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK;
|
||||
usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT;
|
||||
if (usb2->base)
|
||||
writel(usb2ctl, usb2->base);
|
||||
else
|
||||
writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
|
||||
|
||||
writel(usb2ctl, usb2->base);
|
||||
|
||||
/* Lock DMU PLL settings */
|
||||
if (usb2->clkset)
|
||||
regmap_write(usb2->clkset, 0, 0x00000000);
|
||||
else
|
||||
writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
|
||||
regmap_write(usb2->clkset, 0, 0x00000000);
|
||||
|
||||
err_clk_off:
|
||||
clk_disable_unprepare(usb2->ref_clk);
|
||||
@ -107,27 +93,17 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
usb2->dev = dev;
|
||||
|
||||
if (of_property_present(dev->of_node, "brcm,syscon-clkset")) {
|
||||
usb2->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(usb2->base)) {
|
||||
dev_err(dev, "Failed to map control reg\n");
|
||||
return PTR_ERR(usb2->base);
|
||||
}
|
||||
usb2->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(usb2->base)) {
|
||||
dev_err(dev, "Failed to map control reg\n");
|
||||
return PTR_ERR(usb2->base);
|
||||
}
|
||||
|
||||
usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
|
||||
"brcm,syscon-clkset");
|
||||
if (IS_ERR(usb2->clkset)) {
|
||||
dev_err(dev, "Failed to lookup clkset regmap\n");
|
||||
return PTR_ERR(usb2->clkset);
|
||||
}
|
||||
} else {
|
||||
usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
|
||||
if (IS_ERR(usb2->dmu)) {
|
||||
dev_err(dev, "Failed to map DMU regs\n");
|
||||
return PTR_ERR(usb2->dmu);
|
||||
}
|
||||
|
||||
dev_warn(dev, "using deprecated DT binding\n");
|
||||
usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
|
||||
"brcm,syscon-clkset");
|
||||
if (IS_ERR(usb2->clkset)) {
|
||||
dev_err(dev, "Failed to lookup clkset regmap\n");
|
||||
return PTR_ERR(usb2->clkset);
|
||||
}
|
||||
|
||||
usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
|
||||
|
Loading…
x
Reference in New Issue
Block a user