summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2022-10-23 18:30:05 -0700
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2022-10-23 18:30:05 -0700
commit958525371207e7efdab669f2d2f94719dc5affc1 (patch)
treee6a217c56aea31822c82001cea18c9dae9e723a4
parent5945481e13a862aa823bab73d63b757884e66775 (diff)
parentd398f69d3215794aa994686bdeee1b51951641f3 (diff)
downloadlynx-958525371207e7efdab669f2d2f94719dc5affc1.tar.gz
Merge android13-gs-pixel-5.10-tm-qpr2 into android13-gs-pixel-5.10-udc
SBMerger: 478053055 Change-Id: I32936146b9d018b87f5b2b252ce86396554ffbcf Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--display/panel-samsung-s6e3fc5.c105
-rw-r--r--dts/Makefile4
-rw-r--r--dts/gs201-lynx-charging.dtsi6
-rw-r--r--dts/gs201-lynx-dvt1_0-gain1.dts28
-rw-r--r--dts/gs201-lynx-wcharger.dtsi7
5 files changed, 103 insertions, 47 deletions
diff --git a/display/panel-samsung-s6e3fc5.c b/display/panel-samsung-s6e3fc5.c
index e3c80e2..d9e32b6 100644
--- a/display/panel-samsung-s6e3fc5.c
+++ b/display/panel-samsung-s6e3fc5.c
@@ -39,6 +39,7 @@ static const unsigned char PPS_SETTING[] = {
#define S6E3FC5_WRCTRLD_BCTRL_BIT 0x20
#define S6E3FC5_WRCTRLD_HBM_BIT 0xC0
#define S6E3FC5_WRCTRLD_LOCAL_HBM_BIT 0x10
+#define LHBM_RGB_RATIO_SIZE 3
static const u8 display_off[] = { 0x28 };
static const u8 display_on[] = { 0x29 };
@@ -49,6 +50,10 @@ static const u8 test_key_off_f1[] = { 0xF1, 0xA5, 0xA5 };
static const u8 freq_update[] = { 0xF7, 0x0F };
static const u8 new_gamma_ip_bypass[] = { 0x68, 0x01 };
static const u8 new_gamma_ip_enable[] = { 0x68, 0x02 };
+static const u32 lhbm_1300_1100_rgb_ratio[LHBM_RGB_RATIO_SIZE] = {922974324, 910436713, 898442180};
+static const u32 lhbm_990_1300_rgb_ratio[LHBM_RGB_RATIO_SIZE] = {1089563019, 1063348416, 1099934254};
+static const u32 lhbm_1208_1300_rgb_ratio[LHBM_RGB_RATIO_SIZE] = {1029306415, 1018581722, 1029205963};
+static const u32 lhbm_1280_1300_rgb_ratio[LHBM_RGB_RATIO_SIZE] = {1005012531, 1005714286, 1003953871};
static const struct exynos_dsi_cmd s6e3fc5_off_cmds[] = {
EXYNOS_DSI_CMD(display_off, 0),
@@ -171,34 +176,48 @@ static void s6e3fc5_update_lhbm_gamma(struct exynos_panel *ctx)
*/
struct s6e3fc5_panel *spanel = to_spanel(ctx);
u8 *gamma_cmd = spanel->local_hbm_gamma.hs_cmd;
- const u32 rgb_ratio[3] = {922974324, 910436713, 898442180};
+ const int *rgb_ratio = NULL;
const u8 rgb_offset[3][2] = {{1, 3}, {2, 4}, {2,5}};
u8 new_gamma_cmd[LHBM_GAMMA_CMD_SIZE] = {0};
u64 tmp;
int i;
u16 mask, shift;
- dev_info(ctx->dev, "%s: gamma_cmd(%02x %02x %02x %02x %02x)\n", __func__,
- gamma_cmd[1], gamma_cmd[2], gamma_cmd[3], gamma_cmd[4], gamma_cmd[5]);
- for (i = 0; i < ARRAY_SIZE(rgb_ratio); i++) {
- if (i % 2) {
- mask = 0xf0;
- shift = 4;
- } else {
- mask = 0x0f;
- shift = 0;
+ if (ctx->panel_rev < PANEL_REV_EVT1)
+ rgb_ratio = lhbm_1300_1100_rgb_ratio;
+ else if (ctx->panel_rev == PANEL_REV_EVT1)
+ rgb_ratio = lhbm_990_1300_rgb_ratio;
+ else if (ctx->panel_rev == PANEL_REV_EVT1_0_2)
+ rgb_ratio = lhbm_1208_1300_rgb_ratio;
+ else if (ctx->panel_rev == PANEL_REV_EVT1_1)
+ rgb_ratio = lhbm_1280_1300_rgb_ratio;
+
+ if (rgb_ratio) {
+ dev_info(ctx->dev, "%s: gamma_cmd(%02x %02x %02x %02x %02x)\n", __func__,
+ gamma_cmd[1], gamma_cmd[2], gamma_cmd[3], gamma_cmd[4], gamma_cmd[5]);
+ for (i = 0; i < LHBM_RGB_RATIO_SIZE ; i++) {
+ if (i % 2) {
+ mask = 0xf0;
+ shift = 4;
+ } else {
+ mask = 0x0f;
+ shift = 0;
+ }
+ tmp = ((gamma_cmd[rgb_offset[i][0]] & mask) >> shift) << 8 | gamma_cmd[rgb_offset[i][1]];
+ dev_dbg(ctx->dev, "%s: lhbm_gamma[%d] = %llu\n", __func__, i, tmp);
+ /* Round off and revert to original gamma value */
+ tmp = (tmp * rgb_ratio[i] + 500000000)/1000000000;
+ dev_dbg(ctx->dev, "%s: new lhbm_gamma[%d] = %llu\n", __func__, i, tmp);
+ new_gamma_cmd[rgb_offset[i][0]] |= ((tmp & 0xff00) >> 8) << shift;
+ new_gamma_cmd[rgb_offset[i][1]] |= tmp & 0xff;
}
- tmp = ((gamma_cmd[rgb_offset[i][0]] & mask) >> shift) << 8 | gamma_cmd[rgb_offset[i][1]];
- dev_dbg(ctx->dev, "%s: lhbm_gamma[%d] = %llu\n", __func__, i, tmp);
- /* Round off and revert to original gamma value */
- tmp = (tmp * rgb_ratio[i] + 500000000)/1000000000;
- dev_dbg(ctx->dev, "%s: new lhbm_gamma[%d] = %llu\n", __func__, i, tmp);
- new_gamma_cmd[rgb_offset[i][0]] |= ((tmp & 0xff00) >> 8) << shift;
- new_gamma_cmd[rgb_offset[i][1]] |= tmp & 0xff;
+ memcpy(&gamma_cmd[1], &new_gamma_cmd[1], LHBM_GAMMA_CMD_SIZE - 1);
+ dev_info(ctx->dev, "%s: new_gamma_cmd(%02x %02x %02x %02x %02x)\n", __func__,
+ gamma_cmd[1], gamma_cmd[2], gamma_cmd[3], gamma_cmd[4], gamma_cmd[5]);
+ dev_info(ctx->dev, "%s: rgb_ratio(%u %u %u)\n", __func__,
+ rgb_ratio[0], rgb_ratio[1], rgb_ratio[2]);
}
- memcpy(&gamma_cmd[1], &new_gamma_cmd[1], LHBM_GAMMA_CMD_SIZE - 1);
- dev_info(ctx->dev, "%s: new_gamma_cmd(%02x %02x %02x %02x %02x)\n", __func__,
- gamma_cmd[1], gamma_cmd[2], gamma_cmd[3], gamma_cmd[4], gamma_cmd[5]);
+
}
static void s6e3fc5_lhbm_gamma_read(struct exynos_panel *ctx)
@@ -250,8 +269,7 @@ static void s6e3fc5_lhbm_gamma_read(struct exynos_panel *ctx)
EXYNOS_DCS_WRITE_TABLE(ctx, test_key_off_f0);
- if (ctx->panel_rev < PANEL_REV_EVT1)
- s6e3fc5_update_lhbm_gamma(ctx);
+ s6e3fc5_update_lhbm_gamma(ctx);
}
static void s6e3fc5_lhbm_gamma_write(struct exynos_panel *ctx)
@@ -442,7 +460,7 @@ static void s6e3fc5_update_wrctrld(struct exynos_panel *ctx)
EXYNOS_DCS_WRITE_SEQ(ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, val);
}
-#define MAX_BR_HBM_EVT1 4094
+#define MAX_BR_HBM_EVT1_0_2 4094
static int s6e3fc5_set_brightness(struct exynos_panel *ctx, u16 br)
{
u16 brightness;
@@ -456,10 +474,10 @@ static int s6e3fc5_set_brightness(struct exynos_panel *ctx, u16 br)
return 0;
}
- if (ctx->panel_rev <= PANEL_REV_EVT1 && br >= MAX_BR_HBM_EVT1) {
- br = MAX_BR_HBM_EVT1;
- dev_dbg(ctx->dev, "%s: capped to dbv(%d) for EVT1 and before\n",
- __func__, MAX_BR_HBM_EVT1);
+ if (ctx->panel_rev <= PANEL_REV_EVT1_0_2 && br >= MAX_BR_HBM_EVT1_0_2) {
+ br = MAX_BR_HBM_EVT1_0_2;
+ dev_dbg(ctx->dev, "%s: capped to dbv(%d) for EVT1_0_2 and before\n",
+ __func__, MAX_BR_HBM_EVT1_0_2);
}
brightness = (br & 0xff) << 8 | br >> 8;
@@ -600,34 +618,37 @@ static void s6e3fc5_get_panel_rev(struct exynos_panel *ctx, u32 id)
{
/* extract command 0xDB */
u8 build_code = (id & 0xFF00) >> 8;
- u8 rev = build_code >> 2;
+ u8 rev = build_code;
switch (rev) {
- case 4:
+ case 0x0A:
ctx->panel_rev = PANEL_REV_PROTO1;
break;
- case 5:
+ case 0x14:
ctx->panel_rev = PANEL_REV_PROTO1_1;
break;
- case 6:
+ case 0x18:
ctx->panel_rev = PANEL_REV_PROTO1_2;
break;
- case 8:
+ case 0x20:
ctx->panel_rev = PANEL_REV_EVT1;
break;
- case 9:
+ case 0x21:
+ ctx->panel_rev = PANEL_REV_EVT1_0_2;
+ break;
+ case 0x24:
ctx->panel_rev = PANEL_REV_EVT1_1;
break;
- case 0x0A:
+ case 0x28:
ctx->panel_rev = PANEL_REV_EVT1_2;
break;
- case 0x10:
+ case 0x40:
ctx->panel_rev = PANEL_REV_DVT1;
break;
- case 0x11:
+ case 0x60:
ctx->panel_rev = PANEL_REV_DVT1_1;
break;
- case 0x20:
+ case 0x80:
ctx->panel_rev = PANEL_REV_PVT;
break;
default:
@@ -638,7 +659,7 @@ static void s6e3fc5_get_panel_rev(struct exynos_panel *ctx, u32 id)
return;
}
- dev_info(ctx->dev, "panel_rev: 0x%x\n", ctx->panel_rev);
+ dev_info(ctx->dev, "panel_rev: 0x%x, build id: 0x%x\n", ctx->panel_rev, rev);
}
static int s6e3fc5_panel_probe(struct mipi_dsi_device *dsi)
@@ -800,7 +821,7 @@ const struct brightness_capability s6e3fc5_brightness_capability = {
.normal = {
.nits = {
.min = 2,
- .max = 500,
+ .max = 600,
},
.level = {
.min = 4,
@@ -808,12 +829,12 @@ const struct brightness_capability s6e3fc5_brightness_capability = {
},
.percentage = {
.min = 0,
- .max = 50,
+ .max = 60,
},
},
.hbm = {
.nits = {
- .min = 550,
+ .min = 600,
.max = 1000,
},
.level = {
@@ -821,7 +842,7 @@ const struct brightness_capability s6e3fc5_brightness_capability = {
.max = 4095,
},
.percentage = {
- .min = 50,
+ .min = 60,
.max = 100,
},
},
diff --git a/dts/Makefile b/dts/Makefile
index 6661ea5..d15415e 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -10,7 +10,8 @@ dtbo-y += \
gs201-lynx-evt1_0.dtbo \
gs201-lynx-evt1_0-wingboard.dtbo \
gs201-lynx-evt1_1.dtbo \
- gs201-lynx-dvt1_0.dtbo
+ gs201-lynx-dvt1_0.dtbo \
+ gs201-lynx-dvt1_0-gain1.dtbo
gs201-lynx-dev1_0.dtbo-base := google-base/gs201-a0.dtb
gs201-lynx-proto1_0.dtbo-base := google-base/gs201-a0.dtb
@@ -19,5 +20,6 @@ gs201-lynx-evt1_0.dtbo-base := google-base/gs201-b0_v2-ipop.dtb
gs201-lynx-evt1_0-wingboard.dtbo-base := google-base/gs201-b0_v2-ipop.dtb
gs201-lynx-evt1_1.dtbo-base := google-base/gs201-b0_v2-ipop.dtb
gs201-lynx-dvt1_0.dtbo-base := google-base/gs201-b0_v2-ipop.dtb
+gs201-lynx-dvt1_0-gain1.dtbo-base := google-base/gs201-b0_v2-ipop.dtb
MKDTIMG_FLAGS += --page_size=4096 --id=/:board_id --rev=/:board_rev
diff --git a/dts/gs201-lynx-charging.dtsi b/dts/gs201-lynx-charging.dtsi
index 077bfc3..7b47470 100644
--- a/dts/gs201-lynx-charging.dtsi
+++ b/dts/gs201-lynx-charging.dtsi
@@ -24,16 +24,18 @@
google,fv-max-uv = <4450000>;
google,thermal-mitigation =
- <4000000 3700000 3500000 3200000 3000000 2700000 2500000 2200000 2000000 1500000 1000000 500000>;
+ <4000000 3200000 3000000 2800000 2600000 2400000 2300000 2200000 2000000 1500000 1000000 500000>;
google,wlc-thermal-mitigation =
<1100000 750000 750000 500000 500000 500000 250000 250000 250000 100000 100000 100000>;
// thermal budgets
google,thermal-mitigation-budgets =
- <4599000 4040000 3676000 3153000 2795000 2340000 2053000 1686000 1441000 957000 597000 352000>;
+ <4599000 4340000 4040000 3676000 2795000 2340000 2053000 1686000 1441000 957000 597000 352000>;
google,wlc-thermal-mitigation-budgets =
<4599000 4040000 3676000 3153000 2795000 2340000 2053000 1686000 1441000 957000 597000 352000>;
+ google,wlc-thermal-dc-fan-alarm = <2>;
+
/* b/170700459 thresholds, updated in b/191070950 */
google,bd-resume-abs-temp = <280>;
google,bd-resume-soc = <50>;
diff --git a/dts/gs201-lynx-dvt1_0-gain1.dts b/dts/gs201-lynx-dvt1_0-gain1.dts
new file mode 100644
index 0000000..e3291c8
--- /dev/null
+++ b/dts/gs201-lynx-dvt1_0-gain1.dts
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Lynx device tree source
+ *
+ * Copyright 2022 Google,LLC
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include "gs201-lynx-common.dtsi"
+#include "gs201-lynx-touch.dtsi"
+
+/ {
+ board_id = <0x30504>;
+ board_rev = <0x10001>;
+ fragment@boardbase {
+ target-path="/";
+ __overlay__ {
+ model = "GS201 LYNX DVT 1.0 with GAIN 1 calibration based on GS201";
+ compatible = "google,GS201 LYNX", "google,GS201";
+ };
+ };
+};
+
+&serial_0 {
+ status = "okay";
+};
diff --git a/dts/gs201-lynx-wcharger.dtsi b/dts/gs201-lynx-wcharger.dtsi
index 0a12448..ac66394 100644
--- a/dts/gs201-lynx-wcharger.dtsi
+++ b/dts/gs201-lynx-wcharger.dtsi
@@ -64,7 +64,7 @@
idt,gpio_qien = <&gpp0 0 GPIO_ACTIVE_LOW>;
idt,irq_gpio = <&gpa9 5 GPIO_ACTIVE_LOW>;
idt,gpio_slct = <&s2mpg12_gpio 0 GPIO_ACTIVE_HIGH>;
- idt,gpio_slct_value = <1>;
+ idt,gpio_slct_value = <0>;
idt,max_vout_mv = <10000>; /* max voltage in mV */
@@ -74,10 +74,13 @@
google,alignment_offset_high_current = <129000>;
google,alignment_current_threshold = <500>;
- google,q_value = <37>;
+ google,q_value = <43>;
fod = [A9 20 89 27 8D 25 92 23 9B 10 A0 0F];
fod_epp = [84 68 89 4D 92 2B 8A 4B 93 20 93 26 01 01 FF 19];
+ google,iop_en; /* IOP enable */
+ google,light_load; /* Calibration light load */
+
p9xxx_gpio: p9xxx_gpio {
gpio-controller;
#gpio-cells = <2>;