diff options
author | Guoqing Li <ligq@marvell.com> | 2013-09-13 14:59:47 +0800 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-09-20 12:52:33 +0300 |
commit | 1f2e42c6c3cdf1b62772f27e1de6033691839cfb (patch) | |
tree | 53b3bca1e04b0653b62c4990bf2a40743fa803e2 /drivers/video/mmp | |
parent | 7ebdc78af2e310129a8b6eaffd8fbe637e18bd50 (diff) | |
download | talos-op-linux-1f2e42c6c3cdf1b62772f27e1de6033691839cfb.tar.gz talos-op-linux-1f2e42c6c3cdf1b62772f27e1de6033691839cfb.zip |
video: mmp: optimize some register setting code
There are dumplicate code of the smooth setting based on different
path, optimized the routine and use readl_relaxed instead.
Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Jing Xiang <jxiang@marvell.com>
Signed-off-by: Guoqing Li <ligq@marvell.com>
Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Reviewed-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/mmp')
-rw-r--r-- | drivers/video/mmp/hw/mmp_ctrl.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index a40d95a54eec..c0eb8bccfb87 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c @@ -53,7 +53,7 @@ static irqreturn_t ctrl_handle_irq(int irq, void *dev_id) tmp = readl_relaxed(ctrl->reg_base + SPU_IRQ_ISR); if (tmp & isr) writel_relaxed(~isr, ctrl->reg_base + SPU_IRQ_ISR); - } while ((isr = readl(ctrl->reg_base + SPU_IRQ_ISR)) & imask); + } while ((isr = readl_relaxed(ctrl->reg_base + SPU_IRQ_ISR)) & imask); return IRQ_HANDLED; } @@ -372,20 +372,12 @@ static void path_set_default(struct mmp_path *path) * bus arbiter for faster read if not tv path; * 2.enable horizontal smooth filter; */ - if (PATH_PN == path->id) { - mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK - | CFG_ARBFAST_ENA(1); - tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); - tmp |= mask; - writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); - } else if (PATH_TV == path->id) { - mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK - | CFG_ARBFAST_ENA(1); - tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); - tmp &= ~mask; - tmp |= CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK; - writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); - } + mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK | CFG_ARBFAST_ENA(1); + tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); + tmp |= mask; + if (PATH_TV == path->id) + tmp &= ~CFG_ARBFAST_ENA(1); + writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); } static int path_init(struct mmphw_path_plat *path_plat, |