Skip to content

Commit

Permalink
lk2nd: panel: oem_panel: Enable tps65132 for huawei-g7
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.
  • Loading branch information
stephan-gh committed Apr 9, 2022
1 parent 930590a commit bf8bccd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lk2nd/panel/oem_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,39 @@ 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 target_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 0;
}

int target_ldo_ctrl(uint8_t enable, struct msm_panel_info *pinfo)
{
if (panel_select(LK1ST_PANEL) == panel_tianma_nt35521_5p5_720p_video_select)
return target_tps65132_ctrl(enable);

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)
{
Expand Down

0 comments on commit bf8bccd

Please sign in to comment.