aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorDavid Riley <davidriley@chromium.org>2015-03-18 05:52:25 -0400
committerThierry Reding <treding@nvidia.com>2015-05-04 08:21:45 -0400
commit7892158a96629c46c46dfae52eaf951f51222cf5 (patch)
treeb8630cbec1b17f862c38c2905cdf4de441ee9803 /drivers/soc
parent4d48edb3c3e1234d6b3fcdfb9ac24d7c6de449cb (diff)
soc/tegra: pmc: move to using a restart handler
The pmc driver was previously exporting tegra_pmc_restart, which was assigned to machine_desc.init_machine, taking precedence over the restart handlers registered through register_restart_handler(). Signed-off-by: David Riley <davidriley@chromium.org> [tomeu.vizoso@collabora.com: Rebased] Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> [treding@nvidia.com: minor cleanups] Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/tegra/pmc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index c956395cf46f..cc119d15dd16 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -377,13 +377,10 @@ int tegra_pmc_cpu_remove_clamping(int cpuid)
377} 377}
378#endif /* CONFIG_SMP */ 378#endif /* CONFIG_SMP */
379 379
380/** 380static int tegra_pmc_restart_notify(struct notifier_block *this,
381 * tegra_pmc_restart() - reboot the system 381 unsigned long action, void *data)
382 * @mode: which mode to reboot in
383 * @cmd: reboot command
384 */
385void tegra_pmc_restart(enum reboot_mode mode, const char *cmd)
386{ 382{
383 const char *cmd = data;
387 u32 value; 384 u32 value;
388 385
389 value = tegra_pmc_readl(PMC_SCRATCH0); 386 value = tegra_pmc_readl(PMC_SCRATCH0);
@@ -405,8 +402,15 @@ void tegra_pmc_restart(enum reboot_mode mode, const char *cmd)
405 value = tegra_pmc_readl(0); 402 value = tegra_pmc_readl(0);
406 value |= 0x10; 403 value |= 0x10;
407 tegra_pmc_writel(value, 0); 404 tegra_pmc_writel(value, 0);
405
406 return NOTIFY_DONE;
408} 407}
409 408
409static struct notifier_block tegra_pmc_restart_handler = {
410 .notifier_call = tegra_pmc_restart_notify,
411 .priority = 128,
412};
413
410static int powergate_show(struct seq_file *s, void *data) 414static int powergate_show(struct seq_file *s, void *data)
411{ 415{
412 unsigned int i; 416 unsigned int i;
@@ -837,6 +841,13 @@ static int tegra_pmc_probe(struct platform_device *pdev)
837 return err; 841 return err;
838 } 842 }
839 843
844 err = register_restart_handler(&tegra_pmc_restart_handler);
845 if (err) {
846 dev_err(&pdev->dev, "unable to register restart handler, %d\n",
847 err);
848 return err;
849 }
850
840 return 0; 851 return 0;
841} 852}
842 853