summaryrefslogtreecommitdiff
path: root/src/mainboard/google/corsola/panel_anx7625.c
diff options
context:
space:
mode:
authorRuihai Zhou <zhouruihai@huaqin.corp-partner.google.com>2023-03-28 16:49:01 +0800
committerLean Sheng Tan <sheng.tan@9elements.com>2023-05-14 12:52:21 +0000
commitd5c1e1330434c750ce0cd7bf635f55b789f67934 (patch)
treeb4f8f88c196793da6f5dded41ceb2acaae22a668 /src/mainboard/google/corsola/panel_anx7625.c
parent946d17a2a53e6d2de8387ba3cd3d94ef91e36f59 (diff)
downloadcoreboot-d5c1e1330434c750ce0cd7bf635f55b789f67934.tar.gz
mb/google/corsola: Add support for MIPI panel
The detachable Starmie will use MIPI panels, which require reading serializable data from the CBFS. So we add MIPI panel support to the display configuration and align the configuration sequence with the panels that use MIPI bridges. The PMIC Datasheet: TPS65132-Single-Inductor-Dual-Output-Power-Supply.pdf BUG=b:275470328 BRANCH=corsola TEST=emerge-corsola coreboot chromeos-bootimage and display normally Signed-off-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Change-Id: I6f079e54f0317ff2f685f0e3834ebd1ceb8e9fcb Reviewed-on: https://review.coreboot.org/c/coreboot/+/74051 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yidi Lin <yidilin@google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard/google/corsola/panel_anx7625.c')
-rw-r--r--src/mainboard/google/corsola/panel_anx7625.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/mainboard/google/corsola/panel_anx7625.c b/src/mainboard/google/corsola/panel_anx7625.c
new file mode 100644
index 0000000000..7b50e476ec
--- /dev/null
+++ b/src/mainboard/google/corsola/panel_anx7625.c
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <delay.h>
+#include <drivers/analogix/anx7625/anx7625.h>
+#include <edid.h>
+#include <gpio.h>
+#include <soc/i2c.h>
+
+#include "display.h"
+#include "gpio.h"
+
+static void bridge_anx7625_power_on(void)
+{
+ /* Turn on bridge */
+ gpio_output(GPIO_EDPBRDG_RST_L, 0);
+ gpio_output(GPIO_EN_PP1000_EDPBRDG, 1);
+ gpio_output(GPIO_EN_PP1800_EDPBRDG, 1);
+ gpio_output(GPIO_EN_PP3300_EDPBRDG, 1);
+ mdelay(14);
+ gpio_output(GPIO_EDPBRDG_PWREN, 1);
+ mdelay(80);
+ gpio_output(GPIO_EDPBRDG_RST_L, 1);
+}
+
+static int bridge_anx7625_get_edid(u8 i2c_bus, struct edid *edid)
+{
+ if (anx7625_init(i2c_bus) < 0) {
+ printk(BIOS_ERR, "%s: Can't init ANX7625 bridge\n", __func__);
+ return -1;
+ }
+ if (anx7625_dp_get_edid(i2c_bus, edid) < 0) {
+ printk(BIOS_ERR, "%s: Can't get panel's edid\n", __func__);
+ return -1;
+ }
+ return 0;
+}
+
+static int bridge_anx7625_post_power_on(u8 i2c_bus, struct edid *edid)
+{
+ return anx7625_dp_start(i2c_bus, edid);
+}
+
+static struct panel_serializable_data anx7625_data;
+
+static struct panel_description anx7625_bridge = {
+ .s = &anx7625_data,
+ .post_power_on = bridge_anx7625_post_power_on,
+ .orientation = LB_FB_ORIENTATION_NORMAL,
+};
+
+struct panel_description *get_anx7625_description(void)
+{
+ mtk_i2c_bus_init(BRIDGE_I2C, I2C_SPEED_FAST);
+ bridge_anx7625_power_on();
+ if (bridge_anx7625_get_edid(BRIDGE_I2C, &anx7625_bridge.s->edid) < 0) {
+ printk(BIOS_ERR, "Can't get panel's edid\n");
+ return NULL;
+ }
+ return &anx7625_bridge;
+}