From mboxrd@z Thu Jan 1 00:00:00 1970 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 BFEA9C3ABBE for ; Tue, 6 May 2025 01:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SvyysXeO2VEh1umaIVcAgObVTxEGJux7Zi8wLzXFy2Q=; b=2weVe6buNgMpSRGG6iA0u48ryz mI/VlkGICRlxlsUaeCw82EFi6idJjA8HV14nkeaIsX/cGg5nHiKvFoUy+pD0Wia7y8idD1wiDGGuP XY4wlNPfGgcksLWpPNIF/32/IX6DehBbLXMJ3wJxzC1do9aIIKhjcDpgMLLf+Kk7qZw22ZhfxsUJE QI5CPua17bevxRyOomlwKjYyJdEUAIDLgCiEwGZqZYLcWWLHa7lZ//irYm7yZL84IrsaBhKh7VU7A aelFr4UnwKS+SWxIRJOJi3nFqRHawNBg+QGlswOPomGOvHTzVF7gd27CiZSz5A0D3TfuadeXNa14i mGveam2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC7VF-00000009cGY-1JrA; Tue, 06 May 2025 01:53:49 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC4bL-00000008rjm-2OVc for linux-arm-kernel@lists.infradead.org; Mon, 05 May 2025 22:47:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 9F3A243DFE; Mon, 5 May 2025 22:47:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78157C4CEED; Mon, 5 May 2025 22:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746485275; bh=sxEgw4/xPQat4lCQR+i4/CUFUKOYT7PxqtHzO2BYxog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dD20EV+UT43X+4tIH80Zv+vA0dw2Ud2OwePSsog0j1GM0XS3GINd9JPHbZvsnm0a4 z5wgjtB1h81EJauAW7F7MhNQXE4ZNHZJYhrDcwbt7uVuGPgHrbjSB7l5Q2zvzUHY1W LTKznKyXceBy86PwygHFvCUi9uHk67TbcaOeG4tonwaCBUpfND3migyzTQU5Bbv7fN XXIHCPMTlflc7OHLGpT+GtVi+OkzIKwpLrhl7gdhUqz8iUVFF/KsJyhsnQxYWjbGWe oXI5KlZgfhA25are17ySGbIMewFCoycRxghKYuq2VXKiYyxuTLjcEAterUKfXbJazd vfHAHgE9W+gng== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrew Davis , Nishanth Menon , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 6.12 248/486] soc: ti: k3-socinfo: Do not use syscon helper to build regmap Date: Mon, 5 May 2025 18:35:24 -0400 Message-Id: <20250505223922.2682012-248-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505223922.2682012-1-sashal@kernel.org> References: <20250505223922.2682012-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.26 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250505_154755_620748_A47BF6A9 X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrew Davis [ Upstream commit a5caf03188e44388e8c618dcbe5fffad1a249385 ] The syscon helper device_node_to_regmap() is used to fetch a regmap registered to a device node. It also currently creates this regmap if the node did not already have a regmap associated with it. This should only be used on "syscon" nodes. This driver is not such a device and instead uses device_node_to_regmap() on its own node as a hacky way to create a regmap for itself. This will not work going forward and so we should create our regmap the normal way by defining our regmap_config, fetching our memory resource, then using the normal regmap_init_mmio() function. Signed-off-by: Andrew Davis Link: https://lore.kernel.org/r/20250123181726.597144-1-afd@ti.com Signed-off-by: Nishanth Menon Signed-off-by: Sasha Levin --- drivers/soc/ti/k3-socinfo.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 4fb0f0a248288..704039eb3c078 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -105,6 +105,12 @@ k3_chipinfo_variant_to_sr(unsigned int partno, unsigned int variant, return -ENODEV; } +static const struct regmap_config k3_chipinfo_regmap_cfg = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, +}; + static int k3_chipinfo_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node; @@ -112,13 +118,18 @@ static int k3_chipinfo_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct soc_device *soc_dev; struct regmap *regmap; + void __iomem *base; u32 partno_id; u32 variant; u32 jtag_id; u32 mfg; int ret; - regmap = device_node_to_regmap(node); + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg); if (IS_ERR(regmap)) return PTR_ERR(regmap); -- 2.39.5