From: Andrzej Hajda Date: Thu, 28 Apr 2016 09:58:48 +0000 (+0200) Subject: drm/panel/s6e3ha2: fix frequency calibration on 1440p displays X-Git-Tag: accepted/tizen/common/20161219.151653~408 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cc7a3fd1f3b0575f8eb7f58cfa5ef0369143a93;p=platform%2Fkernel%2Flinux-exynos.git drm/panel/s6e3ha2: fix frequency calibration on 1440p displays The driver support 1440p and 1600p displays, to support both models correctly it should send different frequency calibration sequence. Signed-off-by: Andrzej Hajda Signed-off-by: Marek Szyprowski Change-Id: Ic38d4eb357609be0d1a67c655c5c110559b08bd3 --- diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c index ab1e06e..7d1abad 100644 --- a/drivers/gpu/drm/panel/panel-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-s6e3ha2.c @@ -227,10 +227,13 @@ unsigned char VINT_TABLE[VINT_STATUS_MAX] = { 0x1D, 0x1E, 0x1F, 0x20, 0x21 }; +enum s6e3ha2_model { MODEL_1440, MODEL_1600 }; + struct s6e3ha2 { struct device *dev; struct drm_panel panel; struct backlight_device *bl_dev; + enum s6e3ha2_model model; struct regulator_bulk_data supplies[2]; struct gpio_desc *reset_gpio; @@ -315,13 +318,17 @@ static void s6e3ha2_single_dsi_set2(struct s6e3ha2 *ctx) static void s6e3ha2_freq_calibration(struct s6e3ha2 *ctx) { s6e3ha2_dcs_write_seq_static(ctx, 0xfd, 0x1c); - s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); + if (ctx->model != MODEL_1440) + s6e3ha2_dcs_write_seq_static(ctx, 0xf2, 0x67, 0x40, 0xc5); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20, 0x39); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0xa0); s6e3ha2_dcs_write_seq_static(ctx, 0xfe, 0x20); - s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, - 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5 - ); + if (ctx->model == MODEL_1440) + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x12, 0x62, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); + else + s6e3ha2_dcs_write_seq_static(ctx, 0xce, 0x03, 0x3b, 0x14, 0x6d, + 0x40, 0x80, 0xc0, 0x28, 0x28, 0x28, 0x28, 0x39, 0xc5); } static void s6e3ha2_aor_control(struct s6e3ha2 *ctx) @@ -655,6 +662,19 @@ static int s6e3ha2_parse_dt(struct s6e3ha2 *ctx) if (ret < 0) return ret; + switch (ctx->vm.hactive) { + case 1440: + ctx->model = MODEL_1440; + break; + case 1600: + ctx->model = MODEL_1600; + break; + default: + dev_err(dev, "Unsupported panel resolution: %dx%d\n", + ctx->vm.hactive, ctx->vm.vactive); + return -EINVAL; + } + of_property_read_u32(np, "panel-width-mm", &ctx->width_mm); of_property_read_u32(np, "panel-height-mm", &ctx->height_mm);