Unverified Commit 7e1e2acb authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'sunxi-drivers-fixes-for-6.0-1' of...

Merge tag 'sunxi-drivers-fixes-for-6.0-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes

sunxi SRAM controller fixes for
- loading/unloading
- claiming regions
- debugfs info

* tag 'sunxi-drivers-fixes-for-6.0-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  soc: sunxi: sram: Fix debugfs info for A64 SRAM C
  soc: sunxi: sram: Fix probe function ordering issues
  soc: sunxi: sram: Prevent the driver from being unbound
  soc: sunxi: sram: Actually claim SRAM regions

Link: https://lore.kernel.org/r/YyeN0m78+m9nNEah@kista.localdomain


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents b58e7317 e3c95edb
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -78,8 +78,8 @@ static struct sunxi_sram_desc sun4i_a10_sram_d = {

static struct sunxi_sram_desc sun50i_a64_sram_c = {
	.data	= SUNXI_SRAM_DATA("C", 0x4, 24, 1,
				  SUNXI_SRAM_MAP(0, 1, "cpu"),
				  SUNXI_SRAM_MAP(1, 0, "de2")),
				  SUNXI_SRAM_MAP(1, 0, "cpu"),
				  SUNXI_SRAM_MAP(0, 1, "de2")),
};

static const struct of_device_id sunxi_sram_dt_ids[] = {
@@ -254,6 +254,7 @@ int sunxi_sram_claim(struct device *dev)
	writel(val | ((device << sram_data->offset) & mask),
	       base + sram_data->reg);

	sram_desc->claimed = true;
	spin_unlock(&sram_lock);

	return 0;
@@ -329,11 +330,11 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
	.writeable_reg	= sunxi_sram_regmap_accessible_reg,
};

static int sunxi_sram_probe(struct platform_device *pdev)
static int __init sunxi_sram_probe(struct platform_device *pdev)
{
	struct dentry *d;
	struct regmap *emac_clock;
	const struct sunxi_sramc_variant *variant;
	struct device *dev = &pdev->dev;

	sram_dev = &pdev->dev;

@@ -345,13 +346,6 @@ static int sunxi_sram_probe(struct platform_device *pdev)
	if (IS_ERR(base))
		return PTR_ERR(base);

	of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);

	d = debugfs_create_file("sram", S_IRUGO, NULL, NULL,
				&sunxi_sram_fops);
	if (!d)
		return -ENOMEM;

	if (variant->num_emac_clocks > 0) {
		emac_clock = devm_regmap_init_mmio(&pdev->dev, base,
						   &sunxi_sram_emac_clock_regmap);
@@ -360,6 +354,10 @@ static int sunxi_sram_probe(struct platform_device *pdev)
			return PTR_ERR(emac_clock);
	}

	of_platform_populate(dev->of_node, NULL, NULL, dev);

	debugfs_create_file("sram", 0444, NULL, NULL, &sunxi_sram_fops);

	return 0;
}

@@ -409,9 +407,8 @@ static struct platform_driver sunxi_sram_driver = {
		.name		= "sunxi-sram",
		.of_match_table	= sunxi_sram_dt_match,
	},
	.probe	= sunxi_sram_probe,
};
module_platform_driver(sunxi_sram_driver);
builtin_platform_driver_probe(sunxi_sram_driver, sunxi_sram_probe);

MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver");