diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index e0350476feaa..203664c40d3d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -3442,6 +3442,7 @@ static int omap_hwmod_check_module(struct device *dev, | |||
3442 | * @dev: struct device | 3442 | * @dev: struct device |
3443 | * @oh: module | 3443 | * @oh: module |
3444 | * @sysc_fields: sysc register bits | 3444 | * @sysc_fields: sysc register bits |
3445 | * @clockdomain: clockdomain | ||
3445 | * @rev_offs: revision register offset | 3446 | * @rev_offs: revision register offset |
3446 | * @sysc_offs: sysconfig register offset | 3447 | * @sysc_offs: sysconfig register offset |
3447 | * @syss_offs: sysstatus register offset | 3448 | * @syss_offs: sysstatus register offset |
@@ -3453,6 +3454,7 @@ static int omap_hwmod_check_module(struct device *dev, | |||
3453 | static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | 3454 | static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, |
3454 | const struct ti_sysc_module_data *data, | 3455 | const struct ti_sysc_module_data *data, |
3455 | struct sysc_regbits *sysc_fields, | 3456 | struct sysc_regbits *sysc_fields, |
3457 | struct clockdomain *clkdm, | ||
3456 | s32 rev_offs, s32 sysc_offs, | 3458 | s32 rev_offs, s32 sysc_offs, |
3457 | s32 syss_offs, u32 sysc_flags, | 3459 | s32 syss_offs, u32 sysc_flags, |
3458 | u32 idlemodes) | 3460 | u32 idlemodes) |
@@ -3460,8 +3462,6 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | |||
3460 | struct omap_hwmod_class_sysconfig *sysc; | 3462 | struct omap_hwmod_class_sysconfig *sysc; |
3461 | struct omap_hwmod_class *class = NULL; | 3463 | struct omap_hwmod_class *class = NULL; |
3462 | struct omap_hwmod_ocp_if *oi = NULL; | 3464 | struct omap_hwmod_ocp_if *oi = NULL; |
3463 | struct clockdomain *clkdm = NULL; | ||
3464 | struct clk *clk = NULL; | ||
3465 | void __iomem *regs = NULL; | 3465 | void __iomem *regs = NULL; |
3466 | unsigned long flags; | 3466 | unsigned long flags; |
3467 | 3467 | ||
@@ -3508,36 +3508,6 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, | |||
3508 | oi->user = OCP_USER_MPU | OCP_USER_SDMA; | 3508 | oi->user = OCP_USER_MPU | OCP_USER_SDMA; |
3509 | } | 3509 | } |
3510 | 3510 | ||
3511 | if (!oh->_clk) { | ||
3512 | struct clk_hw_omap *hwclk; | ||
3513 | |||
3514 | clk = of_clk_get_by_name(dev->of_node, "fck"); | ||
3515 | if (!IS_ERR(clk)) | ||
3516 | clk_prepare(clk); | ||
3517 | else | ||
3518 | clk = NULL; | ||
3519 | |||
3520 | /* | ||
3521 | * Populate clockdomain based on dts clock. It is needed for | ||
3522 | * clkdm_deny_idle() and clkdm_allow_idle() until we have have | ||
3523 | * interconnect driver and reset driver capable of blocking | ||
3524 | * clockdomain idle during reset, enable and idle. | ||
3525 | */ | ||
3526 | if (clk) { | ||
3527 | hwclk = to_clk_hw_omap(__clk_get_hw(clk)); | ||
3528 | if (hwclk && hwclk->clkdm_name) | ||
3529 | clkdm = clkdm_lookup(hwclk->clkdm_name); | ||
3530 | } | ||
3531 | |||
3532 | /* | ||
3533 | * Note that we assume interconnect driver manages the clocks | ||
3534 | * and do not need to populate oh->_clk for dynamically | ||
3535 | * allocated modules. | ||
3536 | */ | ||
3537 | clk_unprepare(clk); | ||
3538 | clk_put(clk); | ||
3539 | } | ||
3540 | |||
3541 | spin_lock_irqsave(&oh->_lock, flags); | 3511 | spin_lock_irqsave(&oh->_lock, flags); |
3542 | if (regs) | 3512 | if (regs) |
3543 | oh->_mpu_rt_va = regs; | 3513 | oh->_mpu_rt_va = regs; |
@@ -3623,7 +3593,7 @@ int omap_hwmod_init_module(struct device *dev, | |||
3623 | u32 sysc_flags, idlemodes; | 3593 | u32 sysc_flags, idlemodes; |
3624 | int error; | 3594 | int error; |
3625 | 3595 | ||
3626 | if (!dev || !data) | 3596 | if (!dev || !data || !data->name || !cookie) |
3627 | return -EINVAL; | 3597 | return -EINVAL; |
3628 | 3598 | ||
3629 | oh = _lookup(data->name); | 3599 | oh = _lookup(data->name); |
@@ -3694,7 +3664,8 @@ int omap_hwmod_init_module(struct device *dev, | |||
3694 | return error; | 3664 | return error; |
3695 | 3665 | ||
3696 | return omap_hwmod_allocate_module(dev, oh, data, sysc_fields, | 3666 | return omap_hwmod_allocate_module(dev, oh, data, sysc_fields, |
3697 | rev_offs, sysc_offs, syss_offs, | 3667 | cookie->clkdm, rev_offs, |
3668 | sysc_offs, syss_offs, | ||
3698 | sysc_flags, idlemodes); | 3669 | sysc_flags, idlemodes); |
3699 | } | 3670 | } |
3700 | 3671 | ||