summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-12-16 00:57:08 +0100
committerArnd Bergmann <arnd@arndb.de>2015-12-16 00:57:08 +0100
commit3081dc9eff32519bc3298c6dba0b877675d4c1cd (patch)
treed4c1d2af14e09e96dd015fa9163df88106b11ddf /drivers/soc
parent22ba14f41ca6b7f96fe3d4a8eb116358060595fd (diff)
parentc5d431e8c511788556651b91debd7d77d4508f4b (diff)
downloadlinux-3081dc9eff32519bc3298c6dba0b877675d4c1cd.tar.bz2
Merge tag 'mvebu-soc-4.5-1' of git://git.infradead.org/linux-mvebu into next/multiplatform
Merge "mvebu soc for 4.5 (part 1)" from Gregory CLEMENT: - orion5x/mv78xx0 multiplatform conversion - legacy dove PMU support conversion * tag 'mvebu-soc-4.5-1' of git://git.infradead.org/linux-mvebu: ARM: dove: convert legacy dove to PMU support soc: dove: add legacy support to PMU driver ARM: orion5x: multiplatform support ARM: orion5x: clean up mach/*.h headers ARM: mv78xx0: multiplatform support ARM: mv78xx0: clean up mach/*.h headers ARM: orion: use SPARSE_IRQ everywhere ARM: orion: always use MULTI_IRQ_HANDLER ARM: orion: move watchdog setup to mach-orion5x Conflicts: arch/arm/Kconfig arch/arm/mach-dove/include/mach/entry-macro.S arch/arm/mach-orion5x/include/mach/entry-macro.S
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/Makefile1
-rw-r--r--drivers/soc/dove/pmu.c43
2 files changed, 44 insertions, 0 deletions
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index f2ba2e932ae1..d52872680f86 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -3,6 +3,7 @@
#
obj-$(CONFIG_SOC_BRCMSTB) += brcmstb/
+obj-$(CONFIG_ARCH_DOVE) += dove/
obj-$(CONFIG_MACH_DOVE) += dove/
obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
obj-$(CONFIG_ARCH_QCOM) += qcom/
diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c
index abd087917f80..039374e9fdc0 100644
--- a/drivers/soc/dove/pmu.c
+++ b/drivers/soc/dove/pmu.c
@@ -305,6 +305,49 @@ static int __init dove_init_pmu_irq(struct pmu_data *pmu, int irq)
return 0;
}
+int __init dove_init_pmu_legacy(const struct dove_pmu_initdata *initdata)
+{
+ const struct dove_pmu_domain_initdata *domain_initdata;
+ struct pmu_data *pmu;
+ int ret;
+
+ pmu = kzalloc(sizeof(*pmu), GFP_KERNEL);
+ if (!pmu)
+ return -ENOMEM;
+
+ spin_lock_init(&pmu->lock);
+ pmu->pmc_base = initdata->pmc_base;
+ pmu->pmu_base = initdata->pmu_base;
+
+ pmu_reset_init(pmu);
+ for (domain_initdata = initdata->domains; domain_initdata->name;
+ domain_initdata++) {
+ struct pmu_domain *domain;
+
+ domain = kzalloc(sizeof(*domain), GFP_KERNEL);
+ if (domain) {
+ domain->pmu = pmu;
+ domain->pwr_mask = domain_initdata->pwr_mask;
+ domain->rst_mask = domain_initdata->rst_mask;
+ domain->iso_mask = domain_initdata->iso_mask;
+ domain->base.name = domain_initdata->name;
+
+ __pmu_domain_register(domain, NULL);
+ }
+ }
+
+ ret = dove_init_pmu_irq(pmu, initdata->irq);
+ if (ret)
+ pr_err("dove_init_pmu_irq() failed: %d\n", ret);
+
+ if (pmu->irq_domain)
+ irq_domain_associate_many(pmu->irq_domain,
+ initdata->irq_domain_start,
+ 0, NR_PMU_IRQS);
+
+ return 0;
+}
+
/*
* pmu: power-manager@d0000 {
* compatible = "marvell,dove-pmu";