Skip to content

Commit 1a01663

Browse files
glneoopsiff
authored andcommitted
soc: ti: k3-socinfo: Do not use syscon helper to build regmap
[ Upstream commit a5caf03 ] 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 <afd@ti.com> Link: https://lore.kernel.org/r/20250123181726.597144-1-afd@ti.com Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 3314310b3f3e69961f421a123ccb1ea9669d75c4)
1 parent b8a66ad commit 1a01663

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/soc/ti/k3-socinfo.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,31 @@ k3_chipinfo_partno_to_names(unsigned int partno,
6363
return -EINVAL;
6464
}
6565

66+
static const struct regmap_config k3_chipinfo_regmap_cfg = {
67+
.reg_bits = 32,
68+
.val_bits = 32,
69+
.reg_stride = 4,
70+
};
71+
6672
static int k3_chipinfo_probe(struct platform_device *pdev)
6773
{
6874
struct device_node *node = pdev->dev.of_node;
6975
struct soc_device_attribute *soc_dev_attr;
7076
struct device *dev = &pdev->dev;
7177
struct soc_device *soc_dev;
7278
struct regmap *regmap;
79+
void __iomem *base;
7380
u32 partno_id;
7481
u32 variant;
7582
u32 jtag_id;
7683
u32 mfg;
7784
int ret;
7885

79-
regmap = device_node_to_regmap(node);
86+
base = devm_platform_ioremap_resource(pdev, 0);
87+
if (IS_ERR(base))
88+
return PTR_ERR(base);
89+
90+
regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
8091
if (IS_ERR(regmap))
8192
return PTR_ERR(regmap);
8293

0 commit comments

Comments
 (0)