aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c2
-rw-r--r--arch/arm/mach-omap2/serial.c2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h6
7 files changed, 24 insertions, 25 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2a7ab6adee82..557d9eb609a6 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod implementation for OMAP2/3/4 2 * omap_hwmod implementation for OMAP2/3/4
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * 5 *
6 * Paul Walmsley, Benoît Cousson, Kevin Hilman 6 * Paul Walmsley, Benoît Cousson, Kevin Hilman
7 * 7 *
@@ -901,7 +901,7 @@ static struct omap_hwmod *_lookup(const char *name)
901 * @oh: struct omap_hwmod * 901 * @oh: struct omap_hwmod *
902 * @data: not used; pass NULL 902 * @data: not used; pass NULL
903 * 903 *
904 * Called by omap_hwmod_late_init() (after omap2_clk_init()). 904 * Called by omap_hwmod_setup_all() (after omap2_clk_init()).
905 * Resolves all clock names embedded in the hwmod. Returns -EINVAL if 905 * Resolves all clock names embedded in the hwmod. Returns -EINVAL if
906 * the omap_hwmod has not yet been registered or if the clocks have 906 * the omap_hwmod has not yet been registered or if the clocks have
907 * already been initialized, 0 on success, or a non-zero error on 907 * already been initialized, 0 on success, or a non-zero error on
@@ -1580,17 +1580,15 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1580 return ret; 1580 return ret;
1581} 1581}
1582 1582
1583
1584/** 1583/**
1585 * omap_hwmod_init - init omap_hwmod code and register hwmods 1584 * omap_hwmod_register - register an array of hwmods
1586 * @ohs: pointer to an array of omap_hwmods to register 1585 * @ohs: pointer to an array of omap_hwmods to register
1587 * 1586 *
1588 * Intended to be called early in boot before the clock framework is 1587 * Intended to be called early in boot before the clock framework is
1589 * initialized. If @ohs is not null, will register all omap_hwmods 1588 * initialized. If @ohs is not null, will register all omap_hwmods
1590 * listed in @ohs that are valid for this chip. Returns -EINVAL if 1589 * listed in @ohs that are valid for this chip. Returns 0.
1591 * omap_hwmod_init() has already been called or 0 otherwise.
1592 */ 1590 */
1593int __init omap_hwmod_init(struct omap_hwmod **ohs) 1591int __init omap_hwmod_register(struct omap_hwmod **ohs)
1594{ 1592{
1595 int r, i; 1593 int r, i;
1596 1594
@@ -1613,9 +1611,8 @@ int __init omap_hwmod_init(struct omap_hwmod **ohs)
1613/* 1611/*
1614 * _populate_mpu_rt_base - populate the virtual address for a hwmod 1612 * _populate_mpu_rt_base - populate the virtual address for a hwmod
1615 * 1613 *
1616 * Must be called only from omap_hwmod_late_init so ioremap works properly. 1614 * Must be called only from omap_hwmod_setup_all() so ioremap works properly.
1617 * Assumes the caller takes care of locking if needed. 1615 * Assumes the caller takes care of locking if needed.
1618 *
1619 */ 1616 */
1620static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) 1617static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
1621{ 1618{
@@ -1631,13 +1628,13 @@ static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
1631} 1628}
1632 1629
1633/** 1630/**
1634 * omap_hwmod_late_init - do some post-clock framework initialization 1631 * omap_hwmod_setup - do some post-clock framework initialization
1635 * 1632 *
1636 * Must be called after omap2_clk_init(). Resolves the struct clk names 1633 * Must be called after omap2_clk_init(). Resolves the struct clk names
1637 * to struct clk pointers for each registered omap_hwmod. Also calls 1634 * to struct clk pointers for each registered omap_hwmod. Also calls
1638 * _setup() on each hwmod. Returns 0. 1635 * _setup() on each hwmod. Returns 0.
1639 */ 1636 */
1640static int __init omap_hwmod_late_init(void) 1637static int __init omap_hwmod_setup_all(void)
1641{ 1638{
1642 int r; 1639 int r;
1643 1640
@@ -1645,7 +1642,7 @@ static int __init omap_hwmod_late_init(void)
1645 1642
1646 /* XXX check return value */ 1643 /* XXX check return value */
1647 r = omap_hwmod_for_each(_init_clocks, NULL); 1644 r = omap_hwmod_for_each(_init_clocks, NULL);
1648 WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); 1645 WARN(r, "omap_hwmod: %s: _init_clocks failed\n", __func__);
1649 1646
1650 mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); 1647 mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME);
1651 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", 1648 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n",
@@ -1655,7 +1652,7 @@ static int __init omap_hwmod_late_init(void)
1655 1652
1656 return 0; 1653 return 0;
1657} 1654}
1658core_initcall(omap_hwmod_late_init); 1655core_initcall(omap_hwmod_setup_all);
1659 1656
1660/** 1657/**
1661 * omap_hwmod_enable - enable an omap_hwmod 1658 * omap_hwmod_enable - enable an omap_hwmod
@@ -2174,11 +2171,11 @@ int omap_hwmod_for_each_by_class(const char *classname,
2174 * @oh: struct omap_hwmod * 2171 * @oh: struct omap_hwmod *
2175 * @state: state that _setup() should leave the hwmod in 2172 * @state: state that _setup() should leave the hwmod in
2176 * 2173 *
2177 * Sets the hwmod state that @oh will enter at the end of _setup() (called by 2174 * Sets the hwmod state that @oh will enter at the end of _setup()
2178 * omap_hwmod_late_init()). Only valid to call between calls to 2175 * (called by omap_hwmod_setup_all()). Only valid to call between
2179 * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or 2176 * calling omap_hwmod_register() and omap_hwmod_setup_all(). Returns
2180 * -EINVAL if there is a problem with the arguments or if the hwmod is 2177 * 0 upon success or -EINVAL if there is a problem with the arguments
2181 * in the wrong state. 2178 * or if the hwmod is in the wrong state.
2182 */ 2179 */
2183int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) 2180int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
2184{ 2181{
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index c2f84aa114b2..e58621aa9b34 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -1990,5 +1990,5 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
1990 1990
1991int __init omap2420_hwmod_init(void) 1991int __init omap2420_hwmod_init(void)
1992{ 1992{
1993 return omap_hwmod_init(omap2420_hwmods); 1993 return omap_hwmod_register(omap2420_hwmods);
1994} 1994}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index c03699653b0b..b46a54ce1a41 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -2183,5 +2183,5 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
2183 2183
2184int __init omap2430_hwmod_init(void) 2184int __init omap2430_hwmod_init(void)
2185{ 2185{
2186 return omap_hwmod_init(omap2430_hwmods); 2186 return omap_hwmod_register(omap2430_hwmods);
2187} 2187}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index b8776ee241fa..fc1b2b963bb9 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -2919,5 +2919,5 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
2919 2919
2920int __init omap3xxx_hwmod_init(void) 2920int __init omap3xxx_hwmod_init(void)
2921{ 2921{
2922 return omap_hwmod_init(omap3xxx_hwmods); 2922 return omap_hwmod_register(omap3xxx_hwmods);
2923} 2923}
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 79a860178913..2c5882792e01 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -5125,6 +5125,6 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
5125 5125
5126int __init omap44xx_hwmod_init(void) 5126int __init omap44xx_hwmod_init(void)
5127{ 5127{
5128 return omap_hwmod_init(omap44xx_hwmods); 5128 return omap_hwmod_register(omap44xx_hwmods);
5129} 5129}
5130 5130
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 47eef48b8830..1ac361b7b8cb 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -680,7 +680,7 @@ static int __init omap_serial_early_init(void)
680 num_uarts++; 680 num_uarts++;
681 681
682 /* 682 /*
683 * NOTE: omap_hwmod_init() has not yet been called, 683 * NOTE: omap_hwmod_setup*() has not yet been called,
684 * so no hwmod functions will work yet. 684 * so no hwmod functions will work yet.
685 */ 685 */
686 686
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index fedd82971c9e..afdf1971c51c 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod macros, structures 2 * omap_hwmod macros, structures
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Paul Walmsley 5 * Paul Walmsley
6 * 6 *
7 * Created in collaboration with (alphabetical order): Benoît Cousson, 7 * Created in collaboration with (alphabetical order): Benoît Cousson,
@@ -370,8 +370,10 @@ struct omap_hwmod_omap4_prcm {
370 * of standby, rather than relying on module smart-standby 370 * of standby, rather than relying on module smart-standby
371 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 371 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
372 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file 372 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
373 * XXX Should be HWMOD_SETUP_NO_RESET
373 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM 374 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
374 * controller, etc. XXX probably belongs outside the main hwmod file 375 * controller, etc. XXX probably belongs outside the main hwmod file
376 * XXX Should be HWMOD_SETUP_NO_IDLE
375 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) 377 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
376 * when module is enabled, rather than the default, which is to 378 * when module is enabled, rather than the default, which is to
377 * enable autoidle 379 * enable autoidle
@@ -535,7 +537,7 @@ struct omap_hwmod {
535 const struct omap_chip_id omap_chip; 537 const struct omap_chip_id omap_chip;
536}; 538};
537 539
538int omap_hwmod_init(struct omap_hwmod **ohs); 540int omap_hwmod_register(struct omap_hwmod **ohs);
539struct omap_hwmod *omap_hwmod_lookup(const char *name); 541struct omap_hwmod *omap_hwmod_lookup(const char *name);
540int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 542int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
541 void *data); 543 void *data);