summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2014-07-05 17:48:26 -0400
committerDave Airlie <airlied@gmail.com>2014-07-05 17:48:26 -0400
commitd808e62f7f14a5551b62926017c507d0e331d4ff (patch)
tree3abce7f5bb619c05a220953a47e6ea867bd1f87e
parente1a08b855f56d6528e7f85aae9ca8123f4c3ae04 (diff)
parent92fbdfcd7d6b9db6b0a738c5bd85a4a9d731629d (diff)
Merge branch 'tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox
mode fixes for tda998x. * 'tda998x-fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-cubox: drm/i2c: tda998x: add some basic mode validation drm/i2c: tda998x: faster polling for edid drm/i2c: tda998x: move drm_i2c_encoder_destroy call
-rw-r--r--drivers/gpu/drm/i2c/tda998x_drv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 240c331405b9..ac357b02bd35 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -810,6 +810,12 @@ static int
810tda998x_encoder_mode_valid(struct drm_encoder *encoder, 810tda998x_encoder_mode_valid(struct drm_encoder *encoder,
811 struct drm_display_mode *mode) 811 struct drm_display_mode *mode)
812{ 812{
813 if (mode->clock > 150000)
814 return MODE_CLOCK_HIGH;
815 if (mode->htotal >= BIT(13))
816 return MODE_BAD_HVALUE;
817 if (mode->vtotal >= BIT(11))
818 return MODE_BAD_VVALUE;
813 return MODE_OK; 819 return MODE_OK;
814} 820}
815 821
@@ -1048,8 +1054,8 @@ read_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk)
1048 return i; 1054 return i;
1049 } 1055 }
1050 } else { 1056 } else {
1051 for (i = 10; i > 0; i--) { 1057 for (i = 100; i > 0; i--) {
1052 msleep(10); 1058 msleep(1);
1053 ret = reg_read(priv, REG_INT_FLAGS_2); 1059 ret = reg_read(priv, REG_INT_FLAGS_2);
1054 if (ret < 0) 1060 if (ret < 0)
1055 return ret; 1061 return ret;
@@ -1183,7 +1189,6 @@ static void
1183tda998x_encoder_destroy(struct drm_encoder *encoder) 1189tda998x_encoder_destroy(struct drm_encoder *encoder)
1184{ 1190{
1185 struct tda998x_priv *priv = to_tda998x_priv(encoder); 1191 struct tda998x_priv *priv = to_tda998x_priv(encoder);
1186 drm_i2c_encoder_destroy(encoder);
1187 1192
1188 /* disable all IRQs and free the IRQ handler */ 1193 /* disable all IRQs and free the IRQ handler */
1189 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); 1194 cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
@@ -1193,6 +1198,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
1193 1198
1194 if (priv->cec) 1199 if (priv->cec)
1195 i2c_unregister_device(priv->cec); 1200 i2c_unregister_device(priv->cec);
1201 drm_i2c_encoder_destroy(encoder);
1196 kfree(priv); 1202 kfree(priv);
1197} 1203}
1198 1204