summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com>2023-01-08 18:53:57 -0800
committerSecurityBot <android-nexus-securitybot@system.gserviceaccount.com>2023-01-08 18:53:58 -0800
commit9ed5d2b12650a9a87556d3d926a53f56c7843cd6 (patch)
treeef3052932610b1073609cf5e9a4990d087aad62b
parent979ec538bd0d9d3b0ed3d5aac5db0b53b6d42c8f (diff)
parent8659a8d15015d690732185fc2d9f002a23747442 (diff)
downloadtangorpro-9ed5d2b12650a9a87556d3d926a53f56c7843cd6.tar.gz
Merge android13-gs-pixel-5.10-tm-qpr3 into android13-gs-pixel-5.10-udc
SBMerger: 478053055 Change-Id: I379775f3f4fc5a2f94cc1380cdb881dabab69acd Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r--display/panel-boe-ts110f5mlg0.c259
-rw-r--r--display/panel-csot-ppa957db2d.c259
-rw-r--r--dts/gs201-tangorpro-display-common.dtsi7
-rw-r--r--dts/gs201-tangorpro-display-constants.dtsi6
-rw-r--r--dts/gs201-tangorpro-display.dtsi50
-rw-r--r--dts/gs201-tangorpro-pmic.dtsi6
-rw-r--r--tangorpro_gki.fragment2
-rw-r--r--vendor_kernel_boot_modules.tangorpro2
8 files changed, 578 insertions, 13 deletions
diff --git a/display/panel-boe-ts110f5mlg0.c b/display/panel-boe-ts110f5mlg0.c
index cc8c659..fa1cc52 100644
--- a/display/panel-boe-ts110f5mlg0.c
+++ b/display/panel-boe-ts110f5mlg0.c
@@ -7,6 +7,7 @@
*/
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
@@ -157,6 +158,33 @@ static const struct exynos_dsi_cmd ts110f5mlg0_off_cmds[] = {
};
static DEFINE_EXYNOS_CMD_SET(ts110f5mlg0_off);
+/**
+ * struct ts110f5mlg0_panel - panel specific info
+ * This struct maintains ts110f5mlg0 panel specific information, any fixed details about
+ * panel should most likely go into struct exynos_panel or exynos_panel_desc
+ */
+struct ts110f5mlg0_panel {
+ /** @base: base panel struct */
+ struct exynos_panel base;
+
+ /** @i2c_pwr: i2c power supply */
+ struct regulator *i2c_pwr;
+
+ /** @avdd: avdd regulator for TDDI */
+ struct regulator *avdd;
+
+ /** @avee: avee regulator for TDDI */
+ struct regulator *avee;
+
+ /** @avdd_uV: microVolt of avdd */
+ u32 avdd_uV;
+
+ /** @avee_uV: microVolt of avee */
+ u32 avee_uV;
+};
+
+#define to_spanel(ctx) container_of(ctx, struct ts110f5mlg0_panel, base)
+
static void ts110f5mlg0_reset(struct exynos_panel *ctx)
{
dev_dbg(ctx->dev, "%s +\n", __func__);
@@ -306,6 +334,233 @@ static void ts110f5mlg0_get_panel_rev(struct exynos_panel *ctx, u32 id)
}
}
+static int ts110f5mlg0_parse_regualtors(struct exynos_panel *ctx)
+{
+ struct device *dev = ctx->dev;
+ struct ts110f5mlg0_panel *spanel = to_spanel(ctx);
+ int count, i, ret;
+
+ ctx->vddi = devm_regulator_get(dev, "vddi");
+ if (IS_ERR(ctx->vddi)) {
+ dev_err(ctx->dev, "failed to get panel vddi\n");
+ return -EPROBE_DEFER;
+ }
+
+ /* The i2c power source and backlight enable (BL_EN) use the same hardware pin.
+ * We should be cautious when controlling this hardware pin (b/244526124).
+ */
+ spanel->i2c_pwr = devm_regulator_get_optional(dev, "i2c-pwr");
+ if (PTR_ERR_OR_ZERO(spanel->i2c_pwr)) {
+ dev_err(ctx->dev, "failed to get display i2c-pwr\n");
+ return -EPROBE_DEFER;
+ }
+
+ /* log the device tree status for every display bias source */
+ count = of_property_count_elems_of_size(dev->of_node, "disp_bias", sizeof(u32));
+ if (count <= 0) {
+ dev_err(ctx->dev, "failed to parse disp_bias entry\n");
+ return -EINVAL;
+ }
+ for (i = 0; i < count; ++i) {
+ struct device_node *dev_node = of_parse_phandle(dev->of_node, "disp_bias", i);
+
+ if (of_device_is_available(dev_node))
+ dev_info(ctx->dev, "%s is enabled by bootloader\n", dev_node->full_name);
+ else
+ dev_dbg(ctx->dev, "%s is disabled by bootloader\n", dev_node->full_name);
+ }
+
+ spanel->avdd = devm_regulator_get_optional(dev, "disp_avdd");
+ if (PTR_ERR_OR_ZERO(spanel->avdd)) {
+ dev_err(ctx->dev, "failed to get disp_avdd provider\n");
+ return -EPROBE_DEFER;
+ }
+
+ spanel->avee = devm_regulator_get_optional(dev, "disp_avee");
+ if (PTR_ERR_OR_ZERO(spanel->avee)) {
+ dev_err(ctx->dev, "failed to get disp_avee provider\n");
+ return -EPROBE_DEFER;
+ }
+
+ ret = of_property_read_u32(dev->of_node, "avdd-microvolt", &spanel->avdd_uV);
+ if (ret) {
+ dev_err(ctx->dev, "failed to parse avdd-microvolt: %d\n", ret);
+ return ret;
+ }
+ dev_dbg(ctx->dev, "use avdd-microvolt: %d uV\n", spanel->avdd_uV);
+
+ ret = of_property_read_u32(dev->of_node, "avee-microvolt", &spanel->avee_uV);
+ if (ret) {
+ dev_err(ctx->dev, "failed to parse avee-microvolt: %d\n", ret);
+ return ret;
+ }
+ dev_dbg(ctx->dev, "use avee-microvolt: %d uV\n", spanel->avee_uV);
+
+ return 0;
+}
+
+static int ts110f5mlg0_set_power(struct exynos_panel *ctx, bool on)
+{
+ struct ts110f5mlg0_panel *spanel = to_spanel(ctx);
+ int ret;
+
+ if (on) {
+ /* Case 1. set_power when handoff from bootloader.
+ * 1. i2c_pwr (BL_EN) is left on (use_count = 0)
+ * 2. ppa957db2d_set_power +
+ * 3. ppa957db2d_set_power -
+ * 4. i2c_pwr (BL_EN) is left on (use_count = 0)
+ * 5. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ *
+ * Case 2. system resume (tap to check tablet is disabled)
+ * 1. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 2. ppa957db2d_set_power +
+ * 3. ppa957db2d_set_power -
+ * 4. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 5. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ *
+ * Case 3. system resume (tap to check tablet is enabled)
+ * 1. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 2. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ */
+ bool i2c_pwr_already_on;
+
+ /* VDDI power */
+ ret = regulator_enable(ctx->vddi);
+ if (ret) {
+ dev_err(ctx->dev, "vddi enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "vddi enable successfully\n");
+ usleep_range(2000, 3000);
+
+ i2c_pwr_already_on = regulator_is_enabled(spanel->i2c_pwr);
+ if (!i2c_pwr_already_on) {
+ /* For case 1, the i2c_pwr (BL_EN) should be turned on manually to
+ * configure the AVDD/AVEE voltage level via i2c.
+ * For case 2, the i2c_pwr (BL_EN) is already turned on (used_count = 0)
+ * and should not turned on here. Otherwise, it need to be turned off
+ * later to reset the use_count to zero. However turning off will
+ * affect the continuous splash feature (black flicker).
+ */
+ ret = regulator_enable(spanel->i2c_pwr);
+ if (ret) {
+ dev_err(ctx->dev, "i2c_pwr enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "i2c_pwr enable successfully\n");
+ usleep_range(2000, 2500);
+ }
+
+ /* AVDD power */
+ ret = regulator_enable(spanel->avdd);
+ if (ret) {
+ dev_err(ctx->dev, "avdd enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avdd enable successfully\n");
+
+ /* set voltage twice to fix the problem from tps65132_enable: it doesn't
+ * restore the voltage register value via regmap_write (SW value and HW value
+ * are inconsistent). At this time, set the voltage to target value directly
+ * will not take effect because the direct return condition in
+ * regulator_set_voltage_unlocked:
+ * `voltage->min_uV == min_uV && voltage->max_uV == max_uV`
+ */
+ if (regulator_set_voltage(spanel->avdd, spanel->avdd_uV - 100000,
+ spanel->avdd_uV - 100000) || regulator_set_voltage(spanel->avdd,
+ spanel->avdd_uV, spanel->avdd_uV)) {
+ dev_err(ctx->dev, "avdd set voltage failed\n");
+ /* If regulator_set_voltage fail, the display can still be light on
+ * with default voltage level, should not return here.
+ */
+ } else {
+ dev_dbg(ctx->dev, "avdd set voltage successfully\n");
+ }
+ usleep_range(1000, 1100);
+
+ /* AVEE power */
+ ret = regulator_enable(spanel->avee);
+ if (ret) {
+ dev_err(ctx->dev, "avee enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avee enable successfully\n");
+
+ /* set voltage twice as AVDD */
+ if (regulator_set_voltage(spanel->avee, spanel->avee_uV - 100000,
+ spanel->avee_uV - 100000) || regulator_set_voltage(spanel->avee,
+ spanel->avee_uV, spanel->avee_uV)) {
+ dev_err(ctx->dev, "avee set voltage failed\n");
+ /* If regulator_set_voltage fail, the display can still be light on
+ * with default voltage level, should not return here.
+ */
+ } else {
+ dev_dbg(ctx->dev, "avee set voltage successfully\n");
+ }
+ usleep_range(1000, 1100);
+
+ if (!i2c_pwr_already_on) {
+ /* For case 2, the i2c_pwr (BL_EN) should be reset to use_count 0.
+ * Such that the backlight driver can fully control on the BL_EN.
+ */
+ if (regulator_disable(spanel->i2c_pwr))
+ dev_err(ctx->dev, "i2c_pwr disable failed\n");
+ else
+ dev_dbg(ctx->dev, "i2c_pwr disable successfully\n");
+ }
+ } else {
+ /* Case 1. system suspend (tap to check tablet is disabled)
+ * 1. i2c_pwr (BL_EN) is on (use_count = 1)
+ * 2. backlight driver turn off i2c_pwr (BL_EN) (use_count = 0)
+ * 3. ppa957db2d_set_power +
+ * 4. only turn off DISP_PMIC_ENABLE gpio pin, no i2c access here.
+ * 5. ppa957db2d_set_power -
+ *
+ * Case 2. system suspend (tap to check tablet is enabled)
+ * 1. i2c_pwr (BL_EN) is on (use_count = 1)
+ * 2. backlight driver turn off i2c_pwr (BL_EN) (use_count = 0)
+ */
+ gpiod_set_value(ctx->reset_gpio, 0);
+
+ ret = regulator_disable(spanel->avee);
+ if (ret) {
+ dev_err(ctx->dev, "avee disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avee disable successfully\n");
+ usleep_range(1000, 1100);
+
+ ret = regulator_disable(spanel->avdd);
+ if (ret) {
+ dev_err(ctx->dev, "avdd disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avdd disable successfully\n");
+ usleep_range(6000, 7000);
+
+ ret = regulator_disable(ctx->vddi);
+ if (ret) {
+ dev_err(ctx->dev, "vddi disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "vddi disable successfully\n");
+ }
+
+ return 0;
+}
+
+static int ts110f5mlg0_panel_probe(struct mipi_dsi_device *dsi)
+{
+ struct ts110f5mlg0_panel *spanel;
+
+ spanel = devm_kzalloc(&dsi->dev, sizeof(*spanel), GFP_KERNEL);
+ if (!spanel)
+ return -ENOMEM;
+
+ return exynos_panel_common_init(dsi, &spanel->base);
+}
+
static const struct exynos_panel_mode ts110f5mlg0_modes[] = {
{
/* 1600x2560 @ 60 */
@@ -348,6 +603,8 @@ static const struct exynos_panel_funcs ts110f5mlg0_exynos_funcs = {
.set_brightness = exynos_panel_set_brightness,
.set_cabc_mode = ts110f5mlg0_set_cabc_mode,
.get_panel_rev = ts110f5mlg0_get_panel_rev,
+ .parse_regulators = ts110f5mlg0_parse_regualtors,
+ .set_power = ts110f5mlg0_set_power,
};
const struct brightness_capability ts110f5mlg0_brightness_capability = {
@@ -393,7 +650,7 @@ static const struct of_device_id exynos_panel_of_match[] = {
MODULE_DEVICE_TABLE(of, exynos_panel_of_match);
static struct mipi_dsi_driver exynos_panel_driver = {
- .probe = exynos_panel_probe,
+ .probe = ts110f5mlg0_panel_probe,
.remove = exynos_panel_remove,
.driver = {
.name = "panel-boe-ts110f5mlg0",
diff --git a/display/panel-csot-ppa957db2d.c b/display/panel-csot-ppa957db2d.c
index 9d5863c..83da9ad 100644
--- a/display/panel-csot-ppa957db2d.c
+++ b/display/panel-csot-ppa957db2d.c
@@ -7,6 +7,7 @@
*/
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/kthread.h>
#include <uapi/linux/sched/types.h>
@@ -157,6 +158,33 @@ static const struct exynos_dsi_cmd ppa957db2d_off_cmds[] = {
};
static DEFINE_EXYNOS_CMD_SET(ppa957db2d_off);
+/**
+ * struct ppa957db2d_panel - panel specific info
+ * This struct maintains ppa957db2d panel specific information, any fixed details about
+ * panel should most likely go into struct exynos_panel or exynos_panel_desc
+ */
+struct ppa957db2d_panel {
+ /** @base: base panel struct */
+ struct exynos_panel base;
+
+ /** @i2c_pwr: i2c power supply */
+ struct regulator *i2c_pwr;
+
+ /** @avdd: avdd regulator for TDDI */
+ struct regulator *avdd;
+
+ /** @avee: avee regulator for TDDI */
+ struct regulator *avee;
+
+ /** @avdd_uV: microVolt of avdd */
+ u32 avdd_uV;
+
+ /** @avee_uV: microVolt of avee */
+ u32 avee_uV;
+};
+
+#define to_spanel(ctx) container_of(ctx, struct ppa957db2d_panel, base)
+
static void ppa957db2d_reset(struct exynos_panel *ctx)
{
dev_dbg(ctx->dev, "%s +\n", __func__);
@@ -306,6 +334,233 @@ static void ppa957db2d_get_panel_rev(struct exynos_panel *ctx, u32 id)
}
}
+static int ppa957db2d_parse_regualtors(struct exynos_panel *ctx)
+{
+ struct device *dev = ctx->dev;
+ struct ppa957db2d_panel *spanel = to_spanel(ctx);
+ int count, i, ret;
+
+ ctx->vddi = devm_regulator_get(dev, "vddi");
+ if (IS_ERR(ctx->vddi)) {
+ dev_err(ctx->dev, "failed to get panel vddi\n");
+ return -EPROBE_DEFER;
+ }
+
+ /* The i2c power source and backlight enable (BL_EN) use the same hardware pin.
+ * We should be cautious when controlling this hardware pin (b/244526124).
+ */
+ spanel->i2c_pwr = devm_regulator_get_optional(dev, "i2c-pwr");
+ if (PTR_ERR_OR_ZERO(spanel->i2c_pwr)) {
+ dev_err(ctx->dev, "failed to get display i2c-pwr\n");
+ return -EPROBE_DEFER;
+ }
+
+ /* log the device tree status for every display bias source */
+ count = of_property_count_elems_of_size(dev->of_node, "disp_bias", sizeof(u32));
+ if (count <= 0) {
+ dev_err(ctx->dev, "failed to parse disp_bias entry\n");
+ return -EINVAL;
+ }
+ for (i = 0; i < count; ++i) {
+ struct device_node *dev_node = of_parse_phandle(dev->of_node, "disp_bias", i);
+
+ if (of_device_is_available(dev_node))
+ dev_info(ctx->dev, "%s is enabled by bootloader\n", dev_node->full_name);
+ else
+ dev_dbg(ctx->dev, "%s is disabled by bootloader\n", dev_node->full_name);
+ }
+
+ spanel->avdd = devm_regulator_get_optional(dev, "disp_avdd");
+ if (PTR_ERR_OR_ZERO(spanel->avdd)) {
+ dev_err(ctx->dev, "failed to get disp_avdd provider\n");
+ return -EPROBE_DEFER;
+ }
+
+ spanel->avee = devm_regulator_get_optional(dev, "disp_avee");
+ if (PTR_ERR_OR_ZERO(spanel->avee)) {
+ dev_err(ctx->dev, "failed to get disp_avee provider\n");
+ return -EPROBE_DEFER;
+ }
+
+ ret = of_property_read_u32(dev->of_node, "avdd-microvolt", &spanel->avdd_uV);
+ if (ret) {
+ dev_err(ctx->dev, "failed to parse avdd-microvolt: %d\n", ret);
+ return ret;
+ }
+ dev_dbg(ctx->dev, "use avdd-microvolt: %d uV\n", spanel->avdd_uV);
+
+ ret = of_property_read_u32(dev->of_node, "avee-microvolt", &spanel->avee_uV);
+ if (ret) {
+ dev_err(ctx->dev, "failed to parse avee-microvolt: %d\n", ret);
+ return ret;
+ }
+ dev_dbg(ctx->dev, "use avee-microvolt: %d uV\n", spanel->avee_uV);
+
+ return 0;
+}
+
+static int ppa957db2d_set_power(struct exynos_panel *ctx, bool on)
+{
+ struct ppa957db2d_panel *spanel = to_spanel(ctx);
+ int ret;
+
+ if (on) {
+ /* Case 1. set_power when handoff from bootloader.
+ * 1. i2c_pwr (BL_EN) is left on (use_count = 0)
+ * 2. ppa957db2d_set_power +
+ * 3. ppa957db2d_set_power -
+ * 4. i2c_pwr (BL_EN) is left on (use_count = 0)
+ * 5. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ *
+ * Case 2. system resume (tap to check tablet is disabled)
+ * 1. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 2. ppa957db2d_set_power +
+ * 3. ppa957db2d_set_power -
+ * 4. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 5. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ *
+ * Case 3. system resume (tap to check tablet is enabled)
+ * 1. i2c_pwr (BL_EN) is off (use_count = 0)
+ * 2. backlight driver turn on i2c_pwr (BL_EN) (use_count = 1)
+ */
+ bool i2c_pwr_already_on;
+
+ /* VDDI power */
+ ret = regulator_enable(ctx->vddi);
+ if (ret) {
+ dev_err(ctx->dev, "vddi enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "vddi enable successfully\n");
+ usleep_range(2000, 3000);
+
+ i2c_pwr_already_on = regulator_is_enabled(spanel->i2c_pwr);
+ if (!i2c_pwr_already_on) {
+ /* For case 1, the i2c_pwr (BL_EN) should be turned on manually to
+ * configure the AVDD/AVEE voltage level via i2c.
+ * For case 2, the i2c_pwr (BL_EN) is already turned on (used_count = 0)
+ * and should not turned on here. Otherwise, it need to be turned off
+ * later to reset the use_count to zero. However turning off will
+ * affect the continuous splash feature (black flicker).
+ */
+ ret = regulator_enable(spanel->i2c_pwr);
+ if (ret) {
+ dev_err(ctx->dev, "i2c_pwr enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "i2c_pwr enable successfully\n");
+ usleep_range(2000, 2500);
+ }
+
+ /* AVDD power */
+ ret = regulator_enable(spanel->avdd);
+ if (ret) {
+ dev_err(ctx->dev, "avdd enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avdd enable successfully\n");
+
+ /* set voltage twice to fix the problem from tps65132_enable: it doesn't
+ * restore the voltage register value via regmap_write (SW value and HW value
+ * are inconsistent). At this time, set the voltage to target value directly
+ * will not take effect because the direct return condition in
+ * regulator_set_voltage_unlocked:
+ * `voltage->min_uV == min_uV && voltage->max_uV == max_uV`
+ */
+ if (regulator_set_voltage(spanel->avdd, spanel->avdd_uV - 100000,
+ spanel->avdd_uV - 100000) || regulator_set_voltage(spanel->avdd,
+ spanel->avdd_uV, spanel->avdd_uV)) {
+ dev_err(ctx->dev, "avdd set voltage failed\n");
+ /* If regulator_set_voltage fail, the display can still be light on
+ * with default voltage level, should not return here.
+ */
+ } else {
+ dev_dbg(ctx->dev, "avdd set voltage successfully\n");
+ }
+ usleep_range(1000, 1100);
+
+ /* AVEE power */
+ ret = regulator_enable(spanel->avee);
+ if (ret) {
+ dev_err(ctx->dev, "avee enable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avee enable successfully\n");
+
+ /* set voltage twice as AVDD */
+ if (regulator_set_voltage(spanel->avee, spanel->avee_uV - 100000,
+ spanel->avee_uV - 100000) || regulator_set_voltage(spanel->avee,
+ spanel->avee_uV, spanel->avee_uV)) {
+ dev_err(ctx->dev, "avee set voltage failed\n");
+ /* If regulator_set_voltage fail, the display can still be light on
+ * with default voltage level, should not return here.
+ */
+ } else {
+ dev_dbg(ctx->dev, "avee set voltage successfully\n");
+ }
+ usleep_range(1000, 1100);
+
+ if (!i2c_pwr_already_on) {
+ /* For case 2, the i2c_pwr (BL_EN) should be reset to use_count 0.
+ * Such that the backlight driver can fully control on the BL_EN.
+ */
+ if (regulator_disable(spanel->i2c_pwr))
+ dev_err(ctx->dev, "i2c_pwr disable failed\n");
+ else
+ dev_dbg(ctx->dev, "i2c_pwr disable successfully\n");
+ }
+ } else {
+ /* Case 1. system suspend (tap to check tablet is disabled)
+ * 1. i2c_pwr (BL_EN) is on (use_count = 1)
+ * 2. backlight driver turn off i2c_pwr (BL_EN) (use_count = 0)
+ * 3. ppa957db2d_set_power +
+ * 4. only turn off DISP_PMIC_ENABLE gpio pin, no i2c access here.
+ * 5. ppa957db2d_set_power -
+ *
+ * Case 2. system suspend (tap to check tablet is enabled)
+ * 1. i2c_pwr (BL_EN) is on (use_count = 1)
+ * 2. backlight driver turn off i2c_pwr (BL_EN) (use_count = 0)
+ */
+ gpiod_set_value(ctx->reset_gpio, 0);
+
+ ret = regulator_disable(spanel->avee);
+ if (ret) {
+ dev_err(ctx->dev, "avee disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avee disable successfully\n");
+ usleep_range(1000, 1100);
+
+ ret = regulator_disable(spanel->avdd);
+ if (ret) {
+ dev_err(ctx->dev, "avdd disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "avdd disable successfully\n");
+ usleep_range(6000, 7000);
+
+ ret = regulator_disable(ctx->vddi);
+ if (ret) {
+ dev_err(ctx->dev, "vddi disable failed\n");
+ return ret;
+ }
+ dev_dbg(ctx->dev, "vddi disable successfully\n");
+ }
+
+ return 0;
+}
+
+static int ppa957db2d_panel_probe(struct mipi_dsi_device *dsi)
+{
+ struct ppa957db2d_panel *spanel;
+
+ spanel = devm_kzalloc(&dsi->dev, sizeof(*spanel), GFP_KERNEL);
+ if (!spanel)
+ return -ENOMEM;
+
+ return exynos_panel_common_init(dsi, &spanel->base);
+}
+
static const struct exynos_panel_mode ppa957db2d_modes[] = {
{
/* 1600x2560 @ 60 */
@@ -348,6 +603,8 @@ static const struct exynos_panel_funcs ppa957db2d_exynos_funcs = {
.set_brightness = exynos_panel_set_brightness,
.set_cabc_mode = ts110f5mlg0_set_cabc_mode,
.get_panel_rev = ppa957db2d_get_panel_rev,
+ .parse_regulators = ppa957db2d_parse_regualtors,
+ .set_power = ppa957db2d_set_power,
};
const struct brightness_capability ppa957db2d_brightness_capability = {
@@ -393,7 +650,7 @@ static const struct of_device_id exynos_panel_of_match[] = {
MODULE_DEVICE_TABLE(of, exynos_panel_of_match);
static struct mipi_dsi_driver exynos_panel_driver = {
- .probe = exynos_panel_probe,
+ .probe = ppa957db2d_panel_probe,
.remove = exynos_panel_remove,
.driver = {
.name = "panel-csot-ppa957db2d",
diff --git a/dts/gs201-tangorpro-display-common.dtsi b/dts/gs201-tangorpro-display-common.dtsi
index a2bc1dd..cdc04e5 100644
--- a/dts/gs201-tangorpro-display-common.dtsi
+++ b/dts/gs201-tangorpro-display-common.dtsi
@@ -9,7 +9,12 @@
/* 0: normal, 1: bottom up, 2: left up, 3: right up */
orientation = <0>;
+/* i2c power supply */
+i2c-pwr-supply = <&m_ldo25_reg>;
+
/* reset, power */
reset-gpios = <&gpa7 1 GPIO_ACTIVE_HIGH>;
vddi-supply = <&m_ldo24_reg>;
-vci-supply = <&disp_vci>;
+disp_bias = <&rt4801_bias &tps65132_bias>;
+avdd-microvolt = <TANGORPRO_AVDD_MICROVOLT>;
+avee-microvolt = <TANGORPRO_AVEE_MICROVOLT>;
diff --git a/dts/gs201-tangorpro-display-constants.dtsi b/dts/gs201-tangorpro-display-constants.dtsi
index d1315e9..c62a2e0 100644
--- a/dts/gs201-tangorpro-display-constants.dtsi
+++ b/dts/gs201-tangorpro-display-constants.dtsi
@@ -5,7 +5,5 @@
* Copyright 2022 Google LLC.
*
*/
-#define TANGORPRO_VCI_MICROVOLT 3025000
-#define TANGORPRO_VDDD_NORMAL_MICROVOLT 1200000
-#define TANGORPRO_3HC4_VDDD_NORMAL_MICROVOLT 1125000
-#define TANGORPRO_VDDD_LP_MICROVOLT 1050000
+#define TANGORPRO_AVDD_MICROVOLT 5500000
+#define TANGORPRO_AVEE_MICROVOLT 5500000
diff --git a/dts/gs201-tangorpro-display.dtsi b/dts/gs201-tangorpro-display.dtsi
index fba263b..178390b 100644
--- a/dts/gs201-tangorpro-display.dtsi
+++ b/dts/gs201-tangorpro-display.dtsi
@@ -98,6 +98,56 @@
led-short-protection;
pfm-enable;
};
+
+ tps65132_bias: lcd-bias@3e {
+ /*
+ * If bootloader probed rt4801_bias successfully, it will change
+ * tps65132_bias to status = "disabled"
+ */
+ status = "okay";
+ compatible = "ti,tps65132";
+ reg = <0x3e>;
+
+ tps65132_avdd: outp {
+ regulator-name = "disp_avdd";
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <TANGORPRO_AVDD_MICROVOLT>;
+ regulator-boot-on;
+ enable-gpios = <&gpp23 1 GPIO_ACTIVE_HIGH>;
+ };
+
+ tps65132_avee: outn {
+ regulator-name = "disp_avee";
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <TANGORPRO_AVEE_MICROVOLT>;
+ regulator-boot-on;
+ };
+ };
+
+ rt4801_bias: lcd-bias@73 {
+ /*
+ * If bootloader probed tps65132_bias successfully, it will change
+ * rt4801_bias to status = "disabled"
+ */
+ status = "okay";
+ compatible = "richtek,rt4801";
+ reg = <0x73>;
+ enable-gpios = <&gpp23 1 GPIO_ACTIVE_HIGH>;
+
+ rt4801_avdd: DSVP {
+ regulator-name = "disp_avdd";
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <TANGORPRO_AVDD_MICROVOLT>;
+ regulator-boot-on;
+ };
+
+ rt4801_avee: DSVN {
+ regulator-name = "disp_avee";
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <TANGORPRO_AVEE_MICROVOLT>;
+ regulator-boot-on;
+ };
+ };
};
&drmdecon0 {
diff --git a/dts/gs201-tangorpro-pmic.dtsi b/dts/gs201-tangorpro-pmic.dtsi
index 1ab63bb..4d08d30 100644
--- a/dts/gs201-tangorpro-pmic.dtsi
+++ b/dts/gs201-tangorpro-pmic.dtsi
@@ -15,12 +15,6 @@
subsys-name = "Display";
};
-/* Display: vci-supply voltage */
-&disp_vci {
- status = "okay";
- gpio = <&gpp23 1 GPIO_ACTIVE_HIGH>;
-};
-
/* Display: backlight enable */
&m_ldo25_reg {
regulator-boot-on;
diff --git a/tangorpro_gki.fragment b/tangorpro_gki.fragment
index b351d0a..7c58640 100644
--- a/tangorpro_gki.fragment
+++ b/tangorpro_gki.fragment
@@ -12,6 +12,8 @@ CONFIG_EXYNOS_MODEM_IF=n
CONFIG_LINK_DEVICE_PCIE_IOCC=n
CONFIG_LINK_DEVICE_PCIE_IOMMU=n
CONFIG_MODEM_IF_QOS=n
+CONFIG_REGULATOR_RT4801=m
+CONFIG_REGULATOR_TPS65132=m
CONFIG_SEC_MODEM_S5100=n
CONFIG_SHM_IPC=n
CONFIG_SUSPEND_DURING_VOICE_CALL=n
diff --git a/vendor_kernel_boot_modules.tangorpro b/vendor_kernel_boot_modules.tangorpro
index a14e627..913daf2 100644
--- a/vendor_kernel_boot_modules.tangorpro
+++ b/vendor_kernel_boot_modules.tangorpro
@@ -10,3 +10,5 @@ pwm-samsung.ko
rt4539_bl.ko
panel-boe-ts110f5mlg0.ko
panel-csot-ppa957db2d.ko
+rt4801-regulator.ko
+tps65132-regulator.ko