aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
1 files changed, 15 insertions, 18 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{