Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+21 -12
+16 -8
drivers/gpu/drm/imx/imx-tve.c
··· 191 191 /* set gain to (1 + 10/128) to provide 0.7V peak-to-peak amplitude */ 192 192 ret = regmap_update_bits(tve->regmap, TVE_TVDAC0_CONT_REG, 193 193 TVE_TVDAC_GAIN_MASK, 0x0a); 194 + if (ret) 195 + return ret; 196 + 194 197 ret = regmap_update_bits(tve->regmap, TVE_TVDAC1_CONT_REG, 195 198 TVE_TVDAC_GAIN_MASK, 0x0a); 199 + if (ret) 200 + return ret; 201 + 196 202 ret = regmap_update_bits(tve->regmap, TVE_TVDAC2_CONT_REG, 197 203 TVE_TVDAC_GAIN_MASK, 0x0a); 204 + if (ret) 205 + return ret; 198 206 199 207 /* set configuration register */ 200 208 mask = TVE_DATA_SOURCE_MASK | TVE_INP_VIDEO_FORM; ··· 212 204 mask |= TVE_TV_OUT_MODE_MASK | TVE_SYNC_CH_0_EN; 213 205 val |= TVE_TV_OUT_RGB | TVE_SYNC_CH_0_EN; 214 206 ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, mask, val); 215 - if (ret < 0) { 216 - dev_err(tve->dev, "failed to set configuration: %d\n", ret); 207 + if (ret) 217 208 return ret; 218 - } 219 209 220 210 /* set test mode (as documented) */ 221 - ret = regmap_update_bits(tve->regmap, TVE_TST_MODE_REG, 211 + return regmap_update_bits(tve->regmap, TVE_TST_MODE_REG, 222 212 TVE_TVDAC_TEST_MODE_MASK, 1); 223 - 224 - return 0; 225 213 } 226 214 227 215 static enum drm_connector_status imx_tve_connector_detect( ··· 339 335 } 340 336 341 337 if (tve->mode == TVE_MODE_VGA) 342 - tve_setup_vga(tve); 338 + ret = tve_setup_vga(tve); 343 339 else 344 - tve_setup_tvout(tve); 340 + ret = tve_setup_tvout(tve); 341 + if (ret) 342 + dev_err(tve->dev, "failed to set configuration: %d\n", ret); 345 343 } 346 344 347 345 static void imx_tve_encoder_commit(struct drm_encoder *encoder) ··· 677 671 678 672 /* disable cable detection for VGA mode */ 679 673 ret = regmap_write(tve->regmap, TVE_CD_CONT_REG, 0); 674 + if (ret) 675 + return ret; 680 676 681 677 ret = imx_tve_register(drm, tve); 682 678 if (ret)
+2 -2
drivers/gpu/ipu-v3/ipu-common.c
··· 742 742 .tpm_ofs = 0x1f060000, 743 743 .csi0_ofs = 0x1f030000, 744 744 .csi1_ofs = 0x1f038000, 745 - .ic_ofs = 0x1f020000, 745 + .ic_ofs = 0x1e020000, 746 746 .disp0_ofs = 0x1e040000, 747 747 .disp1_ofs = 0x1e048000, 748 748 .dc_tmpl_ofs = 0x1f080000, ··· 758 758 .tpm_ofs = 0x07060000, 759 759 .csi0_ofs = 0x07030000, 760 760 .csi1_ofs = 0x07038000, 761 - .ic_ofs = 0x07020000, 761 + .ic_ofs = 0x06020000, 762 762 .disp0_ofs = 0x06040000, 763 763 .disp1_ofs = 0x06048000, 764 764 .dc_tmpl_ofs = 0x07080000,
+3 -2
drivers/gpu/ipu-v3/ipu-dc.c
··· 277 277 void ipu_dc_disable_channel(struct ipu_dc *dc) 278 278 { 279 279 struct ipu_dc_priv *priv = dc->priv; 280 - int irq, ret; 280 + int irq; 281 + unsigned long ret; 281 282 u32 val; 282 283 283 284 /* TODO: Handle MEM_FG_SYNC differently from MEM_BG_SYNC */ ··· 293 292 enable_irq(irq); 294 293 ret = wait_for_completion_timeout(&priv->comp, msecs_to_jiffies(50)); 295 294 disable_irq(irq); 296 - if (ret <= 0) { 295 + if (ret == 0) { 297 296 dev_warn(priv->dev, "DC stop timeout after 50 ms\n"); 298 297 299 298 val = readl(dc->base + DC_WR_CH_CONF);