提交 dd44c957 编写于 作者: D Dave Airlie

Merge tag 'imx-drm-fixes-2017-06-08' of git://git.pengutronix.de/git/pza/linux into drm-fixes

imx-drm: PRE clock gating, panelless LDB, and VDIC CSI selection fixes

- Keep the external clock input to the PRE ungated and only use the internal
  soft reset to keep the module in low power state, to avoid sporadic startup
  failures.
- Ignore -ENODEV return values from drm_of_find_panel_or_bridge in the LDB
  driver to fix probing for devices that still do not specify a panel in the
  device tree.
- Fix the CSI input selection to the VDIC. According to experiments, the real
  behaviour differs a bit from the documentation.

* tag 'imx-drm-fixes-2017-06-08' of git://git.pengutronix.de/git/pza/linux:
  gpu: ipu-v3: Fix CSI selection for VDIC
  drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure
  gpu: ipu-v3: pre: only use internal clock gating
...@@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) ...@@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
ret = drm_of_find_panel_or_bridge(child, ret = drm_of_find_panel_or_bridge(child,
imx_ldb->lvds_mux ? 4 : 2, 0, imx_ldb->lvds_mux ? 4 : 2, 0,
&channel->panel, &channel->bridge); &channel->panel, &channel->bridge);
if (ret) if (ret && ret != -ENODEV)
return ret; return ret;
/* panel ddc only if there is no bridge */ /* panel ddc only if there is no bridge */
......
...@@ -725,15 +725,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi) ...@@ -725,15 +725,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi)
spin_lock_irqsave(&ipu->lock, flags); spin_lock_irqsave(&ipu->lock, flags);
val = ipu_cm_read(ipu, IPU_CONF); val = ipu_cm_read(ipu, IPU_CONF);
if (vdi) { if (vdi)
val |= IPU_CONF_IC_INPUT; val |= IPU_CONF_IC_INPUT;
} else { else
val &= ~IPU_CONF_IC_INPUT; val &= ~IPU_CONF_IC_INPUT;
if (csi_id == 1)
val |= IPU_CONF_CSI_SEL; if (csi_id == 1)
else val |= IPU_CONF_CSI_SEL;
val &= ~IPU_CONF_CSI_SEL; else
} val &= ~IPU_CONF_CSI_SEL;
ipu_cm_write(ipu, val, IPU_CONF); ipu_cm_write(ipu, val, IPU_CONF);
spin_unlock_irqrestore(&ipu->lock, flags); spin_unlock_irqrestore(&ipu->lock, flags);
......
...@@ -131,8 +131,6 @@ int ipu_pre_get(struct ipu_pre *pre) ...@@ -131,8 +131,6 @@ int ipu_pre_get(struct ipu_pre *pre)
if (pre->in_use) if (pre->in_use)
return -EBUSY; return -EBUSY;
clk_prepare_enable(pre->clk_axi);
/* first get the engine out of reset and remove clock gating */ /* first get the engine out of reset and remove clock gating */
writel(0, pre->regs + IPU_PRE_CTRL); writel(0, pre->regs + IPU_PRE_CTRL);
...@@ -149,12 +147,7 @@ int ipu_pre_get(struct ipu_pre *pre) ...@@ -149,12 +147,7 @@ int ipu_pre_get(struct ipu_pre *pre)
void ipu_pre_put(struct ipu_pre *pre) void ipu_pre_put(struct ipu_pre *pre)
{ {
u32 val; writel(IPU_PRE_CTRL_SFTRST, pre->regs + IPU_PRE_CTRL);
val = IPU_PRE_CTRL_SFTRST | IPU_PRE_CTRL_CLKGATE;
writel(val, pre->regs + IPU_PRE_CTRL);
clk_disable_unprepare(pre->clk_axi);
pre->in_use = false; pre->in_use = false;
} }
...@@ -249,6 +242,8 @@ static int ipu_pre_probe(struct platform_device *pdev) ...@@ -249,6 +242,8 @@ static int ipu_pre_probe(struct platform_device *pdev)
if (!pre->buffer_virt) if (!pre->buffer_virt)
return -ENOMEM; return -ENOMEM;
clk_prepare_enable(pre->clk_axi);
pre->dev = dev; pre->dev = dev;
platform_set_drvdata(pdev, pre); platform_set_drvdata(pdev, pre);
mutex_lock(&ipu_pre_list_mutex); mutex_lock(&ipu_pre_list_mutex);
...@@ -268,6 +263,8 @@ static int ipu_pre_remove(struct platform_device *pdev) ...@@ -268,6 +263,8 @@ static int ipu_pre_remove(struct platform_device *pdev)
available_pres--; available_pres--;
mutex_unlock(&ipu_pre_list_mutex); mutex_unlock(&ipu_pre_list_mutex);
clk_disable_unprepare(pre->clk_axi);
if (pre->buffer_virt) if (pre->buffer_virt)
gen_pool_free(pre->iram, (unsigned long)pre->buffer_virt, gen_pool_free(pre->iram, (unsigned long)pre->buffer_virt,
IPU_PRE_MAX_WIDTH * IPU_PRE_NUM_SCANLINES * 4); IPU_PRE_MAX_WIDTH * IPU_PRE_NUM_SCANLINES * 4);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册