diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/imx-sdma.c | 52 | ||||
-rw-r--r-- | drivers/dma/pxp/pxp_dma_v2.c | 23 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/csi_v4l2_capture.c | 6 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_elcdif_fb.c | 9 | ||||
-rw-r--r-- | drivers/video/mxc/mxc_epdc_fb.c | 5 |
5 files changed, 22 insertions, 73 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index bee75e8c85c5..81434d6af1bb 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -339,34 +339,6 @@ struct sdma_engine { #define SDMA_H_CONFIG_ACR (1 << 4) /* indicates if AHB freq /core freq = 2 or 1 */ #define SDMA_H_CONFIG_CSM (3) /* indicates which context switch mode is selected*/ -#ifdef CONFIG_SDMA_IRAM -static unsigned long sdma_iram_paddr; -static void *sdma_iram_vaddr; -#define sdma_iram_phys_to_virt(p) (sdma_iram_vaddr + ((p) - sdma_iram_paddr)) -#define sdma_iram_virt_to_phys(v) (sdma_iram_paddr + ((v) - sdma_iram_vaddr)) -static struct gen_pool *sdma_iram_pool; - -/*! - * Allocates uncacheable buffer from IRAM - */ -void __iomem *sdma_iram_malloc(size_t size, unsigned long *buf) -{ - *buf = gen_pool_alloc(sdma_iram_pool, size); - if (!buf) - return NULL; - - return sdma_iram_phys_to_virt(*buf); -} - -void sdma_iram_free(unsigned long buf, size_t size) -{ - if (!sdma_iram_pool) - return; - - gen_pool_free(sdma_iram_pool, buf, size); -} -#endif /*CONFIG_SDMA_IRAM */ - static inline u32 chnenbl_ofs(struct sdma_engine *sdma, unsigned int event) { @@ -449,7 +421,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size, int ret; #ifdef CONFIG_SDMA_IRAM - buf_virt = sdma_iram_malloc(size, (unsigned long *)&buf_phys); + buf_virt = iram_alloc(size, (unsigned long *)&buf_phys); #else buf_virt = dma_alloc_coherent(NULL, size, @@ -472,7 +444,7 @@ static int sdma_load_script(struct sdma_engine *sdma, void *buf, int size, spin_unlock_irqrestore(&sdma->channel_0_lock, flags); #ifdef CONFIG_SDMA_IRAM - sdma_iram_free(buf_phys, size); + iram_free(buf_phys, size); #else dma_free_coherent(NULL, size, buf_virt, buf_phys); #endif @@ -938,8 +910,7 @@ static int sdma_request_channel(struct sdma_channel *sdmac) int ret = -EBUSY; #ifdef CONFIG_SDMA_IRAM - sdmac->bd = sdma_iram_malloc(sizeof(sdmac->bd), - (unsigned long *)&sdmac->bd_phys); + sdmac->bd = iram_alloc(PAGE_SIZE, (unsigned long *)&sdmac->bd_phys); #else sdmac->bd = dma_alloc_noncached(NULL, PAGE_SIZE, &sdmac->bd_phys, GFP_KERNEL); #endif @@ -1106,7 +1077,7 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdma_set_channel_priority(sdmac, 0); #ifdef CONFIG_SDMA_IRAM - sdma_iram_free(sdmac->bd_phys, sizeof(sdmac->bd)); + iram_free(sdmac->bd_phys, PAGE_SIZE); #else dma_free_coherent(NULL, PAGE_SIZE, sdmac->bd, sdmac->bd_phys); #endif @@ -1494,12 +1465,7 @@ static int __init sdma_init(struct sdma_engine *sdma) writel_relaxed(0, sdma->regs + SDMA_H_C0PTR); #ifdef CONFIG_SDMA_IRAM - /* Allocate memory for SDMA channel and buffer descriptors */ - sdma_iram_vaddr = iram_alloc(SZ_4K, &sdma_iram_paddr); - sdma_iram_pool = gen_pool_create(PAGE_SHIFT/2, -1); - gen_pool_add(sdma_iram_pool, sdma_iram_paddr, SZ_4K, -1); - - sdma->channel_control = sdma_iram_malloc(MAX_DMA_CHANNELS * + sdma->channel_control = iram_alloc(MAX_DMA_CHANNELS * sizeof(struct sdma_channel_control) + sizeof(struct sdma_context_data), (unsigned long *)&ccb_phys); @@ -1534,7 +1500,7 @@ static int __init sdma_init(struct sdma_engine *sdma) ret = sdma_request_channel(&sdma->channel[0]); if (ret) - goto err_dma_alloc; + goto err_dma_request; sdma_config_ownership(&sdma->channel[0], false, true, false); @@ -1557,6 +1523,12 @@ static int __init sdma_init(struct sdma_engine *sdma) return 0; +err_dma_request: +#ifdef CONFIG_SDMA_IRAM + iram_free((unsigned long)ccb_phys, MAX_DMA_CHANNELS + * sizeof(struct sdma_channel_control) + + sizeof(struct sdma_context_data)); +#endif err_dma_alloc: clk_disable(sdma->clk); dev_err(sdma->dev, "initialisation failed with %d\n", ret); diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index f0b50b7a1c05..7169b44a9bb3 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -800,8 +800,6 @@ static void pxp_clk_enable(struct pxps *pxp) } clk_enable(pxp->clk); - /* Pull PxP out of reset */ - __raw_writel(0, pxp->base + HW_PXP_CTRL); pxp->clk_stat = CLK_STAT_ON; mutex_unlock(&pxp->clk_mutex); @@ -820,13 +818,6 @@ static void pxp_clk_disable(struct pxps *pxp) spin_lock_irqsave(&pxp->lock, flags); if ((pxp->pxp_ongoing == 0) && list_empty(&head)) { - /* Put the PXP into reset as the Display MIX is going - * to be Power gated. - */ - while (__raw_readl(pxp->base + HW_PXP_CTRL) - & BM_PXP_CTRL_ENABLE) - ; - __raw_writel(BM_PXP_CTRL_SFTRST, pxp->base + HW_PXP_CTRL); spin_unlock_irqrestore(&pxp->lock, flags); clk_disable(pxp->clk); pxp->clk_stat = CLK_STAT_OFF; @@ -1636,11 +1627,11 @@ static int pxp_suspend(struct platform_device *pdev, pm_message_t state) { struct pxps *pxp = platform_get_drvdata(pdev); - /* Need to call the enable/disable sequence here to - * ensure that the PXP is in the right state before the - * SOC enters suspend state. - */ pxp_clk_enable(pxp); + while (__raw_readl(pxp->base + HW_PXP_CTRL) & BM_PXP_CTRL_ENABLE) + ; + + __raw_writel(BM_PXP_CTRL_SFTRST, pxp->base + HW_PXP_CTRL); pxp_clk_disable(pxp); return 0; @@ -1650,11 +1641,9 @@ static int pxp_resume(struct platform_device *pdev) { struct pxps *pxp = platform_get_drvdata(pdev); - /* Need to call the enable/disable sequence here to - * ensure that the PXP is in the right state after the - * SOC exits suspend state. - */ pxp_clk_enable(pxp); + /* Pull PxP out of reset */ + __raw_writel(0, pxp->base + HW_PXP_CTRL); pxp_clk_disable(pxp); return 0; diff --git a/drivers/media/video/mxc/capture/csi_v4l2_capture.c b/drivers/media/video/mxc/capture/csi_v4l2_capture.c index 58cfa016b183..f2620d85bcc3 100644 --- a/drivers/media/video/mxc/capture/csi_v4l2_capture.c +++ b/drivers/media/video/mxc/capture/csi_v4l2_capture.c @@ -1065,11 +1065,11 @@ static int csi_v4l_dqueue(cam_data *cam, struct v4l2_buffer *buf) return retval; } pxp_complete_update(cam); + memcpy(cam->frame[buf->index].vaddress, + cam->frame[req_buf_number].vaddress, + cam->v2f.fmt.pix.sizeimage); } up(&cam->busy_lock); - memcpy(cam->frame[buf->index].vaddress, - cam->frame[req_buf_number].vaddress, - cam->v2f.fmt.pix.sizeimage); return retval; } diff --git a/drivers/video/mxc/mxc_elcdif_fb.c b/drivers/video/mxc/mxc_elcdif_fb.c index 2c38b0e9379c..b3691b540522 100644 --- a/drivers/video/mxc/mxc_elcdif_fb.c +++ b/drivers/video/mxc/mxc_elcdif_fb.c @@ -79,7 +79,6 @@ struct mxc_elcdif_fb_data { struct semaphore flip_sem; struct fb_var_screeninfo var; u32 pseudo_palette[16]; - bool pg_display_mix; }; struct elcdif_signal_cfg { @@ -1187,12 +1186,6 @@ static int mxc_elcdif_fb_blank(int blank, struct fb_info *info) } if (data->cur_blank != FB_BLANK_UNBLANK) { - - if (data->pg_display_mix) { - mxc_elcdif_stop(); - mxc_elcdif_dma_release(); - data->running = false; - } if (g_elcdif_axi_clk_enable) { clk_disable(g_elcdif_axi_clk); g_elcdif_axi_clk_enable = false; @@ -1499,8 +1492,6 @@ static int mxc_elcdif_fb_probe(struct platform_device *pdev) if (ret) goto err3; - data->pg_display_mix = pdata->pg_display_mix; - platform_set_drvdata(pdev, fbi); return 0; diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c index 71697f2749d9..4103498dc1b0 100644 --- a/drivers/video/mxc/mxc_epdc_fb.c +++ b/drivers/video/mxc/mxc_epdc_fb.c @@ -1089,10 +1089,7 @@ static void epdc_powerup(struct mxc_epdc_fb_data *fb_data) clk_enable(fb_data->epdc_clk_axi); clk_enable(fb_data->epdc_clk_pix); - if (fb_data->pdata->pg_display_mix) - epdc_init_settings(fb_data); - else - __raw_writel(EPDC_CTRL_CLKGATE, EPDC_CTRL_CLEAR); + __raw_writel(EPDC_CTRL_CLKGATE, EPDC_CTRL_CLEAR); /* Enable power to the EPD panel */ ret = regulator_enable(fb_data->display_regulator); |