Skip to content

Commit

Permalink
ARM: OMAP2+: Remove legacy PM init
Browse files Browse the repository at this point in the history
This is no longer needed when booted with device tree.
And let's replace cpu_is with soc_is for the PM code to
avoid confusion, they do the same thing.

Note that omap_pmic_late_init() now just calls
omap3_twl_init() and omap4_twl_init() to initialize the
voltage layer so we can remove the remaining references
to twl-common code and remove it in the following patch.

Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed Nov 10, 2016
1 parent 65fa3e7 commit cb6675d
Showing 1 changed file with 6 additions and 60 deletions.
66 changes: 6 additions & 60 deletions arch/arm/mach-omap2/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "powerdomain.h"
#include "clockdomain.h"
#include "pm.h"
#include "twl-common.h"

#ifdef CONFIG_SUSPEND
/*
Expand Down Expand Up @@ -72,42 +71,6 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
}
#endif

static int __init _init_omap_device(char *name)
{
struct omap_hwmod *oh;
struct platform_device *pdev;

oh = omap_hwmod_lookup(name);
if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
__func__, name))
return -ENODEV;

pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
__func__, name))
return -ENODEV;

return 0;
}

/*
* Build omap_devices for processors and bus.
*/
static void __init omap2_init_processor_devices(void)
{
_init_omap_device("mpu");
if (omap3_has_iva())
_init_omap_device("iva");

if (cpu_is_omap44xx()) {
_init_omap_device("l3_main_1");
_init_omap_device("dsp");
_init_omap_device("iva");
} else {
_init_omap_device("l3_main");
}
}

int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
{
clkdm_allow_idle(clkdm);
Expand Down Expand Up @@ -215,7 +178,7 @@ static int omap_pm_enter(suspend_state_t suspend_state)
static int omap_pm_begin(suspend_state_t state)
{
cpu_idle_poll_ctrl(true);
if (cpu_is_omap34xx())
if (soc_is_omap34xx())
omap_prcm_irq_prepare();
return 0;
}
Expand All @@ -227,7 +190,7 @@ static void omap_pm_end(void)

static void omap_pm_finish(void)
{
if (cpu_is_omap34xx())
if (soc_is_omap34xx())
omap_prcm_irq_complete();
}

Expand All @@ -252,7 +215,7 @@ void omap_common_suspend_init(void *pm_suspend)

static void __init omap3_init_voltages(void)
{
if (!cpu_is_omap34xx())
if (!soc_is_omap34xx())
return;

omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
Expand All @@ -261,26 +224,16 @@ static void __init omap3_init_voltages(void)

static void __init omap4_init_voltages(void)
{
if (!cpu_is_omap44xx())
if (!soc_is_omap44xx())
return;

omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
}

static inline void omap_init_cpufreq(void)
{
struct platform_device_info devinfo = { .name = "omap-cpufreq" };

if (!of_have_populated_dt())
platform_device_register_full(&devinfo);
}

static int __init omap2_common_pm_init(void)
{
if (!of_have_populated_dt())
omap2_init_processor_devices();
omap_pm_if_init();

return 0;
Expand All @@ -289,13 +242,9 @@ omap_postcore_initcall(omap2_common_pm_init);

int __init omap2_common_pm_late_init(void)
{
if (of_have_populated_dt()) {
omap3_twl_init();
omap4_twl_init();
}

/* Init the voltage layer */
omap_pmic_late_init();
omap3_twl_init();
omap4_twl_init();
omap_voltage_late_init();

/* Initialize the voltages */
Expand All @@ -305,8 +254,5 @@ int __init omap2_common_pm_late_init(void)
/* Smartreflex device init */
omap_devinit_smartreflex();

/* cpufreq dummy device instantiation */
omap_init_cpufreq();

return 0;
}

0 comments on commit cb6675d

Please sign in to comment.