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:
Rafał Miłecki 2024-09-13 06:45:57 +02:00 committed by Vinod Koul
parent c3639d423d
commit 0175a673e4

View File

@ -24,9 +24,6 @@ struct bcm_ns_usb2 {
struct phy *phy; struct phy *phy;
struct regmap *clkset; struct regmap *clkset;
void __iomem *base; void __iomem *base;
/* Deprecated binding */
void __iomem *dmu;
}; };
static int bcm_ns_usb2_phy_init(struct phy *phy) 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; goto err_clk_off;
} }
if (usb2->base) usb2ctl = readl(usb2->base);
usb2ctl = readl(usb2->base);
else
usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) { if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) {
usb_pll_pdiv = usb2ctl; 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; usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate;
/* Unlock DMU PLL settings with some magic value */ /* Unlock DMU PLL settings with some magic value */
if (usb2->clkset) regmap_write(usb2->clkset, 0, 0x0000ea68);
regmap_write(usb2->clkset, 0, 0x0000ea68);
else
writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
/* Write USB 2.0 PLL control setting */ /* Write USB 2.0 PLL control setting */
usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK; usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK;
usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT; usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT;
if (usb2->base)
writel(usb2ctl, usb2->base); writel(usb2ctl, usb2->base);
else
writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
/* Lock DMU PLL settings */ /* Lock DMU PLL settings */
if (usb2->clkset) regmap_write(usb2->clkset, 0, 0x00000000);
regmap_write(usb2->clkset, 0, 0x00000000);
else
writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
err_clk_off: err_clk_off:
clk_disable_unprepare(usb2->ref_clk); clk_disable_unprepare(usb2->ref_clk);
@ -107,27 +93,17 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
usb2->dev = dev; usb2->dev = dev;
if (of_property_present(dev->of_node, "brcm,syscon-clkset")) { usb2->base = devm_platform_ioremap_resource(pdev, 0);
usb2->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(usb2->base)) {
if (IS_ERR(usb2->base)) { dev_err(dev, "Failed to map control reg\n");
dev_err(dev, "Failed to map control reg\n"); return PTR_ERR(usb2->base);
return PTR_ERR(usb2->base); }
}
usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node, usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
"brcm,syscon-clkset"); "brcm,syscon-clkset");
if (IS_ERR(usb2->clkset)) { if (IS_ERR(usb2->clkset)) {
dev_err(dev, "Failed to lookup clkset regmap\n"); dev_err(dev, "Failed to lookup clkset regmap\n");
return PTR_ERR(usb2->clkset); 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->ref_clk = devm_clk_get(dev, "phy-ref-clk"); usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");