drm/i2c/ch7006: Don't use POWER_LEVEL_FULL_POWER_OFF on early chip versions.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 5 Aug 2010 20:57:08 +0000 (22:57 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 9 Aug 2010 05:16:23 +0000 (15:16 +1000)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/i2c/ch7006_drv.c
drivers/gpu/drm/i2c/ch7006_mode.c
drivers/gpu/drm/i2c/ch7006_priv.h

index 833b35f44a7705a336d432940c393016de7cd77d..08792a740f188b1bae1d8a4acf3c7d30d7c89cbb 100644 (file)
@@ -470,6 +470,7 @@ static int ch7006_encoder_init(struct i2c_client *client,
        priv->hmargin = 50;
        priv->vmargin = 50;
        priv->last_dpms = -1;
+       priv->chip_version = ch7006_read(client, CH7006_VERSION_ID);
 
        if (ch7006_tv_norm) {
                for (i = 0; i < NUM_TV_NORMS; i++) {
index e447dfb63890c91d948b634a27084ba0ba784293..c860f24a5afc5281bccaf7ddcfccf6e50bb2dfea 100644 (file)
@@ -316,7 +316,10 @@ void ch7006_setup_power_state(struct drm_encoder *encoder)
                }
 
        } else {
-               *power |= bitfs(CH7006_POWER_LEVEL, FULL_POWER_OFF);
+               if (priv->chip_version >= 0x20)
+                       *power |= bitfs(CH7006_POWER_LEVEL, FULL_POWER_OFF);
+               else
+                       *power |= bitfs(CH7006_POWER_LEVEL, POWER_OFF);
        }
 }
 
index 1c6d2e3bd96f154b636f5b15b34766565143ebd1..17667b7d57e78b130836751f03c27d0f138cc8e7 100644 (file)
@@ -95,6 +95,7 @@ struct ch7006_priv {
        int flicker;
        int scale;
 
+       int chip_version;
        int last_dpms;
 };