diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-01-20 17:44:07 -0500 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2015-01-27 09:55:49 -0500 |
commit | f555e7ea03205e8ffc7ff485abdb6fddfd6e44a7 (patch) | |
tree | c9337e8eb3b16714852a54b9ff9f8c3e7a6c64ac /drivers/gpu/drm | |
parent | af7537d3c8d0f894f6499376a538e8138ef188ee (diff) |
drm: imx: imx-tve: Check and propagate the errors
In the case of errors we should propagate them.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/imx/imx-tve.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c index a729f4f7074c..9bb8f665aeec 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) |