Commit 9002e921 authored by Tero Kristo's avatar Tero Kristo Committed by Tony Lindgren

ARM: OMAP2/3: hwmod: merge wait_target_ready functions for omap2/3

The implementation on these is identical, so no need to have them separate.
Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
Acked-by: default avatarPaul Walmsley <paul@pwsan.com>
Tested-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 8843b119
...@@ -2927,7 +2927,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois) ...@@ -2927,7 +2927,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
/* Static functions intended only for use in soc_ops field function pointers */ /* Static functions intended only for use in soc_ops field function pointers */
/** /**
* _omap2xxx_wait_target_ready - wait for a module to leave slave idle * _omap2xxx_3xxx_wait_target_ready - wait for a module to leave slave idle
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Wait for a module @oh to leave slave idle. Returns 0 if the module * Wait for a module @oh to leave slave idle. Returns 0 if the module
...@@ -2935,7 +2935,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois) ...@@ -2935,7 +2935,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
* slave idle; otherwise, pass along the return value of the * slave idle; otherwise, pass along the return value of the
* appropriate *_cm*_wait_module_ready() function. * appropriate *_cm*_wait_module_ready() function.
*/ */
static int _omap2xxx_wait_target_ready(struct omap_hwmod *oh) static int _omap2xxx_3xxx_wait_target_ready(struct omap_hwmod *oh)
{ {
if (!oh) if (!oh)
return -EINVAL; return -EINVAL;
...@@ -2953,33 +2953,6 @@ static int _omap2xxx_wait_target_ready(struct omap_hwmod *oh) ...@@ -2953,33 +2953,6 @@ static int _omap2xxx_wait_target_ready(struct omap_hwmod *oh)
oh->prcm.omap2.idlest_idle_bit); oh->prcm.omap2.idlest_idle_bit);
} }
/**
* _omap3xxx_wait_target_ready - wait for a module to leave slave idle
* @oh: struct omap_hwmod *
*
* Wait for a module @oh to leave slave idle. Returns 0 if the module
* does not have an IDLEST bit or if the module successfully leaves
* slave idle; otherwise, pass along the return value of the
* appropriate *_cm*_wait_module_ready() function.
*/
static int _omap3xxx_wait_target_ready(struct omap_hwmod *oh)
{
if (!oh)
return -EINVAL;
if (oh->flags & HWMOD_NO_IDLEST)
return 0;
if (!_find_mpu_rt_port(oh))
return 0;
/* XXX check module SIDLEMODE, hardreset status, enabled clocks */
return omap3xxx_cm_wait_module_ready(oh->prcm.omap2.module_offs,
oh->prcm.omap2.idlest_reg_id,
oh->prcm.omap2.idlest_idle_bit);
}
/** /**
* _omap4_wait_target_ready - wait for a module to leave slave idle * _omap4_wait_target_ready - wait for a module to leave slave idle
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
...@@ -4234,12 +4207,12 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx) ...@@ -4234,12 +4207,12 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx)
void __init omap_hwmod_init(void) void __init omap_hwmod_init(void)
{ {
if (cpu_is_omap24xx()) { if (cpu_is_omap24xx()) {
soc_ops.wait_target_ready = _omap2xxx_wait_target_ready; soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
soc_ops.assert_hardreset = _omap2_assert_hardreset; soc_ops.assert_hardreset = _omap2_assert_hardreset;
soc_ops.deassert_hardreset = _omap2_deassert_hardreset; soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
} else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
soc_ops.wait_target_ready = _omap3xxx_wait_target_ready; soc_ops.wait_target_ready = _omap2xxx_3xxx_wait_target_ready;
soc_ops.assert_hardreset = _omap2_assert_hardreset; soc_ops.assert_hardreset = _omap2_assert_hardreset;
soc_ops.deassert_hardreset = _omap2_deassert_hardreset; soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment