Skip to content

Commit c93ebb4

Browse files
curroBen Skeggs
authored andcommitted
drm/i2c/ch7006: Don't use POWER_LEVEL_FULL_POWER_OFF on early chip versions.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 1849719 commit c93ebb4

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/gpu/drm/i2c/ch7006_drv.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ static int ch7006_encoder_init(struct i2c_client *client,
470470
priv->hmargin = 50;
471471
priv->vmargin = 50;
472472
priv->last_dpms = -1;
473+
priv->chip_version = ch7006_read(client, CH7006_VERSION_ID);
473474

474475
if (ch7006_tv_norm) {
475476
for (i = 0; i < NUM_TV_NORMS; i++) {

‎drivers/gpu/drm/i2c/ch7006_mode.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ void ch7006_setup_power_state(struct drm_encoder *encoder)
316316
}
317317

318318
} else {
319-
*power |= bitfs(CH7006_POWER_LEVEL, FULL_POWER_OFF);
319+
if (priv->chip_version >= 0x20)
320+
*power |= bitfs(CH7006_POWER_LEVEL, FULL_POWER_OFF);
321+
else
322+
*power |= bitfs(CH7006_POWER_LEVEL, POWER_OFF);
320323
}
321324
}
322325

‎drivers/gpu/drm/i2c/ch7006_priv.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ struct ch7006_priv {
9595
int flicker;
9696
int scale;
9797

98+
int chip_version;
9899
int last_dpms;
99100
};
100101

0 commit comments

Comments
 (0)