From patchwork Fri Sep 13 04:45:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 13802992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16158EEEC0E for ; Fri, 13 Sep 2024 04:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FFE5YSrZgU9x6k24VxVlfEGkJxKKGI0noAYbgbFPcRQ=; b=qnhVUZtsSde3P4 +zBkcFT3SlvV2S5/ZTty1WCh63gcjEcb0k7Vd6bpx7AC5+M4EDTWnGGkgaifDmTXyfMKi5RgCKtch k2OcT5YKshazo7bgEX1IHy8I8S32ZiFE1+qRzS6BvVqK0guLwiePCIuRI1ffyyPFxiiQDL9l71UhK +Z2+WNnQ9UMgRgE/T2qnDh45eyCnC3gKtN6G0taIcvvuaCjYIu9QgBoFzGT5qdedvqt0S5C/QZv2c mzPace3IjJc/DZUUWvh1umgdtdUyUPSw0VsUHuh3wS3fKzkkXlcxos9zAXusOw0LvvKobZFnNropj kdfAFN7fLhRAa2PNGfvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soyCB-0000000EvXS-2T2q; Fri, 13 Sep 2024 04:46:11 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soyC8-0000000EvWy-16Zx for linux-phy@lists.infradead.org; Fri, 13 Sep 2024 04:46:09 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5c241feb80dso5381846a12.0 for ; Thu, 12 Sep 2024 21:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726202766; x=1726807566; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=etW/iub89JqiLphBAHzvsoo9XIPyzDTt8mamtwnIl7s=; b=mZOsvC4oqlpucvQvPg/zGjtkKw1vyTUBsdGp/wFfyBoo7XJx+PiikME2utBMCn6ssH 2S1Hvt4L5WJF1tfmBCe3NwW4K2rDtISBVbkN7qDoRvhtP2ZHBOULmevZjAZqjqC/Ejru vMklVpfBIWUrv3fVkMwbdZQ+J5tGc5zTdNJ+9jtGfntwYpRuDkBalaoO7E5sbh8tW5CR FmS6vrnWicEC6fLXNfVpd78yTNy17NM44dfltcojI9Q8lAYXaoyIVTPhh9oFHdJP+mK+ e2ZYpmPaAHvwIuBc0u1rHqY5OeqnAU5u7fIx05/NxOYncQcB7jOhjo5etoJZUNWkS7e/ e7GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726202766; x=1726807566; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=etW/iub89JqiLphBAHzvsoo9XIPyzDTt8mamtwnIl7s=; b=pUOvbFI8TOnLYgibLGpi16OW0TltBBaX6gIQtu+U2aFeNi5BhA3jEhPZkrptu2spfY YexkUB8yy3X6w5Epabg1ob2yry9oClL6P6XRNk5da8EvbooYKBGkEWVsD8dMl7wiJcMw jox9XgYZgnSKHCIjiIX8Rb7blJBBrXljMrwckdvAPlIuCj40N4Zzg2cL4yyZFRGk6y0H vPMOYzDfxnZc3CXSF3rISKc7TXKLwJi47t6AmV8mYXP2BakYeBaQQlUEylnVWrUqtfP1 JFduY3fIeMyhQQj5d5/QRAdadvIubEUw/qapXnabAKJP1O4eVEQ3ZAzv49o08ch8tcIB Zbzw== X-Forwarded-Encrypted: i=1; AJvYcCVvTJHn0SjtsCyo1pbAfxGNcv4zvqSTbT4Oe/TtbWVYDTbhKZpNNqtOKIrKwQflu/+CO3/NAs86cos=@lists.infradead.org X-Gm-Message-State: AOJu0YxH1mG+MCH2GTsWx+Dghy06R89jN2r9FgIvWWF/AxSzVyRrzTz8 SHU6JV9HOwcUl2XmyjAxVbkXlURwHqqJT7mM7E8/8KtpfJaquzsRVIk/QQ== X-Google-Smtp-Source: AGHT+IHxgF432i43pDnIe5jmxrG9h7pU58o/7t/3GD8MSHv7ETteVuY0BK3UNxdrJtKC2Ox0T0rmDw== X-Received: by 2002:a05:6402:520e:b0:5c2:5248:a929 with SMTP id 4fb4d7f45d1cf-5c41435c3d2mr6267297a12.7.1726202766355; Thu, 12 Sep 2024 21:46:06 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd76fc4sm7303468a12.78.2024.09.12.21.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 21:46:05 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I Cc: Jeff Johnson , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFm?= =?utf-8?b?YcWCIE1pxYJlY2tp?= Subject: [PATCH 2/2] phy: bcm-ns-usb2: drop support for old binding variant Date: Fri, 13 Sep 2024 06:45:57 +0200 Message-Id: <20240913044557.28315-2-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240913044557.28315-1-zajec5@gmail.com> References: <20240913044557.28315-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_214608_330313_1FC1A4EC X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki 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 --- drivers/phy/broadcom/phy-bcm-ns-usb2.c | 54 +++++++------------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c index 5213c75b6da6..c5d35031b398 100644 --- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c +++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c @@ -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->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); - } + 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); + } - 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");