Skip to content

Commit

Permalink
target: msm8916: Initialize adv7533 in target_display, not oem_panel
Browse files Browse the repository at this point in the history
For some reason half of the code is in target_display, while the other
half is in oem_panel. Let's put all of it in target_display so it can
work even with another oem_panel implementation.
  • Loading branch information
stephan-gh committed Jan 14, 2022
1 parent 8ad6a1c commit 6175eec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
14 changes: 0 additions & 14 deletions target/msm8916/oem_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,20 +631,6 @@ int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
#endif

panel_init:
if (platform_is_apq8016() && (hw_id == HW_PLATFORM_SBC)) {
/* Set Switch GPIO to DSI2HDMI mode */
target_set_switch_gpio(1);
/* ADV7533 DSI to HDMI Bridge Chip Connected */
mipi_dsi_i2c_device_init();
/* Read ADV Chip ID */
if (!mipi_dsi_i2c_read_byte(ADV7533_MAIN, 0x00, &rev)) {
dprintf(INFO, "ADV7533 Rev ID: 0x%x\n",rev);
} else {
dprintf(CRITICAL, "error reading Rev ID from bridge chip\n");
return PANEL_TYPE_UNKNOWN;
}
}

/*
* Update all data structures after 'panel_init' label. Only panel
* selection is supposed to happen before that.
Expand Down
16 changes: 16 additions & 0 deletions target/msm8916/target_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,22 @@ int target_display_dsi2hdmi_config(struct msm_panel_info *pinfo)
if (!pinfo)
return ERR_INVALID_ARGS;

if (pinfo->adv7533.dsi_setup_cfg_i2c_cmd || pinfo->adv7533.dsi_tg_i2c_cmd) {
uint8_t rev = 0;

/* Set Switch GPIO to DSI2HDMI mode */
target_set_switch_gpio(1);
/* ADV7533 DSI to HDMI Bridge Chip Connected */
mipi_dsi_i2c_device_init();
/* Read ADV Chip ID */
if (!mipi_dsi_i2c_read_byte(ADV7533_MAIN, 0x00, &rev)) {
dprintf(INFO, "ADV7533 Rev ID: 0x%x\n",rev);
} else {
dprintf(CRITICAL, "error reading Rev ID from bridge chip\n");
return ERR_IO;
}
}

/*
* If dsi to HDMI bridge chip connected then
* send I2c commands to the chip
Expand Down

0 comments on commit 6175eec

Please sign in to comment.