Commit d808e62f authored by Dave Airlie's avatar Dave Airlie

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
parents e1a08b85 92fbdfcd
...@@ -810,6 +810,12 @@ static int ...@@ -810,6 +810,12 @@ static int
tda998x_encoder_mode_valid(struct drm_encoder *encoder, tda998x_encoder_mode_valid(struct drm_encoder *encoder,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
if (mode->clock > 150000)
return MODE_CLOCK_HIGH;
if (mode->htotal >= BIT(13))
return MODE_BAD_HVALUE;
if (mode->vtotal >= BIT(11))
return MODE_BAD_VVALUE;
return MODE_OK; return MODE_OK;
} }
...@@ -1048,8 +1054,8 @@ read_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk) ...@@ -1048,8 +1054,8 @@ read_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk)
return i; return i;
} }
} else { } else {
for (i = 10; i > 0; i--) { for (i = 100; i > 0; i--) {
msleep(10); msleep(1);
ret = reg_read(priv, REG_INT_FLAGS_2); ret = reg_read(priv, REG_INT_FLAGS_2);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -1183,7 +1189,6 @@ static void ...@@ -1183,7 +1189,6 @@ static void
tda998x_encoder_destroy(struct drm_encoder *encoder) tda998x_encoder_destroy(struct drm_encoder *encoder)
{ {
struct tda998x_priv *priv = to_tda998x_priv(encoder); struct tda998x_priv *priv = to_tda998x_priv(encoder);
drm_i2c_encoder_destroy(encoder);
/* disable all IRQs and free the IRQ handler */ /* disable all IRQs and free the IRQ handler */
cec_write(priv, REG_CEC_RXSHPDINTENA, 0); cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
...@@ -1193,6 +1198,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder) ...@@ -1193,6 +1198,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
if (priv->cec) if (priv->cec)
i2c_unregister_device(priv->cec); i2c_unregister_device(priv->cec);
drm_i2c_encoder_destroy(encoder);
kfree(priv); kfree(priv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment