diff options
author | Dave Airlie <airlied@redhat.com> | 2015-02-11 00:35:26 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-02-11 00:35:26 -0500 |
commit | 85840c76d8ad18d978da44e8d2f27bb35b7159af (patch) | |
tree | c54f837e30c81d4f30aa8eb6c9f6b764734dcd1b /drivers/gpu | |
parent | 79a44c16b155b799421f5497ae888985a5d7f80c (diff) | |
parent | a49e7c0d079610062048a4ed1cff2bb09436127c (diff) |
Merge tag 'imx-drm-fixes-2015-01-28' of git://git.pengutronix.de/git/pza/linux into drm-next
imx-drm fixes for IPUv3 DC and i.MX5 IPUv3 IC and TVE
- Corrected handling of wait_for_completion_timeout return value
when disabling IPUv3 DC channels
- Fixed error return value propagation in TVE mode_set
- Fixed IPUv3 register offsets for IC module on i.MX51 and i.MX53
* tag 'imx-drm-fixes-2015-01-28' of git://git.pengutronix.de/git/pza/linux:
gpu: ipu-v3: Fix IC control register offset
drm: imx: imx-tve: Check and propagate the errors
gpu: ipu-v3: wait_for_completion_timeout does not return negative status
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/imx/imx-tve.c | 24 | ||||
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-common.c | 4 | ||||
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-dc.c | 5 |
3 files changed, 21 insertions, 12 deletions
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index b63601d04601..4216e479a9be 100644 --- a/drivers/gpu/drm/imx/imx-tve.c +++ b/drivers/gpu/drm/imx/imx-tve.c | |||
@@ -191,10 +191,18 @@ static int tve_setup_vga(struct imx_tve *tve) | |||
191 | /* set gain to (1 + 10/128) to provide 0.7V peak-to-peak amplitude */ | 191 | /* set gain to (1 + 10/128) to provide 0.7V peak-to-peak amplitude */ |
192 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC0_CONT_REG, | 192 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC0_CONT_REG, |
193 | TVE_TVDAC_GAIN_MASK, 0x0a); | 193 | TVE_TVDAC_GAIN_MASK, 0x0a); |
194 | if (ret) | ||
195 | return ret; | ||
196 | |||
194 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC1_CONT_REG, | 197 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC1_CONT_REG, |
195 | TVE_TVDAC_GAIN_MASK, 0x0a); | 198 | TVE_TVDAC_GAIN_MASK, 0x0a); |
199 | if (ret) | ||
200 | return ret; | ||
201 | |||
196 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC2_CONT_REG, | 202 | ret = regmap_update_bits(tve->regmap, TVE_TVDAC2_CONT_REG, |
197 | TVE_TVDAC_GAIN_MASK, 0x0a); | 203 | TVE_TVDAC_GAIN_MASK, 0x0a); |
204 | if (ret) | ||
205 | return ret; | ||
198 | 206 | ||
199 | /* set configuration register */ | 207 | /* set configuration register */ |
200 | mask = TVE_DATA_SOURCE_MASK | TVE_INP_VIDEO_FORM; | 208 | mask = TVE_DATA_SOURCE_MASK | TVE_INP_VIDEO_FORM; |
@@ -204,16 +212,12 @@ static int tve_setup_vga(struct imx_tve *tve) | |||
204 | mask |= TVE_TV_OUT_MODE_MASK | TVE_SYNC_CH_0_EN; | 212 | mask |= TVE_TV_OUT_MODE_MASK | TVE_SYNC_CH_0_EN; |
205 | val |= TVE_TV_OUT_RGB | TVE_SYNC_CH_0_EN; | 213 | val |= TVE_TV_OUT_RGB | TVE_SYNC_CH_0_EN; |
206 | ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, mask, val); | 214 | ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, mask, val); |
207 | if (ret < 0) { | 215 | if (ret) |
208 | dev_err(tve->dev, "failed to set configuration: %d\n", ret); | ||
209 | return ret; | 216 | return ret; |
210 | } | ||
211 | 217 | ||
212 | /* set test mode (as documented) */ | 218 | /* set test mode (as documented) */ |
213 | ret = regmap_update_bits(tve->regmap, TVE_TST_MODE_REG, | 219 | return regmap_update_bits(tve->regmap, TVE_TST_MODE_REG, |
214 | TVE_TVDAC_TEST_MODE_MASK, 1); | 220 | TVE_TVDAC_TEST_MODE_MASK, 1); |
215 | |||
216 | return 0; | ||
217 | } | 221 | } |
218 | 222 | ||
219 | static enum drm_connector_status imx_tve_connector_detect( | 223 | static enum drm_connector_status imx_tve_connector_detect( |
@@ -335,9 +339,11 @@ static void imx_tve_encoder_mode_set(struct drm_encoder *encoder, | |||
335 | } | 339 | } |
336 | 340 | ||
337 | if (tve->mode == TVE_MODE_VGA) | 341 | if (tve->mode == TVE_MODE_VGA) |
338 | tve_setup_vga(tve); | 342 | ret = tve_setup_vga(tve); |
339 | else | 343 | else |
340 | tve_setup_tvout(tve); | 344 | ret = tve_setup_tvout(tve); |
345 | if (ret) | ||
346 | dev_err(tve->dev, "failed to set configuration: %d\n", ret); | ||
341 | } | 347 | } |
342 | 348 | ||
343 | static void imx_tve_encoder_commit(struct drm_encoder *encoder) | 349 | static void imx_tve_encoder_commit(struct drm_encoder *encoder) |
@@ -671,6 +677,8 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data) | |||
671 | 677 | ||
672 | /* disable cable detection for VGA mode */ | 678 | /* disable cable detection for VGA mode */ |
673 | ret = regmap_write(tve->regmap, TVE_CD_CONT_REG, 0); | 679 | ret = regmap_write(tve->regmap, TVE_CD_CONT_REG, 0); |
680 | if (ret) | ||
681 | return ret; | ||
674 | 682 | ||
675 | ret = imx_tve_register(drm, tve); | 683 | ret = imx_tve_register(drm, tve); |
676 | if (ret) | 684 | if (ret) |
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index f707d25ae78f..67bab5c36056 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c | |||
@@ -742,7 +742,7 @@ static struct ipu_devtype ipu_type_imx51 = { | |||
742 | .tpm_ofs = 0x1f060000, | 742 | .tpm_ofs = 0x1f060000, |
743 | .csi0_ofs = 0x1f030000, | 743 | .csi0_ofs = 0x1f030000, |
744 | .csi1_ofs = 0x1f038000, | 744 | .csi1_ofs = 0x1f038000, |
745 | .ic_ofs = 0x1f020000, | 745 | .ic_ofs = 0x1e020000, |
746 | .disp0_ofs = 0x1e040000, | 746 | .disp0_ofs = 0x1e040000, |
747 | .disp1_ofs = 0x1e048000, | 747 | .disp1_ofs = 0x1e048000, |
748 | .dc_tmpl_ofs = 0x1f080000, | 748 | .dc_tmpl_ofs = 0x1f080000, |
@@ -758,7 +758,7 @@ static struct ipu_devtype ipu_type_imx53 = { | |||
758 | .tpm_ofs = 0x07060000, | 758 | .tpm_ofs = 0x07060000, |
759 | .csi0_ofs = 0x07030000, | 759 | .csi0_ofs = 0x07030000, |
760 | .csi1_ofs = 0x07038000, | 760 | .csi1_ofs = 0x07038000, |
761 | .ic_ofs = 0x07020000, | 761 | .ic_ofs = 0x06020000, |
762 | .disp0_ofs = 0x06040000, | 762 | .disp0_ofs = 0x06040000, |
763 | .disp1_ofs = 0x06048000, | 763 | .disp1_ofs = 0x06048000, |
764 | .dc_tmpl_ofs = 0x07080000, | 764 | .dc_tmpl_ofs = 0x07080000, |
diff --git a/drivers/gpu/ipu-v3/ipu-dc.c b/drivers/gpu/ipu-v3/ipu-dc.c index 323203d0503a..4864f8300797 100644 --- a/drivers/gpu/ipu-v3/ipu-dc.c +++ b/drivers/gpu/ipu-v3/ipu-dc.c | |||
@@ -277,7 +277,8 @@ static irqreturn_t dc_irq_handler(int irq, void *dev_id) | |||
277 | void ipu_dc_disable_channel(struct ipu_dc *dc) | 277 | void ipu_dc_disable_channel(struct ipu_dc *dc) |
278 | { | 278 | { |
279 | struct ipu_dc_priv *priv = dc->priv; | 279 | struct ipu_dc_priv *priv = dc->priv; |
280 | int irq, ret; | 280 | int irq; |
281 | unsigned long ret; | ||
281 | u32 val; | 282 | u32 val; |
282 | 283 | ||
283 | /* TODO: Handle MEM_FG_SYNC differently from MEM_BG_SYNC */ | 284 | /* TODO: Handle MEM_FG_SYNC differently from MEM_BG_SYNC */ |
@@ -292,7 +293,7 @@ void ipu_dc_disable_channel(struct ipu_dc *dc) | |||
292 | enable_irq(irq); | 293 | enable_irq(irq); |
293 | ret = wait_for_completion_timeout(&priv->comp, msecs_to_jiffies(50)); | 294 | ret = wait_for_completion_timeout(&priv->comp, msecs_to_jiffies(50)); |
294 | disable_irq(irq); | 295 | disable_irq(irq); |
295 | if (ret <= 0) { | 296 | if (ret == 0) { |
296 | dev_warn(priv->dev, "DC stop timeout after 50 ms\n"); | 297 | dev_warn(priv->dev, "DC stop timeout after 50 ms\n"); |
297 | 298 | ||
298 | val = readl(dc->base + DC_WR_CH_CONF); | 299 | val = readl(dc->base + DC_WR_CH_CONF); |