Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79620414 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ARM / shmobile: Use pm_genpd_poweroff_unused()



Make shmobile use pm_genpd_poweroff_unused() instead of the
open-coded powering off PM domains without devices in use.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarMagnus Damm <damm@opensource.se>
parent 5125bbf3
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,6 @@ extern struct platform_suspend_ops shmobile_suspend_ops;
struct cpuidle_device;
struct cpuidle_device;
extern void (*shmobile_cpuidle_modes[])(void);
extern void (*shmobile_cpuidle_modes[])(void);
extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
extern void (*shmobile_cpuidle_setup)(struct cpuidle_device *dev);
extern void (*shmobile_runtime_pm_late_init)(void);


extern void sh7367_init_irq(void);
extern void sh7367_init_irq(void);
extern void sh7367_add_early_devices(void);
extern void sh7367_add_early_devices(void);
+0 −13
Original line number Original line Diff line number Diff line
@@ -126,17 +126,6 @@ static bool pd_active_wakeup(struct device *dev)
	return true;
	return true;
}
}


static void sh7372_late_pm_domain_off(void)
{
	/* request power down of unused pm domains */
	queue_work(pm_wq, &sh7372_a4lc.genpd.power_off_work);
	queue_work(pm_wq, &sh7372_a4mp.genpd.power_off_work);
	queue_work(pm_wq, &sh7372_d4.genpd.power_off_work);
	queue_work(pm_wq, &sh7372_a3rv.genpd.power_off_work);
	queue_work(pm_wq, &sh7372_a3ri.genpd.power_off_work);
	queue_work(pm_wq, &sh7372_a3sg.genpd.power_off_work);
}

void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
{
{
	struct generic_pm_domain *genpd = &sh7372_pd->genpd;
	struct generic_pm_domain *genpd = &sh7372_pd->genpd;
@@ -157,8 +146,6 @@ void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
		genpd->power_on = pd_power_up;
		genpd->power_on = pd_power_up;
	}
	}
	genpd->power_on(&sh7372_pd->genpd);
	genpd->power_on(&sh7372_pd->genpd);

	shmobile_runtime_pm_late_init = sh7372_late_pm_domain_off;
}
}


void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd,
void sh7372_add_device_to_domain(struct sh7372_pm_domain *sh7372_pd,
+2 −4
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <linux/pm_runtime.h>
#include <linux/pm_domain.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/clk.h>
#include <linux/sh_clk.h>
#include <linux/sh_clk.h>
@@ -57,12 +58,9 @@ static int __init sh_pm_runtime_init(void)
}
}
core_initcall(sh_pm_runtime_init);
core_initcall(sh_pm_runtime_init);


void (*shmobile_runtime_pm_late_init)(void);

static int __init sh_pm_runtime_late_init(void)
static int __init sh_pm_runtime_late_init(void)
{
{
	if (shmobile_runtime_pm_late_init)
	pm_genpd_poweroff_unused();
		shmobile_runtime_pm_late_init();
	return 0;
	return 0;
}
}
late_initcall(sh_pm_runtime_late_init);
late_initcall(sh_pm_runtime_late_init);