Skip to content

Commit 6d63b12

Browse files
committed
ARM: OMAP2+: Define _HWMOD_STATE_DEFAULT and use it
For dynamically allocated struct hwmod entries probing with ti-sysc interconnect target module driver, we need to specify the initial default state the same way as we do for the platform data cases. Let's prepare for that by adding _HWMOD_STATE_DEFAULT that we can then use to set the initial default state without a need to add similar CONFIG_PM handling in multiple places. Cc: Paul Walmsley <[email protected]> Cc: Tero Kristo <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 513a4ab commit 6d63b12

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

arch/arm/mach-omap2/io.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
411411

412412
static void __init __maybe_unused omap_hwmod_init_postsetup(void)
413413
{
414-
u8 postsetup_state;
414+
u8 postsetup_state = _HWMOD_STATE_DEFAULT;
415415

416416
/* Set the default postsetup state for all hwmods */
417-
#ifdef CONFIG_PM
418-
postsetup_state = _HWMOD_STATE_IDLE;
419-
#else
420-
postsetup_state = _HWMOD_STATE_ENABLED;
421-
#endif
422417
omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
423418
}
424419

arch/arm/mach-omap2/omap_hwmod.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ struct omap_hwmod_omap4_prcm {
493493
#define _HWMOD_STATE_IDLE 5
494494
#define _HWMOD_STATE_DISABLED 6
495495

496+
#ifdef CONFIG_PM
497+
#define _HWMOD_STATE_DEFAULT _HWMOD_STATE_IDLE
498+
#else
499+
#define _HWMOD_STATE_DEFAULT _HWMOD_STATE_ENABLED
500+
#endif
501+
496502
/**
497503
* struct omap_hwmod_class - the type of an IP block
498504
* @name: name of the hwmod_class

0 commit comments

Comments
 (0)