Commit 2dafca17 authored by Ulf Hansson's avatar Ulf Hansson Committed by Vinod Koul

dma: ste_dma40: Don't require CONFIG_PM_RUNTIME

While probing, don't rely on CONFIG_PM_RUNTIME to be configured.
Instead, let's power up the device and make it fully operational.
Update the runtime PM status to reflect the active state.
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 80245216
...@@ -556,7 +556,6 @@ struct d40_gen_dmac { ...@@ -556,7 +556,6 @@ struct d40_gen_dmac {
* later * later
* @reg_val_backup_chan: Backup data for standard channel parameter registers. * @reg_val_backup_chan: Backup data for standard channel parameter registers.
* @gcc_pwr_off_mask: Mask to maintain the channels that can be turned off. * @gcc_pwr_off_mask: Mask to maintain the channels that can be turned off.
* @initialized: true if the dma has been initialized
* @gen_dmac: the struct for generic registers values to represent u8500/8540 * @gen_dmac: the struct for generic registers values to represent u8500/8540
* DMA controller * DMA controller
*/ */
...@@ -594,7 +593,6 @@ struct d40_base { ...@@ -594,7 +593,6 @@ struct d40_base {
u32 reg_val_backup_v4[BACKUP_REGS_SZ_MAX]; u32 reg_val_backup_v4[BACKUP_REGS_SZ_MAX];
u32 *reg_val_backup_chan; u32 *reg_val_backup_chan;
u16 gcc_pwr_off_mask; u16 gcc_pwr_off_mask;
bool initialized;
struct d40_gen_dmac gen_dmac; struct d40_gen_dmac gen_dmac;
}; };
...@@ -3030,8 +3028,7 @@ static int dma40_runtime_resume(struct device *dev) ...@@ -3030,8 +3028,7 @@ static int dma40_runtime_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct d40_base *base = platform_get_drvdata(pdev); struct d40_base *base = platform_get_drvdata(pdev);
if (base->initialized) d40_save_restore_registers(base, false);
d40_save_restore_registers(base, false);
writel_relaxed(D40_DREG_GCC_ENABLE_ALL, writel_relaxed(D40_DREG_GCC_ENABLE_ALL,
base->virtbase + D40_DREG_GCC); base->virtbase + D40_DREG_GCC);
...@@ -3645,12 +3642,6 @@ static int __init d40_probe(struct platform_device *pdev) ...@@ -3645,12 +3642,6 @@ static int __init d40_probe(struct platform_device *pdev)
goto failure; goto failure;
} }
pm_runtime_irq_safe(base->dev);
pm_runtime_set_autosuspend_delay(base->dev, DMA40_AUTOSUSPEND_DELAY);
pm_runtime_use_autosuspend(base->dev);
pm_runtime_enable(base->dev);
pm_runtime_resume(base->dev);
if (base->plat_data->use_esram_lcla) { if (base->plat_data->use_esram_lcla) {
base->lcpa_regulator = regulator_get(base->dev, "lcla_esram"); base->lcpa_regulator = regulator_get(base->dev, "lcla_esram");
...@@ -3671,7 +3662,15 @@ static int __init d40_probe(struct platform_device *pdev) ...@@ -3671,7 +3662,15 @@ static int __init d40_probe(struct platform_device *pdev)
} }
} }
base->initialized = true; writel_relaxed(D40_DREG_GCC_ENABLE_ALL, base->virtbase + D40_DREG_GCC);
pm_runtime_irq_safe(base->dev);
pm_runtime_set_autosuspend_delay(base->dev, DMA40_AUTOSUSPEND_DELAY);
pm_runtime_use_autosuspend(base->dev);
pm_runtime_mark_last_busy(base->dev);
pm_runtime_set_active(base->dev);
pm_runtime_enable(base->dev);
ret = d40_dmaengine_init(base, num_reserved_chans); ret = d40_dmaengine_init(base, num_reserved_chans);
if (ret) if (ret)
goto failure; goto failure;
......
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