#include <asm/arch/dma.h>
#include <asm/arch/mux.h>
#include <asm/arch/irqs.h>
-#include <asm/arch/mcbsp.h>
#include <asm/arch/dsp_common.h>
+#include <asm/arch/mcbsp.h>
#ifdef CONFIG_MCBSP_DEBUG
#define DBG(x...) printk(x)
static void omap_mcbsp_dsp_request(void)
{
if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
- omap_dsp_request_mem();
+ int ret;
+
+ ret = omap_dsp_request_mem();
+ if (ret < 0) {
+ printk(KERN_ERR "Could not get dsp memory: %i\n", ret);
+ return;
+ }
+
clk_enable(mcbsp_dsp_ck);
clk_enable(mcbsp_api_ck);
{
struct omap_mmu_tlb_lock lock;
struct cam_ram_regset *cr;
+ int ret;
clk_enable(mmu->clk);
- omap_dsp_request_mem();
+ ret = omap_dsp_request_mem();
+ if (ret < 0)
+ goto out;
omap_mmu_get_tlb_lock(mmu, &lock);
for (lock.victim = 0; lock.victim < lock.base; lock.victim++) {
omap_mmu_set_tlb_lock(mmu, &lock);
omap_dsp_release_mem();
+out:
clk_disable(mmu->clk);
return 0;
}
int omap_mmu_clear_tlb_entry(struct omap_mmu *mmu, unsigned long vadr)
{
struct omap_mmu_tlb_lock lock;
- int i;
+ int i, ret = 0;
int max_valid = 0;
clk_enable(mmu->clk);
- omap_dsp_request_mem();
+ ret = omap_dsp_request_mem();
+ if (ret < 0)
+ goto out;
omap_mmu_get_tlb_lock(mmu, &lock);
for (i = 0; i < lock.base; i++) {
omap_mmu_set_tlb_lock(mmu, &lock);
omap_dsp_release_mem();
+out:
clk_disable(mmu->clk);
- return 0;
+ return ret;
}
EXPORT_SYMBOL_GPL(omap_mmu_clear_tlb_entry);
static void omap_mmu_gflush(struct omap_mmu *mmu)
{
struct omap_mmu_tlb_lock lock;
+ int ret;
clk_enable(mmu->clk);
- omap_dsp_request_mem();
+ ret = omap_dsp_request_mem();
+ if (ret < 0)
+ goto out;
omap_mmu_write_reg(mmu, 0x1, OMAP_MMU_GFLUSH);
lock.base = lock.victim = mmu->nr_exmap_preserved;
omap_mmu_set_tlb_lock(mmu, &lock);
omap_dsp_release_mem();
+out:
clk_disable(mmu->clk);
}
int ret = 0;
clk_enable(mmu->clk);
- omap_dsp_request_mem();
+ ret = omap_dsp_request_mem();
+ if (ret < 0)
+ goto out;
+
down_write(&mmu->exmap_sem);
ret = request_irq(mmu->irq, omap_mmu_interrupt, IRQF_DISABLED,
if (unlikely(mmu->ops->startup))
ret = mmu->ops->startup(mmu);
- fail:
+fail:
up_write(&mmu->exmap_sem);
omap_dsp_release_mem();
+out:
clk_disable(mmu->clk);
return ret;
{
struct omap_mmu *mmu = dev_get_drvdata(dev);
struct omap_mmu_tlb_lock tlb_lock;
- int ret = -EIO;
+ int ret;
clk_enable(mmu->clk);
- omap_dsp_request_mem();
+ ret = omap_dsp_request_mem();
+ if (ret < 0)
+ goto out;
down_read(&mmu->exmap_sem);
omap_mmu_get_tlb_lock(mmu, &tlb_lock);
+ ret = -EIO;
if (likely(mmu->ops->show))
ret = mmu->ops->show(mmu, buf, &tlb_lock);
up_read(&mmu->exmap_sem);
omap_dsp_release_mem();
+out:
clk_disable(mmu->clk);
return ret;