Skip to content

Commit

Permalink
lk2nd: panel: oem_panel: Enable tps65132 for huawei-kiwi
Browse files Browse the repository at this point in the history
This might need a better solution in the future, but for now lets place
the necessary code directly into oem_panel.

[Raymond: reimplement for huawei-kiwi]
  • Loading branch information
stephan-gh authored and wonderfulShrineMaidenOfParadise committed Nov 19, 2024
1 parent b5b473a commit ba8480a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions lk2nd/display/panel/oem_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <err.h>
#include <mipi_dsi.h>
#include <mipi_dsi_i2c.h>
#include <platform/gpio.h>
#include <string.h>
#include <target/display.h>

Expand All @@ -17,6 +18,14 @@
uint32_t panel_regulator_settings[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static struct gpio_pin enp_gpio = {
"msmgpio", 97, 3, 1, 0, 1
};

static struct gpio_pin enn_gpio = {
"msmgpio", 32, 3, 1, 0, 1
};
#endif

int oem_panel_rotation()
Expand All @@ -42,14 +51,44 @@ uint32_t oem_panel_max_auto_detect_panels()
#define _panel_select(panel) panel_##panel##_select
#define panel_select(panel) _panel_select(panel)

#if TARGET_MSM8916
static int oem_tps65132_ctrl(uint8_t enable)
{
if (enable) {
/* for tps65132 ENP pin */
gpio_tlmm_config(enp_gpio.pin_id, 0,
enp_gpio.pin_direction, enp_gpio.pin_pull,
enp_gpio.pin_strength,
enp_gpio.pin_state);
gpio_set_dir(enp_gpio.pin_id, 2);

/* for tps65132 ENN pin*/
gpio_tlmm_config(enn_gpio.pin_id, 0,
enn_gpio.pin_direction, enn_gpio.pin_pull,
enn_gpio.pin_strength,
enn_gpio.pin_state);
gpio_set_dir(enn_gpio.pin_id, 2);
} else {
gpio_set_dir(enp_gpio.pin_id, 0); /* ENP */
gpio_set_dir(enn_gpio.pin_id, 0); /* ENN */
}
return NO_ERROR;
}
#endif

int oem_panel_select(const char *panel_name, struct panel_struct *panel,
struct msm_panel_info *pinfo, struct mdss_dsi_phy_ctrl *phy_db)
{
int enable = 1;

panel_select(LK2ND_DISPLAY)(panel, pinfo, phy_db);
lk2nd_dev.panel.name = panel->paneldata->panel_node_id;


#if TARGET_MSM8916
if (panel_select(LK2ND_DISPLAY) == panel_cmi_nt35532_5p5_1080pxa_video_select)
oem_tps65132_ctrl(enable);

if (phy_db->regulator_mode == DSI_PHY_REGULATOR_LDO_MODE)
memcpy(panel_regulator_settings, ldo_regulator_settings, REGULATOR_SIZE);
else
Expand Down

0 comments on commit ba8480a

Please sign in to comment.