aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc/renesas/rcar-sysc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-09 13:01:15 -0400
commit0160e00ae8e987be8822745fb166aa76451c9bcc (patch)
treedeca2d09a729155ed0cb631f2bc8f557e634ab06 /drivers/soc/renesas/rcar-sysc.c
parentc81ee18e97e4e3162169a749eb7f2b79b3510c7a (diff)
parentb6942b68f85ed3161c91741791ec6f1779574919 (diff)
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "Driver updates for ARM SoCs: Reset subsystem, merged through arm-soc by tradition: - Make bool drivers explicitly non-modular - New support for i.MX7 and Arria10 reset controllers PATA driver for Palmchip BK371 (acked by Tejun) Power domain drivers for i.MX (GPC, GPCv2) - Moved out of mach-imx for GPC - Bunch of tweaks, fixes, etc PMC support for Tegra186 SoC detection support for Renesas RZ/G1H and RZ/G1N Move Tegra flow controller driver from mach directory to drivers/soc - (Power management / CPU power driver) Misc smaller tweaks for other platforms" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits) soc: pm-domain: Fix the mangled urls soc: renesas: rcar-sysc: Add support for R-Car H3 ES2.0 soc: renesas: rcar-sysc: Add support for fixing up power area tables soc: renesas: Register SoC device early soc: imx: gpc: add workaround for i.MX6QP to the GPC PD driver dt-bindings: imx-gpc: add i.MX6 QuadPlus compatible soc: imx: gpc: add defines for domain index soc: imx: Add GPCv2 power gating driver dt-bindings: Add GPCv2 power gating driver ARM/clk: move the ICST library to drivers/clk ARM: plat-versatile: remove stale clock header ARM: keystone: Drop PM domain support for k2g soc: ti: Add ti_sci_pm_domains driver dt-bindings: Add TI SCI PM Domains PM / Domains: Do not check if simple providers have phandle cells PM / Domains: Add generic data pointer to genpd data struct soc/tegra: Add initial flowctrl support for Tegra132/210 soc/tegra: flowctrl: Add basic platform driver soc/tegra: Move Tegra flowctrl driver ARM: tegra: Remove unnecessary inclusion of flowctrl header ...
Diffstat (limited to 'drivers/soc/renesas/rcar-sysc.c')
-rw-r--r--drivers/soc/renesas/rcar-sysc.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index 225c35c79d9a..528a13742aeb 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -2,7 +2,7 @@
2 * R-Car SYSC Power management support 2 * R-Car SYSC Power management support
3 * 3 *
4 * Copyright (C) 2014 Magnus Damm 4 * Copyright (C) 2014 Magnus Damm
5 * Copyright (C) 2015-2016 Glider bvba 5 * Copyright (C) 2015-2017 Glider bvba
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -334,6 +334,12 @@ static int __init rcar_sysc_pd_init(void)
334 334
335 info = match->data; 335 info = match->data;
336 336
337 if (info->init) {
338 error = info->init();
339 if (error)
340 return error;
341 }
342
337 has_cpg_mstp = of_find_compatible_node(NULL, NULL, 343 has_cpg_mstp = of_find_compatible_node(NULL, NULL,
338 "renesas,cpg-mstp-clocks"); 344 "renesas,cpg-mstp-clocks");
339 345
@@ -377,6 +383,11 @@ static int __init rcar_sysc_pd_init(void)
377 const struct rcar_sysc_area *area = &info->areas[i]; 383 const struct rcar_sysc_area *area = &info->areas[i];
378 struct rcar_sysc_pd *pd; 384 struct rcar_sysc_pd *pd;
379 385
386 if (!area->name) {
387 /* Skip NULLified area */
388 continue;
389 }
390
380 pd = kzalloc(sizeof(*pd) + strlen(area->name) + 1, GFP_KERNEL); 391 pd = kzalloc(sizeof(*pd) + strlen(area->name) + 1, GFP_KERNEL);
381 if (!pd) { 392 if (!pd) {
382 error = -ENOMEM; 393 error = -ENOMEM;
@@ -406,6 +417,18 @@ out_put:
406} 417}
407early_initcall(rcar_sysc_pd_init); 418early_initcall(rcar_sysc_pd_init);
408 419
420void __init rcar_sysc_nullify(struct rcar_sysc_area *areas,
421 unsigned int num_areas, u8 id)
422{
423 unsigned int i;
424
425 for (i = 0; i < num_areas; i++)
426 if (areas[i].isr_bit == id) {
427 areas[i].name = NULL;
428 return;
429 }
430}
431
409void __init rcar_sysc_init(phys_addr_t base, u32 syscier) 432void __init rcar_sysc_init(phys_addr_t base, u32 syscier)
410{ 433{
411 u32 syscimr; 434 u32 syscimr;