summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2016-09-06 15:45:08 +0200
committerInki Dae <inki.dae@samsung.com>2016-09-22 01:08:34 -0700
commit40cb63d1f64807494af8477f4246be0f6ace4829 (patch)
treea5521ec5e5c610cb1b3562a42b5aba1187bb25db
parent0ba9b4524a68a31d6657ad957391a391d51b1dac (diff)
downloadlinux-exynos-40cb63d1f64807494af8477f4246be0f6ace4829.tar.gz
linux-exynos-40cb63d1f64807494af8477f4246be0f6ace4829.tar.bz2
linux-exynos-40cb63d1f64807494af8477f4246be0f6ace4829.zip
drm/panel/s6e3ha2: use Dynamic AID tables
The patch adds support for dynamically generated gamma tables using dynamic_aid helpers. Change-Id: I2124abdda78169f3662f0658b5477e2e8f04ed33 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
-rw-r--r--drivers/gpu/drm/panel/panel-s6e3ha2.c390
1 files changed, 195 insertions, 195 deletions
diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c
index f3b622a28b88..a0a62e2a86d1 100644
--- a/drivers/gpu/drm/panel/panel-s6e3ha2.c
+++ b/drivers/gpu/drm/panel/panel-s6e3ha2.c
@@ -20,15 +20,15 @@
#include <video/of_videomode.h>
#include <video/videomode.h>
+#include "samsung-dynamic_aid.h"
+
+#define LDI_MTP_REG 0xc8
+#define LDI_GAMMODE1 0xca
+
#define MIN_BRIGHTNESS 0
#define MAX_BRIGHTNESS 100
#define DEFAULT_BRIGHTNESS 80
-#define MIN_GAMMA 2
-#define MAX_GAMMA 350
-#define NUM_GAMMA_STEPS 46
-#define GAMMA_CMD_CNT 35
-
static const u8 MDNIE_6500K[] = {
0xec, 0x98, 0x24, 0x10, 0x14, 0xb3, 0x01, 0x0e, 0x01, 0x00,
0x66, 0xfa, 0x2d, 0x03, 0x96, 0x02, 0xff, 0x00, 0x00, 0x07,
@@ -67,191 +67,162 @@ static const u8 MDNIE_BYPASS[] = {
0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00,
};
-static const u8 gamma_tbl[NUM_GAMMA_STEPS][GAMMA_CMD_CNT] = {
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x82, 0x83,
- 0x85, 0x88, 0x8b, 0x8b, 0x84, 0x88, 0x82, 0x82, 0x89, 0x86, 0x8c,
- 0x94, 0x84, 0xb1, 0xaf, 0x8e, 0xcf, 0xad, 0xc9, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x84, 0x84,
- 0x85, 0x87, 0x8b, 0x8a, 0x84, 0x88, 0x82, 0x82, 0x89, 0x86, 0x8a,
- 0x93, 0x84, 0xb0, 0xae, 0x8e, 0xc9, 0xa8, 0xc5, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x8a, 0x8a, 0x84, 0x88, 0x81, 0x84, 0x8a, 0x88, 0x8a,
- 0x91, 0x84, 0xb1, 0xae, 0x8b, 0xd5, 0xb2, 0xcc, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x8a, 0x8a, 0x84, 0x87, 0x81, 0x84, 0x8a, 0x87, 0x8a,
- 0x91, 0x85, 0xae, 0xac, 0x8a, 0xc3, 0xa3, 0xc0, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x85, 0x85,
- 0x86, 0x85, 0x88, 0x89, 0x84, 0x89, 0x82, 0x84, 0x87, 0x85, 0x8b,
- 0x91, 0x88, 0xad, 0xab, 0x8a, 0xb7, 0x9b, 0xb6, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x89, 0x8a, 0x84, 0x89, 0x83, 0x83, 0x86, 0x84, 0x8b,
- 0x90, 0x84, 0xb0, 0xae, 0x8b, 0xce, 0xad, 0xc8, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x87, 0x89, 0x8a, 0x83, 0x87, 0x82, 0x85, 0x88, 0x87, 0x89,
- 0x8f, 0x84, 0xac, 0xaa, 0x89, 0xb1, 0x98, 0xaf, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x88, 0x89, 0x84, 0x88, 0x83, 0x82, 0x85, 0x84, 0x8c,
- 0x91, 0x86, 0xac, 0xaa, 0x89, 0xc2, 0xa5, 0xbd, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x85, 0x87, 0x89, 0x8a, 0x83, 0x87, 0x82, 0x85, 0x88, 0x87, 0x88,
- 0x8b, 0x82, 0xad, 0xaa, 0x8a, 0xc2, 0xa5, 0xbd, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x89, 0x87, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x87, 0x89, 0x84, 0x88, 0x83, 0x82, 0x85, 0x84, 0x8a,
- 0x8e, 0x84, 0xae, 0xac, 0x89, 0xda, 0xb7, 0xd0, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x85, 0x86, 0x87, 0x89, 0x84, 0x88, 0x83, 0x80, 0x83, 0x82, 0x8b,
- 0x8e, 0x85, 0xac, 0xaa, 0x89, 0xc8, 0xaa, 0xc1, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x85, 0x86, 0x87, 0x89, 0x81, 0x85, 0x81, 0x84, 0x86, 0x84, 0x8c,
- 0x8c, 0x84, 0xa9, 0xa8, 0x87, 0xa3, 0x92, 0xa1, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x85, 0x86, 0x87, 0x89, 0x84, 0x86, 0x83, 0x80, 0x83, 0x81, 0x8c,
- 0x8d, 0x84, 0xaa, 0xaa, 0x89, 0xce, 0xaf, 0xc5, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x85, 0x86, 0x87, 0x89, 0x81, 0x83, 0x80, 0x83, 0x85, 0x85, 0x8c,
- 0x8c, 0x84, 0xa8, 0xa8, 0x88, 0xb5, 0x9f, 0xb0, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x86, 0x86, 0x87, 0x88, 0x81, 0x83, 0x80, 0x83, 0x85, 0x85, 0x8c,
- 0x8b, 0x84, 0xab, 0xa8, 0x86, 0xd4, 0xb4, 0xc9, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x86, 0x86, 0x87, 0x88, 0x81, 0x83, 0x80, 0x84, 0x84, 0x85, 0x8b,
- 0x8a, 0x83, 0xa6, 0xa5, 0x84, 0xbb, 0xa4, 0xb3, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x84, 0x84,
- 0x86, 0x85, 0x86, 0x86, 0x82, 0x85, 0x81, 0x82, 0x83, 0x84, 0x8e,
- 0x8b, 0x83, 0xa4, 0xa3, 0x8a, 0xa1, 0x93, 0x9d, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x82, 0x82, 0x84, 0x8e,
- 0x8b, 0x83, 0xa4, 0xa2, 0x86, 0xc1, 0xa9, 0xb7, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x82, 0x82, 0x84, 0x8d,
- 0x89, 0x82, 0xa2, 0xa1, 0x84, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xb8, 0x00, 0xc3, 0x00, 0xb1, 0x88, 0x86, 0x87, 0x83, 0x83,
- 0x85, 0x86, 0x87, 0x87, 0x82, 0x85, 0x81, 0x83, 0x83, 0x85, 0x8c,
- 0x87, 0x7f, 0xa2, 0x9d, 0x88, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xbb, 0x00, 0xc5, 0x00, 0xb4, 0x87, 0x86, 0x86, 0x84, 0x83,
- 0x86, 0x87, 0x87, 0x87, 0x80, 0x82, 0x7f, 0x86, 0x86, 0x88, 0x8a,
- 0x84, 0x7e, 0x9d, 0x9c, 0x82, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xbd, 0x00, 0xc7, 0x00, 0xb7, 0x87, 0x85, 0x85, 0x84, 0x83,
- 0x86, 0x86, 0x86, 0x88, 0x81, 0x83, 0x80, 0x83, 0x84, 0x85, 0x8a,
- 0x85, 0x7e, 0x9c, 0x9b, 0x85, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xc0, 0x00, 0xca, 0x00, 0xbb, 0x87, 0x86, 0x85, 0x83, 0x83,
- 0x85, 0x86, 0x86, 0x88, 0x81, 0x83, 0x80, 0x84, 0x85, 0x86, 0x89,
- 0x83, 0x7d, 0x9c, 0x99, 0x87, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xc4, 0x00, 0xcd, 0x00, 0xbe, 0x87, 0x86, 0x85, 0x83, 0x83,
- 0x86, 0x85, 0x85, 0x87, 0x81, 0x82, 0x80, 0x82, 0x82, 0x83, 0x8a,
- 0x85, 0x7f, 0x9f, 0x9b, 0x86, 0xb4, 0xa1, 0xac, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xc7, 0x00, 0xd0, 0x00, 0xc2, 0x87, 0x85, 0x85, 0x83, 0x82,
- 0x85, 0x85, 0x85, 0x86, 0x82, 0x83, 0x80, 0x82, 0x82, 0x84, 0x87,
- 0x86, 0x80, 0x9e, 0x9a, 0x87, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xca, 0x00, 0xd2, 0x00, 0xc5, 0x87, 0x85, 0x84, 0x82, 0x82,
- 0x84, 0x85, 0x85, 0x86, 0x81, 0x82, 0x7f, 0x82, 0x82, 0x84, 0x88,
- 0x86, 0x81, 0x9d, 0x98, 0x86, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xce, 0x00, 0xd6, 0x00, 0xca, 0x86, 0x85, 0x84, 0x83, 0x83,
- 0x85, 0x84, 0x84, 0x85, 0x81, 0x82, 0x80, 0x81, 0x81, 0x82, 0x89,
- 0x86, 0x81, 0x9c, 0x97, 0x86, 0xa7, 0x98, 0xa1, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xd1, 0x00, 0xd9, 0x00, 0xce, 0x86, 0x84, 0x83, 0x83, 0x82,
- 0x85, 0x85, 0x85, 0x86, 0x81, 0x83, 0x81, 0x82, 0x82, 0x83, 0x86,
- 0x83, 0x7f, 0x99, 0x95, 0x86, 0xbb, 0xa4, 0xb3, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xd4, 0x00, 0xdb, 0x00, 0xd1, 0x86, 0x85, 0x83, 0x83, 0x82,
- 0x85, 0x84, 0x84, 0x85, 0x80, 0x83, 0x82, 0x80, 0x80, 0x81, 0x87,
- 0x84, 0x81, 0x98, 0x93, 0x85, 0xae, 0x9c, 0xa8, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xd8, 0x00, 0xde, 0x00, 0xd6, 0x86, 0x84, 0x83, 0x81, 0x81,
- 0x83, 0x85, 0x85, 0x85, 0x82, 0x83, 0x81, 0x81, 0x81, 0x83, 0x86,
- 0x84, 0x80, 0x98, 0x91, 0x85, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xdc, 0x00, 0xe2, 0x00, 0xda, 0x85, 0x84, 0x83, 0x82, 0x82,
- 0x84, 0x84, 0x84, 0x85, 0x81, 0x82, 0x82, 0x80, 0x80, 0x81, 0x83,
- 0x82, 0x7f, 0x99, 0x93, 0x86, 0x94, 0x8b, 0x92, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xdf, 0x00, 0xe5, 0x00, 0xde, 0x85, 0x84, 0x82, 0x82, 0x82,
- 0x84, 0x83, 0x83, 0x84, 0x81, 0x81, 0x80, 0x83, 0x82, 0x84, 0x82,
- 0x81, 0x7f, 0x99, 0x92, 0x86, 0x7b, 0x7b, 0x7c, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x83, 0x83, 0x84, 0x80, 0x81, 0x80, 0x83, 0x83, 0x84, 0x80,
- 0x81, 0x7c, 0x99, 0x92, 0x87, 0xa1, 0x93, 0x9d, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x85, 0x84, 0x83, 0x81, 0x81,
- 0x82, 0x82, 0x82, 0x83, 0x80, 0x81, 0x80, 0x81, 0x80, 0x82, 0x83,
- 0x82, 0x80, 0x91, 0x8d, 0x83, 0x9a, 0x90, 0x96, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x83, 0x83, 0x84, 0x80, 0x81, 0x80, 0x81, 0x80, 0x82, 0x83,
- 0x81, 0x7f, 0x91, 0x8c, 0x82, 0x8d, 0x88, 0x8b, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x83, 0x83, 0x83, 0x82, 0x82, 0x81, 0x81, 0x80, 0x82, 0x82,
- 0x82, 0x7f, 0x94, 0x89, 0x84, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x83, 0x83, 0x83, 0x82, 0x82, 0x81, 0x81, 0x80, 0x82, 0x83,
- 0x82, 0x7f, 0x91, 0x85, 0x81, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x83, 0x83, 0x83, 0x80, 0x80, 0x7f, 0x83, 0x82, 0x84, 0x83,
- 0x82, 0x7f, 0x90, 0x84, 0x81, 0x9a, 0x90, 0x96, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe4, 0x00, 0xe9, 0x00, 0xe3, 0x84, 0x83, 0x82, 0x80, 0x80,
- 0x82, 0x83, 0x83, 0x83, 0x80, 0x80, 0x7f, 0x80, 0x80, 0x81, 0x81,
- 0x82, 0x83, 0x7e, 0x80, 0x7c, 0xa4, 0x97, 0x9f, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xe9, 0x00, 0xec, 0x00, 0xe8, 0x84, 0x83, 0x82, 0x81, 0x81,
- 0x82, 0x82, 0x82, 0x83, 0x7f, 0x7f, 0x7f, 0x81, 0x80, 0x82, 0x83,
- 0x83, 0x84, 0x79, 0x7c, 0x79, 0xb1, 0xa0, 0xaa, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xed, 0x00, 0xf0, 0x00, 0xec, 0x83, 0x83, 0x82, 0x80, 0x80,
- 0x81, 0x82, 0x82, 0x82, 0x7f, 0x7f, 0x7e, 0x81, 0x81, 0x82, 0x80,
- 0x81, 0x81, 0x84, 0x84, 0x83, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xf1, 0x00, 0xf4, 0x00, 0xf1, 0x83, 0x82, 0x82, 0x80, 0x80,
- 0x81, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x7d,
- 0x7e, 0x7f, 0x84, 0x84, 0x83, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf5, 0x82, 0x82, 0x81, 0x80, 0x80,
- 0x80, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x7f, 0x7f, 0x7f, 0x82,
- 0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x00, 0xfa, 0x00, 0xfb, 0x00, 0xfa, 0x81, 0x81, 0x81, 0x80, 0x80,
- 0x80, 0x82, 0x82, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 },
- { 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00 }
+#define S6E3HA2_VREG_OUT 6400 /* mV */
+
+static const int s6e3ha2_nits[] = {
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20,
+ 21, 22, 24, 25, 27, 29, 30, 32, 34, 37, 39, 41, 44, 47, 50, 53,
+ 56, 60, 64, 68, 72, 77, 82, 87, 93, 98, 105, 111, 119, 126, 134,
+ 143, 152, 162, 172, 183, 195, 207, 220, 234, 249, 265, 282, 300,
+ 316, 333, 360, 360
+};
+#define S6E3HA2_NITS_COUNT ARRAY_SIZE(s6e3ha2_nits)
+
+static const int s6e3ha2_brightness_base[S6E3HA2_NITS_COUNT] = {
+ 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
+ 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
+ 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
+ 113, 122, 128, 136, 145, 155, 164, 175, 187, 196, 208, 223, 234,
+ 253, 253, 253, 253, 253, 253, 253, 268, 283, 300, 319, 337, 360,
+ 360
+};
+
+static const int s6e3ha2_gradation[S6E3HA2_NITS_COUNT][DAID_GCP_COUNT] = {
+ {0, 4, 27, 35, 33, 27, 22, 17, 9, 0},
+ {0, 4, 29, 29, 25, 17, 17, 12, 8, 0},
+ {0, 23, 26, 24, 21, 19, 16, 12, 7, 0},
+ {0, 21, 22, 20, 17, 15, 13, 9, 5, 0},
+ {0, 21, 21, 19, 16, 14, 12, 10, 6, 0},
+ {0, 21, 20, 18, 14, 13, 11, 9, 5, 0},
+ {0, 19, 19, 17, 13, 12, 10, 8, 4, 0},
+ {0, 18, 19, 16, 13, 12, 9, 7, 4, 0},
+ {0, 20, 18, 15, 12, 10, 9, 7, 4, 0},
+ {0, 16, 17, 15, 11, 10, 8, 7, 4, 0},
+ {0, 17, 16, 14, 11, 10, 8, 6, 4, 0},
+ {0, 17, 16, 14, 11, 10, 7, 6, 4, 0},
+ {0, 17, 15, 13, 10, 9, 6, 5, 4, 0},
+ {0, 15, 15, 12, 10, 9, 7, 6, 4, 0},
+ {0, 16, 14, 12, 9, 8, 6, 5, 4, 0},
+ {0, 13, 14, 11, 9, 8, 6, 5, 4, 0},
+ {0, 14, 13, 10, 8, 7, 6, 5, 4, 0},
+ {0, 11, 13, 10, 8, 7, 5, 5, 4, 0},
+ {0, 10, 13, 10, 7, 7, 5, 5, 4, 0},
+ {0, 11, 12, 9, 7, 6, 5, 5, 4, 0},
+ {0, 12, 11, 8, 6, 6, 5, 4, 4, 0},
+ {0, 11, 11, 8, 6, 6, 5, 5, 4, 0},
+ {0, 12, 10, 8, 6, 5, 4, 4, 4, 0},
+ {0, 9, 10, 8, 6, 5, 4, 4, 4, 0},
+ {0, 8, 10, 8, 5, 5, 4, 5, 3, 0},
+ {0, 10, 9, 7, 5, 5, 4, 4, 4, 0},
+ {0, 7, 9, 7, 5, 4, 4, 4, 4, 0},
+ {0, 8, 8, 6, 4, 4, 3, 4, 4, 0},
+ {0, 8, 8, 6, 5, 4, 4, 4, 3, 0},
+ {0, 10, 7, 6, 4, 4, 3, 4, 4, 0},
+ {0, 8, 7, 6, 4, 4, 3, 4, 3, 0},
+ {0, 5, 7, 6, 4, 3, 3, 4, 3, 0},
+ {0, 8, 6, 5, 3, 4, 3, 4, 3, 0},
+ {0, 6, 6, 5, 3, 3, 3, 4, 3, 0},
+ {0, 8, 5, 5, 3, 3, 3, 4, 3, 0},
+ {0, 6, 5, 5, 3, 3, 3, 4, 3, 0},
+ {0, 4, 5, 4, 2, 3, 2, 4, 3, 0},
+ {0, 6, 4, 4, 2, 3, 2, 3, 3, 0},
+ {0, 4, 4, 4, 2, 3, 2, 3, 3, 0},
+ {0, 2, 4, 3, 2, 3, 2, 3, 3, 0},
+ {0, 2, 4, 3, 3, 2, 2, 3, 2, 0},
+ {0, 1, 4, 3, 2, 2, 2, 2, 1, 0},
+ {0, 1, 4, 3, 2, 2, 3, 3, 2, 0},
+ {0, 5, 3, 3, 2, 2, 3, 4, 2, 0},
+ {0, 4, 3, 3, 2, 2, 2, 3, 1, 0},
+ {0, 2, 3, 3, 1, 1, 2, 2, 0, 0},
+ {0, 4, 3, 3, 2, 2, 3, 4, 0, 0},
+ {0, 6, 3, 3, 2, 2, 3, 3, -2, 0},
+ {0, 5, 3, 3, 1, 2, 2, 3, -1, 0},
+ {0, 0, 3, 2, 1, 2, 3, 2, 0, 0},
+ {0, 2, 3, 2, 2, 2, 3, 3, 0, 0},
+ {0, 0, 2, 2, 2, 2, 3, 3, 0, 0},
+ {0, 3, 2, 1, 2, 1, 2, 2, 0, 0},
+ {0, 2, 1, 1, 1, 1, 2, 3, 1, 0},
+ {0, 1, 1, 1, 1, 1, 2, 2, 0, 0},
+ {0, 0, 1, 0, 1, 1, 1, 1, -1, 0},
+ {0, 0, 1, 0, 1, 1, 1, 1, -1, 0},
+ {0, 2, 1, 0, 1, 0, 1, 1, -1, 0},
+ {0, 2, 0, 0, 0, 0, 1, 1, 0, 0},
+ {0, 3, 0, 1, 0, 0, 1, 1, 1, 0},
+ {0, 0, 0, 0, 0, 0, 1, 1, 1, 0},
+ {0, 0, 0, 0, 0, 0, 1, 1, 1, 0},
+ {0, 0, 0, 0, -1, 0, 1, 0, 1, 0},
+ {0, 0, 0, -1, -1, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+};
+
+static const daid_rgb s6e3ha2_color_ofs[S6E3HA2_NITS_COUNT][DAID_GCP_COUNT] = {
+ {{0, 0, 0}, {0, 0, 0}, {21, -2, 1}, {2, 2, -8}, {-7, -1, -5}, {-22, 0, -14}, {-14, -1, -6}, {-5, 0, -3}, {-1, 1, 0}, {-3, 4, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {21, -2, 1}, {-3, 1, -8}, {-4, -1, -3}, {-26, -1, -15}, {-10, 1, -4}, {-4, 1, -1}, {-2, -1, -1}, {-3, 3, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {10, -2, -6}, {-7, 2, -10}, {-10, 4, -4}, {-18, -1, -8}, {-9, 1, -5}, {-3, 1, -1}, {-2, -1, -1}, {0, 4, 1}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 0, -6}, {-8, 2, -8}, {-12, 1, -6}, {-13, 1, -3}, {-7, 1, -4}, {-3, 1, -1}, {-1, 1, 0}, {0, 3, 1}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 2, -7}, {-7, 2, -8}, {-12, 2, -6}, {-11, 2, -2}, {-6, 1, -4}, {-3, 1, -1}, {-1, -1, -1}, {-2, 1, -2}},
+ {{0, 0, 0}, {0, 0, 0}, {4, 4, -9}, {-6, 2, -8}, {-11, 2, -6}, {-9, 2, -3}, {-6, 1, -4}, {-3, 1, -1}, {0, 0, 0}, {-1, 1, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {4, 5, -11}, {-7, 1, -9}, {-12, 2, -7}, {-7, 2, -3}, {-5, 2, -3}, {-2, 1, 0}, {-2, 1, 0}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 1, -14}, {-7, 4, -9}, {-10, 1, -7}, {-7, 3, -4}, {-5, 2, -2}, {-2, 1, 0}, {-1, 1, 0}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 2, -14}, {-7, 3, -9}, {-9, 1, -7}, {-7, 3, -4}, {-5, 2, -2}, {-2, 1, 0}, {0, 1, 1}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {1, 5, -14}, {-7, 2, -9}, {-9, 1, -7}, {-7, 2, -4}, {-3, 2, -2}, {-2, 1, 0}, {0, 1, 1}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {2, 5, -13}, {-6, 3, -9}, {-7, 1, -6}, {-7, 2, -4}, {-3, 2, -2}, {-1, 1, 0}, {0, 1, 1}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {1, 6, -14}, {-7, 2, -11}, {-7, 1, -6}, {-7, 2, -4}, {-2, 2, -2}, {-1, 1, 0}, {-1, 0, 0}, {0, 0, -1}},
+ {{0, 0, 0}, {0, 0, 0}, {5, 8, -13}, {-6, 5, -11}, {-5, 1, -4}, {-7, 1, -4}, {-2, 2, -2}, {-1, 1, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 3, -14}, {-6, 5, -11}, {-5, 1, -4}, {-6, 1, -4}, {-2, 2, -2}, {-1, 1, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {6, 10, -13}, {-8, 2, -11}, {-5, 1, -4}, {-6, 1, -4}, {-2, 2, -2}, {-1, 1, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {3, 6, -13}, {-7, 3, -11}, {-5, 1, -4}, {-6, 1, -3}, {-2, 2, -2}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {8, 9, -13}, {-7, 3, -11}, {-5, 1, -5}, {-6, 1, -3}, {-2, 2, -2}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {6, 5, -16}, {-7, 4, -10}, {-6, 0, -6}, {-6, 1, -3}, {-2, 2, -1}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {1, 3, -17}, {-7, 3, -8}, {-5, 1, -5}, {-5, 1, -3}, {-2, 2, 0}, {-1, 0, -2}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {5, 7, -15}, {-5, 3, -8}, {-5, 2, -5}, {-5, 1, -2}, {-2, 2, 0}, {-1, 0, -2}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {6, 8, -15}, {-3, 5, -10}, {-5, 2, -4}, {-3, 1, -2}, {-2, 2, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {5, 7, -15}, {-5, 4, -10}, {-5, 2, -4}, {-3, 1, -2}, {-2, 2, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {11, 12, -15}, {-5, 2, -10}, {-5, 1, -4}, {-3, 1, -2}, {-2, 2, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {8, 10, -16}, {-5, 2, -9}, {-5, 1, -5}, {-3, 0, -2}, {-2, 2, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {7, 9, -16}, {-7, -1, -9}, {-2, 1, -4}, {-3, 2, -1}, {-2, 1, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {11, 12, -14}, {-2, 2, -9}, {-3, 0, -5}, {-3, 2, 0}, {-2, 1, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {7, 8, -16}, {-4, 1, -9}, {-3, 0, -5}, {-2, 2, 1}, {-1, 1, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {7, 9, -16}, {1, 5, -7}, {-3, 0, -5}, {-2, 2, 1}, {-1, 1, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {8, 9, -15}, {0, 2, -8}, {-3, 0, -5}, {-2, 2, 1}, {-1, 1, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {15, 16, -12}, {-1, 2, -9}, {-3, 0, -5}, {-2, 2, 1}, {-1, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {13, 14, -12}, {0, 2, -8}, {-5, -2, -7}, {-2, 2, 1}, {-1, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 12, -14}, {1, 0, -9}, {-4, -2, -7}, {-2, 2, 1}, {-1, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {12, 14, -12}, {3, 3, -8}, {-2, 1, -5}, {-2, 0, 1}, {-1, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 12, -13}, {3, 2, -8}, {-2, 1, -4}, {-2, 0, 0}, {-1, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {19, 18, -11}, {3, 1, -8}, {-2, 1, -4}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {14, 15, -13}, {2, 0, -9}, {-1, 0, -4}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {7, 8, -11}, {7, 3, -8}, {0, 2, -2}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {13, 12, -11}, {7, 3, -8}, {0, 1, -2}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {11, 11, -13}, {6, 1, -9}, {0, 1, -2}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {5, 3, -12}, {11, 4, -8}, {1, 2, -1}, {-2, 0, 0}, {-1, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {6, 6, -15}, {6, -1, -10}, {1, 2, -1}, {-2, 0, 0}, {0, 0, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {5, 5, -12}, {6, 0, -10}, {1, 2, -1}, {-2, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {4, 3, -10}, {3, -4, -12}, {1, 2, -1}, {-2, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {13, 10, -7}, {4, -2, -10}, {1, 1, -1}, {-1, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {17, 14, -3}, {-1, -3, -10}, {0, 0, -1}, {-1, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {16, 12, -4}, {0, -3, -9}, {0, 0, -1}, {-1, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {15, 11, -4}, {4, 0, -6}, {0, 0, -1}, {-1, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {11, 8, -4}, {-1, -4, -9}, {0, 0, -1}, {-1, 1, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 6, -5}, {0, -3, -7}, {0, 0, -1}, {-2, 1, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {10, 4, -5}, {2, -1, -5}, {0, 0, 0}, {0, 1, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {15, 10, -1}, {-3, -4, -7}, {0, 0, 0}, {-1, 0, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {15, 9, -1}, {-1, -2, -5}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {15, 9, 0}, {0, 0, -5}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {13, 9, 0}, {0, -1, -4}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {13, 8, -1}, {0, -2, -5}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {11, 1, -2}, {4, 3, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {8, -3, -5}, {5, 3, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {7, -4, -5}, {5, 3, -1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}},
+ {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}
};
unsigned char VINT_TABLE[] = {
@@ -291,6 +262,8 @@ struct s6e3ha2 {
* it's possible to access Panel device by VR sysfs interface.
*/
struct mutex lock;
+
+ u8 gammodes[S6E3HA2_NITS_COUNT][DAID_PARAM_COUNT];
};
static inline struct s6e3ha2 *panel_to_s6e3ha2(struct drm_panel *panel)
@@ -485,6 +458,33 @@ static void s6e3ha2_te_start_setting(struct s6e3ha2 *ctx)
s6e3ha2_dcs_write_seq_static(ctx, 0xb9, 0x10, 0x09, 0xff, 0x00, 0x09);
}
+#define BITS(v, h, l) ((int)(GENMASK((h), (l)) & (v)) >> (l))
+
+static void s6e3ha2_calc_gammodes(struct s6e3ha2 *ctx)
+{
+ struct daid_cfg cfg = {
+ .vreg_out = S6E3HA2_VREG_OUT,
+ .nits = s6e3ha2_nits,
+ .nits_count = S6E3HA2_NITS_COUNT,
+ .nit_gct = 360,
+ .gradation = s6e3ha2_gradation,
+ .color_offset = s6e3ha2_color_ofs,
+ .brightness_base = s6e3ha2_brightness_base,
+ };
+ u8 mtp[44];
+
+ s6e3ha2_dcs_read(ctx, LDI_MTP_REG, mtp, ARRAY_SIZE(mtp));
+ if (ctx->error < 0)
+ return;
+
+ dev_dbg(ctx->dev, "MTP: %*ph\n", (int)ARRAY_SIZE(mtp), mtp);
+ dev_info(ctx->dev, "Manufacture date: %d-%02d-%02d %02d:%02d\n",
+ BITS(mtp[40], 7, 4) + 2011, BITS(mtp[40], 3, 0),
+ BITS(mtp[41], 4, 0), BITS(mtp[42], 4, 0), BITS(mtp[43], 5, 0));
+
+ daid_calc_gammodes(ctx->gammodes, &cfg, mtp);
+}
+
static void s6e3ha2_gamma_update(struct s6e3ha2 *ctx)
{
s6e3ha2_dcs_write_seq_static(ctx, 0xf7, 0x03);
@@ -540,16 +540,16 @@ static void s6e3ha2_set_vint(struct s6e3ha2 *ctx)
static unsigned int s6e3ha2_get_brightness_index(unsigned int brightness)
{
- return (brightness * (NUM_GAMMA_STEPS - 1)) / MAX_BRIGHTNESS;
+ return (brightness * (S6E3HA2_NITS_COUNT - 1)) / MAX_BRIGHTNESS;
}
static void s6e3ha2_update_gamma(struct s6e3ha2 *ctx, unsigned int brightness)
{
unsigned int index = s6e3ha2_get_brightness_index(brightness);
- char data[GAMMA_CMD_CNT + 1];
+ char data[DAID_PARAM_COUNT + 1];
- data[0] = 0xca;
- memcpy(data + 1, gamma_tbl[index], GAMMA_CMD_CNT);
+ data[0] = LDI_GAMMODE1;
+ memcpy(data + 1, ctx->gammodes[index], DAID_PARAM_COUNT);
s6e3ha2_dcs_write(ctx, data, ARRAY_SIZE(data));
s6e3ha2_gamma_update(ctx);
@@ -665,6 +665,7 @@ static void s6e3ha2_panel_init(struct s6e3ha2 *ctx)
s6e3ha2_test_key_on_fc(ctx);
s6e3ha2_freq_calibration(ctx);
s6e3ha2_test_key_off_fc(ctx);
+ s6e3ha2_calc_gammodes(ctx);
s6e3ha2_test_key_off_f0(ctx);
}
@@ -794,7 +795,6 @@ static int s6e3ha2_enable(struct drm_panel *panel)
s6e3ha2_dcs_write_seq_static(ctx, MIPI_DCS_SET_TEAR_ON, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
s6e3ha2_test_key_on_f0(ctx);
-
s6e3ha2_test_key_on_fc(ctx);
s6e3ha2_touch_hsync_on1(ctx);
s6e3ha2_pentile_control(ctx);