summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panel
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-09-09 15:12:42 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:52:55 +0900
commit389458ab76b6501360d52adeb0bb39799007f94e (patch)
treef1e96f85c5526edccdd416784a78f83b4e8196fd /drivers/gpu/drm/panel
parentc03b5017d6d0aa4b8318c299600fc3a7c1e6c114 (diff)
drm/panel/s6e3ha2: refactor temperature setting function
Function setting temperature was named incorrectly and split into two functions. The patch fixes it and makes the code more readable. Change-Id: If3588d56b4c5a9aaae833ff84b96ee47171f2bb4 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/panel')
-rw-r--r--drivers/gpu/drm/panel/panel-s6e3ha2.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c
index 63643f74a46f..bfc87f820c10 100644
--- a/drivers/gpu/drm/panel/panel-s6e3ha2.c
+++ b/drivers/gpu/drm/panel/panel-s6e3ha2.c
@@ -786,14 +786,12 @@ static void s6e3ha2_acl_off_opr(struct s6e3ha2 *ctx)
s6e3ha2_dcs_write_seq_static(ctx, LDI_OPRCTL, 0x40);
}
-static void s6e3ha2_test_global(struct s6e3ha2 *ctx)
+static void s6e3ha2_set_temperature(struct s6e3ha2 *ctx, int temp)
{
- s6e3ha2_dcs_write_seq_static(ctx, LDI_G_PARA, 0x07);
-}
+ s8 t = clamp(temp, -127, 127);
-static void s6e3ha2_test(struct s6e3ha2 *ctx)
-{
- s6e3ha2_dcs_write_seq_static(ctx, LDI_TSETCTL, 0x19);
+ s6e3ha2_dcs_write_seq_static(ctx, LDI_G_PARA, 0x07);
+ s6e3ha2_dcs_write_seq(ctx, LDI_TSETCTL, t);
}
static void s6e3ha2_touch_hsync_on1(struct s6e3ha2 *ctx) {
@@ -1212,10 +1210,7 @@ static int s6e3ha2_enable(struct drm_panel *panel)
s6e3ha2_acl_off(ctx);
s6e3ha2_acl_off_opr(ctx);
s6e3ha2_hbm_off(ctx);
-
- /* elvss temp compensation */
- s6e3ha2_test_global(ctx);
- s6e3ha2_test(ctx);
+ s6e3ha2_set_temperature(ctx, 25);
s6e3ha2_test_key_off_f0(ctx);
s6e3ha2_dcs_write_seq_static(ctx, MIPI_DCS_SET_DISPLAY_ON);